LibreOffice Module svx (master) 1
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ImpSdrPdfImport Class Referencefinal

#include <svdpdf.hxx>

Collaboration diagram for ImpSdrPdfImport:
[legend]

Public Member Functions

 ImpSdrPdfImport (SdrModel &rModel, SdrLayerID nLay, const tools::Rectangle &rRect, Graphic const &rGraphic)
 
 ~ImpSdrPdfImport ()
 
int GetPageCount () const
 
size_t DoImport (SdrObjList &rDestList, size_t nInsPos, int nPageNumber, SvdProgressInfo *pProgrInfo=nullptr)
 

Private Member Functions

double correctVertOrigin (double offsetPts) const
 Correct the vertical coordinate to start at the top. More...
 
tools::Rectangle PointsToLogic (double left, double right, double top, double bottom) const
 Convert PDF points to logic (twips). More...
 
Point PointsToLogic (double x, double y) const
 
void checkClip ()
 
bool isClip () const
 
void ImportPdfObject (std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, std::unique_ptr< vcl::pdf::PDFiumTextPage > const &pTextPage, int nPageObjectIndex)
 
void ImportForm (std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, std::unique_ptr< vcl::pdf::PDFiumTextPage > const &pTextPage, int nPageObjectIndex)
 
void ImportImage (std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, int nPageObjectIndex)
 
void ImportPath (std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, int nPageObjectIndex)
 
void ImportText (std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, std::unique_ptr< vcl::pdf::PDFiumTextPage > const &pTextPage, int nPageObjectIndex)
 
void InsertTextObject (const Point &rPos, const Size &rSize, const OUString &rStr)
 
void SetupPageScale (const double dPageWidth, const double dPageHeight)
 
void SetAttributes (SdrObject *pObj, bool bForceTextAttr=false)
 
void InsertObj (SdrObject *pObj, bool bScale=true)
 
void MapScaling ()
 
bool CheckLastPolyLineAndFillMerge (const basegfx::B2DPolyPolygon &rPolyPolygon)
 
void DoObjects (SvdProgressInfo *pProgrInfo, sal_uInt32 *pActionsToReport, int nPageIndex)
 
 ImpSdrPdfImport (const ImpSdrPdfImport &)=delete
 
ImpSdrPdfImportoperator= (const ImpSdrPdfImport &)=delete
 

Private Attributes

std::vector< rtl::Reference< SdrObject > > maTmpList
 
ScopedVclPtr< VirtualDevicempVD
 
tools::Rectangle maScaleRect
 
size_t mnMapScalingOfs
 
std::unique_ptr< SfxItemSetmpLineAttr
 
std::unique_ptr< SfxItemSetmpFillAttr
 
std::unique_ptr< SfxItemSetmpTextAttr
 
SdrModelmpModel
 
SdrLayerID mnLayer
 
Color maOldLineColor
 
sal_Int32 mnLineWidth
 
XDash maDash
 
bool mbMov
 
bool mbSize
 
Point maOfs
 
double mfScaleX
 
double mfScaleY
 
Fraction maScaleX
 
Fraction maScaleY
 
bool mbFntDirty
 
bool mbLastObjWasPolyWithoutLine
 
bool mbNoLine
 
bool mbNoFill
 
basegfx::B2DPolyPolygon maClip
 
std::unique_ptr< vcl::pdf::PDFiumDocumentmpPdfDocument
 
int mnPageCount
 
double mdPageHeightPts
 
basegfx::B2DHomMatrix maCurrentMatrix
 The current transformation matrix, typically used with Form objects. More...
 
std::shared_ptr< vcl::pdf::PDFiummpPDFium
 

Static Private Attributes

static constexpr css::drawing::LineCap gaLineCap = css::drawing::LineCap_BUTT
 

Detailed Description

Definition at line 47 of file svdpdf.hxx.

Constructor & Destructor Documentation

◆ ImpSdrPdfImport() [1/2]

