Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
ddb881e2
Kaydet (Commit)
ddb881e2
authored
Nis 07, 2018
tarafından
Ashod Nakashian
Kaydeden (comit)
Jan Holesovsky
Haz 07, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
svx: support breaking PDFs imported as images
Change-Id: I990c2b3c3055fbffddedc407c34beb5824277b38
üst
eb02d79c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
155 additions
and
15 deletions
+155
-15
sdpdffilter.cxx
sd/source/filter/pdf/sdpdffilter.cxx
+1
-1
Library_svxcore.mk
svx/Library_svxcore.mk
+2
-0
svdedtv.cxx
svx/source/svdraw/svdedtv.cxx
+9
-5
svdedtv2.cxx
svx/source/svdraw/svdedtv2.cxx
+21
-7
svdpdf.cxx
svx/source/svdraw/svdpdf.cxx
+0
-0
svdpdf.hxx
svx/source/svdraw/svdpdf.hxx
+120
-0
impgraph.cxx
vcl/source/gdi/impgraph.cxx
+2
-2
No files found.
sd/source/filter/pdf/sdpdffilter.cxx
Dosyayı görüntüle @
ddb881e2
...
...
@@ -124,7 +124,7 @@ bool SdPdfFilter::Import()
Graphic
aGraphic
(
aBitmap
);
aGraphic
.
setPdfData
(
std
::
make_shared
<
uno
::
Sequence
<
sal_Int8
>>
(
aPdfData
));
aGraphic
.
setPageNumber
(
nPageNumber
);
aGraphic
.
SetLink
(
aGfxLink
);
aGraphic
.
Set
Gfx
Link
(
aGfxLink
);
// Create the page and insert the Graphic.
SdPage
*
pPage
=
mrDocument
.
GetSdPage
(
nPageNumber
++
,
PageKind
::
Standard
);
...
...
svx/Library_svxcore.mk
Dosyayı görüntüle @
ddb881e2
...
...
@@ -84,6 +84,7 @@ $(eval $(call gb_Library_use_externals,svxcore,\
icuuc \
icu_headers \
libxml2 \
$(if $(filter PDFIUM,$(BUILD_TYPE)),pdfium) \
))
ifeq ($(ENABLE_HEADLESS),)
$(eval $(call gb_Library_use_externals,svxcore,\
...
...
@@ -338,6 +339,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/svdraw/svdovirt \
svx/source/svdraw/svdpage \
svx/source/svdraw/svdpagv \
svx/source/svdraw/svdpdf \
svx/source/svdraw/svdpntv \
svx/source/svdraw/svdpoev \
svx/source/svdraw/svdsnpv \
...
...
svx/source/svdraw/svdedtv.cxx
Dosyayı görüntüle @
ddb881e2
...
...
@@ -607,14 +607,18 @@ void SdrEditView::CheckPossibilities()
if
(
!
bImportMtfPossible
)
{
const
SdrGrafObj
*
pSdrGrafObj
=
dynamic_cast
<
const
SdrGrafObj
*
>
(
pObj
);
const
SdrOle2Obj
*
pSdrOle2Obj
=
dynamic_cast
<
const
SdrOle2Obj
*
>
(
pObj
);
if
(
pSdrGrafObj
&&
((
pSdrGrafObj
->
HasGDIMetaFile
()
&&
!
pSdrGrafObj
->
IsEPS
())
||
pSdrGrafObj
->
isEmbeddedVectorGraphicData
()))
if
(
pSdrGrafObj
!=
nullptr
)
{
bImportMtfPossible
=
true
;
if
((
pSdrGrafObj
->
HasGDIMetaFile
()
&&
!
pSdrGrafObj
->
IsEPS
())
||
pSdrGrafObj
->
isEmbeddedVectorGraphicData
()
||
pSdrGrafObj
->
isEmbeddedPdfData
())
{
bImportMtfPossible
=
true
;
}
}
if
(
pSdrOle2Obj
)
const
SdrOle2Obj
*
pSdrOle2Obj
=
dynamic_cast
<
const
SdrOle2Obj
*
>
(
pObj
);
if
(
pSdrOle2Obj
)
{
bImportMtfPossible
=
pSdrOle2Obj
->
GetObjRef
().
is
();
}
...
...
svx/source/svdraw/svdedtv2.cxx
Dosyayı görüntüle @
ddb881e2
...
...
@@ -30,6 +30,7 @@
#include <svx/svdoole2.hxx>
#include <svx/dialmgr.hxx>
#include "svdfmtf.hxx"
#include "svdpdf.hxx"
#include <svx/svdetc.hxx>
#include <sfx2/basedlgs.hxx>
#include <editeng/outlobj.hxx>
...
...
@@ -2038,22 +2039,35 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo)
SdrPageView
*
pPV
=
pM
->
GetPageView
();
SdrObjList
*
pOL
=
pObj
->
getParentOfSdrObject
();
const
size_t
nInsPos
=
pObj
->
GetOrdNum
()
+
1
;
SdrGrafObj
*
pGraf
=
dynamic_cast
<
SdrGrafObj
*>
(
pObj
);
SdrOle2Obj
*
pOle2
=
dynamic_cast
<
SdrOle2Obj
*>
(
pObj
);
sal_uIntPtr
nInsAnz
=
0
;
tools
::
Rectangle
aLogicRect
;
if
(
pGraf
&&
(
pGraf
->
HasGDIMetaFile
()
||
pGraf
->
isEmbeddedVectorGraphicData
()))
SdrGrafObj
*
pGraf
=
dynamic_cast
<
SdrGrafObj
*>
(
pObj
);
if
(
pGraf
!=
nullptr
)
{
GDIMetaFile
aMetaFile
(
GetMetaFile
(
pGraf
));
if
(
aMetaFile
.
GetActionSize
())
if
(
pGraf
->
HasGDIMetaFile
()
||
pGraf
->
isEmbeddedVectorGraphicData
())
{
GDIMetaFile
aMetaFile
(
GetMetaFile
(
pGraf
));
if
(
aMetaFile
.
GetActionSize
())
{
aLogicRect
=
pGraf
->
GetLogicRect
();
ImpSdrGDIMetaFileImport
aFilter
(
*
mpModel
,
pObj
->
GetLayer
(),
aLogicRect
);
nInsAnz
=
aFilter
.
DoImport
(
aMetaFile
,
*
pOL
,
nInsPos
,
pProgrInfo
);
}
}
else
if
(
pGraf
->
isEmbeddedPdfData
())
{
aLogicRect
=
pGraf
->
GetLogicRect
();
ImpSdrGDIMetaFileImport
aFilter
(
*
mpModel
,
pObj
->
GetLayer
(),
aLogicRect
);
nInsAnz
=
aFilter
.
DoImport
(
aMetaFile
,
*
pOL
,
nInsPos
,
pProgrInfo
);
ImpSdrPdfImport
aFilter
(
*
mpModel
,
pObj
->
GetLayer
(),
aLogicRect
,
pGraf
->
getEmbeddedPdfData
());
if
(
pGraf
->
getEmbeddedPageNumber
()
<
aFilter
.
GetPageCount
())
{
nInsAnz
=
aFilter
.
DoImport
(
*
pOL
,
nInsPos
,
pGraf
->
getEmbeddedPageNumber
(),
pProgrInfo
);
}
}
}
SdrOle2Obj
*
pOle2
=
dynamic_cast
<
SdrOle2Obj
*>
(
pObj
);
if
(
pOle2
!=
nullptr
&&
pOle2
->
GetGraphic
())
{
aLogicRect
=
pOle2
->
GetLogicRect
();
...
...
svx/source/svdraw/svdpdf.cxx
0 → 100644
Dosyayı görüntüle @
ddb881e2
This diff is collapsed.
Click to expand it.
svx/source/svdraw/svdpdf.hxx
0 → 100644
Dosyayı görüntüle @
ddb881e2
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SVX_SOURCE_SVDRAW_SVDPDF_HXX
#define INCLUDED_SVX_SOURCE_SVDRAW_SVDPDF_HXX
#include <sal/config.h>
#include <memory>
#include <tools/contnr.hxx>
#include <tools/fract.hxx>
#include <vcl/metaact.hxx>
#include <vcl/virdev.hxx>
#include <svx/svdobj.hxx>
#include <svx/xdash.hxx>
#include <com/sun/star/uno/Sequence.hxx>
// Forward Declarations
class
SfxItemSet
;
class
SdrObjList
;
class
SdrModel
;
class
SdrPage
;
class
SdrObject
;
class
SvdProgressInfo
;
typedef
void
*
FPDF_DOCUMENT
;
// Helper Class to import PDF
class
ImpSdrPdfImport
final
{
::
std
::
vector
<
SdrObject
*>
maTmpList
;
ScopedVclPtr
<
VirtualDevice
>
mpVD
;
tools
::
Rectangle
maScaleRect
;
const
std
::
shared_ptr
<
css
::
uno
::
Sequence
<
sal_Int8
>>
mpPdfData
;
size_t
mnMapScalingOfs
;
// from here on, not edited with MapScaling
std
::
unique_ptr
<
SfxItemSet
>
mpLineAttr
;
std
::
unique_ptr
<
SfxItemSet
>
mpFillAttr
;
std
::
unique_ptr
<
SfxItemSet
>
mpTextAttr
;
SdrModel
*
mpModel
;
SdrLayerID
mnLayer
;
Color
maOldLineColor
;
sal_Int32
mnLineWidth
;
basegfx
::
B2DLineJoin
maLineJoin
;
css
::
drawing
::
LineCap
maLineCap
;
XDash
maDash
;
bool
mbMov
;
bool
mbSize
;
Point
maOfs
;
double
mfScaleX
;
double
mfScaleY
;
Fraction
maScaleX
;
Fraction
maScaleY
;
bool
mbFntDirty
;
// to optimize (PenNULL,Brush,DrawPoly),(Pen,BrushNULL,DrawPoly) -> two-in-one
bool
mbLastObjWasPolyWithoutLine
;
bool
mbNoLine
;
bool
mbNoFill
;
// to optimize multiple lines into a Polyline
bool
mbLastObjWasLine
;
// clipregion
basegfx
::
B2DPolyPolygon
maClip
;
FPDF_DOCUMENT
mpPdfDocument
;
int
mnPageCount
;
// check for clip and evtl. fill maClip
void
checkClip
();
bool
isClip
()
const
;
void
ImportText
(
const
Point
&
rPos
,
const
OUString
&
rStr
);
void
SetAttributes
(
SdrObject
*
pObj
,
bool
bForceTextAttr
=
false
);
void
InsertObj
(
SdrObject
*
pObj
,
bool
bScale
=
true
);
void
MapScaling
();
// #i73407# reformulation to use new B2DPolygon classes
bool
CheckLastLineMerge
(
const
basegfx
::
B2DPolygon
&
rSrcPoly
);
bool
CheckLastPolyLineAndFillMerge
(
const
basegfx
::
B2DPolyPolygon
&
rPolyPolygon
);
void
DoLoopActions
(
SvdProgressInfo
*
pProgrInfo
,
sal_uInt32
*
pActionsToReport
);
// Copy assignment is forbidden and not implemented.
ImpSdrPdfImport
(
const
ImpSdrPdfImport
&
)
=
delete
;
ImpSdrPdfImport
&
operator
=
(
const
ImpSdrPdfImport
&
)
=
delete
;
public
:
ImpSdrPdfImport
(
SdrModel
&
rModel
,
SdrLayerID
nLay
,
const
tools
::
Rectangle
&
rRect
,
const
std
::
shared_ptr
<
css
::
uno
::
Sequence
<
sal_Int8
>>&
pPdfData
);
~
ImpSdrPdfImport
();
int
GetPageCount
()
const
{
return
mnPageCount
;
}
size_t
DoImport
(
SdrObjList
&
rDestList
,
size_t
nInsPos
,
size_t
nPageNumber
,
SvdProgressInfo
*
pProgrInfo
=
nullptr
);
};
#endif // INCLUDED_SVX_SOURCE_SVDRAW_SVDFMTF_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/source/gdi/impgraph.cxx
Dosyayı görüntüle @
ddb881e2
...
...
@@ -195,12 +195,12 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic)
,
mnSizeBytes
(
rImpGraphic
.
mnSizeBytes
)
,
mbSwapOut
(
rImpGraphic
.
mbSwapOut
)
,
mbDummyContext
(
rImpGraphic
.
mbDummyContext
)
,
mnPageNumber
(
-
1
)
,
maVectorGraphicData
(
rImpGraphic
.
maVectorGraphicData
)
,
mpPdfData
(
rImpGraphic
.
mpPdfData
)
,
maGraphicExternalLink
(
rImpGraphic
.
maGraphicExternalLink
)
,
maLastUsed
(
std
::
chrono
::
high_resolution_clock
::
now
())
,
mbPrepared
(
rImpGraphic
.
mbPrepared
)
,
mnPageNumber
(
-
1
)
{
if
(
rImpGraphic
.
mpGfxLink
)
mpGfxLink
=
o3tl
::
make_unique
<
GfxLink
>
(
*
rImpGraphic
.
mpGfxLink
);
...
...
@@ -224,12 +224,12 @@ ImpGraphic::ImpGraphic(ImpGraphic&& rImpGraphic)
,
mnSizeBytes
(
rImpGraphic
.
mnSizeBytes
)
,
mbSwapOut
(
rImpGraphic
.
mbSwapOut
)
,
mbDummyContext
(
rImpGraphic
.
mbDummyContext
)
,
mnPageNumber
(
-
1
)
,
maVectorGraphicData
(
std
::
move
(
rImpGraphic
.
maVectorGraphicData
))
,
mpPdfData
(
std
::
move
(
rImpGraphic
.
mpPdfData
))
,
maGraphicExternalLink
(
rImpGraphic
.
maGraphicExternalLink
)
,
maLastUsed
(
std
::
chrono
::
high_resolution_clock
::
now
())
,
mbPrepared
(
rImpGraphic
.
mbPrepared
)
,
mnPageNumber
(
-
1
)
{
rImpGraphic
.
ImplClear
();
rImpGraphic
.
mbDummyContext
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment