insilmaril@611
|
1 |
#include <typeinfo>
|
insilmaril@611
|
2 |
|
insilmaril@0
|
3 |
#include "ornamentedobj.h"
|
insilmaril@0
|
4 |
#include "texteditor.h"
|
insilmaril@0
|
5 |
#include "mapeditor.h"
|
insilmaril@0
|
6 |
#include "linkablemapobj.h"
|
insilmaril@0
|
7 |
|
insilmaril@0
|
8 |
extern TextEditor *textEditor;
|
insilmaril@0
|
9 |
extern FlagRowObj *systemFlagsDefault;
|
insilmaril@0
|
10 |
extern FlagRowObj *standardFlagsDefault;
|
insilmaril@0
|
11 |
|
insilmaril@0
|
12 |
|
insilmaril@0
|
13 |
/////////////////////////////////////////////////////////////////
|
insilmaril@0
|
14 |
// OrnamentedObj
|
insilmaril@0
|
15 |
/////////////////////////////////////////////////////////////////
|
insilmaril@0
|
16 |
|
insilmaril@0
|
17 |
OrnamentedObj::OrnamentedObj():LinkableMapObj()
|
insilmaril@0
|
18 |
{
|
insilmaril@0
|
19 |
// cout << "Const OrnamentedObj ()\n";
|
insilmaril@0
|
20 |
init ();
|
insilmaril@0
|
21 |
}
|
insilmaril@0
|
22 |
|
insilmaril@408
|
23 |
OrnamentedObj::OrnamentedObj(QGraphicsScene* s) :LinkableMapObj(s)
|
insilmaril@0
|
24 |
{
|
insilmaril@408
|
25 |
// cout << "Const OrnamentedObj (s)\n";
|
insilmaril@0
|
26 |
init ();
|
insilmaril@0
|
27 |
}
|
insilmaril@0
|
28 |
|
insilmaril@408
|
29 |
OrnamentedObj::OrnamentedObj (OrnamentedObj* lmo) : LinkableMapObj (lmo->scene)
|
insilmaril@0
|
30 |
{
|
insilmaril@0
|
31 |
copy (lmo);
|
insilmaril@0
|
32 |
}
|
insilmaril@0
|
33 |
|
insilmaril@0
|
34 |
OrnamentedObj::~OrnamentedObj()
|
insilmaril@0
|
35 |
{
|
insilmaril@442
|
36 |
delete heading;
|
insilmaril@442
|
37 |
delete systemFlags;
|
insilmaril@442
|
38 |
delete standardFlags;
|
insilmaril@442
|
39 |
delete frame;
|
insilmaril@0
|
40 |
}
|
insilmaril@0
|
41 |
|
insilmaril@0
|
42 |
|
insilmaril@0
|
43 |
void OrnamentedObj::init ()
|
insilmaril@0
|
44 |
{
|
insilmaril@408
|
45 |
heading = new HeadingObj(scene);
|
insilmaril@0
|
46 |
heading->move (absPos.x(), absPos.y());
|
insilmaril@0
|
47 |
|
insilmaril@408
|
48 |
systemFlags=new FlagRowObj(scene);
|
insilmaril@0
|
49 |
systemFlags->clone(systemFlagsDefault);
|
insilmaril@0
|
50 |
systemFlags->setName ("systemFlags");
|
insilmaril@0
|
51 |
|
insilmaril@408
|
52 |
standardFlags=new FlagRowObj(scene);
|
insilmaril@0
|
53 |
standardFlags->clone(standardFlagsDefault);
|
insilmaril@0
|
54 |
standardFlags->setName ("standardFlags");
|
insilmaril@243
|
55 |
|
insilmaril@628
|
56 |
attributes.clear();
|
insilmaril@628
|
57 |
|
insilmaril@442
|
58 |
frame = new FrameObj (scene);
|
insilmaril@442
|
59 |
|
insilmaril@243
|
60 |
url="";
|
insilmaril@243
|
61 |
vymLink="";
|
insilmaril@243
|
62 |
|
insilmaril@0
|
63 |
}
|
insilmaril@0
|
64 |
|
insilmaril@0
|
65 |
void OrnamentedObj::copy (OrnamentedObj* other)
|
insilmaril@0
|
66 |
{
|
insilmaril@0
|
67 |
LinkableMapObj::copy(other);
|
insilmaril@0
|
68 |
heading->copy(other->heading);
|
insilmaril@243
|
69 |
setColor (other->heading->getColor());
|
insilmaril@0
|
70 |
|
insilmaril@0
|
71 |
systemFlags->copy (other->systemFlags);
|
insilmaril@0
|
72 |
standardFlags->copy (other->standardFlags);
|
insilmaril@0
|
73 |
|
insilmaril@227
|
74 |
ornamentsBBox=other->ornamentsBBox;
|
insilmaril@227
|
75 |
|
insilmaril@243
|
76 |
url=other->url;
|
insilmaril@243
|
77 |
vymLink=other->vymLink;
|
insilmaril@0
|
78 |
}
|
insilmaril@0
|
79 |
|
insilmaril@0
|
80 |
void OrnamentedObj::setLinkColor()
|
insilmaril@0
|
81 |
{
|
insilmaril@721
|
82 |
if (model->getMapLinkColorHint()==HeadingColor)
|
insilmaril@0
|
83 |
LinkableMapObj::setLinkColor (heading->getColor());
|
insilmaril@0
|
84 |
else
|
insilmaril@721
|
85 |
LinkableMapObj::setLinkColor (model->getMapDefLinkColor());
|
insilmaril@0
|
86 |
}
|
insilmaril@0
|
87 |
|
insilmaril@243
|
88 |
void OrnamentedObj::setColor (QColor col)
|
insilmaril@243
|
89 |
{
|
insilmaril@243
|
90 |
heading->setColor(col);
|
insilmaril@243
|
91 |
setLinkColor();
|
insilmaril@243
|
92 |
}
|
insilmaril@243
|
93 |
|
insilmaril@0
|
94 |
QColor OrnamentedObj::getColor ()
|
insilmaril@0
|
95 |
{
|
insilmaril@0
|
96 |
return heading->getColor();
|
insilmaril@0
|
97 |
}
|
insilmaril@0
|
98 |
|
insilmaril@476
|
99 |
FrameObj::FrameType OrnamentedObj::getFrameType()
|
insilmaril@442
|
100 |
{
|
insilmaril@442
|
101 |
return frame->getFrameType();
|
insilmaril@442
|
102 |
}
|
insilmaril@442
|
103 |
|
insilmaril@476
|
104 |
QString OrnamentedObj::getFrameTypeName()
|
insilmaril@476
|
105 |
{
|
insilmaril@476
|
106 |
return frame->getFrameTypeName();
|
insilmaril@476
|
107 |
}
|
insilmaril@476
|
108 |
|
insilmaril@476
|
109 |
void OrnamentedObj::setFrameType(const FrameObj::FrameType &t)
|
insilmaril@442
|
110 |
{
|
insilmaril@442
|
111 |
frame->setFrameType(t);
|
insilmaril@476
|
112 |
if (t == FrameObj::NoFrame)
|
insilmaril@476
|
113 |
linkpos=LinkableMapObj::Bottom;
|
insilmaril@442
|
114 |
else
|
insilmaril@476
|
115 |
linkpos=LinkableMapObj::Middle;
|
insilmaril@442
|
116 |
|
insilmaril@442
|
117 |
calcBBoxSize();
|
insilmaril@442
|
118 |
positionBBox();
|
insilmaril@442
|
119 |
requestReposition();
|
insilmaril@442
|
120 |
}
|
insilmaril@442
|
121 |
|
insilmaril@442
|
122 |
void OrnamentedObj::setFrameType(const QString &t)
|
insilmaril@442
|
123 |
{
|
insilmaril@442
|
124 |
frame->setFrameType(t);
|
insilmaril@476
|
125 |
if (frame->getFrameType() == FrameObj::NoFrame)
|
insilmaril@476
|
126 |
linkpos=LinkableMapObj::Bottom;
|
insilmaril@442
|
127 |
else
|
insilmaril@476
|
128 |
linkpos=LinkableMapObj::Middle;
|
insilmaril@442
|
129 |
|
insilmaril@442
|
130 |
calcBBoxSize();
|
insilmaril@442
|
131 |
positionBBox();
|
insilmaril@442
|
132 |
requestReposition();
|
insilmaril@442
|
133 |
}
|
insilmaril@442
|
134 |
|
insilmaril@476
|
135 |
void OrnamentedObj::setFramePadding (const int &i)
|
insilmaril@476
|
136 |
{
|
insilmaril@476
|
137 |
frame->setPadding (i);
|
insilmaril@476
|
138 |
calcBBoxSize();
|
insilmaril@476
|
139 |
positionBBox();
|
insilmaril@476
|
140 |
requestReposition();
|
insilmaril@476
|
141 |
}
|
insilmaril@476
|
142 |
|
insilmaril@476
|
143 |
int OrnamentedObj::getFramePadding ()
|
insilmaril@476
|
144 |
{
|
insilmaril@476
|
145 |
return frame->getPadding();
|
insilmaril@476
|
146 |
}
|
insilmaril@476
|
147 |
|
insilmaril@476
|
148 |
void OrnamentedObj::setFrameBorderWidth (const int &i)
|
insilmaril@476
|
149 |
{
|
insilmaril@476
|
150 |
frame->setBorderWidth(i);
|
insilmaril@476
|
151 |
calcBBoxSize();
|
insilmaril@476
|
152 |
positionBBox();
|
insilmaril@476
|
153 |
requestReposition();
|
insilmaril@476
|
154 |
}
|
insilmaril@476
|
155 |
|
insilmaril@476
|
156 |
int OrnamentedObj::getFrameBorderWidth()
|
insilmaril@476
|
157 |
{
|
insilmaril@476
|
158 |
return frame->getBorderWidth();
|
insilmaril@476
|
159 |
}
|
insilmaril@476
|
160 |
|
insilmaril@442
|
161 |
void OrnamentedObj::setFramePenColor(QColor col)
|
insilmaril@442
|
162 |
{
|
insilmaril@442
|
163 |
frame->setPenColor (col);
|
insilmaril@442
|
164 |
}
|
insilmaril@442
|
165 |
|
insilmaril@442
|
166 |
QColor OrnamentedObj::getFramePenColor()
|
insilmaril@442
|
167 |
{
|
insilmaril@442
|
168 |
return frame->getPenColor ();
|
insilmaril@442
|
169 |
}
|
insilmaril@442
|
170 |
|
insilmaril@442
|
171 |
void OrnamentedObj::setFrameBrushColor(QColor col)
|
insilmaril@442
|
172 |
{
|
insilmaril@442
|
173 |
frame->setBrushColor (col);
|
insilmaril@442
|
174 |
}
|
insilmaril@442
|
175 |
|
insilmaril@442
|
176 |
QColor OrnamentedObj::getFrameBrushColor()
|
insilmaril@442
|
177 |
{
|
insilmaril@442
|
178 |
return frame->getBrushColor ();
|
insilmaril@442
|
179 |
}
|
insilmaril@0
|
180 |
|
insilmaril@177
|
181 |
void OrnamentedObj::positionContents()
|
insilmaril@0
|
182 |
{
|
insilmaril@476
|
183 |
double d=frame->getPadding()/2;
|
insilmaril@177
|
184 |
double x=absPos.x();
|
insilmaril@177
|
185 |
double y=absPos.y();
|
insilmaril@227
|
186 |
|
insilmaril@227
|
187 |
double ox,oy; // Offset due to padding
|
insilmaril@227
|
188 |
|
insilmaril@227
|
189 |
ox=leftPad + d;
|
insilmaril@227
|
190 |
oy=topPad + d;
|
insilmaril@227
|
191 |
|
insilmaril@753
|
192 |
//FIXME-2 systemFlags-> move (ox +x , oy + y );
|
insilmaril@0
|
193 |
|
insilmaril@0
|
194 |
// vertical align heading to bottom
|
insilmaril@227
|
195 |
heading->move (ox + x + systemFlags->getBBox().width(),
|
insilmaril@227
|
196 |
oy + y + ornamentsBBox.height() - heading->getHeight()
|
insilmaril@0
|
197 |
);
|
insilmaril@753
|
198 |
//FIXME-2 standardFlags->move (ox +x + heading->getWidth() + systemFlags->getBBox().width() , oy + y );
|
insilmaril@227
|
199 |
|
insilmaril@408
|
200 |
ornamentsBBox.moveTopLeft ( QPointF ((int)(ox+x),(int)(oy+y)));
|
insilmaril@408
|
201 |
clickBox.moveTopLeft (QPointF ((int)(ox + x), (int)(oy + y)));
|
insilmaril@177
|
202 |
}
|
insilmaril@0
|
203 |
|
insilmaril@177
|
204 |
void OrnamentedObj::move (double x, double y)
|
insilmaril@177
|
205 |
{
|
insilmaril@177
|
206 |
MapObj::move (x,y);
|
insilmaril@177
|
207 |
positionContents();
|
insilmaril@0
|
208 |
updateLink();
|
insilmaril@0
|
209 |
requestReposition();
|
insilmaril@0
|
210 |
}
|
insilmaril@0
|
211 |
|
insilmaril@408
|
212 |
void OrnamentedObj::move (QPointF p)
|
insilmaril@0
|
213 |
{
|
insilmaril@0
|
214 |
move (p.x(), p.y());
|
insilmaril@0
|
215 |
}
|
insilmaril@0
|
216 |
|
insilmaril@0
|
217 |
void OrnamentedObj::moveBy (double x, double y)
|
insilmaril@0
|
218 |
{
|
insilmaril@0
|
219 |
|
insilmaril@0
|
220 |
MapObj::moveBy (x,y);
|
insilmaril@0
|
221 |
frame->moveBy (x,y);
|
insilmaril@0
|
222 |
systemFlags->moveBy (x,y);
|
insilmaril@0
|
223 |
standardFlags->moveBy (x,y);
|
insilmaril@0
|
224 |
heading->moveBy (x,y);
|
insilmaril@0
|
225 |
updateLink();
|
insilmaril@0
|
226 |
requestReposition();
|
insilmaril@0
|
227 |
}
|
insilmaril@0
|
228 |
|
insilmaril@408
|
229 |
void OrnamentedObj::moveBy (QPointF p)
|
insilmaril@0
|
230 |
{
|
insilmaril@0
|
231 |
moveBy (p.x(), p.y());
|
insilmaril@0
|
232 |
}
|
insilmaril@0
|
233 |
|
insilmaril@0
|
234 |
void OrnamentedObj::move2RelPos(double x, double y)
|
insilmaril@0
|
235 |
{
|
insilmaril@694
|
236 |
setRelPos (QPointF(x,y));
|
insilmaril@388
|
237 |
if (parObj)
|
insilmaril@388
|
238 |
{
|
insilmaril@408
|
239 |
QPointF p=parObj->getChildPos();
|
insilmaril@388
|
240 |
move (p.x()+x, p.y() +y);
|
insilmaril@388
|
241 |
}
|
insilmaril@0
|
242 |
}
|
insilmaril@0
|
243 |
|
insilmaril@408
|
244 |
void OrnamentedObj::move2RelPos(QPointF p)
|
insilmaril@0
|
245 |
{
|
insilmaril@218
|
246 |
move2RelPos (p.x(),p.y());
|
insilmaril@0
|
247 |
}
|
insilmaril@0
|
248 |
|
insilmaril@243
|
249 |
void OrnamentedObj::setURL(QString s)
|
insilmaril@243
|
250 |
{
|
insilmaril@243
|
251 |
url=s;
|
insilmaril@243
|
252 |
if (!url.isEmpty())
|
insilmaril@243
|
253 |
systemFlags->activate("url");
|
insilmaril@243
|
254 |
else
|
insilmaril@243
|
255 |
systemFlags->deactivate("url");
|
insilmaril@243
|
256 |
calcBBoxSize(); // recalculate bbox
|
insilmaril@243
|
257 |
positionBBox(); // rearrange contents
|
insilmaril@243
|
258 |
forceReposition();
|
insilmaril@243
|
259 |
}
|
insilmaril@243
|
260 |
|
insilmaril@243
|
261 |
QString OrnamentedObj::getURL()
|
insilmaril@243
|
262 |
{
|
insilmaril@243
|
263 |
return url;
|
insilmaril@243
|
264 |
}
|
insilmaril@243
|
265 |
|
insilmaril@243
|
266 |
void OrnamentedObj::setVymLink(QString s)
|
insilmaril@243
|
267 |
{
|
insilmaril@243
|
268 |
if (!s.isEmpty())
|
insilmaril@243
|
269 |
{
|
insilmaril@243
|
270 |
// We need the relative (from loading)
|
insilmaril@243
|
271 |
// or absolute path (from User event)
|
insilmaril@243
|
272 |
// and build the absolute path.
|
insilmaril@243
|
273 |
// Note: If we have relative, use path of
|
insilmaril@243
|
274 |
// current map to build absolute path
|
insilmaril@243
|
275 |
QDir d(s);
|
insilmaril@243
|
276 |
if (!d.path().startsWith ("/"))
|
insilmaril@243
|
277 |
{
|
insilmaril@721
|
278 |
QString p=model->getDestPath();
|
insilmaril@243
|
279 |
int i=p.findRev("/",-1);
|
insilmaril@243
|
280 |
d.setPath(p.left(i)+"/"+s);
|
insilmaril@243
|
281 |
d.convertToAbs();
|
insilmaril@243
|
282 |
}
|
insilmaril@243
|
283 |
vymLink=d.path();
|
insilmaril@243
|
284 |
systemFlags->activate("vymLink");
|
insilmaril@243
|
285 |
}
|
insilmaril@243
|
286 |
else
|
insilmaril@243
|
287 |
{
|
insilmaril@243
|
288 |
systemFlags->deactivate("vymLink");
|
insilmaril@243
|
289 |
vymLink="";
|
insilmaril@243
|
290 |
}
|
insilmaril@243
|
291 |
calcBBoxSize(); // recalculate bbox
|
insilmaril@243
|
292 |
positionBBox(); // rearrange contents
|
insilmaril@243
|
293 |
forceReposition();
|
insilmaril@243
|
294 |
}
|
insilmaril@243
|
295 |
|
insilmaril@243
|
296 |
QString OrnamentedObj::getVymLink()
|
insilmaril@243
|
297 |
{
|
insilmaril@243
|
298 |
return vymLink;
|
insilmaril@243
|
299 |
}
|
insilmaril@243
|
300 |
|
insilmaril@628
|
301 |
|
insilmaril@628
|
302 |
void OrnamentedObj::setAttributes (const QList <Attribute> &al)
|
insilmaril@628
|
303 |
{
|
insilmaril@628
|
304 |
attributes=al;
|
insilmaril@628
|
305 |
}
|
insilmaril@243
|
306 |
|
insilmaril@638
|
307 |
QList <Attribute> OrnamentedObj::getAttributes()
|
insilmaril@638
|
308 |
{
|
insilmaril@638
|
309 |
return attributes;
|
insilmaril@638
|
310 |
}
|
insilmaril@638
|
311 |
|
insilmaril@447
|
312 |
void OrnamentedObj::clearStandardFlags()
|
insilmaril@447
|
313 |
{
|
insilmaril@447
|
314 |
standardFlags->deactivateAll();
|
insilmaril@447
|
315 |
calcBBoxSize();
|
insilmaril@447
|
316 |
positionBBox();
|
insilmaril@447
|
317 |
move (absPos.x(), absPos.y() );
|
insilmaril@447
|
318 |
forceReposition();
|
insilmaril@447
|
319 |
}
|
insilmaril@447
|
320 |
|
insilmaril@103
|
321 |
void OrnamentedObj::toggleStandardFlag(QString f, bool exclusive)
|
insilmaril@0
|
322 |
{
|
insilmaril@103
|
323 |
standardFlags->toggle(f,exclusive);
|
insilmaril@0
|
324 |
calcBBoxSize();
|
insilmaril@0
|
325 |
positionBBox();
|
insilmaril@0
|
326 |
move (absPos.x(), absPos.y() );
|
insilmaril@0
|
327 |
forceReposition();
|
insilmaril@0
|
328 |
}
|
insilmaril@0
|
329 |
|
insilmaril@0
|
330 |
void OrnamentedObj::activateStandardFlag(QString f)
|
insilmaril@0
|
331 |
{
|
insilmaril@0
|
332 |
standardFlags->activate(f);
|
insilmaril@0
|
333 |
calcBBoxSize();
|
insilmaril@0
|
334 |
positionBBox();
|
insilmaril@0
|
335 |
move (absPos.x(), absPos.y() );
|
insilmaril@0
|
336 |
forceReposition();
|
insilmaril@0
|
337 |
}
|
insilmaril@0
|
338 |
|
insilmaril@366
|
339 |
void OrnamentedObj::deactivateStandardFlag(QString f)
|
insilmaril@366
|
340 |
{
|
insilmaril@366
|
341 |
standardFlags->deactivate(f);
|
insilmaril@366
|
342 |
calcBBoxSize();
|
insilmaril@366
|
343 |
positionBBox();
|
insilmaril@366
|
344 |
move (absPos.x(), absPos.y() );
|
insilmaril@366
|
345 |
forceReposition();
|
insilmaril@366
|
346 |
}
|
insilmaril@366
|
347 |
|
insilmaril@296
|
348 |
bool OrnamentedObj::isSetStandardFlag (QString f)
|
insilmaril@296
|
349 |
{
|
insilmaril@296
|
350 |
return standardFlags->isActive(f);
|
insilmaril@296
|
351 |
}
|
insilmaril@296
|
352 |
|
insilmaril@408
|
353 |
QString OrnamentedObj::getSystemFlagName(const QPointF &p)
|
insilmaril@0
|
354 |
{
|
insilmaril@0
|
355 |
return systemFlags->getFlagName(p);
|
insilmaril@0
|
356 |
}
|
insilmaril@0
|
357 |
|
insilmaril@236
|
358 |
bool OrnamentedObj::isActiveFlag (const QString & fname)
|
insilmaril@236
|
359 |
{
|
insilmaril@236
|
360 |
if (standardFlags->isActive (fname) ) return true;
|
insilmaril@236
|
361 |
return false;
|
insilmaril@236
|
362 |
}
|
insilmaril@236
|
363 |
|
insilmaril@746
|
364 |
/* FIXME-3 should move to VymView ?! void OrnamentedObj::getNoteFromTextEditor ()
|
insilmaril@417
|
365 |
{
|
insilmaril@417
|
366 |
note.setFilenameHint (textEditor->getFilename());
|
insilmaril@417
|
367 |
note.setFontHint (textEditor->getFontHint() );
|
insilmaril@417
|
368 |
setNote( textEditor->getText() );
|
insilmaril@417
|
369 |
}
|
insilmaril@746
|
370 |
*/
|
insilmaril@417
|
371 |
|
insilmaril@746
|
372 |
void OrnamentedObj::updateSystemFlags()
|
insilmaril@0
|
373 |
{
|
insilmaril@746
|
374 |
// FIXME-3 check if note here and text in editor are still in sync!!
|
insilmaril@746
|
375 |
// Best would be to always have current text here...
|
insilmaril@746
|
376 |
bool noteEmpty=treeItem->getNoteObj().isEmpty();
|
insilmaril@746
|
377 |
/*
|
insilmaril@417
|
378 |
if (isNoteInEditor)
|
insilmaril@417
|
379 |
noteEmpty=textEditor->isEmpty();
|
insilmaril@417
|
380 |
else
|
insilmaril@417
|
381 |
noteEmpty=note.isEmpty();
|
insilmaril@746
|
382 |
*/
|
insilmaril@0
|
383 |
|
insilmaril@417
|
384 |
if (!noteEmpty)
|
insilmaril@417
|
385 |
{
|
insilmaril@417
|
386 |
if (systemFlags->isActive ("note")) return;
|
insilmaril@417
|
387 |
systemFlags->activate("note");
|
insilmaril@417
|
388 |
}
|
insilmaril@417
|
389 |
else
|
insilmaril@417
|
390 |
{
|
insilmaril@417
|
391 |
if (!systemFlags->isActive ("note")) return;
|
insilmaril@417
|
392 |
systemFlags->deactivate("note");
|
insilmaril@417
|
393 |
}
|
insilmaril@746
|
394 |
//model->setChanged();
|
insilmaril@417
|
395 |
calcBBoxSize();
|
insilmaril@417
|
396 |
positionBBox();
|
insilmaril@417
|
397 |
move (absPos.x(), absPos.y() );
|
insilmaril@417
|
398 |
forceReposition();
|
insilmaril@417
|
399 |
}
|
insilmaril@0
|
400 |
|
insilmaril@366
|
401 |
void OrnamentedObj::updateFlagsToolbar()
|
insilmaril@366
|
402 |
{
|
insilmaril@366
|
403 |
standardFlags->updateToolbar();
|
insilmaril@366
|
404 |
}
|
insilmaril@366
|
405 |
|
insilmaril@628
|
406 |
QString OrnamentedObj::getOrnXMLAttr()
|
insilmaril@243
|
407 |
{
|
insilmaril@243
|
408 |
QString posAttr;
|
insilmaril@252
|
409 |
|
insilmaril@755
|
410 |
if (treeItem->depth()==0)
|
insilmaril@388
|
411 |
posAttr=
|
insilmaril@408
|
412 |
attribut("absPosX",QString().setNum(absPos.x())) +
|
insilmaril@408
|
413 |
attribut("absPosY",QString().setNum(absPos.y()));
|
insilmaril@243
|
414 |
else
|
insilmaril@252
|
415 |
{
|
insilmaril@755
|
416 |
if (treeItem->depth()==1 || typeid (*this)==typeid (FloatImageObj))
|
insilmaril@635
|
417 |
{
|
insilmaril@635
|
418 |
if (relPos.x()==0 && relPos.y()==0)
|
insilmaril@635
|
419 |
setRelPos();
|
insilmaril@388
|
420 |
posAttr=
|
insilmaril@408
|
421 |
attribut("relPosX",QString().setNum(relPos.x())) +
|
insilmaril@408
|
422 |
attribut("relPosY",QString().setNum(relPos.y()));
|
insilmaril@635
|
423 |
} else
|
insilmaril@252
|
424 |
posAttr="";
|
insilmaril@252
|
425 |
}
|
insilmaril@243
|
426 |
|
insilmaril@243
|
427 |
QString urlAttr;
|
insilmaril@243
|
428 |
if (!url.isEmpty())
|
insilmaril@243
|
429 |
urlAttr=attribut ("url",url);
|
insilmaril@243
|
430 |
|
insilmaril@243
|
431 |
QString vymLinkAttr;
|
insilmaril@243
|
432 |
if (!vymLink.isEmpty())
|
insilmaril@721
|
433 |
vymLinkAttr=attribut ("vymLink",convertToRel(model->getDestPath(),vymLink) );
|
insilmaril@243
|
434 |
|
insilmaril@753
|
435 |
/* FIXME-2 QString hideExpAttr;
|
insilmaril@243
|
436 |
if (hideExport)
|
insilmaril@243
|
437 |
hideExpAttr= attribut("hideInExport","true");
|
insilmaril@243
|
438 |
else
|
insilmaril@243
|
439 |
hideExpAttr="";
|
insilmaril@753
|
440 |
*/
|
insilmaril@753
|
441 |
return posAttr +urlAttr +vymLinkAttr +getLinkAttr() ;//+hideExpAttr;
|
insilmaril@243
|
442 |
}
|
insilmaril@243
|
443 |
|