Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <svx/svdglev.hxx>
31 : : #include <math.h>
32 : :
33 : : #include <svx/svdundo.hxx>
34 : : #include "svx/svdstr.hrc" // names taken from the resource
35 : : #include "svx/svdglob.hxx" // StringCache
36 : : #include <svx/svdpagv.hxx>
37 : : #include <svx/svdglue.hxx>
38 : : #include <svx/svdtrans.hxx>
39 : : #include <svx/svdobj.hxx>
40 : :
41 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
42 : :
43 : 4699 : void SdrGlueEditView::ImpClearVars()
44 : : {
45 : 4699 : }
46 : :
47 : 4699 : SdrGlueEditView::SdrGlueEditView(SdrModel* pModel1, OutputDevice* pOut):
48 : 4699 : SdrPolyEditView(pModel1,pOut)
49 : : {
50 [ + - ]: 4699 : ImpClearVars();
51 : 4699 : }
52 : :
53 : 4508 : SdrGlueEditView::~SdrGlueEditView()
54 : : {
55 [ - + ]: 4508 : }
56 : :
57 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
58 : :
59 : 920 : void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, sal_Bool bConst, const void* p1, const void* p2, const void* p3, const void* p4, const void* p5)
60 : : {
61 : 920 : sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
62 [ + + ]: 925 : for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) {
63 : 5 : SdrMark* pM=GetSdrMarkByIndex(nm);
64 : 5 : SdrObject* pObj=pM->GetMarkedSdrObj();
65 : 5 : const SdrUShortCont* pPts=pM->GetMarkedGluePoints();
66 [ - + ]: 5 : sal_uIntPtr nPtAnz=pPts==NULL ? 0 : pPts->size();
67 [ - + ]: 5 : if (nPtAnz!=0) {
68 : 0 : SdrGluePointList* pGPL=NULL;
69 [ # # ]: 0 : if (bConst) {
70 : 0 : const SdrGluePointList* pConstGPL=pObj->GetGluePointList();
71 : 0 : pGPL=(SdrGluePointList*)pConstGPL;
72 : : } else {
73 : 0 : pGPL=pObj->ForceGluePointList();
74 : : }
75 [ # # ]: 0 : if (pGPL!=NULL)
76 : : {
77 [ # # ][ # # ]: 0 : if(!bConst && IsUndoEnabled() )
[ # # ]
78 : 0 : AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
79 : :
80 [ # # ][ # # ]: 0 : for(SdrUShortCont::const_iterator it = pPts->begin(); it != pPts->end(); ++it)
[ # # ]
81 : : {
82 [ # # ]: 0 : sal_uInt16 nPtId=*it;
83 [ # # ]: 0 : sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
84 [ # # ]: 0 : if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND)
85 : : {
86 [ # # ]: 0 : SdrGluePoint& rGP=(*pGPL)[nGlueIdx];
87 [ # # ]: 0 : (*pDoFunc)(rGP,pObj,p1,p2,p3,p4,p5);
88 : : }
89 : : }
90 [ # # ]: 0 : if (!bConst)
91 : : {
92 : 0 : pObj->SetChanged();
93 : 0 : pObj->BroadcastObjectChange();
94 : : }
95 : : }
96 : : }
97 : : }
98 [ - + ][ # # ]: 920 : if (!bConst && nMarkAnz!=0) pMod->SetChanged();
99 : 920 : }
100 : :
101 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
102 : :
103 : 0 : static void ImpGetEscDir(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pnThisEsc, const void* pnRet, const void*, const void*)
104 : : {
105 : 0 : sal_uInt16& nRet=*(sal_uInt16*)pnRet;
106 : 0 : sal_Bool& bFirst=*(sal_Bool*)pbFirst;
107 [ # # ]: 0 : if (nRet!=FUZZY) {
108 : 0 : sal_uInt16 nEsc=rGP.GetEscDir();
109 : 0 : sal_Bool bOn=(nEsc & *(sal_uInt16*)pnThisEsc)!=0;
110 [ # # ]: 0 : if (bFirst) { nRet=bOn; bFirst=sal_False; }
111 [ # # ]: 0 : else if (nRet!=bOn) nRet=FUZZY;
112 : : }
113 : 0 : }
114 : :
115 : 736 : TRISTATE SdrGlueEditView::IsMarkedGluePointsEscDir(sal_uInt16 nThisEsc) const
116 : : {
117 [ + - ]: 736 : ForceUndirtyMrkPnt();
118 : 736 : sal_Bool bFirst=sal_True;
119 : 736 : sal_uInt16 nRet=sal_False;
120 [ + - ]: 736 : ((SdrGlueEditView*)this)->ImpDoMarkedGluePoints(ImpGetEscDir,sal_True,&bFirst,&nThisEsc,&nRet);
121 : 736 : return (TRISTATE)nRet;
122 : : }
123 : :
124 : 0 : static void ImpSetEscDir(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pnThisEsc, const void* pbOn, const void*, const void*, const void*)
125 : : {
126 : 0 : sal_uInt16 nEsc=rGP.GetEscDir();
127 [ # # ]: 0 : if (*(sal_Bool*)pbOn) nEsc|=*(sal_uInt16*)pnThisEsc;
128 : 0 : else nEsc&=~*(sal_uInt16*)pnThisEsc;
129 : 0 : rGP.SetEscDir(nEsc);
130 : 0 : }
131 : :
132 : 0 : void SdrGlueEditView::SetMarkedGluePointsEscDir(sal_uInt16 nThisEsc, sal_Bool bOn)
133 : : {
134 : 0 : ForceUndirtyMrkPnt();
135 [ # # ][ # # ]: 0 : BegUndo(ImpGetResStr(STR_EditSetGlueEscDir),GetDescriptionOfMarkedGluePoints());
[ # # ]
136 : 0 : ImpDoMarkedGluePoints(ImpSetEscDir,sal_False,&nThisEsc,&bOn);
137 : 0 : EndUndo();
138 : 0 : }
139 : :
140 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
141 : :
142 : 0 : static void ImpGetPercent(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pnRet, const void*, const void*, const void*)
143 : : {
144 : 0 : sal_uInt16& nRet=*(sal_uInt16*)pnRet;
145 : 0 : sal_Bool& bFirst=*(sal_Bool*)pbFirst;
146 [ # # ]: 0 : if (nRet!=FUZZY) {
147 : 0 : bool bOn=rGP.IsPercent();
148 [ # # ]: 0 : if (bFirst) { nRet=bOn; bFirst=sal_False; }
149 [ # # ]: 0 : else if ((nRet!=0)!=bOn) nRet=FUZZY;
150 : : }
151 : 0 : }
152 : :
153 : 184 : TRISTATE SdrGlueEditView::IsMarkedGluePointsPercent() const
154 : : {
155 [ + - ]: 184 : ForceUndirtyMrkPnt();
156 : 184 : sal_Bool bFirst=sal_True;
157 : 184 : sal_uInt16 nRet=sal_True;
158 [ + - ]: 184 : ((SdrGlueEditView*)this)->ImpDoMarkedGluePoints(ImpGetPercent,sal_True,&bFirst,&nRet);
159 : 184 : return (TRISTATE)nRet;
160 : : }
161 : :
162 : 0 : static void ImpSetPercent(SdrGluePoint& rGP, const SdrObject* pObj, const void* pbOn, const void*, const void*, const void*, const void*)
163 : : {
164 [ # # ]: 0 : Point aPos(rGP.GetAbsolutePos(*pObj));
165 : 0 : rGP.SetPercent(*(sal_Bool*)pbOn);
166 [ # # ]: 0 : rGP.SetAbsolutePos(aPos,*pObj);
167 : 0 : }
168 : :
169 : 0 : void SdrGlueEditView::SetMarkedGluePointsPercent(sal_Bool bOn)
170 : : {
171 : 0 : ForceUndirtyMrkPnt();
172 [ # # ][ # # ]: 0 : BegUndo(ImpGetResStr(STR_EditSetGluePercent),GetDescriptionOfMarkedGluePoints());
[ # # ]
173 : 0 : ImpDoMarkedGluePoints(ImpSetPercent,sal_False,&bOn);
174 : 0 : EndUndo();
175 : 0 : }
176 : :
177 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
178 : :
179 : 0 : static void ImpGetAlign(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pbDontCare, const void* pbVert, const void* pnRet, const void*)
180 : : {
181 : 0 : sal_uInt16& nRet=*(sal_uInt16*)pnRet;
182 : 0 : sal_Bool& bFirst=*(sal_Bool*)pbFirst;
183 : 0 : sal_Bool& bDontCare=*(sal_Bool*)pbDontCare;
184 : 0 : sal_Bool bVert=*(sal_Bool*)pbVert;
185 [ # # ]: 0 : if (!bDontCare) {
186 : 0 : sal_uInt16 nAlg=0;
187 [ # # ]: 0 : if (bVert) {
188 : 0 : nAlg=rGP.GetVertAlign();
189 : : } else {
190 : 0 : nAlg=rGP.GetHorzAlign();
191 : : }
192 [ # # ]: 0 : if (bFirst) { nRet=nAlg; bFirst=sal_False; }
193 [ # # ]: 0 : else if (nRet!=nAlg) {
194 [ # # ]: 0 : if (bVert) {
195 : 0 : nRet=SDRVERTALIGN_DONTCARE;
196 : : } else {
197 : 0 : nRet=SDRHORZALIGN_DONTCARE;
198 : : }
199 : 0 : bDontCare=sal_True;
200 : : }
201 : : }
202 : 0 : }
203 : :
204 : 0 : sal_uInt16 SdrGlueEditView::GetMarkedGluePointsAlign(sal_Bool bVert) const
205 : : {
206 [ # # ]: 0 : ForceUndirtyMrkPnt();
207 : 0 : sal_Bool bFirst=sal_True;
208 : 0 : sal_Bool bDontCare=sal_False;
209 : 0 : sal_uInt16 nRet=0;
210 [ # # ]: 0 : ((SdrGlueEditView*)this)->ImpDoMarkedGluePoints(ImpGetAlign,sal_True,&bFirst,&bDontCare,&bVert,&nRet);
211 : 0 : return nRet;
212 : : }
213 : :
214 : 0 : static void ImpSetAlign(SdrGluePoint& rGP, const SdrObject* pObj, const void* pbVert, const void* pnAlign, const void*, const void*, const void*)
215 : : {
216 [ # # ]: 0 : Point aPos(rGP.GetAbsolutePos(*pObj));
217 [ # # ]: 0 : if (*(sal_Bool*)pbVert) { // bVert?
218 : 0 : rGP.SetVertAlign(*(sal_uInt16*)pnAlign);
219 : : } else {
220 : 0 : rGP.SetHorzAlign(*(sal_uInt16*)pnAlign);
221 : : }
222 [ # # ]: 0 : rGP.SetAbsolutePos(aPos,*pObj);
223 : 0 : }
224 : :
225 : 0 : void SdrGlueEditView::SetMarkedGluePointsAlign(sal_Bool bVert, sal_uInt16 nAlign)
226 : : {
227 : 0 : ForceUndirtyMrkPnt();
228 [ # # ][ # # ]: 0 : BegUndo(ImpGetResStr(STR_EditSetGlueAlign),GetDescriptionOfMarkedGluePoints());
[ # # ]
229 : 0 : ImpDoMarkedGluePoints(ImpSetAlign,sal_False,&bVert,&nAlign);
230 : 0 : EndUndo();
231 : 0 : }
232 : :
233 : 0 : void SdrGlueEditView::DeleteMarkedGluePoints()
234 : : {
235 : 0 : BrkAction();
236 : 0 : ForceUndirtyMrkPnt();
237 : 0 : const bool bUndo = IsUndoEnabled();
238 [ # # ]: 0 : if( bUndo )
239 [ # # ][ # # ]: 0 : BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedGluePoints(),SDRREPFUNC_OBJ_DELETE);
[ # # ]
240 : :
241 : 0 : sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
242 [ # # ]: 0 : for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
243 : : {
244 : 0 : SdrMark* pM=GetSdrMarkByIndex(nm);
245 : 0 : SdrObject* pObj=pM->GetMarkedSdrObj();
246 : 0 : const SdrUShortCont* pPts=pM->GetMarkedGluePoints();
247 [ # # ]: 0 : sal_uIntPtr nPtAnz=pPts==NULL ? 0 : pPts->size();
248 [ # # ]: 0 : if (nPtAnz!=0)
249 : : {
250 : 0 : SdrGluePointList* pGPL=pObj->ForceGluePointList();
251 [ # # ]: 0 : if (pGPL!=NULL)
252 : : {
253 [ # # ]: 0 : if( bUndo )
254 : 0 : AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
255 : :
256 [ # # ][ # # ]: 0 : for(SdrUShortCont::const_iterator it = pPts->begin(); it != pPts->end(); ++it)
[ # # ]
257 : : {
258 [ # # ]: 0 : sal_uInt16 nPtId=*it;
259 [ # # ]: 0 : sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
260 [ # # ]: 0 : if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND)
261 : : {
262 [ # # ]: 0 : pGPL->Delete(nGlueIdx);
263 : : }
264 : : }
265 : 0 : pObj->SetChanged();
266 : 0 : pObj->BroadcastObjectChange();
267 : : }
268 : : }
269 : : }
270 [ # # ]: 0 : if( bUndo )
271 : 0 : EndUndo();
272 : 0 : UnmarkAllGluePoints();
273 [ # # ]: 0 : if (nMarkAnz!=0)
274 : 0 : pMod->SetChanged();
275 : 0 : }
276 : :
277 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
278 : :
279 : 0 : void SdrGlueEditView::ImpCopyMarkedGluePoints()
280 : : {
281 : 0 : const bool bUndo = IsUndoEnabled();
282 : :
283 [ # # ]: 0 : if( bUndo )
284 : 0 : BegUndo();
285 : :
286 : 0 : sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
287 [ # # ]: 0 : for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
288 : : {
289 : 0 : SdrMark* pM=GetSdrMarkByIndex(nm);
290 : 0 : SdrObject* pObj=pM->GetMarkedSdrObj();
291 : 0 : SdrUShortCont* pPts=pM->GetMarkedGluePoints();
292 : 0 : SdrGluePointList* pGPL=pObj->ForceGluePointList();
293 [ # # ]: 0 : sal_uIntPtr nPtAnz=pPts==NULL ? 0 : pPts->size();
294 [ # # ][ # # ]: 0 : if (nPtAnz!=0 && pGPL!=NULL)
295 : : {
296 [ # # ]: 0 : if( bUndo )
297 [ # # ][ # # ]: 0 : AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
[ # # ]
298 : :
299 [ # # ]: 0 : SdrUShortCont aIdsToErase;
300 [ # # ]: 0 : SdrUShortCont aIdsToInsert;
301 [ # # ][ # # ]: 0 : for(SdrUShortCont::const_iterator it = pPts->begin(); it != pPts->end(); ++it)
[ # # ]
302 : : {
303 [ # # ]: 0 : sal_uInt16 nPtId=*it;
304 [ # # ]: 0 : sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
305 [ # # ]: 0 : if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND)
306 : : {
307 [ # # ]: 0 : SdrGluePoint aNewGP((*pGPL)[nGlueIdx]); // clone GluePoint
308 [ # # ]: 0 : sal_uInt16 nNewIdx=pGPL->Insert(aNewGP); // and insert it
309 [ # # ]: 0 : sal_uInt16 nNewId=(*pGPL)[nNewIdx].GetId(); // retrieve ID of new GluePoints
310 [ # # ]: 0 : aIdsToErase.insert(nPtId); // select it (instead of the old one)
311 [ # # ]: 0 : aIdsToInsert.insert(nNewId);
312 : : }
313 : : }
314 [ # # ][ # # ]: 0 : for(SdrUShortCont::const_iterator it = aIdsToErase.begin(); it != aIdsToErase.end(); ++it)
[ # # ]
315 [ # # ][ # # ]: 0 : pPts->erase(*it);
316 [ # # ]: 0 : pPts->insert(aIdsToInsert.begin(), aIdsToInsert.end());
317 : :
318 : : }
319 : : }
320 [ # # ]: 0 : if( bUndo )
321 : 0 : EndUndo();
322 : :
323 [ # # ]: 0 : if (nMarkAnz!=0)
324 : 0 : pMod->SetChanged();
325 : 0 : }
326 : :
327 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
328 : :
329 : 0 : void SdrGlueEditView::ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const void* p1, const void* p2, const void* p3, const void* p4, const void* p5)
330 : : {
331 : 0 : sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
332 [ # # ]: 0 : for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) {
333 : 0 : SdrMark* pM=GetSdrMarkByIndex(nm);
334 : 0 : SdrObject* pObj=pM->GetMarkedSdrObj();
335 : 0 : const SdrUShortCont* pPts=pM->GetMarkedGluePoints();
336 [ # # ]: 0 : sal_uIntPtr nPtAnz=pPts==NULL ? 0 : pPts->size();
337 [ # # ]: 0 : if (nPtAnz!=0) {
338 : 0 : SdrGluePointList* pGPL=pObj->ForceGluePointList();
339 [ # # ]: 0 : if (pGPL!=NULL)
340 : : {
341 [ # # ]: 0 : if( IsUndoEnabled() )
342 : 0 : AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
343 : :
344 [ # # ][ # # ]: 0 : for(SdrUShortCont::const_iterator it = pPts->begin(); it != pPts->end(); ++it)
[ # # ]
345 : : {
346 [ # # ]: 0 : sal_uInt16 nPtId=*it;
347 [ # # ]: 0 : sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
348 [ # # ]: 0 : if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND) {
349 [ # # ]: 0 : SdrGluePoint& rGP=(*pGPL)[nGlueIdx];
350 [ # # ]: 0 : Point aPos(rGP.GetAbsolutePos(*pObj));
351 [ # # ]: 0 : (*pTrFunc)(aPos,p1,p2,p3,p4,p5);
352 [ # # ]: 0 : rGP.SetAbsolutePos(aPos,*pObj);
353 : : }
354 : : }
355 : 0 : pObj->SetChanged();
356 : 0 : pObj->BroadcastObjectChange();
357 : : }
358 : : }
359 : : }
360 [ # # ]: 0 : if (nMarkAnz!=0) pMod->SetChanged();
361 : 0 : }
362 : :
363 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
364 : :
365 : 0 : static void ImpMove(Point& rPt, const void* p1, const void* /*p2*/, const void* /*p3*/, const void* /*p4*/, const void* /*p5*/)
366 : : {
367 : 0 : rPt.X()+=((const Size*)p1)->Width();
368 : 0 : rPt.Y()+=((const Size*)p1)->Height();
369 : 0 : }
370 : :
371 : 0 : void SdrGlueEditView::MoveMarkedGluePoints(const Size& rSiz, bool bCopy)
372 : : {
373 [ # # ]: 0 : ForceUndirtyMrkPnt();
374 [ # # ]: 0 : XubString aStr(ImpGetResStr(STR_EditMove));
375 [ # # ][ # # ]: 0 : if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
[ # # ][ # # ]
376 [ # # ][ # # ]: 0 : BegUndo(aStr,GetDescriptionOfMarkedGluePoints(),SDRREPFUNC_OBJ_MOVE);
[ # # ]
377 [ # # ][ # # ]: 0 : if (bCopy) ImpCopyMarkedGluePoints();
378 [ # # ]: 0 : ImpTransformMarkedGluePoints(ImpMove,&rSiz);
379 [ # # ]: 0 : EndUndo();
380 [ # # ][ # # ]: 0 : AdjustMarkHdl();
381 : 0 : }
382 : :
383 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
384 : :
385 : 0 : static void ImpResize(Point& rPt, const void* p1, const void* p2, const void* p3, const void* /*p4*/, const void* /*p5*/)
386 : : {
387 [ # # ][ # # ]: 0 : ResizePoint(rPt,*(const Point*)p1,*(const Fraction*)p2,*(const Fraction*)p3);
388 : 0 : }
389 : :
390 : 0 : void SdrGlueEditView::ResizeMarkedGluePoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy)
391 : : {
392 [ # # ]: 0 : ForceUndirtyMrkPnt();
393 [ # # ]: 0 : XubString aStr(ImpGetResStr(STR_EditResize));
394 [ # # ][ # # ]: 0 : if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
[ # # ][ # # ]
395 [ # # ][ # # ]: 0 : BegUndo(aStr,GetDescriptionOfMarkedGluePoints(),SDRREPFUNC_OBJ_RESIZE);
[ # # ]
396 [ # # ][ # # ]: 0 : if (bCopy) ImpCopyMarkedGluePoints();
397 [ # # ]: 0 : ImpTransformMarkedGluePoints(ImpResize,&rRef,&xFact,&yFact);
398 [ # # ]: 0 : EndUndo();
399 [ # # ][ # # ]: 0 : AdjustMarkHdl();
400 : 0 : }
401 : :
402 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
403 : :
404 : 0 : static void ImpRotate(Point& rPt, const void* p1, const void* /*p2*/, const void* p3, const void* p4, const void* /*p5*/)
405 : : {
406 : 0 : RotatePoint(rPt,*(const Point*)p1,*(const double*)p3,*(const double*)p4);
407 : 0 : }
408 : :
409 : 0 : void SdrGlueEditView::RotateMarkedGluePoints(const Point& rRef, long nWink, bool bCopy)
410 : : {
411 [ # # ]: 0 : ForceUndirtyMrkPnt();
412 [ # # ]: 0 : XubString aStr(ImpGetResStr(STR_EditRotate));
413 [ # # ][ # # ]: 0 : if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
[ # # ][ # # ]
414 [ # # ][ # # ]: 0 : BegUndo(aStr,GetDescriptionOfMarkedGluePoints(),SDRREPFUNC_OBJ_ROTATE);
[ # # ]
415 [ # # ][ # # ]: 0 : if (bCopy) ImpCopyMarkedGluePoints();
416 : 0 : double nSin=sin(nWink*nPi180);
417 : 0 : double nCos=cos(nWink*nPi180);
418 [ # # ]: 0 : ImpTransformMarkedGluePoints(ImpRotate,&rRef,&nWink,&nSin,&nCos);
419 [ # # ]: 0 : EndUndo();
420 [ # # ][ # # ]: 0 : AdjustMarkHdl();
421 : 0 : }
422 : :
423 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|