ImpSdrPdfImport::ImpSdrPdfImport ( const ImpSdrPdfImport )
privatedelete

◆ ImpSdrPdfImport() [2/2]

ImpSdrPdfImport::ImpSdrPdfImport ( SdrModel rModel,
SdrLayerID  nLay,
const tools::Rectangle rRect,
Graphic const &  rGraphic 
)

◆ ~ImpSdrPdfImport()

ImpSdrPdfImport::~ImpSdrPdfImport ( )
default

Member Function Documentation

◆ checkClip()

void ImpSdrPdfImport::checkClip ( )
private

◆ CheckLastPolyLineAndFillMerge()

bool ImpSdrPdfImport::CheckLastPolyLineAndFillMerge ( const basegfx::B2DPolyPolygon rPolyPolygon)
private

◆ correctVertOrigin()

double ImpSdrPdfImport::correctVertOrigin ( double  offsetPts) const
inlineprivate

Correct the vertical coordinate to start at the top.

PDF coordinate system has origin at the bottom right.

Definition at line 89 of file svdpdf.hxx.

References mdPageHeightPts.

Referenced by PointsToLogic().

◆ DoImport()

size_t ImpSdrPdfImport::DoImport ( SdrObjList rDestList,
size_t  nInsPos,
int  nPageNumber,
SvdProgressInfo pProgrInfo = nullptr 
)

◆ DoObjects()

void ImpSdrPdfImport::DoObjects ( SvdProgressInfo pProgrInfo,
sal_uInt32 *  pActionsToReport,
int  nPageIndex 
)
private

◆ GetPageCount()

int ImpSdrPdfImport::GetPageCount ( ) const
inline

Definition at line 135 of file svdpdf.hxx.

References mnPageCount.

Referenced by SdrEditView::DoImportMarkedMtf().

◆ ImportForm()

void ImpSdrPdfImport::ImportForm ( std::unique_ptr< vcl::pdf::PDFiumPageObject > const &  pPageObject,
std::unique_ptr< vcl::pdf::PDFiumTextPage > const &  pTextPage,
int  nPageObjectIndex 
)
private

Definition at line 678 of file svdpdf.cxx.

References ImportPdfObject(), maCurrentMatrix, nCount, and nIndex.

Referenced by ImportPdfObject().

◆ ImportImage()

void ImpSdrPdfImport::ImportImage ( std::unique_ptr< vcl::pdf::PDFiumPageObject > const &  pPageObject,
int  nPageObjectIndex 
)
private

◆ ImportPath()

void ImpSdrPdfImport::ImportPath ( std::unique_ptr< vcl::pdf::PDFiumPageObject > const &  pPageObject,
int  nPageObjectIndex 
)
private

◆ ImportPdfObject()

void ImpSdrPdfImport::ImportPdfObject ( std::unique_ptr< vcl::pdf::PDFiumPageObject > const &  pPageObject,
std::unique_ptr< vcl::pdf::PDFiumTextPage > const &  pTextPage,
int  nPageObjectIndex 
)
private

◆ ImportText()

void ImpSdrPdfImport::ImportText ( std::unique_ptr< vcl::pdf::PDFiumPageObject > const &  pPageObject,
std::unique_ptr< vcl::pdf::PDFiumTextPage > const &  pTextPage,
int  nPageObjectIndex 
)
private

◆ InsertObj()

void ImpSdrPdfImport::InsertObj ( SdrObject pObj,
bool  bScale = true 
)
private

◆ InsertTextObject()

void ImpSdrPdfImport::InsertTextObject ( const Point rPos,
const Size rSize,
const OUString &  rStr 
)
private

◆ isClip()

bool ImpSdrPdfImport::isClip ( ) const
private

◆ MapScaling()

void ImpSdrPdfImport::MapScaling ( )
private

Definition at line 832 of file svdpdf.cxx.

References MapMode::GetOrigin(), i, maTmpList, mnMapScalingOfs, mpVD, SdrObject::NbcMove(), nCount, Point::X(), and Point::Y().

