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
96e9fdd4
Kaydet (Commit)
96e9fdd4
authored
Nis 15, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
oox: generate data, not code for VML export preset definitions
Change-Id: Ied9171715de948d30b360eb56626b93b695b7b93
üst
b720ee5d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
45 deletions
+56
-45
CustomTarget_generated.mk
oox/CustomTarget_generated.mk
+3
-3
Library_oox.mk
oox/Library_oox.mk
+0
-4
Package_generated.mk
oox/Package_generated.mk
+1
-0
preset-definitions-to-shape-types.pl
oox/source/export/preset-definitions-to-shape-types.pl
+17
-33
vmlexport.cxx
oox/source/export/vmlexport.cxx
+26
-4
module_filter.scp
scp2/source/ooo/module_filter.scp
+9
-1
No files found.
oox/CustomTarget_generated.mk
Dosyayı görüntüle @
96e9fdd4
...
...
@@ -14,14 +14,14 @@ oox_MISC := $(call gb_CustomTarget_get_workdir,oox/generated)/misc
oox_INC := $(call gb_CustomTarget_get_workdir,oox/generated)
oox_GENHEADERPATH := $(oox_INC)/oox/token
$(oox_MISC)/vml
export-shape-types.cxx
: \
$(oox_MISC)/vml
-shape-types
: \
$(SRCDIR)/oox/source/export/preset-definitions-to-shape-types.pl \
$(SRCDIR)/oox/source/drawingml/customshapes/presetShapeDefinitions.xml \
$(SRCDIR)/oox/source/export/presetTextWarpDefinitions.xml \
$(SRCDIR)/oox/CustomTarget_generated.mk
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PRL,1)
mkdir -p $(dir $@)
perl $
^
> $@.in_progress 2> $@.log && mv $@.in_progress $@
perl $
< --vml-shape-types-data $(filter-out $<,$^)
> $@.in_progress 2> $@.log && mv $@.in_progress $@
$(oox_MISC)/oox-drawingml-adj-names : \
$(SRCDIR)/oox/source/export/preset-definitions-to-shape-types.pl \
...
...
@@ -58,8 +58,8 @@ $(eval $(call oox_GenTarget,properties,property,))
$(eval $(call oox_GenTarget,tokens,token,tokenhash.gperf))
$(call gb_CustomTarget_get_target,oox/generated) : \
$(oox_MISC)/vmlexport-shape-types.cxx \
$(oox_MISC)/oox-drawingml-adj-names \
$(oox_MISC)/vml-shape-types \
$(oox_INC)/tokenhash.inc \
$(oox_INC)/tokennames.inc \
$(oox_INC)/namespacenames.inc \
...
...
oox/Library_oox.mk
Dosyayı görüntüle @
96e9fdd4
...
...
@@ -296,8 +296,4 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
oox/source/vml/vmltextbox \
))
$(eval $(call gb_Library_add_generated_exception_objects,oox,\
CustomTarget/oox/generated/misc/vmlexport-shape-types \
))
# vim: set noet sw=4 ts=4:
oox/Package_generated.mk
Dosyayı görüntüle @
96e9fdd4
...
...
@@ -11,6 +11,7 @@ $(eval $(call gb_Package_Package,oox_generated,$(call gb_CustomTarget_get_workdi
$(eval $(call gb_Package_add_files,oox_generated,$(LIBO_SHARE_FOLDER)/filter,\
misc/oox-drawingml-adj-names \
misc/vml-shape-types \
))
# vim: set noet sw=4 ts=4:
oox/source/export/preset-definitions-to-shape-types.pl
Dosyayı görüntüle @
96e9fdd4
...
...
@@ -22,7 +22,7 @@ use warnings;
sub
usage
()
{
print
STDERR
<<EOF;
Usage: preset-definitions-to-shape-types.pl <shapes> <text>
Usage: preset-definitions-to-shape-types.pl
[ --drawingml-adj-names-data | --vml-shape-types-data ]
<shapes> <text>
Converts presetShapeDefinitions.xml and presetTextWarpDefinitions.xml to a
.cxx that contains VML with the definitions of the shapes. The result is
...
...
@@ -47,10 +47,14 @@ sub show_call_stack
}
my
$drawingml_adj_names_data
=
0
;
my
$vml_shape_types_data
=
0
;
my
$src_shapes
=
shift
;
if
(
$src_shapes
eq
"--drawingml-adj-names-data"
)
{
$drawingml_adj_names_data
=
1
;
$src_shapes
=
shift
;
}
elsif
(
$src_shapes
eq
"--vml-shape-types-data"
)
{
$vml_shape_types_data
=
1
;
$src_shapes
=
shift
;
}
my
$src_text
=
shift
;
...
...
@@ -1191,7 +1195,7 @@ if ( !defined( $result_shapes{'textBox'} ) ) {
"</v:shapetype>"
;
}
# Generate the
code
# Generate the
data
if
(
$drawingml_adj_names_data
eq
1
)
{
foreach
my
$adj_name
(
keys
%
adj_names
)
{
...
...
@@ -1201,52 +1205,32 @@ if ($drawingml_adj_names_data eq 1) {
}
}
exit
0
;
}
print
<<EOF;
// Shape types generated from
// '$src_shapes'
// and
// '$src_text'
// which are part of the OOXML documentation
#include <map>
#include <filter/msfilter/escherex.hxx>
const char* pShapeTypes[ ESCHER_ShpInst_COUNT ] =
{
EOF
for
(
my
$i
=
0
;
$i
<
203
;
++
$i
)
{
}
elsif
(
$vml_shape_types_data
eq
1
)
{
for
(
my
$i
=
0
;
$i
<
203
;
++
$i
)
{
if
(
$i
<
4
)
{
print
" /* $i - $shapes_ids{$i} - handled separately */\n NULL,
\n"
;
print
"/* $i - $shapes_ids{$i} - handled separately */\nNULL
\n"
;
}
else
{
print
"
/* $i - $shapes_ids{$i} */\n"
;
print
"
/* $i - $shapes_ids{$i} */\n"
;
my
$out
=
$result_shapes
{
$shapes_ids
{
$i
}};
if
(
defined
(
$out
)
)
{
# set the id
$out
=~
s/__ID__/$i/g
;
# escape the '"'s
$out
=~
s/"/\\"/g
;
# output as string
$out
=~
s/^/ "/
;
$out
=~
s/\n/"\n "/g
;
$out
=~
s/$/"/
;
$out
=~
s/\n//g
;
print
"$out,
\n"
;
print
"$out
\n"
;
}
else
{
print
" NULL,\n"
;
print
"NULL\n"
;
}
}
}
exit
0
;
}
print
<<EOF;
};
EOF
# should not happen
exit
1
;
# vim:set ft=perl shiftwidth=4 softtabstop=4 expandtab: #
oox/source/export/vmlexport.cxx
Dosyayı görüntüle @
96e9fdd4
...
...
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_folders.h>
#include "rtl/bootstrap.hxx"
#include <oox/export/vmlexport.hxx>
#include <oox/token/tokens.hxx>
...
...
@@ -927,7 +929,26 @@ void VMLExport::AddShapeAttribute( sal_Int32 nAttribute, const OString& rValue )
m_pShapeAttrList
->
add
(
nAttribute
,
rValue
);
}
extern
const
char
*
pShapeTypes
[];
std
::
vector
<
OString
>
lcl_getShapeTypes
()
{
std
::
vector
<
OString
>
aRet
;
OUString
aPath
(
"$BRAND_BASE_DIR/"
LIBO_SHARE_FOLDER
"/filter/vml-shape-types"
);
rtl
::
Bootstrap
::
expandMacros
(
aPath
);
SvFileStream
aStream
(
aPath
,
STREAM_READ
);
if
(
aStream
.
GetError
()
!=
ERRCODE_NONE
)
SAL_WARN
(
"oox"
,
"failed to open vml-shape-types"
);
OString
aLine
;
bool
bNotDone
=
aStream
.
ReadLine
(
aLine
);
while
(
bNotDone
)
{
// Filter out comments.
if
(
!
aLine
.
startsWith
(
"/"
))
aRet
.
push_back
(
aLine
);
bNotDone
=
aStream
.
ReadLine
(
aLine
);
}
return
aRet
;
}
sal_Int32
VMLExport
::
StartShape
()
{
...
...
@@ -951,13 +972,14 @@ sal_Int32 VMLExport::StartShape()
nShapeElement
=
XML_shape
;
// a predefined shape?
const
char
*
pShapeType
=
pShapeTypes
[
m_nShapeType
];
if
(
pShapeType
)
static
std
::
vector
<
OString
>
aShapeTypes
=
lcl_getShapeTypes
();
OString
aShapeType
=
aShapeTypes
[
m_nShapeType
];
if
(
aShapeType
!=
"NULL"
)
{
bReferToShapeType
=
true
;
if
(
!
m_pShapeTypeWritten
[
m_nShapeType
]
)
{
m_pSerializer
->
write
(
pShapeType
);
m_pSerializer
->
write
(
aShapeType
.
getStr
()
);
m_pShapeTypeWritten
[
m_nShapeType
]
=
true
;
}
}
...
...
scp2/source/ooo/module_filter.scp
Dosyayı görüntüle @
96e9fdd4
...
...
@@ -17,7 +17,8 @@ Module gid_Module_Filter
Styles = (HIDDEN_ROOT);
Dirs = (gid_Dir_Share_Filter);
Files = (
gid_File_Dat_OoxDrawingmlAdjNames);
gid_File_Dat_OoxDrawingmlAdjNames,
gid_File_Dat_VmlShapeTypes);
End
Directory gid_Dir_Share_Filter
...
...
@@ -32,4 +33,11 @@ File gid_File_Dat_OoxDrawingmlAdjNames
Styles = (PACKED);
End
File gid_File_Dat_OoxVmlShapeTypes
TXT_FILE_BODY;
Dir = gid_Dir_Share_Filter;
Name = "vml-shape-types";
Styles = (PACKED);
End
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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