LibreOffice Module svx (master) 1
svdpdf.cxx
Go to the documentation of this file.
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 <svdpdf.hxx>
21
23#include <vcl/graph.hxx>
25
26#include <math.h>
27#include <editeng/eeitem.hxx>
28#include <editeng/fhgtitem.hxx>
29#include <editeng/wghtitem.hxx>
30#include <editeng/postitem.hxx>
31#include <editeng/udlnitem.hxx>
33#include <editeng/shdditem.hxx>
34#include <svx/xlnclit.hxx>
35#include <svx/xlncapit.hxx>
36#include <svx/xlnwtit.hxx>
37#include <svx/xflclit.hxx>
38#include <editeng/fontitem.hxx>
39#include <editeng/wrlmitem.hxx>
41#include <editeng/colritem.hxx>
42#include <vcl/metric.hxx>
44#include <svx/sdtditm.hxx>
45#include <svx/sdtagitm.hxx>
46#include <svx/sdtfsitm.hxx>
47#include <svx/svdmodel.hxx>
48#include <svx/svdpage.hxx>
49#include <svx/svdobj.hxx>
50#include <svx/svdotext.hxx>
51#include <svx/svdorect.hxx>
52#include <svx/svdograf.hxx>
53#include <svx/svdopath.hxx>
54#include <svx/svdetc.hxx>
55#include <svl/itemset.hxx>
57#include <tools/helpers.hxx>
60#include <svx/xlinjoit.hxx>
61#include <svx/xlndsit.hxx>
63#include <svx/xbtmpit.hxx>
64#include <svx/xfillit0.hxx>
65#include <svx/xflbmtit.hxx>
66#include <svx/xflbstit.hxx>
67#include <svx/xlineit0.hxx>
69#include <svx/svditer.hxx>
70#include <svx/svdogrp.hxx>
71#include <vcl/dibtools.hxx>
72#include <sal/log.hxx>
73#include <osl/diagnose.h>
74
75using namespace com::sun::star;
76
78 Graphic const& rGraphic)
79 : mpVD(VclPtr<VirtualDevice>::Create())
80 , maScaleRect(rRect)
81 , mnMapScalingOfs(0)
82 , mpModel(&rModel)
83 , mnLayer(nLay)
84 , mnLineWidth(0)
85 , maDash(css::drawing::DashStyle_RECT, 0, 0, 0, 0, 0)
86 , mbMov(false)
87 , mbSize(false)
88 , maOfs(0, 0)
89 , mfScaleX(1.0)
90 , mfScaleY(1.0)
91 , maScaleX(1.0)
92 , maScaleY(1.0)
93 , mbFntDirty(true)
94 , mbLastObjWasPolyWithoutLine(false)
95 , mbNoLine(false)
96 , mbNoFill(false)
97 , mnPageCount(0)
98 , mdPageHeightPts(0)
99 , mpPDFium(vcl::pdf::PDFiumLibrary::get())
100{
101 mpVD->EnableOutput(false);
102 mpVD->SetLineColor();
103 mpVD->SetFillColor();
104 maOldLineColor.SetRed(mpVD->GetLineColor().GetRed() + 1);
105 mpLineAttr = std::make_unique<SfxItemSetFixed<XATTR_LINE_FIRST, XATTR_LINE_LAST>>(
106 rModel.GetItemPool());
107 mpFillAttr = std::make_unique<SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST>>(
108 rModel.GetItemPool());
110 = std::make_unique<SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END>>(rModel.GetItemPool());
111
112 checkClip();
113
114 // Load the buffer using pdfium.
115 auto const& rVectorGraphicData = rGraphic.getVectorGraphicData();
116 auto* pData = rVectorGraphicData->getBinaryDataContainer().getData();
117 sal_Int32 nSize = rVectorGraphicData->getBinaryDataContainer().getSize();
118 mpPdfDocument = mpPDFium ? mpPDFium->openDocument(pData, nSize, OString()) : nullptr;
119 if (!mpPdfDocument)
120 return;
121
122 mnPageCount = mpPdfDocument->getPageCount();
123}
124
126
127void ImpSdrPdfImport::DoObjects(SvdProgressInfo* pProgrInfo, sal_uInt32* pActionsToReport,
128 int nPageIndex)
129{
130 const int nPageCount = mpPdfDocument->getPageCount();
131 if (!(nPageCount > 0 && nPageIndex >= 0 && nPageIndex < nPageCount))
132 return;
133
134 // Render next page.
135 auto pPdfPage = mpPdfDocument->openPage(nPageIndex);
136 if (!pPdfPage)
137 return;
138
139 basegfx::B2DSize dPageSize = mpPdfDocument->getPageSize(nPageIndex);
140
141 SetupPageScale(dPageSize.getWidth(), dPageSize.getHeight());
142
143 // Load the page text to extract it when we get text elements.
144 auto pTextPage = pPdfPage->getTextPage();
145
146 const int nPageObjectCount = pPdfPage->getObjectCount();
147 if (pProgrInfo)
148 pProgrInfo->SetActionCount(nPageObjectCount);
149
150 for (int nPageObjectIndex = 0; nPageObjectIndex < nPageObjectCount; ++nPageObjectIndex)
151 {
152 auto pPageObject = pPdfPage->getObject(nPageObjectIndex);
153 ImportPdfObject(pPageObject, pTextPage, nPageObjectIndex);
154 if (pProgrInfo && pActionsToReport)
155 {
156 (*pActionsToReport)++;
157
158 if (*pActionsToReport >= 16)
159 {
160 if (!pProgrInfo->ReportActions(*pActionsToReport))
161 break;
162
163 *pActionsToReport = 0;
164 }
165 }
166 }
167}
168
169void ImpSdrPdfImport::SetupPageScale(const double dPageWidth, const double dPageHeight)
170{
171 mfScaleX = mfScaleY = 1.0;
172
173 // Store the page dimensions in Points.
174 mdPageHeightPts = dPageHeight;
175
176 Size aPageSize(convertPointToMm100(dPageWidth), convertPointToMm100(dPageHeight));
177
178 if (aPageSize.Width() && aPageSize.Height() && (!maScaleRect.IsEmpty()))
179 {
181
182 if (aPageSize.Width() != (maScaleRect.GetWidth() - 1))
183 {
184 mfScaleX = static_cast<double>(maScaleRect.GetWidth() - 1)
185 / static_cast<double>(aPageSize.Width());
186 }
187
188 if (aPageSize.Height() != (maScaleRect.GetHeight() - 1))
189 {
190 mfScaleY = static_cast<double>(maScaleRect.GetHeight() - 1)
191 / static_cast<double>(aPageSize.Height());
192 }
193 }
194
195 mbMov = maOfs.X() != 0 || maOfs.Y() != 0;
196 mbSize = false;
197 maScaleX = Fraction(1, 1);
198 maScaleY = Fraction(1, 1);
199
200 if (aPageSize.Width() != (maScaleRect.GetWidth() - 1))
201 {
202 maScaleX = Fraction(maScaleRect.GetWidth() - 1, aPageSize.Width());
203 mbSize = true;
204 }
205
206 if (aPageSize.Height() != (maScaleRect.GetHeight() - 1))
207 {
208 maScaleY = Fraction(maScaleRect.GetHeight() - 1, aPageSize.Height());
209 mbSize = true;
210 }
211}
212
213size_t ImpSdrPdfImport::DoImport(SdrObjList& rOL, size_t nInsPos, int nPageNumber,
214 SvdProgressInfo* pProgrInfo)
215{
216 sal_uInt32 nActionsToReport(0);
217
218 // execute
219 DoObjects(pProgrInfo, &nActionsToReport, nPageNumber);
220
221 if (pProgrInfo)
222 {
223 pProgrInfo->ReportActions(nActionsToReport);
224 nActionsToReport = 0;
225 }
226
227 // MapMode scaling
228 MapScaling();
229
230 // To calculate the progress meter, we use GetActionSize()*3.
231 // However, maTmpList has a lower entry count limit than GetActionSize(),
232 // so the actions that were assumed were too much have to be re-added.
233 // nActionsToReport = (rMtf.GetActionSize() - maTmpList.size()) * 2;
234
235 // announce all currently unannounced rescales
236 if (pProgrInfo)
237 {
238 pProgrInfo->ReportRescales(nActionsToReport);
239 pProgrInfo->SetInsertCount(maTmpList.size());
240 }
241
242 nActionsToReport = 0;
243
244 // insert all objects cached in aTmpList now into rOL from nInsPos
245 nInsPos = std::min(nInsPos, rOL.GetObjCount());
246
248 {
249 rOL.NbcInsertObject(pObj.get(), nInsPos);
250 nInsPos++;
251
252 if (pProgrInfo)
253 {
254 nActionsToReport++;
255
256 if (nActionsToReport >= 32) // update all 32 actions
257 {
258 pProgrInfo->ReportInserts(nActionsToReport);
259 nActionsToReport = 0;
260 }
261 }
262 }
263
264 // report all remaining inserts for the last time
265 if (pProgrInfo)
266 {
267 pProgrInfo->ReportInserts(nActionsToReport);
268 }
269
270 return maTmpList.size();
271}
272
273void ImpSdrPdfImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr)
274{
275 mbNoLine = false;
276 mbNoFill = false;
277 bool bLine(!bForceTextAttr);
278 bool bFill(!pObj || (pObj->IsClosedObj() && !bForceTextAttr));
279 bool bText(bForceTextAttr || (pObj && pObj->GetOutlinerParaObject()));
280
281 if (bLine)
282 {
283 if (mnLineWidth)
284 {
286 }
287 else
288 {
289 mpLineAttr->Put(XLineWidthItem(0));
290 }
291
292 maOldLineColor = mpVD->GetLineColor();
293
294 if (mpVD->IsLineColor())
295 {
296 mpLineAttr->Put(XLineStyleItem(drawing::LineStyle_SOLID)); //TODO support dashed lines.
297 mpLineAttr->Put(XLineColorItem(OUString(), mpVD->GetLineColor()));
298 }
299 else
300 {
301 mpLineAttr->Put(XLineStyleItem(drawing::LineStyle_NONE));
302 }
303
304 mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_NONE));
305
306 // Add LineCap support
308
309 if (((maDash.GetDots() && maDash.GetDotLen())
310 || (maDash.GetDashes() && maDash.GetDashLen()))
311 && maDash.GetDistance())
312 {
313 mpLineAttr->Put(XLineDashItem(OUString(), maDash));
314 }
315 else
316 {
317 mpLineAttr->Put(XLineDashItem(OUString(), XDash(css::drawing::DashStyle_RECT)));
318 }
319 }
320 else
321 {
322 mbNoLine = true;
323 }
324
325 if (bFill)
326 {
327 if (mpVD->IsFillColor())
328 {
329 mpFillAttr->Put(XFillStyleItem(drawing::FillStyle_SOLID));
330 mpFillAttr->Put(XFillColorItem(OUString(), mpVD->GetFillColor()));
331 }
332 else
333 {
334 mpFillAttr->Put(XFillStyleItem(drawing::FillStyle_NONE));
335 }
336 }
337 else
338 {
339 mbNoFill = true;
340 }
341
342 if (bText && mbFntDirty)
343 {
344 vcl::Font aFnt(mpVD->GetFont());
345 const sal_uInt32 nHeight(FRound(aFnt.GetFontSize().Height() * mfScaleY));
346
348 aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO));
350 aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO_CJK));
352 aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO_CTL));
363
364 // #i118485# Setting this item leads to problems (written #i118498# for this)
365 // mpTextAttr->Put(SvxAutoKernItem(aFnt.IsKerning(), EE_CHAR_KERNING));
366
369 mpTextAttr->Put(SvxColorItem(mpVD->GetTextColor(), EE_CHAR_COLOR));
370 //... svxfont textitem svditext
371 mbFntDirty = false;
372 }
373
374 if (!pObj)
375 return;
376
377 pObj->SetLayer(mnLayer);
378
379 if (bLine)
380 {
382 }
383
384 if (bFill)
385 {
387 }
388
389 if (bText)
390 {
393 }
394}
395
396void ImpSdrPdfImport::InsertObj(SdrObject* pObj1, bool bScale)
397{
398 rtl::Reference<SdrObject> pObj = pObj1;
399 if (bScale && !maScaleRect.IsEmpty())
400 {
401 if (mbSize)
402 {
403 pObj->NbcResize(Point(), maScaleX, maScaleY);
404 }
405
406 if (mbMov)
407 {
408 pObj->NbcMove(Size(maOfs.X(), maOfs.Y()));
409 }
410 }
411
412 if (isClip())
413 {
414 const basegfx::B2DPolyPolygon aPoly(pObj->TakeXorPoly());
415 const basegfx::B2DRange aOldRange(aPoly.getB2DRange());
416 const SdrLayerID aOldLayer(pObj->GetLayer());
417 const SfxItemSet aOldItemSet(pObj->GetMergedItemSet());
418 const SdrGrafObj* pSdrGrafObj = dynamic_cast<SdrGrafObj*>(pObj.get());
419 const SdrTextObj* pSdrTextObj = DynCastSdrTextObj(pObj.get());
420
421 if (pSdrTextObj && pSdrTextObj->HasText())
422 {
423 // all text objects are created from ImportText and have no line or fill attributes, so
424 // it is okay to concentrate on the text itself
425 while (true)
426 {
427 const basegfx::B2DPolyPolygon aTextContour(pSdrTextObj->TakeContour());
428 const basegfx::B2DRange aTextRange(aTextContour.getB2DRange());
429 const basegfx::B2DRange aClipRange(maClip.getB2DRange());
430
431 // no overlap -> completely outside
432 if (!aClipRange.overlaps(aTextRange))
433 {
434 pObj.clear();
435 break;
436 }
437
438 // when the clip is a rectangle fast check for inside is possible
439 if (basegfx::utils::isRectangle(maClip) && aClipRange.isInside(aTextRange))
440 {
441 // completely inside ClipRect
442 break;
443 }
444
445 // here text needs to be clipped; to do so, convert to SdrObjects with polygons
446 // and add these recursively. Delete original object, do not add in this run
447 rtl::Reference<SdrObject> pConverted = pSdrTextObj->ConvertToPolyObj(true, true);
448 pObj.clear();
449 if (pConverted)
450 {
451 // recursively add created conversion; per definition this shall not
452 // contain further SdrTextObjs. Visit only non-group objects
453 SdrObjListIter aIter(*pConverted, SdrIterMode::DeepNoGroups);
454
455 // work with clones; the created conversion may contain group objects
456 // and when working with the original objects the loop itself could
457 // break and the cleanup later would be pretty complicated (only delete group
458 // objects, are these empty, ...?)
459 while (aIter.IsMore())
460 {
461 SdrObject* pCandidate = aIter.Next();
462 OSL_ENSURE(pCandidate && dynamic_cast<SdrObjGroup*>(pCandidate) == nullptr,
463 "SdrObjListIter with SdrIterMode::DeepNoGroups error (!)");
465 pCandidate->CloneSdrObject(pCandidate->getSdrModelFromSdrObject()));
466
467 if (pNewClone)
468 {
469 InsertObj(pNewClone.get(), false);
470 }
471 else
472 {
473 OSL_ENSURE(false, "SdrObject::Clone() failed (!)");
474 }
475 }
476 }
477
478 break;
479 }
480 }
481 else
482 {
483 BitmapEx aBitmapEx;
484
485 if (pSdrGrafObj)
486 {
487 aBitmapEx = pSdrGrafObj->GetGraphic().GetBitmapEx();
488 }
489
490 pObj.clear();
491
492 if (!aOldRange.isEmpty())
493 {
494 // clip against ClipRegion
496 aPoly, maClip, true, !aPoly.isClosed()));
497 const basegfx::B2DRange aNewRange(aNewPoly.getB2DRange());
498
499 if (!aNewRange.isEmpty())
500 {
501 pObj = new SdrPathObj(
503 aNewPoly);
504
505 pObj->SetLayer(aOldLayer);
506 pObj->SetMergedItemSet(aOldItemSet);
507
508 if (!aBitmapEx.IsEmpty())
509 {
510 // aNewRange is inside of aOldRange and defines which part of aBitmapEx is used
511 const double fScaleX(aBitmapEx.GetSizePixel().Width()
512 / (aOldRange.getWidth() ? aOldRange.getWidth() : 1.0));
513 const double fScaleY(
514 aBitmapEx.GetSizePixel().Height()
515 / (aOldRange.getHeight() ? aOldRange.getHeight() : 1.0));
516 basegfx::B2DRange aPixel(aNewRange);
518
519 aTrans.translate(-aOldRange.getMinX(), -aOldRange.getMinY());
520 aTrans.scale(fScaleX, fScaleY);
521 aPixel.transform(aTrans);
522
523 const Size aOrigSizePixel(aBitmapEx.GetSizePixel());
524 const Point aClipTopLeft(
525 basegfx::fround(floor(std::max(0.0, aPixel.getMinX()))),
526 basegfx::fround(floor(std::max(0.0, aPixel.getMinY()))));
527 const Size aClipSize(
528 basegfx::fround(ceil(std::min(
529 static_cast<double>(aOrigSizePixel.Width()), aPixel.getWidth()))),
531 ceil(std::min(static_cast<double>(aOrigSizePixel.Height()),
532 aPixel.getHeight()))));
533 const BitmapEx aClippedBitmap(aBitmapEx, aClipTopLeft, aClipSize);
534
535 pObj->SetMergedItem(XFillStyleItem(drawing::FillStyle_BITMAP));
536 pObj->SetMergedItem(XFillBitmapItem(OUString(), Graphic(aClippedBitmap)));
537 pObj->SetMergedItem(XFillBmpTileItem(false));
538 pObj->SetMergedItem(XFillBmpStretchItem(true));
539 }
540 }
541 }
542 }
543 }
544
545 if (!pObj)
546 return;
547
548 // #i111954# check object for visibility
549 // used are SdrPathObj, SdrRectObj, SdrCircObj, SdrGrafObj
550 bool bVisible(false);
551
552 if (pObj->HasLineStyle())
553 {
554 bVisible = true;
555 }
556
557 if (!bVisible && pObj->HasFillStyle())
558 {
559 bVisible = true;
560 }
561
562 if (!bVisible)
563 {
564 SdrTextObj* pTextObj = DynCastSdrTextObj(pObj.get());
565
566 if (pTextObj && pTextObj->HasText())
567 {
568 bVisible = true;
569 }
570 }
571
572 if (!bVisible)
573 {
574 SdrGrafObj* pGrafObj = dynamic_cast<SdrGrafObj*>(pObj.get());
575
576 if (pGrafObj)
577 {
578 // this may be refined to check if the graphic really is visible. It
579 // is here to ensure that graphic objects without fill, line and text
580 // get created
581 bVisible = true;
582 }
583 }
584
585 if (bVisible)
586 {
587 maTmpList.push_back(pObj);
588
589 if (dynamic_cast<SdrPathObj*>(pObj.get()))
590 {
591 const bool bClosed(pObj->IsClosedObj());
592
594 }
595 else
596 {
598 }
599 }
600}
601
603{
604 // #i73407# reformulation to use new B2DPolygon classes
606 {
607 SdrObject* pTmpObj = !maTmpList.empty() ? maTmpList[maTmpList.size() - 1].get() : nullptr;
608 SdrPathObj* pLastPoly = dynamic_cast<SdrPathObj*>(pTmpObj);
609
610 if (pLastPoly)
611 {
612 if (pLastPoly->GetPathPoly() == rPolyPolygon)
613 {
614 SetAttributes(nullptr);
615
616 if (!mbNoLine && mbNoFill)
617 {
618 pLastPoly->SetMergedItemSet(*mpLineAttr);
619
620 return true;
621 }
622 }
623 }
624 }
625
626 return false;
627}
628
630{
631 if (mpVD->IsClipRegion())
632 {
633 maClip = mpVD->GetClipRegion().GetAsB2DPolyPolygon();
634
635 if (isClip())
636 {
638 mfScaleX, mfScaleY, maOfs.X(), maOfs.Y()));
639
640 maClip.transform(aTransform);
641 }
642 }
643}
644
647 std::unique_ptr<vcl::pdf::PDFiumPageObject> const& pPageObject,
648 std::unique_ptr<vcl::pdf::PDFiumTextPage> const& pTextPage, int nPageObjectIndex)
649{
650 if (!pPageObject)
651 return;
652
653 const vcl::pdf::PDFPageObjectType ePageObjectType = pPageObject->getType();
654 switch (ePageObjectType)
655 {
657 ImportText(pPageObject, pTextPage, nPageObjectIndex);
658 break;
660 ImportPath(pPageObject, nPageObjectIndex);
661 break;
663 ImportImage(pPageObject, nPageObjectIndex);
664 break;
666 SAL_WARN("sd.filter", "Got page object SHADING: " << nPageObjectIndex);
667 break;
669 ImportForm(pPageObject, pTextPage, nPageObjectIndex);
670 break;
671 default:
672 SAL_WARN("sd.filter", "Unknown PDF page object #" << nPageObjectIndex << " of type: "
673 << static_cast<int>(ePageObjectType));
674 break;
675 }
676}
677
678void ImpSdrPdfImport::ImportForm(std::unique_ptr<vcl::pdf::PDFiumPageObject> const& pPageObject,
679 std::unique_ptr<vcl::pdf::PDFiumTextPage> const& pTextPage,
680 int /*nPageObjectIndex*/)
681{
682 // Get the form matrix to perform correct translation/scaling of the form sub-objects.
683 const basegfx::B2DHomMatrix aOldMatrix = maCurrentMatrix;
684
685 maCurrentMatrix = pPageObject->getMatrix();
686
687 const int nCount = pPageObject->getFormObjectCount();
688 for (int nIndex = 0; nIndex < nCount; ++nIndex)
689 {
690 auto pFormObject = pPageObject->getFormObject(nIndex);
691
692 ImportPdfObject(pFormObject, pTextPage, -1);
693 }
694
695 // Restore the old one.
696 maCurrentMatrix = aOldMatrix;
697}
698
699void ImpSdrPdfImport::ImportText(std::unique_ptr<vcl::pdf::PDFiumPageObject> const& pPageObject,
700 std::unique_ptr<vcl::pdf::PDFiumTextPage> const& pTextPage,
701 int /*nPageObjectIndex*/)
702{
703 basegfx::B2DRectangle aTextRect = pPageObject->getBounds();
704 basegfx::B2DHomMatrix aMatrix = pPageObject->getMatrix();
705
707
708 aTextRect *= aTextMatrix;
709 const tools::Rectangle aRect = PointsToLogic(aTextRect.getMinX(), aTextRect.getMaxX(),
710 aTextRect.getMinY(), aTextRect.getMaxY());
711
712 OUString sText = pPageObject->getText(pTextPage);
713
714 const double dFontSize = pPageObject->getFontSize();
715 double dFontSizeH = fabs(std::hypot(aMatrix.a(), aMatrix.c()) * dFontSize);
716 double dFontSizeV = fabs(std::hypot(aMatrix.b(), aMatrix.d()) * dFontSize);
717
718 dFontSizeH = convertPointToMm100(dFontSizeH);
719 dFontSizeV = convertPointToMm100(dFontSizeV);
720
721 const Size aFontSize(dFontSizeH, dFontSizeV);
722 vcl::Font aFnt = mpVD->GetFont();
723 if (aFontSize != aFnt.GetFontSize())
724 {
725 aFnt.SetFontSize(aFontSize);
726 mpVD->SetFont(aFnt);
727 mbFntDirty = true;
728 }
729
730 OUString sFontName = pPageObject->getFontName();
731 if (!sFontName.isEmpty() && sFontName != aFnt.GetFamilyName())
732 {
733 aFnt.SetFamilyName(sFontName);
734 mpVD->SetFont(aFnt);
735 mbFntDirty = true;
736 }
737
738 Color aTextColor(COL_TRANSPARENT);
739 bool bFill = false;
740 bool bUse = true;
741 switch (pPageObject->getTextRenderMode())
742 {
747 bFill = true;
748 break;
752 break;
755 bUse = false;
756 break;
757 }
758 if (bUse)
759 {
760 Color aColor = bFill ? pPageObject->getFillColor() : pPageObject->getStrokeColor();
761 if (aColor != COL_TRANSPARENT)
762 aTextColor = aColor.GetRGBColor();
763 }
764
765 if (aTextColor != mpVD->GetTextColor())
766 {
767 mpVD->SetTextColor(aTextColor);
768 mbFntDirty = true;
769 }
770
771 InsertTextObject(aRect.TopLeft(), aRect.GetSize(), sText);
772}
773
774void ImpSdrPdfImport::InsertTextObject(const Point& rPos, const Size& rSize, const OUString& rStr)
775{
776 // calc text box size, add 5% to make it fit safely
777
778 FontMetric aFontMetric(mpVD->GetFontMetric());
779 vcl::Font aFont(mpVD->GetFont());
780 TextAlign eAlignment(aFont.GetAlignment());
781
782 // sal_Int32 nTextWidth = static_cast<sal_Int32>(mpVD->GetTextWidth(rStr) * mfScaleX);
783 sal_Int32 nTextHeight = static_cast<sal_Int32>(mpVD->GetTextHeight() * mfScaleY);
784
785 Point aPosition(FRound(rPos.X() * mfScaleX + maOfs.X()),
786 FRound(rPos.Y() * mfScaleY + maOfs.Y()));
787 Size aSize(FRound(rSize.Width() * mfScaleX), FRound(rSize.Height() * mfScaleY));
788
789 if (eAlignment == ALIGN_BASELINE)
790 aPosition.AdjustY(-FRound(aFontMetric.GetAscent() * mfScaleY));
791 else if (eAlignment == ALIGN_BOTTOM)
792 aPosition.AdjustY(-nTextHeight);
793
794 tools::Rectangle aTextRect(aPosition, aSize);
796
797 pText->SetMergedItem(makeSdrTextUpperDistItem(0));
798 pText->SetMergedItem(makeSdrTextLowerDistItem(0));
799 pText->SetMergedItem(makeSdrTextRightDistItem(0));
800 pText->SetMergedItem(makeSdrTextLeftDistItem(0));
801
802 if (aFont.GetAverageFontWidth())
803 {
804 pText->ClearMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH);
805 pText->SetMergedItem(makeSdrTextAutoGrowHeightItem(false));
806 // don't let the margins eat the space needed for the text
807 pText->SetMergedItem(SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_ALLLINES));
808 }
809 else
810 {
811 pText->SetMergedItem(makeSdrTextAutoGrowWidthItem(true));
812 }
813
814 pText->SetLayer(mnLayer);
815 pText->NbcSetText(rStr);
816 SetAttributes(pText.get(), true);
817 pText->SetSnapRect(aTextRect);
818
819 if (!aFont.IsTransparent())
820 {
822 aAttr.Put(XFillStyleItem(drawing::FillStyle_SOLID));
823 aAttr.Put(XFillColorItem(OUString(), aFont.GetFillColor()));
824 pText->SetMergedItemSet(aAttr);
825 }
826 Degree100 nAngle = to<Degree100>(aFont.GetOrientation());
827 if (nAngle)
828 pText->SdrAttrObj::NbcRotate(aPosition, nAngle);
829 InsertObj(pText.get(), false);
830}
831
833{
834 const size_t nCount(maTmpList.size());
835 const MapMode& rMap = mpVD->GetMapMode();
836 Point aMapOrg(rMap.GetOrigin());
837 bool bMov2(aMapOrg.X() != 0 || aMapOrg.Y() != 0);
838
839 if (bMov2)
840 {
841 for (size_t i = mnMapScalingOfs; i < nCount; i++)
842 {
843 SdrObject* pObj = maTmpList[i].get();
844
845 pObj->NbcMove(Size(aMapOrg.X(), aMapOrg.Y()));
846 }
847 }
848
850}
851
852void ImpSdrPdfImport::ImportImage(std::unique_ptr<vcl::pdf::PDFiumPageObject> const& pPageObject,
853 int /*nPageObjectIndex*/)
854{
855 std::unique_ptr<vcl::pdf::PDFiumBitmap> bitmap = pPageObject->getImageBitmap();
856 if (!bitmap)
857 {
858 SAL_WARN("sd.filter", "Failed to get IMAGE");
859 return;
860 }
861
862 const vcl::pdf::PDFBitmapType format = bitmap->getFormat();
864 {
865 SAL_WARN("sd.filter", "Failed to get IMAGE format");
866 return;
867 }
868
869 const unsigned char* pBuf = bitmap->getBuffer();
870 const int nWidth = bitmap->getWidth();
871 const int nHeight = bitmap->getHeight();
872 const int nStride = bitmap->getStride();
873 BitmapEx aBitmap(Size(nWidth, nHeight), vcl::PixelFormat::N24_BPP);
874
875 switch (format)
876 {
878 ReadRawDIB(aBitmap, pBuf, ScanlineFormat::N24BitTcBgr, nHeight, nStride);
879 break;
881 ReadRawDIB(aBitmap, pBuf, ScanlineFormat::N32BitTcRgba, nHeight, nStride);
882 break;
884 ReadRawDIB(aBitmap, pBuf, ScanlineFormat::N32BitTcBgra, nHeight, nStride);
885 break;
886 default:
887 SAL_WARN("sd.filter", "Got IMAGE width: " << nWidth << ", height: " << nHeight
888 << ", stride: " << nStride
889 << ", format: " << static_cast<int>(format));
890 break;
891 }
892
893 basegfx::B2DRectangle aBounds = pPageObject->getBounds();
894 float left = aBounds.getMinX();
895 // Upside down.
896 float bottom = aBounds.getMinY();
897 float right = aBounds.getMaxX();
898 // Upside down.
899 float top = aBounds.getMaxY();
901 aRect.AdjustRight(1);
902 aRect.AdjustBottom(1);
903
904 rtl::Reference<SdrGrafObj> pGraf = new SdrGrafObj(*mpModel, Graphic(aBitmap), aRect);
905
906 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
907 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
908 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
909 InsertObj(pGraf.get());
910}
911
912void ImpSdrPdfImport::ImportPath(std::unique_ptr<vcl::pdf::PDFiumPageObject> const& pPageObject,
913 int /*nPageObjectIndex*/)
914{
915 auto aPathMatrix = pPageObject->getMatrix();
916
917 aPathMatrix *= maCurrentMatrix;
918
919 basegfx::B2DPolyPolygon aPolyPoly;
921 std::vector<basegfx::B2DPoint> aBezier;
922
923 const int nSegments = pPageObject->getPathSegmentCount();
924 for (int nSegmentIndex = 0; nSegmentIndex < nSegments; ++nSegmentIndex)
925 {
926 auto pPathSegment = pPageObject->getPathSegment(nSegmentIndex);
927 if (pPathSegment != nullptr)
928 {
929 basegfx::B2DPoint aB2DPoint = pPathSegment->getPoint();
930 aB2DPoint *= aPathMatrix;
931
932 const bool bClose = pPathSegment->isClosed();
933 if (bClose)
934 aPoly.setClosed(bClose); // TODO: Review
935
936 Point aPoint = PointsToLogic(aB2DPoint.getX(), aB2DPoint.getY());
937 aB2DPoint.setX(aPoint.X());
938 aB2DPoint.setY(aPoint.Y());
939
940 const vcl::pdf::PDFSegmentType eSegmentType = pPathSegment->getType();
941 switch (eSegmentType)
942 {
944 aPoly.append(aB2DPoint);
945 break;
946
948 aBezier.emplace_back(aB2DPoint.getX(), aB2DPoint.getY());
949 if (aBezier.size() == 3)
950 {
951 aPoly.appendBezierSegment(aBezier[0], aBezier[1], aBezier[2]);
952 aBezier.clear();
953 }
954 break;
955
957 // New Poly.
958 if (aPoly.count() > 0)
959 {
960 aPolyPoly.append(aPoly, 1);
961 aPoly.clear();
962 }
963
964 aPoly.append(aB2DPoint);
965 break;
966
968 default:
969 SAL_WARN("sd.filter", "Unknown path segment type in PDF: "
970 << static_cast<int>(eSegmentType));
971 break;
972 }
973 }
974 }
975
976 if (aBezier.size() == 3)
977 {
978 aPoly.appendBezierSegment(aBezier[0], aBezier[1], aBezier[2]);
979 aBezier.clear();
980 }
981
982 if (aPoly.count() > 0)
983 {
984 aPolyPoly.append(aPoly, 1);
985 aPoly.clear();
986 }
987
988 const basegfx::B2DHomMatrix aTransform(
990 aPolyPoly.transform(aTransform);
991
992 float fWidth = pPageObject->getStrokeWidth();
993 const double dWidth = 0.5 * fabs(std::hypot(aPathMatrix.a(), aPathMatrix.c()) * fWidth);
995
997 bool bStroke = true; // Assume we have to draw, unless told otherwise.
998 if (pPageObject->getDrawMode(nFillMode, bStroke))
999 {
1000 if (nFillMode == vcl::pdf::PDFFillMode::Alternate)
1001 mpVD->SetDrawMode(DrawModeFlags::Default);
1002 else if (nFillMode == vcl::pdf::PDFFillMode::Winding)
1003 mpVD->SetDrawMode(DrawModeFlags::Default);
1004 else
1005 mpVD->SetDrawMode(DrawModeFlags::NoFill);
1006 }
1007
1008 mpVD->SetFillColor(pPageObject->getFillColor());
1009
1010 if (bStroke)
1011 {
1012 mpVD->SetLineColor(pPageObject->getStrokeColor());
1013 }
1014 else
1015 mpVD->SetLineColor(COL_TRANSPARENT);
1016
1018 {
1020 = new SdrPathObj(*mpModel, SdrObjKind::Polygon, std::move(aPolyPoly));
1021 SetAttributes(pPath.get());
1022 InsertObj(pPath.get(), false);
1023 }
1024}
1025
1026Point ImpSdrPdfImport::PointsToLogic(double x, double y) const
1027{
1029
1031 return aPos;
1032}
1033
1034tools::Rectangle ImpSdrPdfImport::PointsToLogic(double left, double right, double top,
1035 double bottom) const
1036{
1039
1042
1043 return tools::Rectangle(aPos, aSize);
1044}
1045
1046/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const int mnLayer
constexpr auto convertPointToMm100(N n)
bool IsEmpty() const
const Size & GetSizePixel() const
Color GetRGBColor() const
void SetRed(sal_uInt8 nRed)
tools::Long GetAscent() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
const std::shared_ptr< VectorGraphicData > & getVectorGraphicData() const
std::unique_ptr< SfxItemSet > mpFillAttr
Definition: svdpdf.hxx:54
Fraction maScaleY
Definition: svdpdf.hxx:69
void ImportText(std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, std::unique_ptr< vcl::pdf::PDFiumTextPage > const &pTextPage, int nPageObjectIndex)
Definition: svdpdf.cxx:699
std::unique_ptr< SfxItemSet > mpTextAttr
Definition: svdpdf.hxx:55
void checkClip()
Definition: svdpdf.cxx:629
std::unique_ptr< vcl::pdf::PDFiumDocument > mpPdfDocument
Definition: svdpdf.hxx:81
ImpSdrPdfImport(const ImpSdrPdfImport &)=delete
tools::Rectangle PointsToLogic(double left, double right, double top, double bottom) const
Convert PDF points to logic (twips).
Definition: svdpdf.cxx:1034
void ImportPath(std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, int nPageObjectIndex)
Definition: svdpdf.cxx:912
void InsertObj(SdrObject *pObj, bool bScale=true)
Definition: svdpdf.cxx:396
void InsertTextObject(const Point &rPos, const Size &rSize, const OUString &rStr)
Definition: svdpdf.cxx:774
SdrModel * mpModel
Definition: svdpdf.hxx:56
std::unique_ptr< SfxItemSet > mpLineAttr
Definition: svdpdf.hxx:53
ScopedVclPtr< VirtualDevice > mpVD
Definition: svdpdf.hxx:50
size_t mnMapScalingOfs
Definition: svdpdf.hxx:52
bool CheckLastPolyLineAndFillMerge(const basegfx::B2DPolyPolygon &rPolyPolygon)
Definition: svdpdf.cxx:602
void ImportPdfObject(std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, std::unique_ptr< vcl::pdf::PDFiumTextPage > const &pTextPage, int nPageObjectIndex)
Definition: svdpdf.cxx:646
double mfScaleY
Definition: svdpdf.hxx:67
Fraction maScaleX
Definition: svdpdf.hxx:68
void DoObjects(SvdProgressInfo *pProgrInfo, sal_uInt32 *pActionsToReport, int nPageIndex)
Definition: svdpdf.cxx:127
size_t DoImport(SdrObjList &rDestList, size_t nInsPos, int nPageNumber, SvdProgressInfo *pProgrInfo=nullptr)
Definition: svdpdf.cxx:213
void SetAttributes(SdrObject *pObj, bool bForceTextAttr=false)
Definition: svdpdf.cxx:273
void MapScaling()
Definition: svdpdf.cxx:832
bool mbLastObjWasPolyWithoutLine
Definition: svdpdf.hxx:74
Color maOldLineColor
Definition: svdpdf.hxx:58
void ImportForm(std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, std::unique_ptr< vcl::pdf::PDFiumTextPage > const &pTextPage, int nPageObjectIndex)
Definition: svdpdf.cxx:678
SdrLayerID mnLayer
Definition: svdpdf.hxx:57
basegfx::B2DHomMatrix maCurrentMatrix
The current transformation matrix, typically used with Form objects.
Definition: svdpdf.hxx:85
sal_Int32 mnLineWidth
Definition: svdpdf.hxx:59
void SetupPageScale(const double dPageWidth, const double dPageHeight)
Definition: svdpdf.cxx:169
double mdPageHeightPts
Definition: svdpdf.hxx:83
double correctVertOrigin(double offsetPts) const
Correct the vertical coordinate to start at the top.
Definition: svdpdf.hxx:89
bool isClip() const
Definition: svdpdf.cxx:645
static constexpr css::drawing::LineCap gaLineCap
Definition: svdpdf.hxx:60
bool mbFntDirty
Definition: svdpdf.hxx:71
std::vector< rtl::Reference< SdrObject > > maTmpList
Definition: svdpdf.hxx:49
tools::Rectangle maScaleRect
Definition: svdpdf.hxx:51
std::shared_ptr< vcl::pdf::PDFium > mpPDFium
Definition: svdpdf.hxx:94
void ImportImage(std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, int nPageObjectIndex)
Definition: svdpdf.cxx:852
double mfScaleX
Definition: svdpdf.hxx:66
XDash maDash
Definition: svdpdf.hxx:61
basegfx::B2DPolyPolygon maClip
Definition: svdpdf.hxx:79
const Point & GetOrigin() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
constexpr tools::Long X() const
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:68
const Graphic & GetGraphic() const
Definition: svdograf.cxx:381
const SfxItemPool & GetItemPool() const
Definition: svdmodel.hxx:318
SdrObject * Next()
Definition: svditer.hxx:63
bool IsMore() const
Definition: svditer.hxx:62
size_t GetObjCount() const
Definition: svdpage.cxx:779
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:244
Abstract DrawObject.
Definition: svdobj.hxx:260
bool IsClosedObj() const
Definition: svdobj.hxx:745
virtual OutlinerParaObject * GetOutlinerParaObject() const
Definition: svdobj.cxx:1833
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1999
rtl::Reference< SdrObject > ConvertToPolyObj(bool bBezier, bool bLineToArea) const
Definition: svdobj.cxx:2620
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:289
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const =0
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1984
virtual void SetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:669
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1439
const basegfx::B2DPolyPolygon & GetPathPoly() const
Definition: svdopath.hxx:141
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
virtual basegfx::B2DPolyPolygon TakeContour() const override
contour for TextToContour
Definition: svdotext.cxx:1113
virtual bool HasText() const override
Definition: svdotxat.cxx:420
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
Helper class for the communication between the dialog In order to break open Metafiles (sd/source/ui/...
Definition: svdetc.hxx:111
void ReportInserts(size_t nInsertCount)
Definition: svdetc.cxx:435
void SetActionCount(size_t _nActionCount)
Definition: svdetc.cxx:449
bool ReportActions(size_t nActionCount)
Definition: svdetc.cxx:425
void SetInsertCount(size_t _nInsertCount)
Definition: svdetc.cxx:454
void ReportRescales(size_t nRescaleCount)
Definition: svdetc.cxx:443
Definition: xdash.hxx:32
double GetDotLen() const
Definition: xdash.hxx:56
double GetDashLen() const
Definition: xdash.hxx:58
double GetDistance() const
Definition: xdash.hxx:59
sal_uInt16 GetDots() const
Definition: xdash.hxx:55
sal_uInt16 GetDashes() const
Definition: xdash.hxx:57
double c() const
double a() const
void translate(double fX, double fY)
void scale(double fX, double fY)
double d() const
double b() const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void transform(const basegfx::B2DHomMatrix &rMatrix)
B2DRange getB2DRange() const
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
sal_uInt32 count() const
void setClosed(bool bNew)
void appendBezierSegment(const basegfx::B2DPoint &rNextControlPoint, const basegfx::B2DPoint &rPrevControlPoint, const basegfx::B2DPoint &rPoint)
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
TYPE getMaxX() const
TYPE getWidth() const
TYPE getMinX() const
TYPE getMinY() const
TYPE getMaxY() const
bool isInside(const Tuple2D< TYPE > &rTuple) const
bool isEmpty() const
TYPE getHeight() const
bool overlaps(const Range2D &rRange) const
TYPE getWidth() const
TYPE getHeight() const
TYPE getX() const
void setY(TYPE fY)
TYPE getY() const
void setX(TYPE fX)
constexpr tools::Long GetWidth() const
constexpr Point TopLeft() const
constexpr Size GetSize() const
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
constexpr tools::Long GetHeight() const
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
constexpr bool IsEmpty() const
void SetFontSize(const Size &)
FontFamily GetFamilyType()
const OUString & GetStyleName() const
FontStrikeout GetStrikeout() const
bool IsShadow() const
FontLineStyle GetOverline() const
FontItalic GetItalic()
bool IsTransparent() const
const OUString & GetFamilyName() const
TextAlign GetAlignment() const
const Size & GetFontSize() const
FontPitch GetPitch()
FontWeight GetWeight()
void SetFamilyName(const OUString &rFamilyName)
FontLineStyle GetUnderline() const
rtl_TextEncoding GetCharSet() const
bool IsOutline() const
bool IsWordLineMode() const
Degree10 GetOrientation() const
const Color & GetFillColor() const
tools::Long GetAverageFontWidth() const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
int nCount
bool VCL_DLLPUBLIC ReadRawDIB(BitmapEx &rTarget, const unsigned char *pBuf, const ScanlineFormat nFormat, const int nHeight, const int nStride)
OString right
OString top
OString bottom
float y
float x
constexpr TypedWhichId< SvxContourItem > EE_CHAR_OUTLINE(EE_CHAR_START+8)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxShadowedItem > EE_CHAR_SHADOW(EE_CHAR_START+9)
constexpr TypedWhichId< SvxOverlineItem > EE_CHAR_OVERLINE(EE_CHAR_START+29)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr TypedWhichId< SvxCrossedOutItem > EE_CHAR_STRIKEOUT(EE_CHAR_START+6)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC(EE_CHAR_START+7)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
constexpr TypedWhichId< SvxCharScaleWidthItem > EE_CHAR_FONTWIDTH(EE_CHAR_START+3)
constexpr TypedWhichId< SvxWordLineModeItem > EE_CHAR_WLM(EE_CHAR_START+13)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
ALIGN_BOTTOM
ALIGN_BASELINE
tools::Long FRound(double fVal)
sal_Int32 nIndex
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
bool isRectangle(const B2DPolygon &rPoly)
B2DPolyPolygon clipPolyPolygonOnPolyPolygon(const B2DPolyPolygon &rCandidate, const B2DPolyPolygon &rClip, bool bInside, bool bStroke, size_t *pPointLimit)
B2IRange fround(const B2DRange &rRange)
int i
void Create(SvxOrientationItem &rItem, SvStream &rStrm, sal_uInt16)
Definition: legacyitem.cxx:34
TextAlign
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
Definition: sdtagitm.hxx:25
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
Definition: sdtagitm.hxx:30
@ SDRTEXTHORZADJUST_LEFT
Definition: sdtaitm.hxx:53
SdrMetricItem makeSdrTextUpperDistItem(tools::Long mnHeight)
Definition: sdtditm.hxx:35
SdrMetricItem makeSdrTextRightDistItem(tools::Long mnHeight)
Definition: sdtditm.hxx:30
SdrMetricItem makeSdrTextLowerDistItem(tools::Long mnHeight)
Definition: sdtditm.hxx:40
SdrMetricItem makeSdrTextLeftDistItem(tools::Long mnHeight)
Definition: sdtditm.hxx:25
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
Definition: svdobj.cxx:3212
@ Polygon
circle cut
@ Text
closed free-hand line
@ PolyLine
polygon, PolyPolygon
bool bVisible
sal_uInt64 left