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