Referenced by DoImport().

◆ operator=()

ImpSdrPdfImport & ImpSdrPdfImport::operator= ( const ImpSdrPdfImport )
privatedelete

◆ PointsToLogic() [1/2]

tools::Rectangle ImpSdrPdfImport::PointsToLogic ( double  left,
double  right,
double  top,
double  bottom 
) const
private

Convert PDF points to logic (twips).

Definition at line 1034 of file svdpdf.cxx.

References bottom, convertPointToMm100(), correctVertOrigin(), left, right, and top.

Referenced by ImportImage(), ImportPath(), and ImportText().

◆ PointsToLogic() [2/2]

Point ImpSdrPdfImport::PointsToLogic ( double  x,
double  y 
) const
private

Definition at line 1026 of file svdpdf.cxx.

References convertPointToMm100(), correctVertOrigin(), x, and y.

◆ SetAttributes()

void ImpSdrPdfImport::SetAttributes ( SdrObject pObj,
bool  bForceTextAttr = false 
)
private

◆ SetupPageScale()

void ImpSdrPdfImport::SetupPageScale ( const double  dPageWidth,
const double  dPageHeight 
)
private

Member Data Documentation

◆ gaLineCap

constexpr css::drawing::LineCap ImpSdrPdfImport::gaLineCap = css::drawing::LineCap_BUTT
staticconstexprprivate

Definition at line 60 of file svdpdf.hxx.

Referenced by SetAttributes().

◆ maClip

basegfx::B2DPolyPolygon ImpSdrPdfImport::maClip
private

Definition at line 79 of file svdpdf.hxx.

Referenced by checkClip(), InsertObj(), and isClip().

◆ maCurrentMatrix

basegfx::B2DHomMatrix ImpSdrPdfImport::maCurrentMatrix
private

The current transformation matrix, typically used with Form objects.

Definition at line 85 of file svdpdf.hxx.

Referenced by ImportForm(), ImportPath(), and ImportText().

◆ maDash

XDash ImpSdrPdfImport::maDash
private

Definition at line 61 of file svdpdf.hxx.

Referenced by SetAttributes().

◆ maOfs

Point ImpSdrPdfImport::maOfs
private

Definition at line 65 of file svdpdf.hxx.

Referenced by checkClip(), ImportPath(), InsertObj(), InsertTextObject(), and SetupPageScale().

◆ maOldLineColor

Color ImpSdrPdfImport::maOldLineColor
private

Definition at line 58 of file svdpdf.hxx.

Referenced by ImpSdrPdfImport(), and SetAttributes().

◆ maScaleRect

tools::Rectangle ImpSdrPdfImport::maScaleRect
private

Definition at line 51 of file svdpdf.hxx.

Referenced by InsertObj(), and SetupPageScale().

◆ maScaleX

Fraction ImpSdrPdfImport::maScaleX
private

Definition at line 68 of file svdpdf.hxx.

Referenced by InsertObj(), and SetupPageScale().

◆ maScaleY

Fraction ImpSdrPdfImport::maScaleY
private

Definition at line 69 of file svdpdf.hxx.

Referenced by InsertObj(), and SetupPageScale().

◆ maTmpList

std::vector<rtl::Reference<SdrObject> > ImpSdrPdfImport::maTmpList
private

Definition at line 49 of file svdpdf.hxx.

Referenced by CheckLastPolyLineAndFillMerge(), DoImport(), InsertObj(), and MapScaling().

◆ mbFntDirty

bool ImpSdrPdfImport::mbFntDirty
private

Definition at line 71 of file svdpdf.hxx.

Referenced by ImportText(), and SetAttributes().

◆ mbLastObjWasPolyWithoutLine

bool ImpSdrPdfImport::mbLastObjWasPolyWithoutLine
private

Definition at line 74 of file svdpdf.hxx.

Referenced by CheckLastPolyLineAndFillMerge(), ImportPath(), and InsertObj().

◆ mbMov

bool ImpSdrPdfImport::mbMov
private

Definition at line 63 of file svdpdf.hxx.

Referenced by InsertObj(), and SetupPageScale().

◆ mbNoFill

bool ImpSdrPdfImport::mbNoFill
private

Definition at line 76 of file svdpdf.hxx.

Referenced by CheckLastPolyLineAndFillMerge(), and SetAttributes().

◆ mbNoLine

bool ImpSdrPdfImport::mbNoLine
private

Definition at line 75 of file svdpdf.hxx.

Referenced by CheckLastPolyLineAndFillMerge(), InsertObj(), and SetAttributes().

◆ mbSize

bool ImpSdrPdfImport::mbSize
private

Definition at line 64 of file svdpdf.hxx.

Referenced by InsertObj(), and SetupPageScale().

◆ mdPageHeightPts

double ImpSdrPdfImport::mdPageHeightPts
private

Definition at line 83 of file svdpdf.hxx.

Referenced by correctVertOrigin(), and SetupPageScale().

◆ mfScaleX

double ImpSdrPdfImport::mfScaleX
private

Definition at line 66 of file svdpdf.hxx.

Referenced by checkClip(), ImportPath(), InsertTextObject(), and SetupPageScale().

◆ mfScaleY

double ImpSdrPdfImport::mfScaleY
private

Definition at line 67 of file svdpdf.hxx.

Referenced by checkClip(), ImportPath(), InsertTextObject(), SetAttributes(), and SetupPageScale().

◆ mnLayer

SdrLayerID ImpSdrPdfImport::mnLayer
private

Definition at line 57 of file svdpdf.hxx.

Referenced by InsertTextObject(), and SetAttributes().

◆ mnLineWidth

sal_Int32 ImpSdrPdfImport::mnLineWidth
private

Definition at line 59 of file svdpdf.hxx.

Referenced by ImportPath(), and SetAttributes().

◆ mnMapScalingOfs

size_t ImpSdrPdfImport::mnMapScalingOfs
private

Definition at line 52 of file svdpdf.hxx.

Referenced by MapScaling().

◆ mnPageCount

int ImpSdrPdfImport::mnPageCount
private

Definition at line 82 of file svdpdf.hxx.

Referenced by GetPageCount(), and ImpSdrPdfImport().

◆ mpFillAttr

std::unique_ptr<SfxItemSet> ImpSdrPdfImport::mpFillAttr
private

Definition at line 54 of file svdpdf.hxx.

Referenced by ImpSdrPdfImport(), InsertTextObject(), and SetAttributes().

◆ mpLineAttr

std::unique_ptr<SfxItemSet> ImpSdrPdfImport::mpLineAttr
private

Definition at line 53 of file svdpdf.hxx.

Referenced by CheckLastPolyLineAndFillMerge(), ImpSdrPdfImport(), and SetAttributes().

◆ mpModel

SdrModel* ImpSdrPdfImport::mpModel
private

Definition at line 56 of file svdpdf.hxx.

Referenced by ImportImage(), ImportPath(), InsertObj(), and InsertTextObject().

◆ mpPdfDocument

std::unique_ptr<vcl::pdf::PDFiumDocument> ImpSdrPdfImport::mpPdfDocument
private

Definition at line 81 of file svdpdf.hxx.

Referenced by DoObjects(), and ImpSdrPdfImport().

◆ mpPDFium

std::shared_ptr<vcl::pdf::PDFium> ImpSdrPdfImport::mpPDFium
private

Definition at line 94 of file svdpdf.hxx.

Referenced by ImpSdrPdfImport().

◆ mpTextAttr

std::unique_ptr<SfxItemSet> ImpSdrPdfImport::mpTextAttr
private

Definition at line 55 of file svdpdf.hxx.

Referenced by ImpSdrPdfImport(), and SetAttributes().

◆ mpVD

ScopedVclPtr<VirtualDevice> ImpSdrPdfImport::mpVD
private

The documentation for this class was generated from the following files: