summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/customshapes/README
blob: fe1156e1a19691737a3b0eaf7ff2f8c103551a78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash

# The Perl code here is used to generate the custom shape presets
# source code.

# This file is both a README and also, if run as a shell script, does what
# it describes.

# We want to exit on errors...

set -o errexit

# To re-generate the code, you need to be on Linux (I think). You need
# to have done a make dev-install. oox needs to be build with
# dbglevel=2 so that DEBUG is defined.

make oox.clean && make oox dbglevel=2

# This reads the
# oox/source/drawingml/customshapes/presetShapeDefinitions.xml file.
# It will produce the file
# oox/source/drawingml/customshapes/pptx/cshape-all.ppx and a whole
# bunch of other files that aren't needed further.

(cd oox/source/drawingml/customshapes && ./generatePresetsPPTXs.pl)


# Then load it and store the debugging output. Note that this will run
# an *interactive* LO, and you need to quit it manually.

echo
echo "Starting LibreOffice, quit once you see the slide."
echo

# We need only the SAL_INFO output with tag "oox.cscode", plus stderr
# for PropertyMap::dumpCode() output.

SAL_LOG='+INFO.oox.cscode-WARN' instdir/program/soffice oox/source/drawingml/customshapes/pptx/cshape-all.pptx > oox/source/drawingml/customshapes/custom-shapes.log 2>&1


# Now run a script that reads the above log file and generates the
# customshapepresets*.cxx sources:

(cd oox/source/drawingml/customshapes && ./generatePresetsCXX.pl)


# Then move them into place

mv oox/source/drawingml/customshapes/customshapepresets*.cxx oox/source/drawingml

echo
echo "To see what has been done, run git diff --patience oox/source/drawingml"
echo
echo "The generatePresetsCXX.pl doesn't sort the classes by name (it uses just"
echo "the keys function on a hash which returns the keys in an unspecified"
echo "order), so there will almost always be some random re-ordering of"
echo "classes, sigh."
echo