/src/libreoffice/svx/source/svdraw/svdovirt.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
11 | | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | | * contributor license agreements. See the NOTICE file distributed |
13 | | * with this work for additional information regarding copyright |
14 | | * ownership. The ASF licenses this file to you under the Apache |
15 | | * License, Version 2.0 (the "License"); you may not use this file |
16 | | * except in compliance with the License. You may obtain a copy of |
17 | | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | | */ |
19 | | |
20 | | |
21 | | #include <sdr/properties/emptyproperties.hxx> |
22 | | #include <svx/svdovirt.hxx> |
23 | | #include <svx/svdhdl.hxx> |
24 | | #include <svx/sdr/contact/viewcontactofvirtobj.hxx> |
25 | | #include <svx/svdograf.hxx> |
26 | | #include <svx/svddrgv.hxx> |
27 | | #include <basegfx/matrix/b2dhommatrixtools.hxx> |
28 | | |
29 | | sdr::properties::BaseProperties& SdrVirtObj::GetProperties() const |
30 | 0 | { |
31 | 0 | return mxRefObj->GetProperties(); |
32 | 0 | } |
33 | | |
34 | | |
35 | | std::unique_ptr<sdr::properties::BaseProperties> SdrVirtObj::CreateObjectSpecificProperties() |
36 | 0 | { |
37 | 0 | return std::make_unique<sdr::properties::EmptyProperties>(*this); |
38 | 0 | } |
39 | | |
40 | | // #i27224# |
41 | | std::unique_ptr<sdr::contact::ViewContact> SdrVirtObj::CreateObjectSpecificViewContact() |
42 | 0 | { |
43 | 0 | return std::make_unique<sdr::contact::ViewContactOfVirtObj>(*this); |
44 | 0 | } |
45 | | |
46 | | SdrVirtObj::SdrVirtObj( |
47 | | SdrModel& rSdrModel, |
48 | | SdrObject& rNewObj) |
49 | 26.7k | : SdrObject(rSdrModel), |
50 | 26.7k | mxRefObj(&rNewObj) |
51 | 26.7k | { |
52 | 26.7k | m_bVirtObj=true; // this is only a virtual object |
53 | 26.7k | mxRefObj->AddReference(*this); |
54 | 26.7k | m_bClosedObj = mxRefObj->IsClosedObj(); |
55 | 26.7k | } |
56 | | |
57 | | SdrVirtObj::SdrVirtObj( |
58 | | SdrModel& rSdrModel, SdrVirtObj const & rSource) |
59 | 0 | : SdrObject(rSdrModel, rSource), |
60 | 0 | mxRefObj(rSource.mxRefObj) |
61 | 0 | { |
62 | 0 | m_bVirtObj=true; // this is only a virtual object |
63 | 0 | m_bClosedObj = mxRefObj->IsClosedObj(); |
64 | |
|
65 | 0 | mxRefObj->AddReference(*this); |
66 | |
|
67 | 0 | maSnapRect = rSource.maSnapRect; |
68 | 0 | m_aAnchor = rSource.m_aAnchor; |
69 | 0 | } |
70 | | |
71 | | SdrVirtObj::~SdrVirtObj() |
72 | 26.7k | { |
73 | 26.7k | mxRefObj->DelReference(*this); |
74 | 26.7k | } |
75 | | |
76 | | const SdrObject& SdrVirtObj::GetReferencedObj() const |
77 | 7.86M | { |
78 | 7.86M | return *mxRefObj; |
79 | 7.86M | } |
80 | | |
81 | | SdrObject& SdrVirtObj::ReferencedObj() |
82 | 6.78M | { |
83 | 6.78M | return *mxRefObj; |
84 | 6.78M | } |
85 | | |
86 | | void SdrVirtObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& /*rHint*/) |
87 | 25.8k | { |
88 | 25.8k | m_bClosedObj = mxRefObj->IsClosedObj(); |
89 | 25.8k | SetBoundAndSnapRectsDirty(); // TODO: Optimize this. |
90 | | |
91 | | // Only a repaint here, rRefObj may have changed and broadcasts |
92 | 25.8k | ActionChanged(); |
93 | 25.8k | } |
94 | | |
95 | | void SdrVirtObj::NbcSetAnchorPos(const Point& rAnchorPos) |
96 | 0 | { |
97 | 0 | m_aAnchor=rAnchorPos; |
98 | 0 | } |
99 | | |
100 | | bool SdrVirtObj::IsPrintable() const |
101 | 0 | { |
102 | 0 | return mxRefObj->IsPrintable(); |
103 | 0 | } |
104 | | |
105 | | void SdrVirtObj::SetPrintable(bool const isPrintable) |
106 | 0 | { |
107 | 0 | mxRefObj->SetPrintable(isPrintable); |
108 | 0 | } |
109 | | |
110 | | bool SdrVirtObj::IsVisible() const |
111 | 147k | { |
112 | 147k | return mxRefObj->IsVisible(); |
113 | 147k | } |
114 | | |
115 | | void SdrVirtObj::SetVisible(bool const isVisible) |
116 | 0 | { |
117 | 0 | mxRefObj->SetVisible(isVisible); |
118 | 0 | } |
119 | | |
120 | | void SdrVirtObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const |
121 | 0 | { |
122 | 0 | mxRefObj->TakeObjInfo(rInfo); |
123 | 0 | } |
124 | | |
125 | | SdrInventor SdrVirtObj::GetObjInventor() const |
126 | 78.8k | { |
127 | 78.8k | return mxRefObj->GetObjInventor(); |
128 | 78.8k | } |
129 | | |
130 | | SdrObjKind SdrVirtObj::GetObjIdentifier() const |
131 | 26.0k | { |
132 | 26.0k | return mxRefObj->GetObjIdentifier(); |
133 | 26.0k | } |
134 | | |
135 | | SdrObjList* SdrVirtObj::GetSubList() const |
136 | 53.3k | { |
137 | 53.3k | return mxRefObj->GetSubList(); |
138 | 53.3k | } |
139 | | |
140 | | void SdrVirtObj::SetName(const OUString& rStr, const bool bSetChanged) |
141 | 0 | { |
142 | 0 | return mxRefObj->SetName(rStr, bSetChanged); |
143 | 0 | } |
144 | | |
145 | | const OUString & SdrVirtObj::GetName() const |
146 | 879 | { |
147 | 879 | return mxRefObj->GetName(); |
148 | 879 | } |
149 | | |
150 | | void SdrVirtObj::SetTitle(const OUString& rStr) |
151 | 0 | { |
152 | 0 | return mxRefObj->SetTitle(rStr); |
153 | 0 | } |
154 | | |
155 | | OUString SdrVirtObj::GetTitle() const |
156 | 879 | { |
157 | 879 | return mxRefObj->GetTitle(); |
158 | 879 | } |
159 | | |
160 | | void SdrVirtObj::SetDescription(const OUString& rStr) |
161 | 0 | { |
162 | 0 | return mxRefObj->SetDescription(rStr); |
163 | 0 | } |
164 | | |
165 | | OUString SdrVirtObj::GetDescription() const |
166 | 879 | { |
167 | 879 | return mxRefObj->GetDescription(); |
168 | 879 | } |
169 | | |
170 | | void SdrVirtObj::SetDecorative(bool const isDecorative) |
171 | 0 | { |
172 | 0 | return mxRefObj->SetDecorative(isDecorative); |
173 | 0 | } |
174 | | |
175 | | bool SdrVirtObj::IsDecorative() const |
176 | 0 | { |
177 | 0 | return mxRefObj->IsDecorative(); |
178 | 0 | } |
179 | | |
180 | | const tools::Rectangle& SdrVirtObj::GetCurrentBoundRect() const |
181 | 0 | { |
182 | 0 | auto aRectangle = mxRefObj->GetCurrentBoundRect(); // TODO: Optimize this. |
183 | 0 | aRectangle += m_aAnchor; |
184 | 0 | setOutRectangleConst(aRectangle); |
185 | 0 | return getOutRectangle(); |
186 | 0 | } |
187 | | |
188 | | const tools::Rectangle& SdrVirtObj::GetLastBoundRect() const |
189 | 0 | { |
190 | 0 | auto aRectangle = mxRefObj->GetLastBoundRect(); // TODO: Optimize this. |
191 | 0 | aRectangle += m_aAnchor; |
192 | 0 | setOutRectangleConst(aRectangle); |
193 | 0 | return getOutRectangle(); |
194 | 0 | } |
195 | | |
196 | | void SdrVirtObj::RecalcBoundRect() |
197 | 0 | { |
198 | 0 | tools::Rectangle aRectangle = mxRefObj->GetCurrentBoundRect(); |
199 | 0 | aRectangle += m_aAnchor; |
200 | 0 | setOutRectangle(aRectangle); |
201 | 0 | } |
202 | | |
203 | | rtl::Reference<SdrObject> SdrVirtObj::CloneSdrObject(SdrModel& rTargetModel) const |
204 | 0 | { |
205 | 0 | return new SdrVirtObj(rTargetModel, *this); |
206 | | // TTTT not sure if the above works - how could SdrObjFactory::MakeNewObject |
207 | | // create an object with correct rRefObj (?) OTOH VirtObj probably needs not |
208 | | // to be cloned ever - only used in Writer for multiple instances e.g. Header/Footer |
209 | | // return new SdrVirtObj( |
210 | | // getSdrModelFromSdrObject(), |
211 | | // rRefObj); // only a further reference |
212 | 0 | } |
213 | | |
214 | | OUString SdrVirtObj::TakeObjNameSingul() const |
215 | 0 | { |
216 | 0 | OUString sName = "[" + mxRefObj->TakeObjNameSingul() + "]"; |
217 | |
|
218 | 0 | OUString aName(GetName()); |
219 | 0 | if (!aName.isEmpty()) |
220 | 0 | sName += " '" + aName + "'"; |
221 | |
|
222 | 0 | return sName; |
223 | 0 | } |
224 | | |
225 | | OUString SdrVirtObj::TakeObjNamePlural() const |
226 | 0 | { |
227 | 0 | return "[" + mxRefObj->TakeObjNamePlural() + "]"; |
228 | 0 | } |
229 | | |
230 | | bool SdrVirtObj::HasLimitedRotation() const |
231 | 0 | { |
232 | | // RotGrfFlyFrame: If true, this SdrObject supports only limited rotation |
233 | 0 | return mxRefObj->HasLimitedRotation(); |
234 | 0 | } |
235 | | |
236 | | basegfx::B2DPolyPolygon SdrVirtObj::TakeXorPoly() const |
237 | 0 | { |
238 | 0 | basegfx::B2DPolyPolygon aPolyPolygon(mxRefObj->TakeXorPoly()); |
239 | |
|
240 | 0 | if(m_aAnchor.X() || m_aAnchor.Y()) |
241 | 0 | { |
242 | 0 | aPolyPolygon.translate(m_aAnchor.X(), m_aAnchor.Y()); |
243 | 0 | } |
244 | |
|
245 | 0 | return aPolyPolygon; |
246 | 0 | } |
247 | | |
248 | | |
249 | | sal_uInt32 SdrVirtObj::GetHdlCount() const |
250 | 0 | { |
251 | 0 | return mxRefObj->GetHdlCount(); |
252 | 0 | } |
253 | | |
254 | | void SdrVirtObj::AddToHdlList(SdrHdlList& rHdlList) const |
255 | 0 | { |
256 | 0 | SdrHdlList tempList(nullptr); |
257 | 0 | mxRefObj->AddToHdlList(tempList); |
258 | 0 | for (size_t i=0; i<tempList.GetHdlCount(); ++i) |
259 | 0 | { |
260 | 0 | SdrHdl* pHdl = tempList.GetHdl(i); |
261 | 0 | Point aP(pHdl->GetPos()+m_aAnchor); |
262 | 0 | pHdl->SetPos(aP); |
263 | 0 | } |
264 | 0 | tempList.MoveTo(rHdlList); |
265 | 0 | } |
266 | | |
267 | | void SdrVirtObj::AddToPlusHdlList(SdrHdlList& rHdlList, SdrHdl& rHdl) const |
268 | 0 | { |
269 | 0 | SdrHdlList tempList(nullptr); |
270 | 0 | mxRefObj->AddToPlusHdlList(tempList, rHdl); |
271 | 0 | for (size_t i=0; i<tempList.GetHdlCount(); ++i) |
272 | 0 | { |
273 | 0 | SdrHdl* pHdl = tempList.GetHdl(i); |
274 | 0 | Point aP(pHdl->GetPos()+m_aAnchor); |
275 | 0 | pHdl->SetPos(aP); |
276 | 0 | } |
277 | 0 | tempList.MoveTo(rHdlList); |
278 | 0 | } |
279 | | |
280 | | bool SdrVirtObj::hasSpecialDrag() const |
281 | 0 | { |
282 | 0 | return mxRefObj->hasSpecialDrag(); |
283 | 0 | } |
284 | | |
285 | | bool SdrVirtObj::supportsFullDrag() const |
286 | 0 | { |
287 | 0 | return false; |
288 | 0 | } |
289 | | |
290 | | rtl::Reference<SdrObject> SdrVirtObj::getFullDragClone() const |
291 | 0 | { |
292 | 0 | SdrObject& rReferencedObject = const_cast<SdrVirtObj*>(this)->ReferencedObj(); |
293 | 0 | return rtl::Reference<SdrObject>(new SdrGrafObj( |
294 | 0 | getSdrModelFromSdrObject(), |
295 | 0 | SdrDragView::GetObjGraphic(rReferencedObject), |
296 | 0 | GetLogicRect())); |
297 | 0 | } |
298 | | |
299 | | bool SdrVirtObj::beginSpecialDrag(SdrDragStat& rDrag) const |
300 | 0 | { |
301 | 0 | return mxRefObj->beginSpecialDrag(rDrag); |
302 | 0 | } |
303 | | |
304 | | bool SdrVirtObj::applySpecialDrag(SdrDragStat& rDrag) |
305 | 0 | { |
306 | 0 | return mxRefObj->applySpecialDrag(rDrag); |
307 | 0 | } |
308 | | |
309 | | basegfx::B2DPolyPolygon SdrVirtObj::getSpecialDragPoly(const SdrDragStat& rDrag) const |
310 | 0 | { |
311 | 0 | return mxRefObj->getSpecialDragPoly(rDrag); |
312 | | // TODO: we don't handle offsets yet! |
313 | 0 | } |
314 | | |
315 | | OUString SdrVirtObj::getSpecialDragComment(const SdrDragStat& rDrag) const |
316 | 0 | { |
317 | 0 | return mxRefObj->getSpecialDragComment(rDrag); |
318 | 0 | } |
319 | | |
320 | | |
321 | | bool SdrVirtObj::BegCreate(SdrDragStat& rStat) |
322 | 0 | { |
323 | 0 | return mxRefObj->BegCreate(rStat); |
324 | 0 | } |
325 | | |
326 | | bool SdrVirtObj::MovCreate(SdrDragStat& rStat) |
327 | 0 | { |
328 | 0 | return mxRefObj->MovCreate(rStat); |
329 | 0 | } |
330 | | |
331 | | bool SdrVirtObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) |
332 | 0 | { |
333 | 0 | return mxRefObj->EndCreate(rStat,eCmd); |
334 | 0 | } |
335 | | |
336 | | bool SdrVirtObj::BckCreate(SdrDragStat& rStat) |
337 | 0 | { |
338 | 0 | return mxRefObj->BckCreate(rStat); |
339 | 0 | } |
340 | | |
341 | | void SdrVirtObj::BrkCreate(SdrDragStat& rStat) |
342 | 0 | { |
343 | 0 | mxRefObj->BrkCreate(rStat); |
344 | 0 | } |
345 | | |
346 | | basegfx::B2DPolyPolygon SdrVirtObj::TakeCreatePoly(const SdrDragStat& rDrag) const |
347 | 0 | { |
348 | 0 | return mxRefObj->TakeCreatePoly(rDrag); |
349 | | // TODO: we don't handle offsets yet! |
350 | 0 | } |
351 | | |
352 | | |
353 | | void SdrVirtObj::NbcMove(const Size& rSiz) |
354 | 0 | { |
355 | 0 | m_aAnchor.Move(rSiz); |
356 | 0 | SetBoundAndSnapRectsDirty(); |
357 | 0 | } |
358 | | |
359 | | void SdrVirtObj::NbcResize(const Point& rRef, double xFact, double yFact) |
360 | 0 | { |
361 | 0 | mxRefObj->NbcResize(rRef-m_aAnchor,xFact,yFact); |
362 | 0 | SetBoundAndSnapRectsDirty(); |
363 | 0 | } |
364 | | |
365 | | void SdrVirtObj::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs) |
366 | 0 | { |
367 | 0 | mxRefObj->NbcRotate(rRef-m_aAnchor,nAngle,sn,cs); |
368 | 0 | SetBoundAndSnapRectsDirty(); |
369 | 0 | } |
370 | | |
371 | | void SdrVirtObj::NbcMirror(const Point& rRef1, const Point& rRef2) |
372 | 0 | { |
373 | 0 | mxRefObj->NbcMirror(rRef1-m_aAnchor,rRef2-m_aAnchor); |
374 | 0 | SetBoundAndSnapRectsDirty(); |
375 | 0 | } |
376 | | |
377 | | void SdrVirtObj::NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear) |
378 | 0 | { |
379 | 0 | mxRefObj->NbcShear(rRef-m_aAnchor,nAngle,tn,bVShear); |
380 | 0 | SetBoundAndSnapRectsDirty(); |
381 | 0 | } |
382 | | |
383 | | |
384 | | void SdrVirtObj::Move(const Size& rSiz) |
385 | 0 | { |
386 | 0 | if (!rSiz.IsEmpty()) { |
387 | 0 | tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); |
388 | 0 | NbcMove(rSiz); |
389 | 0 | SetChanged(); |
390 | 0 | BroadcastObjectChange(); |
391 | 0 | SendUserCall(SdrUserCallType::MoveOnly,aBoundRect0); |
392 | 0 | } |
393 | 0 | } |
394 | | |
395 | | void SdrVirtObj::Resize(const Point& rRef, double xFact, double yFact, bool bUnsetRelative) |
396 | 0 | { |
397 | 0 | if (xFact != 1.0 || yFact != 1.0) { |
398 | 0 | tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); |
399 | 0 | mxRefObj->Resize(rRef-m_aAnchor,xFact,yFact, bUnsetRelative); |
400 | 0 | SetBoundAndSnapRectsDirty(); |
401 | 0 | SendUserCall(SdrUserCallType::Resize,aBoundRect0); |
402 | 0 | } |
403 | 0 | } |
404 | | |
405 | | void SdrVirtObj::Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs) |
406 | 0 | { |
407 | 0 | if (nAngle) { |
408 | 0 | tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); |
409 | 0 | mxRefObj->Rotate(rRef-m_aAnchor,nAngle,sn,cs); |
410 | 0 | SetBoundAndSnapRectsDirty(); |
411 | 0 | SendUserCall(SdrUserCallType::Resize,aBoundRect0); |
412 | 0 | } |
413 | 0 | } |
414 | | |
415 | | void SdrVirtObj::Mirror(const Point& rRef1, const Point& rRef2) |
416 | 0 | { |
417 | 0 | tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); |
418 | 0 | mxRefObj->Mirror(rRef1-m_aAnchor,rRef2-m_aAnchor); |
419 | 0 | SetBoundAndSnapRectsDirty(); |
420 | 0 | SendUserCall(SdrUserCallType::Resize,aBoundRect0); |
421 | 0 | } |
422 | | |
423 | | void SdrVirtObj::Shear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear) |
424 | 0 | { |
425 | 0 | if (nAngle) { |
426 | 0 | tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); |
427 | 0 | mxRefObj->Shear(rRef-m_aAnchor,nAngle,tn,bVShear); |
428 | 0 | SetBoundAndSnapRectsDirty(); |
429 | 0 | SendUserCall(SdrUserCallType::Resize,aBoundRect0); |
430 | 0 | } |
431 | 0 | } |
432 | | |
433 | | |
434 | | void SdrVirtObj::RecalcSnapRect() |
435 | 0 | { |
436 | 0 | maSnapRect=mxRefObj->GetSnapRect(); |
437 | 0 | maSnapRect+=m_aAnchor; |
438 | 0 | } |
439 | | |
440 | | const tools::Rectangle& SdrVirtObj::GetSnapRect() const |
441 | 0 | { |
442 | 0 | const_cast<SdrVirtObj*>(this)->maSnapRect=mxRefObj->GetSnapRect(); |
443 | 0 | const_cast<SdrVirtObj*>(this)->maSnapRect+=m_aAnchor; |
444 | 0 | return maSnapRect; |
445 | 0 | } |
446 | | |
447 | | void SdrVirtObj::SetSnapRect(const tools::Rectangle& rRect) |
448 | 0 | { |
449 | 0 | tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); |
450 | 0 | tools::Rectangle aR(rRect); |
451 | 0 | aR-=m_aAnchor; |
452 | 0 | mxRefObj->SetSnapRect(aR); |
453 | 0 | SetBoundAndSnapRectsDirty(); |
454 | 0 | SendUserCall(SdrUserCallType::Resize,aBoundRect0); |
455 | 0 | } |
456 | | |
457 | | void SdrVirtObj::NbcSetSnapRect(const tools::Rectangle& rRect) |
458 | 0 | { |
459 | 0 | tools::Rectangle aR(rRect); |
460 | 0 | aR-=m_aAnchor; |
461 | 0 | SetBoundAndSnapRectsDirty(); |
462 | 0 | mxRefObj->NbcSetSnapRect(aR); |
463 | 0 | } |
464 | | |
465 | | |
466 | | const tools::Rectangle& SdrVirtObj::GetLogicRect() const |
467 | 0 | { |
468 | 0 | const_cast<SdrVirtObj*>(this)->maSnapRect=mxRefObj->GetLogicRect(); // An abuse of aSnapRect! |
469 | 0 | const_cast<SdrVirtObj*>(this)->maSnapRect+=m_aAnchor; // If there's trouble, we need another Rectangle Member (or a Heap). |
470 | 0 | return maSnapRect; |
471 | 0 | } |
472 | | |
473 | | void SdrVirtObj::SetLogicRect(const tools::Rectangle& rRect) |
474 | 0 | { |
475 | 0 | tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); |
476 | 0 | tools::Rectangle aR(rRect); |
477 | 0 | aR-=m_aAnchor; |
478 | 0 | mxRefObj->SetLogicRect(aR); |
479 | 0 | SetBoundAndSnapRectsDirty(); |
480 | 0 | SendUserCall(SdrUserCallType::Resize,aBoundRect0); |
481 | 0 | } |
482 | | |
483 | | void SdrVirtObj::NbcSetLogicRect(const tools::Rectangle& rRect, bool bAdaptTextMinSize) |
484 | 0 | { |
485 | 0 | tools::Rectangle aR(rRect); |
486 | 0 | aR-=m_aAnchor; |
487 | 0 | SetBoundAndSnapRectsDirty(); |
488 | 0 | mxRefObj->NbcSetLogicRect(aR, bAdaptTextMinSize); |
489 | 0 | } |
490 | | |
491 | | |
492 | | Degree100 SdrVirtObj::GetRotateAngle() const |
493 | 0 | { |
494 | 0 | return mxRefObj->GetRotateAngle(); |
495 | 0 | } |
496 | | |
497 | | Degree100 SdrVirtObj::GetShearAngle(bool bVertical) const |
498 | 0 | { |
499 | 0 | return mxRefObj->GetShearAngle(bVertical); |
500 | 0 | } |
501 | | |
502 | | |
503 | | sal_uInt32 SdrVirtObj::GetSnapPointCount() const |
504 | 0 | { |
505 | 0 | return mxRefObj->GetSnapPointCount(); |
506 | 0 | } |
507 | | |
508 | | Point SdrVirtObj::GetSnapPoint(sal_uInt32 i) const |
509 | 0 | { |
510 | 0 | Point aP(mxRefObj->GetSnapPoint(i)); |
511 | 0 | aP+=m_aAnchor; |
512 | 0 | return aP; |
513 | 0 | } |
514 | | |
515 | | bool SdrVirtObj::IsPolyObj() const |
516 | 0 | { |
517 | 0 | return mxRefObj->IsPolyObj(); |
518 | 0 | } |
519 | | |
520 | | sal_uInt32 SdrVirtObj::GetPointCount() const |
521 | 0 | { |
522 | 0 | return mxRefObj->GetPointCount(); |
523 | 0 | } |
524 | | |
525 | | Point SdrVirtObj::GetPoint(sal_uInt32 i) const |
526 | 0 | { |
527 | 0 | return mxRefObj->GetPoint(i) + m_aAnchor; |
528 | 0 | } |
529 | | |
530 | | void SdrVirtObj::NbcSetPoint(const Point& rPnt, sal_uInt32 i) |
531 | 0 | { |
532 | 0 | Point aP(rPnt); |
533 | 0 | aP-=m_aAnchor; |
534 | 0 | mxRefObj->SetPoint(aP,i); |
535 | 0 | SetBoundAndSnapRectsDirty(); |
536 | 0 | } |
537 | | |
538 | | |
539 | | std::unique_ptr<SdrObjGeoData> SdrVirtObj::NewGeoData() const |
540 | 0 | { |
541 | 0 | return mxRefObj->NewGeoData(); |
542 | 0 | } |
543 | | |
544 | | void SdrVirtObj::SaveGeoData(SdrObjGeoData& rGeo) const |
545 | 0 | { |
546 | 0 | mxRefObj->SaveGeoData(rGeo); |
547 | 0 | } |
548 | | |
549 | | void SdrVirtObj::RestoreGeoData(const SdrObjGeoData& rGeo) |
550 | 0 | { |
551 | 0 | mxRefObj->RestoreGeoData(rGeo); |
552 | 0 | SetBoundAndSnapRectsDirty(); |
553 | 0 | } |
554 | | |
555 | | |
556 | | std::unique_ptr<SdrObjGeoData> SdrVirtObj::GetGeoData() const |
557 | 0 | { |
558 | 0 | return mxRefObj->GetGeoData(); |
559 | 0 | } |
560 | | |
561 | | void SdrVirtObj::SetGeoData(const SdrObjGeoData& rGeo) |
562 | 0 | { |
563 | 0 | tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); |
564 | 0 | mxRefObj->SetGeoData(rGeo); |
565 | 0 | SetBoundAndSnapRectsDirty(); |
566 | 0 | SendUserCall(SdrUserCallType::Resize,aBoundRect0); |
567 | 0 | } |
568 | | |
569 | | |
570 | | void SdrVirtObj::NbcReformatText() |
571 | 0 | { |
572 | 0 | mxRefObj->NbcReformatText(); |
573 | 0 | } |
574 | | |
575 | | bool SdrVirtObj::HasMacro() const |
576 | 0 | { |
577 | 0 | return mxRefObj->HasMacro(); |
578 | 0 | } |
579 | | |
580 | | SdrObject* SdrVirtObj::CheckMacroHit(const SdrObjMacroHitRec& rRec) const |
581 | 0 | { |
582 | 0 | return mxRefObj->CheckMacroHit(rRec); // TODO: positioning offset |
583 | 0 | } |
584 | | |
585 | | PointerStyle SdrVirtObj::GetMacroPointer(const SdrObjMacroHitRec& rRec) const |
586 | 0 | { |
587 | 0 | return mxRefObj->GetMacroPointer(rRec); // TODO: positioning offset |
588 | 0 | } |
589 | | |
590 | | void SdrVirtObj::PaintMacro(OutputDevice& rOut, const tools::Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const |
591 | 0 | { |
592 | 0 | mxRefObj->PaintMacro(rOut,rDirtyRect,rRec); // TODO: positioning offset |
593 | 0 | } |
594 | | |
595 | | bool SdrVirtObj::DoMacro(const SdrObjMacroHitRec& rRec) |
596 | 0 | { |
597 | 0 | return mxRefObj->DoMacro(rRec); // TODO: positioning offset |
598 | 0 | } |
599 | | |
600 | | Point SdrVirtObj::GetOffset() const |
601 | 0 | { |
602 | | // #i73248# default offset of SdrVirtObj is aAnchor |
603 | 0 | return m_aAnchor; |
604 | 0 | } |
605 | | |
606 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |