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
25adc4fb
Kaydet (Commit)
25adc4fb
authored
Kas 14, 2018
tarafından
Tamás Zolnai
Kaydeden (comit)
Jan Holesovsky
Ara 07, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avoid writing out unneeded data to SVG file in SelectionOnly mode
Change-Id: I6d0ce089be051667e965aff45a63f6b1a8342952
üst
a92733b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
46 deletions
+60
-46
svgexport.cxx
filter/source/svg/svgexport.cxx
+60
-46
No files found.
filter/source/svg/svgexport.cxx
Dosyayı görüntüle @
25adc4fb
...
...
@@ -785,6 +785,7 @@ bool SVGFilter::implExportDocument()
mpSVGDoc
=
new
SvXMLElementExport
(
*
mpSVGExport
,
XML_NAMESPACE_NONE
,
"svg"
,
true
,
true
);
// Create a ClipPath element that will be used for cutting bitmaps and other elements that could exceed the page margins.
if
(
!
mbExportShapeSelection
)
{
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"class"
,
"ClipPathGroup"
);
SvXMLElementExport
aDefsElem
(
*
mpSVGExport
,
XML_NAMESPACE_NONE
,
"defs"
,
true
,
true
);
...
...
@@ -803,7 +804,6 @@ bool SVGFilter::implExportDocument()
}
// Create a ClipPath element applied to the leaving slide in order
// to avoid that slide borders are visible during transition
if
(
!
mbExportShapeSelection
)
{
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"id"
,
"presentation_clip_path_shrink"
);
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"clipPathUnits"
,
"userSpaceOnUse"
);
...
...
@@ -1189,6 +1189,9 @@ void SVGFilter::implExportAnimations()
void
SVGFilter
::
implExportTextShapeIndex
()
{
if
(
mbExportShapeSelection
)
return
;
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"class"
,
"TextShapeIndex"
);
SvXMLElementExport
aDefsContainerElem
(
*
mpSVGExport
,
XML_NAMESPACE_NONE
,
"defs"
,
true
,
true
);
...
...
@@ -1487,66 +1490,77 @@ void SVGFilter::implExportDrawPages( const std::vector< Reference< css::drawing:
}
}
// We wrap all slide in a group element with class name "SlideGroup".
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"class"
,
"SlideGroup"
);
SvXMLElementExport
aExp
(
*
mpSVGExport
,
XML_NAMESPACE_NONE
,
"g"
,
true
,
true
);
for
(
sal_Int32
i
=
nFirstPage
;
i
<=
nLastPage
;
++
i
)
if
(
!
mbExportShapeSelection
)
{
Reference
<
css
::
drawing
::
XShapes
>
xShapes
;
// We wrap all slide in a group element with class name "SlideGroup".
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"class"
,
"SlideGroup"
);
SvXMLElementExport
aExp
(
*
mpSVGExport
,
XML_NAMESPACE_NONE
,
"g"
,
true
,
true
);
if
(
mbExportShapeSelection
)
{
// #i124608# export a given object selection
xShapes
=
maShapeSelection
;
}
else
for
(
sal_Int32
i
=
nFirstPage
;
i
<=
nLastPage
;
++
i
)
{
xShapes
.
set
(
rxPages
[
i
],
UNO_QUERY
);
}
Reference
<
css
::
drawing
::
XShapes
>
xShapes
;
if
(
xShapes
.
is
()
)
{
// Insert the <g> open tag related to the svg element for
// handling a slide visibility.
// In case the exported slides are more than one the initial
// visibility of each slide is set to 'hidden'.
if
(
mbPresentation
)
if
(
mbExportShapeSelection
)
{
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"visibility"
,
"hidden"
);
// #i124608# export a given object selection
xShapes
=
maShapeSelection
;
}
else
{
xShapes
.
set
(
rxPages
[
i
],
UNO_QUERY
);
}
SvXMLElementExport
aGElement
(
*
mpSVGExport
,
XML_NAMESPACE_NONE
,
"g"
,
true
,
true
);
if
(
xShapes
.
is
()
)
{
// Insert a further inner the <g> open tag for handling elements
// inserted before or after a slide: that is used for some
// when switching from the last to the first slide.
const
OUString
&
sPageId
=
implGetValidIDFromInterface
(
rxPages
[
i
]
);
OUString
sContainerId
=
"container-"
;
sContainerId
+=
sPageId
;
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"id"
,
sContainerId
);
SvXMLElementExport
aContainerExp
(
*
mpSVGExport
,
XML_NAMESPACE_NONE
,
"g"
,
true
,
true
);
// Insert the <g> open tag related to the svg element for
// handling a slide visibility.
// In case the exported slides are more than one the initial
// visibility of each slide is set to 'hidden'.
if
(
mbPresentation
)
{
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"visibility"
,
"hidden"
);
}
SvXMLElementExport
aGElement
(
*
mpSVGExport
,
XML_NAMESPACE_NONE
,
"g"
,
true
,
true
);
{
// add id attribute
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"id"
,
sPageId
);
// Insert a further inner the <g> open tag for handling elements
// inserted before or after a slide: that is used for some
// when switching from the last to the first slide.
const
OUString
&
sPageId
=
implGetValidIDFromInterface
(
rxPages
[
i
]
);
OUString
sContainerId
=
"container-"
;
sContainerId
+=
sPageId
;
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"id"
,
sContainerId
);
SvXMLElementExport
aContainerExp
(
*
mpSVGExport
,
XML_NAMESPACE_NONE
,
"g"
,
true
,
true
);
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"class"
,
"Slide"
);
{
// add id attribute
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"id"
,
sPageId
);
// Adding a clip path to each exported slide , so in case
// bitmaps or other elements exceed the slide margins, they are
// trimmed, even when they are shown inside a thumbnail view.
OUString
sClipPathAttrValue
=
"url(#"
+
msClipPathId
+
")"
;
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"clip-path"
,
sClipPathAttrValue
);
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"class"
,
"Slide"
);
SvXMLElementExport
aSlideElement
(
*
mpSVGExport
,
XML_NAMESPACE_NONE
,
"g"
,
true
,
true
);
// Adding a clip path to each exported slide , so in case
// bitmaps or other elements exceed the slide margins, they are
// trimmed, even when they are shown inside a thumbnail view.
OUString
sClipPathAttrValue
=
"url(#"
+
msClipPathId
+
")"
;
mpSVGExport
->
AddAttribute
(
XML_NAMESPACE_NONE
,
"clip-path"
,
sClipPathAttrValue
);
implExportPage
(
sPageId
,
rxPages
[
i
],
xShapes
,
false
/* is not a master page */
);
}
}
// append the </g> closing tag related to inserted elements
}
// append the </g> closing tag related to the svg element handling the slide visibility
SvXMLElementExport
aSlideElement
(
*
mpSVGExport
,
XML_NAMESPACE_NONE
,
"g"
,
true
,
true
);
implExportPage
(
sPageId
,
rxPages
[
i
],
xShapes
,
false
/* is not a master page */
);
}
}
// append the </g> closing tag related to inserted elements
}
// append the </g> closing tag related to the svg element handling the slide visibility
}
}
else
{
assert
(
maShapeSelection
.
is
());
assert
(
rxPages
.
size
()
==
1
);
const
OUString
&
sPageId
=
implGetValidIDFromInterface
(
rxPages
[
0
]
);
implExportPage
(
sPageId
,
rxPages
[
0
],
maShapeSelection
,
false
/* is not a master page */
);
}
}
...
...
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