Coverage Report

Created: 2025-07-07 10:01

/src/libreoffice/svx/source/svdraw/svdorect.cxx
Line
Count
Source (jump to first uncovered line)
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
#include <svx/svdorect.hxx>
21
#include <svx/xpoly.hxx>
22
#include <svx/svdtrans.hxx>
23
#include <svx/svddrag.hxx>
24
#include <svx/svdmodel.hxx>
25
#include <svx/svdview.hxx>
26
#include <svx/svdopath.hxx>
27
#include <svx/dialmgr.hxx>
28
#include <svx/strings.hrc>
29
#include <sdr/properties/rectangleproperties.hxx>
30
#include <sdr/contact/viewcontactofsdrrectobj.hxx>
31
#include <tools/debug.hxx>
32
#include <vcl/ptrstyle.hxx>
33
#include <osl/diagnose.h>
34
35
using namespace com::sun::star;
36
37
// BaseProperties section
38
39
std::unique_ptr<sdr::properties::BaseProperties> SdrRectObj::CreateObjectSpecificProperties()
40
1.40M
{
41
1.40M
    return std::make_unique<sdr::properties::RectangleProperties>(*this);
42
1.40M
}
43
44
45
// DrawContact section
46
47
std::unique_ptr<sdr::contact::ViewContact> SdrRectObj::CreateObjectSpecificViewContact()
48
1.42M
{
49
1.42M
    return std::make_unique<sdr::contact::ViewContactOfSdrRectObj>(*this);
50
1.42M
}
51
52
SdrRectObj::SdrRectObj(SdrModel& rSdrModel, const tools::Rectangle& rRectangle, std::optional<SdrObjKind> oeTextKind)
53
1.47M
    : SdrTextObj(rSdrModel, rRectangle, oeTextKind)
54
1.47M
{
55
1.47M
    DBG_ASSERT(meTextKind == SdrObjKind::Text ||
56
1.47M
               meTextKind == SdrObjKind::OutlineText || meTextKind == SdrObjKind::TitleText,
57
1.47M
               "SdrRectObj::SdrRectObj(SdrObjKind,...) can only be applied to text frames.");
58
59
1.47M
    m_bClosedObj = true;
60
1.47M
}
61
62
SdrRectObj::SdrRectObj(SdrModel& rSdrModel, SdrRectObj const & rSource)
63
14.1k
:   SdrTextObj(rSdrModel, rSource)
64
14.1k
{
65
14.1k
    m_bClosedObj = true;
66
14.1k
    mpXPoly = rSource.mpXPoly;
67
14.1k
}
68
69
1.48M
SdrRectObj::~SdrRectObj() = default;
70
71
void SdrRectObj::SetXPolyDirty()
72
31.4M
{
73
31.4M
    mpXPoly.reset();
74
31.4M
}
75
76
XPolygon SdrRectObj::ImpCalcXPoly(const tools::Rectangle& rRect1, tools::Long nRad1) const
77
4
{
78
4
    XPolygon aXPoly(rRect1,nRad1,nRad1);
79
4
    const sal_uInt16 nPointCnt(aXPoly.GetPointCount());
80
4
    XPolygon aNewPoly(nPointCnt+1);
81
4
    sal_uInt16 nShift=nPointCnt-2;
82
4
    if (nRad1!=0) nShift=nPointCnt-5;
83
4
    sal_uInt16 j=nShift;
84
20
    for (sal_uInt16 i=1; i<nPointCnt; i++) {
85
16
        aNewPoly[i]=aXPoly[j];
86
16
        aNewPoly.SetFlags(i,aXPoly.GetFlags(j));
87
16
        j++;
88
16
        if (j>=nPointCnt) j=1;
89
16
    }
90
4
    aNewPoly[0]=rRect1.BottomCenter();
91
4
    aNewPoly[nPointCnt]=aNewPoly[0];
92
4
    aXPoly=std::move(aNewPoly);
93
94
    // these angles always relate to the top left corner of aRect
95
4
    if (maGeo.m_nShearAngle) ShearXPoly(aXPoly, getRectangle().TopLeft(), maGeo.mfTanShearAngle);
96
4
    if (maGeo.m_nRotationAngle) RotateXPoly(aXPoly, getRectangle().TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
97
4
    return aXPoly;
98
4
}
99
100
void SdrRectObj::RecalcXPoly()
101
0
{
102
0
    mpXPoly = ImpCalcXPoly(getRectangle(), GetEckenradius());
103
0
}
104
105
const XPolygon& SdrRectObj::GetXPoly() const
106
1.25k
{
107
1.25k
    if(!mpXPoly)
108
1.25k
    {
109
1.25k
        const_cast<SdrRectObj*>(this)->RecalcXPoly();
110
1.25k
    }
111
112
1.25k
    return *mpXPoly;
113
1.25k
}
114
115
void SdrRectObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
116
0
{
117
0
    bool bNoTextFrame=!IsTextFrame();
118
0
    rInfo.bResizeFreeAllowed=bNoTextFrame || ((maGeo.m_nRotationAngle.get() % 9000) == 0);
119
0
    rInfo.bResizePropAllowed=true;
120
0
    rInfo.bRotateFreeAllowed=true;
121
0
    rInfo.bRotate90Allowed  =true;
122
0
    rInfo.bMirrorFreeAllowed=bNoTextFrame;
123
0
    rInfo.bMirror45Allowed  =bNoTextFrame;
124
0
    rInfo.bMirror90Allowed  =bNoTextFrame;
125
126
    // allow transparency
127
0
    rInfo.bTransparenceAllowed = true;
128
129
0
    rInfo.bShearAllowed     =bNoTextFrame;
130
0
    rInfo.bEdgeRadiusAllowed=true;
131
132
0
    bool bCanConv=!HasText() || ImpCanConvTextToCurve();
133
0
    if (bCanConv && !bNoTextFrame && !HasText()) {
134
0
        bCanConv=HasFill() || HasLine();
135
0
    }
136
0
    rInfo.bCanConvToPath    =bCanConv;
137
0
    rInfo.bCanConvToPoly    =bCanConv;
138
0
    rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary());
139
0
}
140
141
SdrObjKind SdrRectObj::GetObjIdentifier() const
142
4.48M
{
143
4.48M
    if (IsTextFrame())
144
4.37M
        return meTextKind;
145
112k
    else return SdrObjKind::Rectangle;
146
4.48M
}
147
148
void SdrRectObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
149
0
{
150
0
    rRect = getRectangle();
151
0
    if (maGeo.m_nShearAngle==0_deg100)
152
0
        return;
153
154
0
    tools::Long nDst=basegfx::fround<tools::Long>((getRectangle().Bottom()-getRectangle().Top()) * maGeo.mfTanShearAngle);
155
0
    if (maGeo.m_nShearAngle>0_deg100)
156
0
    {
157
0
        Point aRef(rRect.TopLeft());
158
0
        rRect.AdjustLeft( -nDst );
159
0
        Point aTmpPt(rRect.TopLeft());
160
0
        RotatePoint(aTmpPt,aRef,maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
161
0
        aTmpPt-=rRect.TopLeft();
162
0
        rRect.Move(aTmpPt.X(),aTmpPt.Y());
163
0
    }
164
0
    else
165
0
    {
166
0
        rRect.AdjustRight( -nDst );
167
0
    }
168
0
}
169
170
OUString SdrRectObj::TakeObjNameSingul() const
171
39.7k
{
172
39.7k
    if (IsTextFrame())
173
39.7k
    {
174
39.7k
        return SdrTextObj::TakeObjNameSingul();
175
39.7k
    }
176
177
0
    bool bRounded = GetEckenradius() != 0; // rounded down
178
0
    TranslateId pResId = bRounded ? STR_ObjNameSingulRECTRND : STR_ObjNameSingulRECT;
179
0
    if (maGeo.m_nShearAngle)
180
0
    {
181
0
        pResId = bRounded ? STR_ObjNameSingulPARALRND : STR_ObjNameSingulPARAL;  // parallelogram or, maybe, rhombus
182
0
    }
183
0
    else if (getRectangle().GetWidth() == getRectangle().GetHeight())
184
0
    {
185
0
        pResId = bRounded ? STR_ObjNameSingulQUADRND : STR_ObjNameSingulQUAD; // square
186
0
    }
187
0
    OUString sName(SvxResId(pResId));
188
189
0
    OUString aName(GetName());
190
0
    if (!aName.isEmpty())
191
0
        sName += " '" + aName + "'";
192
193
0
    return sName;
194
39.7k
}
195
196
OUString SdrRectObj::TakeObjNamePlural() const
197
0
{
198
0
    if (IsTextFrame())
199
0
    {
200
0
        return SdrTextObj::TakeObjNamePlural();
201
0
    }
202
203
0
    bool bRounded = GetEckenradius() != 0; // rounded down
204
0
    TranslateId pResId = bRounded ? STR_ObjNamePluralRECTRND : STR_ObjNamePluralRECT;
205
0
    if (maGeo.m_nShearAngle)
206
0
    {
207
0
        pResId = bRounded ? STR_ObjNamePluralPARALRND : STR_ObjNamePluralPARAL;  // parallelogram or rhombus
208
0
    }
209
0
    else if (getRectangle().GetWidth() == getRectangle().GetHeight())
210
0
    {
211
0
        pResId = bRounded ? STR_ObjNamePluralQUADRND : STR_ObjNamePluralQUAD; // square
212
0
    }
213
214
0
    return SvxResId(pResId);
215
0
}
216
217
rtl::Reference<SdrObject> SdrRectObj::CloneSdrObject(SdrModel& rTargetModel) const
218
13.6k
{
219
13.6k
    return new SdrRectObj(rTargetModel, *this);
220
13.6k
}
221
222
basegfx::B2DPolyPolygon SdrRectObj::TakeXorPoly() const
223
3
{
224
3
    XPolyPolygon aXPP;
225
3
    aXPP.Insert(ImpCalcXPoly(getRectangle(), GetEckenradius()));
226
3
    return aXPP.getB2DPolyPolygon();
227
3
}
228
229
void SdrRectObj::RecalcSnapRect()
230
42.0k
{
231
42.0k
    tools::Long nEckRad=GetEckenradius();
232
42.0k
    if ((maGeo.m_nRotationAngle || maGeo.m_nShearAngle) && nEckRad!=0) {
233
0
        maSnapRect=GetXPoly().GetBoundRect();
234
42.0k
    } else {
235
42.0k
        SdrTextObj::RecalcSnapRect();
236
42.0k
    }
237
42.0k
}
238
239
void SdrRectObj::NbcSetSnapRect(const tools::Rectangle& rRect)
240
167k
{
241
167k
    SdrTextObj::NbcSetSnapRect(rRect);
242
167k
    SetXPolyDirty();
243
167k
}
244
245
void SdrRectObj::NbcSetLogicRect(const tools::Rectangle& rRect, bool bAdaptTextMinSize)
246
2.95M
{
247
2.95M
    SdrTextObj::NbcSetLogicRect(rRect, bAdaptTextMinSize);
248
2.95M
    SetXPolyDirty();
249
2.95M
}
250
251
sal_uInt32 SdrRectObj::GetHdlCount() const
252
0
{
253
0
    return IsTextFrame() ? 10 : 9;
254
0
}
255
256
void SdrRectObj::AddToHdlList(SdrHdlList& rHdlList) const
257
0
{
258
    // A text box has an additional (pseudo-)handle for the blinking frame.
259
0
    if(IsTextFrame())
260
0
    {
261
0
        OSL_ENSURE(!IsTextEditActive(), "Do not use an ImpTextframeHdl for highlighting text in active text edit, this will collide with EditEngine paints (!)");
262
0
        std::unique_ptr<SdrHdl> pH(new ImpTextframeHdl(getRectangle()));
263
0
        pH->SetObj(const_cast<SdrRectObj*>(this));
264
0
        pH->SetRotationAngle(maGeo.m_nRotationAngle);
265
0
        rHdlList.AddHdl(std::move(pH));
266
0
    }
267
268
0
    for(sal_Int32 nHdlNum = 1; nHdlNum <= 9; ++nHdlNum)
269
0
    {
270
0
        Point aPnt;
271
0
        SdrHdlKind eKind = SdrHdlKind::Move;
272
0
        auto const& rRectangle = getRectangle();
273
0
        switch(nHdlNum)
274
0
        {
275
0
            case 1: // Handle for changing the corner radius
276
0
            {
277
0
                tools::Long a = GetEckenradius();
278
0
                tools::Long b = std::max(rRectangle.GetWidth(), rRectangle.GetHeight())/2; // rounded up, because GetWidth() adds 1
279
0
                if (a>b) a=b;
280
0
                if (a<0) a=0;
281
0
                aPnt = rRectangle.TopLeft();
282
0
                aPnt.AdjustX(a );
283
0
                eKind = SdrHdlKind::Circle;
284
0
                break;
285
0
            }
286
0
            case 2: aPnt = rRectangle.TopLeft();      eKind = SdrHdlKind::UpperLeft; break;
287
0
            case 3: aPnt = rRectangle.TopCenter();    eKind = SdrHdlKind::Upper; break;
288
0
            case 4: aPnt = rRectangle.TopRight();     eKind = SdrHdlKind::UpperRight; break;
289
0
            case 5: aPnt = rRectangle.LeftCenter();   eKind = SdrHdlKind::Left ; break;
290
0
            case 6: aPnt = rRectangle.RightCenter();  eKind = SdrHdlKind::Right; break;
291
0
            case 7: aPnt = rRectangle.BottomLeft();   eKind = SdrHdlKind::LowerLeft; break;
292
0
            case 8: aPnt = rRectangle.BottomCenter(); eKind = SdrHdlKind::Lower; break;
293
0
            case 9: aPnt = rRectangle.BottomRight();  eKind = SdrHdlKind::LowerRight; break;
294
0
        }
295
296
0
        if (maGeo.m_nShearAngle)
297
0
        {
298
0
            ShearPoint(aPnt,rRectangle.TopLeft(),maGeo.mfTanShearAngle);
299
0
        }
300
0
        if (maGeo.m_nRotationAngle)
301
0
        {
302
0
            RotatePoint(aPnt,rRectangle.TopLeft(),maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
303
0
        }
304
305
0
        std::unique_ptr<SdrHdl> pH(new SdrHdl(aPnt,eKind));
306
0
        pH->SetObj(const_cast<SdrRectObj*>(this));
307
0
        pH->SetRotationAngle(maGeo.m_nRotationAngle);
308
0
        rHdlList.AddHdl(std::move(pH));
309
0
    }
310
0
}
311
312
bool SdrRectObj::hasSpecialDrag() const
313
0
{
314
0
    return true;
315
0
}
316
317
bool SdrRectObj::beginSpecialDrag(SdrDragStat& rDrag) const
318
0
{
319
0
    const bool bRad(rDrag.GetHdl() && SdrHdlKind::Circle == rDrag.GetHdl()->GetKind());
320
321
0
    if(bRad)
322
0
    {
323
0
        rDrag.SetEndDragChangesAttributes(true);
324
325
0
        return true;
326
0
    }
327
328
0
    return SdrTextObj::beginSpecialDrag(rDrag);
329
0
}
330
331
bool SdrRectObj::applySpecialDrag(SdrDragStat& rDrag)
332
0
{
333
0
    const bool bRad(rDrag.GetHdl() && SdrHdlKind::Circle == rDrag.GetHdl()->GetKind());
334
335
0
    if (bRad)
336
0
    {
337
0
        Point aPt(rDrag.GetNow());
338
339
0
        if (maGeo.m_nRotationAngle)
340
0
            RotatePoint(aPt, getRectangle().TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
341
342
0
        sal_Int32 nRad(aPt.X() - getRectangle().Left());
343
344
0
        if (nRad < 0)
345
0
            nRad = 0;
346
347
0
        if(nRad != GetEckenradius())
348
0
        {
349
0
            NbcSetEckenradius(nRad);
350
0
        }
351
352
0
        return true;
353
0
    }
354
0
    else
355
0
    {
356
0
        return SdrTextObj::applySpecialDrag(rDrag);
357
0
    }
358
0
}
359
360
OUString SdrRectObj::getSpecialDragComment(const SdrDragStat& rDrag) const
361
0
{
362
0
    const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
363
364
0
    if(bCreateComment)
365
0
    {
366
0
        return OUString();
367
0
    }
368
0
    else
369
0
    {
370
0
        const bool bRad(rDrag.GetHdl() && SdrHdlKind::Circle == rDrag.GetHdl()->GetKind());
371
372
0
        if(bRad)
373
0
        {
374
0
            Point aPt(rDrag.GetNow());
375
376
            // -sin for reversal
377
0
            if (maGeo.m_nRotationAngle)
378
0
                RotatePoint(aPt, getRectangle().TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
379
380
0
            sal_Int32 nRad(aPt.X() - getRectangle().Left());
381
382
0
            if(nRad < 0)
383
0
                nRad = 0;
384
385
0
            return ImpGetDescriptionStr(STR_DragRectEckRad) +
386
0
                " (" +
387
0
                GetMetrStr(nRad) +
388
0
                ")";
389
0
        }
390
0
        else
391
0
        {
392
0
            return SdrTextObj::getSpecialDragComment(rDrag);
393
0
        }
394
0
    }
395
0
}
396
397
398
basegfx::B2DPolyPolygon SdrRectObj::TakeCreatePoly(const SdrDragStat& rDrag) const
399
0
{
400
0
    tools::Rectangle aRect1;
401
0
    rDrag.TakeCreateRect(aRect1);
402
0
    aRect1.Normalize();
403
404
0
    basegfx::B2DPolyPolygon aRetval;
405
0
    aRetval.append(ImpCalcXPoly(aRect1,GetEckenradius()).getB2DPolygon());
406
0
    return aRetval;
407
0
}
408
409
PointerStyle SdrRectObj::GetCreatePointer() const
410
0
{
411
0
    if (IsTextFrame()) return PointerStyle::DrawText;
412
0
    return PointerStyle::DrawRect;
413
0
}
414
415
void SdrRectObj::NbcMove(const Size& rSiz)
416
54.3k
{
417
54.3k
    SdrTextObj::NbcMove(rSiz);
418
54.3k
    SetXPolyDirty();
419
54.3k
}
420
421
void SdrRectObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
422
2.67k
{
423
2.67k
    SdrTextObj::NbcResize(rRef,xFact,yFact);
424
2.67k
    SetXPolyDirty();
425
2.67k
}
426
427
void SdrRectObj::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
428
3.58k
{
429
3.58k
    SdrTextObj::NbcRotate(rRef,nAngle,sn,cs);
430
3.58k
    SetXPolyDirty();
431
3.58k
}
432
433
void SdrRectObj::NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear)
434
0
{
435
0
    SdrTextObj::NbcShear(rRef,nAngle,tn,bVShear);
436
0
    SetXPolyDirty();
437
0
}
438
439
void SdrRectObj::NbcMirror(const Point& rRef1, const Point& rRef2)
440
4.91k
{
441
4.91k
    SdrTextObj::NbcMirror(rRef1,rRef2);
442
4.91k
    SetXPolyDirty();
443
4.91k
}
444
445
SdrGluePoint SdrRectObj::GetVertexGluePoint(sal_uInt16 nPosNum) const
446
0
{
447
0
    sal_Int32 nWdt = ImpGetLineWdt(); // #i25616#
448
449
    // #i25616#
450
0
    if(!LineIsOutsideGeometry())
451
0
    {
452
0
        nWdt++;
453
0
        nWdt /= 2;
454
0
    }
455
456
0
    Point aPt;
457
0
    auto const& rRectangle = getRectangle();
458
0
    switch (nPosNum) {
459
0
        case 0: aPt = rRectangle.TopCenter();    aPt.AdjustY( -nWdt ); break;
460
0
        case 1: aPt = rRectangle.RightCenter();  aPt.AdjustX(nWdt ); break;
461
0
        case 2: aPt = rRectangle.BottomCenter(); aPt.AdjustY(nWdt ); break;
462
0
        case 3: aPt = rRectangle.LeftCenter();   aPt.AdjustX( -nWdt ); break;
463
0
    }
464
0
    if (maGeo.m_nShearAngle)
465
0
        ShearPoint(aPt, rRectangle.TopLeft(), maGeo.mfTanShearAngle);
466
0
    if (maGeo.m_nRotationAngle)
467
0
        RotatePoint(aPt, rRectangle.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
468
0
    aPt-=GetSnapRect().Center();
469
0
    SdrGluePoint aGP(aPt);
470
0
    aGP.SetPercent(false);
471
0
    return aGP;
472
0
}
473
474
SdrGluePoint SdrRectObj::GetCornerGluePoint(sal_uInt16 nPosNum) const
475
0
{
476
0
    sal_Int32 nWdt = ImpGetLineWdt(); // #i25616#
477
478
    // #i25616#
479
0
    if(!LineIsOutsideGeometry())
480
0
    {
481
0
        nWdt++;
482
0
        nWdt /= 2;
483
0
    }
484
485
0
    Point aPt;
486
0
    auto const& rRectangle = getRectangle();
487
0
    switch (nPosNum) {
488
0
        case 0: aPt = rRectangle.TopLeft();     aPt.AdjustX( -nWdt ); aPt.AdjustY( -nWdt ); break;
489
0
        case 1: aPt = rRectangle.TopRight();    aPt.AdjustX(nWdt ); aPt.AdjustY( -nWdt ); break;
490
0
        case 2: aPt = rRectangle.BottomRight(); aPt.AdjustX(nWdt ); aPt.AdjustY(nWdt ); break;
491
0
        case 3: aPt = rRectangle.BottomLeft();  aPt.AdjustX( -nWdt ); aPt.AdjustY(nWdt ); break;
492
0
    }
493
0
    if (maGeo.m_nShearAngle)
494
0
        ShearPoint(aPt, rRectangle.TopLeft(),maGeo.mfTanShearAngle);
495
0
    if (maGeo.m_nRotationAngle)
496
0
        RotatePoint(aPt, rRectangle.TopLeft(),maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
497
0
    aPt-=GetSnapRect().Center();
498
499
0
    SdrGluePoint aGP(aPt);
500
0
    aGP.SetPercent(false);
501
0
    return aGP;
502
0
}
503
504
rtl::Reference<SdrObject> SdrRectObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
505
1
{
506
1
    XPolygon aXP(ImpCalcXPoly(getRectangle(), GetEckenradius()));
507
1
    { // TODO: this is only for the moment, until we have the new TakeContour()
508
1
        aXP.Remove(0,1);
509
1
        aXP[aXP.GetPointCount()-1]=aXP[0];
510
1
    }
511
512
1
    basegfx::B2DPolyPolygon aPolyPolygon(aXP.getB2DPolygon());
513
1
    aPolyPolygon.removeDoublePoints();
514
1
    rtl::Reference<SdrObject> pRet;
515
516
    // small correction: Do not create something when no fill and no line. To
517
    // be sure to not damage something with non-text frames, do this only
518
    // when used with bAddText==false from other converters
519
1
    if((bAddText && !IsTextFrame()) || HasFill() || HasLine())
520
1
    {
521
1
        pRet = ImpConvertMakeObj(aPolyPolygon, true, bBezier);
522
1
    }
523
524
1
    if(bAddText)
525
1
    {
526
1
        pRet = ImpConvertAddText(std::move(pRet), bBezier);
527
1
    }
528
529
1
    return pRet;
530
1
}
531
532
void SdrRectObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
533
21.2M
{
534
21.2M
    SdrTextObj::Notify(rBC,rHint);
535
21.2M
    SetXPolyDirty(); // because of the corner radius
536
21.2M
}
537
538
void SdrRectObj::RestoreGeoData(const SdrObjGeoData& rGeo)
539
0
{
540
0
    SdrTextObj::RestoreGeoData(rGeo);
541
0
    SetXPolyDirty();
542
0
}
543
544
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */