summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
Diffstat (limited to 'filter')
-rw-r--r--filter/inc/filter/msfilter/escherex.hxx1116
-rw-r--r--filter/inc/filter/msfilter/msdffimp.hxx197
-rw-r--r--filter/inc/filter/msfilter/msocximex.hxx10
-rw-r--r--filter/inc/filter/msfilter/svdfppt.hxx14
-rw-r--r--filter/inc/registration.hxx11
-rw-r--r--filter/prj/d.lst1
-rw-r--r--filter/source/config/cache/registration.cxx3
-rw-r--r--filter/source/config/fragments/makefile.mk10
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_2003_XML.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_97.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_SYLK.xcu4
-rw-r--r--filter/source/config/fragments/types/writer_MS_Word_2003_XML.xcu2
-rw-r--r--filter/source/filtertracer/exports.dxp3
-rw-r--r--filter/source/filtertracer/filtertraceruno.cxx9
-rw-r--r--filter/source/flash/swfuno.cxx8
-rw-r--r--filter/source/graphicfilter/epbm/epbm.cxx9
-rw-r--r--filter/source/graphicfilter/epgm/epgm.cxx9
-rw-r--r--filter/source/graphicfilter/eppm/eppm.cxx9
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx36
-rw-r--r--filter/source/graphicfilter/expm/expm.cxx9
-rw-r--r--filter/source/msfilter/escherex.cxx114
-rw-r--r--filter/source/msfilter/makefile.mk4
-rw-r--r--filter/source/msfilter/msdffimp.cxx211
-rw-r--r--filter/source/msfilter/msocximex.cxx89
-rw-r--r--filter/source/msfilter/mstoolbar.cxx2
-rw-r--r--filter/source/msfilter/powerpoint/pptimporteruno.cxx5
-rw-r--r--filter/source/msfilter/services.cxx10
-rw-r--r--filter/source/msfilter/svdfppt.cxx99
-rw-r--r--filter/source/odfflatxml/OdfFlatXml.cxx2
-rw-r--r--filter/source/pdf/impdialog.cxx8
-rw-r--r--filter/source/pdf/impdialog.hrc5
-rw-r--r--filter/source/pdf/impdialog.hxx8
-rw-r--r--filter/source/pdf/impdialog.src119
-rw-r--r--filter/source/pdf/pdfuno.cxx8
-rw-r--r--filter/source/placeware/exports.dxp1
-rw-r--r--filter/source/placeware/uno.cxx7
-rw-r--r--filter/source/svg/exports.map1
-rw-r--r--filter/source/svg/makefile.mk3
-rw-r--r--filter/source/svg/svgdialog.cxx6
-rw-r--r--filter/source/svg/svgexport.cxx1464
-rw-r--r--filter/source/svg/svgfilter.cxx130
-rw-r--r--filter/source/svg/svgfilter.hxx140
-rw-r--r--filter/source/svg/svgfontexport.cxx6
-rw-r--r--filter/source/svg/svgfontexport.hxx11
-rw-r--r--filter/source/svg/svgscript.hxx1689
-rw-r--r--filter/source/svg/svgwriter.cxx132
-rw-r--r--filter/source/svg/svgwriter.hxx67
-rw-r--r--filter/source/t602/filterenv.cxx7
-rw-r--r--filter/source/xmlfilteradaptor/genericfilter.cxx7
-rw-r--r--filter/source/xmlfilterdetect/fdcomp.cxx7
-rw-r--r--filter/source/xsltdialog/exports.dxp1
-rw-r--r--filter/source/xsltdialog/xmlfilterdialogcomponent.cxx8
-rw-r--r--filter/source/xsltfilter/XSLTFilter.cxx6
-rw-r--r--filter/source/xsltfilter/makefile.mk4
54 files changed, 4170 insertions, 1675 deletions
diff --git a/filter/inc/filter/msfilter/escherex.hxx b/filter/inc/filter/msfilter/escherex.hxx
index 37dbadc207b3..4afd1f006d45 100644
--- a/filter/inc/filter/msfilter/escherex.hxx
+++ b/filter/inc/filter/msfilter/escherex.hxx
@@ -50,264 +50,263 @@
/*Record Name FBT-Value Instance Contents Wrd Exl PPt Ver*/
// In der Mickysoft-Doku heissen die msofbt... statt ESCHER_...
-#define ESCHER_DggContainer 0xF000 /* per-document data X X X */
-#define ESCHER_Dgg 0xF006 /* an FDGG and several FIDCLs X X X 0 */
-#define ESCHER_CLSID 0xF016 /* the CLSID of the application that put the data on the clipboard C C C 0 */
-#define ESCHER_OPT 0xF00B /* count of properties the document-wide default shape properties X X X 3 */
-#define ESCHER_ColorMRU 0xF11A /* count of colors the colors in the MRU swatch X X X 0 */
-#define ESCHER_SplitMenuColors 0xF11E /* count of colors the colors in the top-level split menus X X X 0 */
-#define ESCHER_BstoreContainer 0xF001 /* count of BLIPs all images in the document (JPEGs, metafiles, etc.) X X X */
-#define ESCHER_BSE 0xF007 /* BLIP type an FBSE (one per BLIP) X X X 2 */
-#define ESCHER_BlipFirst 0xF018 /* range of fbts reserved for various kinds of BLIPs X X X */
-#define ESCHER_BlipLast 0xF117 /* range of fbts reserved for various kinds of BLIPs X X X */
-
-#define ESCHER_DgContainer 0xF002 /* per-sheet/page/slide data X X X */
-#define ESCHER_Dg 0xF008 /* drawing ID an FDG X X X 0 */
-#define ESCHER_RegroupItems 0xF118 /* count of regroup entries several FRITs X X X 0 */
-#define ESCHER_ColorScheme 0xF120 /* count of colors the colors of the source host's color scheme C C 0 */
-#define ESCHER_SpgrContainer 0xF003 /* several SpContainers, the first of which is the group shape itself X X X */
-#define ESCHER_SpContainer 0xF004 /* a shape X X X */
-#define ESCHER_Spgr 0xF009 /* an FSPGR; only present if the shape is a group shape X X X 1 */
-#define ESCHER_Sp 0xF00A /* shape type an FSP X X X 2 */
+#define ESCHER_DggContainer 0xF000 /* per-document data X X X */
+#define ESCHER_Dgg 0xF006 /* an FDGG and several FIDCLs X X X 0 */
+#define ESCHER_CLSID 0xF016 /* the CLSID of the application that put the data on the clipboard C C C 0 */
+#define ESCHER_OPT 0xF00B /* count of properties the document-wide default shape properties X X X 3 */
+#define ESCHER_ColorMRU 0xF11A /* count of colors the colors in the MRU swatch X X X 0 */
+#define ESCHER_SplitMenuColors 0xF11E /* count of colors the colors in the top-level split menus X X X 0 */
+#define ESCHER_BstoreContainer 0xF001 /* count of BLIPs all images in the document (JPEGs, metafiles, etc.) X X X */
+#define ESCHER_BSE 0xF007 /* BLIP type an FBSE (one per BLIP) X X X 2 */
+#define ESCHER_BlipFirst 0xF018 /* range of fbts reserved for various kinds of BLIPs X X X */
+#define ESCHER_BlipLast 0xF117 /* range of fbts reserved for various kinds of BLIPs X X X */
+
+#define ESCHER_DgContainer 0xF002 /* per-sheet/page/slide data X X X */
+#define ESCHER_Dg 0xF008 /* drawing ID an FDG X X X 0 */
+#define ESCHER_RegroupItems 0xF118 /* count of regroup entries several FRITs X X X 0 */
+#define ESCHER_ColorScheme 0xF120 /* count of colors the colors of the source host's color scheme C C 0 */
+#define ESCHER_SpgrContainer 0xF003 /* several SpContainers, the first of which is the group shape itself X X X */
+#define ESCHER_SpContainer 0xF004 /* a shape X X X */
+#define ESCHER_Spgr 0xF009 /* an FSPGR; only present if the shape is a group shape X X X 1 */
+#define ESCHER_Sp 0xF00A /* shape type an FSP X X X 2 */
//#define ESCHER_OPT 0xF00B /* count of properties a shape property table X X X 3 */
-#define ESCHER_Textbox 0xF00C /* RTF text C C C 0 */
-#define ESCHER_ClientTextbox 0xF00D /* host-defined the text in the textbox, in host-defined format X X X */
-#define ESCHER_Anchor 0xF00E /* a RECT, in 100000ths of an inch C C C 0 */
-#define ESCHER_ChildAnchor 0xF00F /* a RECT, in units relative to the parent group X X X 0 */
-#define ESCHER_ClientAnchor 0xF010 /* host-defined the location of the shape, in a host-defined format X X X */
-#define ESCHER_ClientData 0xF011 /* host-defined host-specific data X X X */
-#define ESCHER_OleObject 0xF11F /* a serialized IStorage for an OLE object C C C 0 */
-#define ESCHER_DeletedPspl 0xF11D /* an FPSPL; only present in top-level deleted shapes X 0 */
-#define ESCHER_SolverContainer 0xF005 /* count of rules the rules governing shapes X X X */
-#define ESCHER_ConnectorRule 0xF012 /* an FConnectorRule X X 1 */
-#define ESCHER_AlignRule 0xF013 /* an FAlignRule X X X 0 */
-#define ESCHER_ArcRule 0xF014 /* an FARCRU X X X 0 */
-#define ESCHER_ClientRule 0xF015 /* host-defined host-defined */
-#define ESCHER_CalloutRule 0xF017 /* an FCORU X X X 0 */
-#define ESCHER_Selection 0xF119 /* an FDGSL followed by the SPIDs of the shapes in the selection X 0 */
-#define ESCHER_UDefProp 0xF122
-
-#define SHAPEFLAG_GROUP 0x001 // This shape is a group shape
-#define SHAPEFLAG_CHILD 0x002 // Not a top-level shape
-#define SHAPEFLAG_PATRIARCH 0x004 // This is the topmost group shape. Exactly one of these per drawing.
-#define SHAPEFLAG_DELETED 0x008 // The shape has been deleted
-#define SHAPEFLAG_OLESHAPE 0x010 // The shape is an OLE object
-#define SHAPEFLAG_HAVEMASTER 0x020 // Shape has a hspMaster property
-#define SHAPEFLAG_FLIPH 0x040 // Shape is flipped horizontally
-#define SHAPEFLAG_FLIPV 0x080 // Shape is flipped vertically
-#define SHAPEFLAG_CONNECTOR 0x100 // Connector type of shape
-#define SHAPEFLAG_HAVEANCHOR 0x200 // Shape has an anchor of some kind
-#define SHAPEFLAG_BACKGROUND 0x400 // Background shape
-#define SHAPEFLAG_HAVESPT 0x800 // Shape has a shape type property
-
-#define ESCHER_ShpInst_Min 0
-#define ESCHER_ShpInst_NotPrimitive ESCHER_ShpInst_Min
-#define ESCHER_ShpInst_Rectangle 1
-#define ESCHER_ShpInst_RoundRectangle 2
-#define ESCHER_ShpInst_Ellipse 3
-#define ESCHER_ShpInst_Diamond 4
-#define ESCHER_ShpInst_IsocelesTriangle 5
-#define ESCHER_ShpInst_RightTriangle 6
-#define ESCHER_ShpInst_Parallelogram 7
-#define ESCHER_ShpInst_Trapezoid 8
-#define ESCHER_ShpInst_Hexagon 9
-#define ESCHER_ShpInst_Octagon 10
-#define ESCHER_ShpInst_Plus 11
-#define ESCHER_ShpInst_Star 12
-#define ESCHER_ShpInst_Arrow 13
-#define ESCHER_ShpInst_ThickArrow 14
-#define ESCHER_ShpInst_HomePlate 15
-#define ESCHER_ShpInst_Cube 16
-#define ESCHER_ShpInst_Balloon 17
-#define ESCHER_ShpInst_Seal 18
-#define ESCHER_ShpInst_Arc 19
-#define ESCHER_ShpInst_Line 20
-#define ESCHER_ShpInst_Plaque 21
-#define ESCHER_ShpInst_Can 22
-#define ESCHER_ShpInst_Donut 23
-#define ESCHER_ShpInst_TextSimple 24
-#define ESCHER_ShpInst_TextOctagon 25
-#define ESCHER_ShpInst_TextHexagon 26
-#define ESCHER_ShpInst_TextCurve 27
-#define ESCHER_ShpInst_TextWave 28
-#define ESCHER_ShpInst_TextRing 29
-#define ESCHER_ShpInst_TextOnCurve 30
-#define ESCHER_ShpInst_TextOnRing 31
-#define ESCHER_ShpInst_StraightConnector1 32
-#define ESCHER_ShpInst_BentConnector2 33
-#define ESCHER_ShpInst_BentConnector3 34
-#define ESCHER_ShpInst_BentConnector4 35
-#define ESCHER_ShpInst_BentConnector5 36
-#define ESCHER_ShpInst_CurvedConnector2 37
-#define ESCHER_ShpInst_CurvedConnector3 38
-#define ESCHER_ShpInst_CurvedConnector4 39
-#define ESCHER_ShpInst_CurvedConnector5 40
-#define ESCHER_ShpInst_Callout1 41
-#define ESCHER_ShpInst_Callout2 42
-#define ESCHER_ShpInst_Callout3 43
-#define ESCHER_ShpInst_AccentCallout1 44
-#define ESCHER_ShpInst_AccentCallout2 45
-#define ESCHER_ShpInst_AccentCallout3 46
-#define ESCHER_ShpInst_BorderCallout1 47
-#define ESCHER_ShpInst_BorderCallout2 48
-#define ESCHER_ShpInst_BorderCallout3 49
-#define ESCHER_ShpInst_AccentBorderCallout1 50
-#define ESCHER_ShpInst_AccentBorderCallout2 51
-#define ESCHER_ShpInst_AccentBorderCallout3 52
-#define ESCHER_ShpInst_Ribbon 53
-#define ESCHER_ShpInst_Ribbon2 54
-#define ESCHER_ShpInst_Chevron 55
-#define ESCHER_ShpInst_Pentagon 56
-#define ESCHER_ShpInst_NoSmoking 57
-#define ESCHER_ShpInst_Seal8 58
-#define ESCHER_ShpInst_Seal16 59
-#define ESCHER_ShpInst_Seal32 60
-#define ESCHER_ShpInst_WedgeRectCallout 61
-#define ESCHER_ShpInst_WedgeRRectCallout 62
-#define ESCHER_ShpInst_WedgeEllipseCallout 63
-#define ESCHER_ShpInst_Wave 64
-#define ESCHER_ShpInst_FoldedCorner 65
-#define ESCHER_ShpInst_LeftArrow 66
-#define ESCHER_ShpInst_DownArrow 67
-#define ESCHER_ShpInst_UpArrow 68
-#define ESCHER_ShpInst_LeftRightArrow 69
-#define ESCHER_ShpInst_UpDownArrow 70
-#define ESCHER_ShpInst_IrregularSeal1 71
-#define ESCHER_ShpInst_IrregularSeal2 72
-#define ESCHER_ShpInst_LightningBolt 73
-#define ESCHER_ShpInst_Heart 74
-#define ESCHER_ShpInst_PictureFrame 75
-#define ESCHER_ShpInst_QuadArrow 76
-#define ESCHER_ShpInst_LeftArrowCallout 77
-#define ESCHER_ShpInst_RightArrowCallout 78
-#define ESCHER_ShpInst_UpArrowCallout 79
-#define ESCHER_ShpInst_DownArrowCallout 80
-#define ESCHER_ShpInst_LeftRightArrowCallout 81
-#define ESCHER_ShpInst_UpDownArrowCallout 82
-#define ESCHER_ShpInst_QuadArrowCallout 83
-#define ESCHER_ShpInst_Bevel 84
-#define ESCHER_ShpInst_LeftBracket 85
-#define ESCHER_ShpInst_RightBracket 86
-#define ESCHER_ShpInst_LeftBrace 87
-#define ESCHER_ShpInst_RightBrace 88
-#define ESCHER_ShpInst_LeftUpArrow 89
-#define ESCHER_ShpInst_BentUpArrow 90
-#define ESCHER_ShpInst_BentArrow 91
-#define ESCHER_ShpInst_Seal24 92
-#define ESCHER_ShpInst_StripedRightArrow 93
-#define ESCHER_ShpInst_NotchedRightArrow 94
-#define ESCHER_ShpInst_BlockArc 95
-#define ESCHER_ShpInst_SmileyFace 96
-#define ESCHER_ShpInst_VerticalScroll 97
-#define ESCHER_ShpInst_HorizontalScroll 98
-#define ESCHER_ShpInst_CircularArrow 99
-#define ESCHER_ShpInst_NotchedCircularArrow 100
-#define ESCHER_ShpInst_UturnArrow 101
-#define ESCHER_ShpInst_CurvedRightArrow 102
-#define ESCHER_ShpInst_CurvedLeftArrow 103
-#define ESCHER_ShpInst_CurvedUpArrow 104
-#define ESCHER_ShpInst_CurvedDownArrow 105
-#define ESCHER_ShpInst_CloudCallout 106
-#define ESCHER_ShpInst_EllipseRibbon 107
-#define ESCHER_ShpInst_EllipseRibbon2 108
-#define ESCHER_ShpInst_FlowChartProcess 109
-#define ESCHER_ShpInst_FlowChartDecision 110
-#define ESCHER_ShpInst_FlowChartInputOutput 111
+#define ESCHER_Textbox 0xF00C /* RTF text C C C 0 */
+#define ESCHER_ClientTextbox 0xF00D /* host-defined the text in the textbox, in host-defined format X X X */
+#define ESCHER_Anchor 0xF00E /* a RECT, in 100000ths of an inch C C C 0 */
+#define ESCHER_ChildAnchor 0xF00F /* a RECT, in units relative to the parent group X X X 0 */
+#define ESCHER_ClientAnchor 0xF010 /* host-defined the location of the shape, in a host-defined format X X X */
+#define ESCHER_ClientData 0xF011 /* host-defined host-specific data X X X */
+#define ESCHER_OleObject 0xF11F /* a serialized IStorage for an OLE object C C C 0 */
+#define ESCHER_DeletedPspl 0xF11D /* an FPSPL; only present in top-level deleted shapes X 0 */
+#define ESCHER_SolverContainer 0xF005 /* count of rules the rules governing shapes X X X */
+#define ESCHER_ConnectorRule 0xF012 /* an FConnectorRule X X 1 */
+#define ESCHER_AlignRule 0xF013 /* an FAlignRule X X X 0 */
+#define ESCHER_ArcRule 0xF014 /* an FARCRU X X X 0 */
+#define ESCHER_ClientRule 0xF015 /* host-defined host-defined */
+#define ESCHER_CalloutRule 0xF017 /* an FCORU X X X 0 */
+#define ESCHER_Selection 0xF119 /* an FDGSL followed by the SPIDs of the shapes in the selection X 0 */
+#define ESCHER_UDefProp 0xF122
+
+#define SHAPEFLAG_GROUP 0x001 /* This shape is a group shape */
+#define SHAPEFLAG_CHILD 0x002 /* Not a top-level shape */
+#define SHAPEFLAG_PATRIARCH 0x004 /* This is the topmost group shape. Exactly one of these per drawing. */
+#define SHAPEFLAG_DELETED 0x008 /* The shape has been deleted */
+#define SHAPEFLAG_OLESHAPE 0x010 /* The shape is an OLE object */
+#define SHAPEFLAG_HAVEMASTER 0x020 /* Shape has a hspMaster property */
+#define SHAPEFLAG_FLIPH 0x040 /* Shape is flipped horizontally */
+#define SHAPEFLAG_FLIPV 0x080 /* Shape is flipped vertically */
+#define SHAPEFLAG_CONNECTOR 0x100 /* Connector type of shape */
+#define SHAPEFLAG_HAVEANCHOR 0x200 /* Shape has an anchor of some kind */
+#define SHAPEFLAG_BACKGROUND 0x400 /* Background shape */
+#define SHAPEFLAG_HAVESPT 0x800 /* Shape has a shape type property */
+
+#define ESCHER_ShpInst_Min 0
+#define ESCHER_ShpInst_NotPrimitive ESCHER_ShpInst_Min
+#define ESCHER_ShpInst_Rectangle 1
+#define ESCHER_ShpInst_RoundRectangle 2
+#define ESCHER_ShpInst_Ellipse 3
+#define ESCHER_ShpInst_Diamond 4
+#define ESCHER_ShpInst_IsocelesTriangle 5
+#define ESCHER_ShpInst_RightTriangle 6
+#define ESCHER_ShpInst_Parallelogram 7
+#define ESCHER_ShpInst_Trapezoid 8
+#define ESCHER_ShpInst_Hexagon 9
+#define ESCHER_ShpInst_Octagon 10
+#define ESCHER_ShpInst_Plus 11
+#define ESCHER_ShpInst_Star 12
+#define ESCHER_ShpInst_Arrow 13
+#define ESCHER_ShpInst_ThickArrow 14
+#define ESCHER_ShpInst_HomePlate 15
+#define ESCHER_ShpInst_Cube 16
+#define ESCHER_ShpInst_Balloon 17
+#define ESCHER_ShpInst_Seal 18
+#define ESCHER_ShpInst_Arc 19
+#define ESCHER_ShpInst_Line 20
+#define ESCHER_ShpInst_Plaque 21
+#define ESCHER_ShpInst_Can 22
+#define ESCHER_ShpInst_Donut 23
+#define ESCHER_ShpInst_TextSimple 24
+#define ESCHER_ShpInst_TextOctagon 25
+#define ESCHER_ShpInst_TextHexagon 26
+#define ESCHER_ShpInst_TextCurve 27
+#define ESCHER_ShpInst_TextWave 28
+#define ESCHER_ShpInst_TextRing 29
+#define ESCHER_ShpInst_TextOnCurve 30
+#define ESCHER_ShpInst_TextOnRing 31
+#define ESCHER_ShpInst_StraightConnector1 32
+#define ESCHER_ShpInst_BentConnector2 33
+#define ESCHER_ShpInst_BentConnector3 34
+#define ESCHER_ShpInst_BentConnector4 35
+#define ESCHER_ShpInst_BentConnector5 36
+#define ESCHER_ShpInst_CurvedConnector2 37
+#define ESCHER_ShpInst_CurvedConnector3 38
+#define ESCHER_ShpInst_CurvedConnector4 39
+#define ESCHER_ShpInst_CurvedConnector5 40
+#define ESCHER_ShpInst_Callout1 41
+#define ESCHER_ShpInst_Callout2 42
+#define ESCHER_ShpInst_Callout3 43
+#define ESCHER_ShpInst_AccentCallout1 44
+#define ESCHER_ShpInst_AccentCallout2 45
+#define ESCHER_ShpInst_AccentCallout3 46
+#define ESCHER_ShpInst_BorderCallout1 47
+#define ESCHER_ShpInst_BorderCallout2 48
+#define ESCHER_ShpInst_BorderCallout3 49
+#define ESCHER_ShpInst_AccentBorderCallout1 50
+#define ESCHER_ShpInst_AccentBorderCallout2 51
+#define ESCHER_ShpInst_AccentBorderCallout3 52
+#define ESCHER_ShpInst_Ribbon 53
+#define ESCHER_ShpInst_Ribbon2 54
+#define ESCHER_ShpInst_Chevron 55
+#define ESCHER_ShpInst_Pentagon 56
+#define ESCHER_ShpInst_NoSmoking 57
+#define ESCHER_ShpInst_Seal8 58
+#define ESCHER_ShpInst_Seal16 59
+#define ESCHER_ShpInst_Seal32 60
+#define ESCHER_ShpInst_WedgeRectCallout 61
+#define ESCHER_ShpInst_WedgeRRectCallout 62
+#define ESCHER_ShpInst_WedgeEllipseCallout 63
+#define ESCHER_ShpInst_Wave 64
+#define ESCHER_ShpInst_FoldedCorner 65
+#define ESCHER_ShpInst_LeftArrow 66
+#define ESCHER_ShpInst_DownArrow 67
+#define ESCHER_ShpInst_UpArrow 68
+#define ESCHER_ShpInst_LeftRightArrow 69
+#define ESCHER_ShpInst_UpDownArrow 70
+#define ESCHER_ShpInst_IrregularSeal1 71
+#define ESCHER_ShpInst_IrregularSeal2 72
+#define ESCHER_ShpInst_LightningBolt 73
+#define ESCHER_ShpInst_Heart 74
+#define ESCHER_ShpInst_PictureFrame 75
+#define ESCHER_ShpInst_QuadArrow 76
+#define ESCHER_ShpInst_LeftArrowCallout 77
+#define ESCHER_ShpInst_RightArrowCallout 78
+#define ESCHER_ShpInst_UpArrowCallout 79
+#define ESCHER_ShpInst_DownArrowCallout 80
+#define ESCHER_ShpInst_LeftRightArrowCallout 81
+#define ESCHER_ShpInst_UpDownArrowCallout 82
+#define ESCHER_ShpInst_QuadArrowCallout 83
+#define ESCHER_ShpInst_Bevel 84
+#define ESCHER_ShpInst_LeftBracket 85
+#define ESCHER_ShpInst_RightBracket 86
+#define ESCHER_ShpInst_LeftBrace 87
+#define ESCHER_ShpInst_RightBrace 88
+#define ESCHER_ShpInst_LeftUpArrow 89
+#define ESCHER_ShpInst_BentUpArrow 90
+#define ESCHER_ShpInst_BentArrow 91
+#define ESCHER_ShpInst_Seal24 92
+#define ESCHER_ShpInst_StripedRightArrow 93
+#define ESCHER_ShpInst_NotchedRightArrow 94
+#define ESCHER_ShpInst_BlockArc 95
+#define ESCHER_ShpInst_SmileyFace 96
+#define ESCHER_ShpInst_VerticalScroll 97
+#define ESCHER_ShpInst_HorizontalScroll 98
+#define ESCHER_ShpInst_CircularArrow 99
+#define ESCHER_ShpInst_NotchedCircularArrow 100
+#define ESCHER_ShpInst_UturnArrow 101
+#define ESCHER_ShpInst_CurvedRightArrow 102
+#define ESCHER_ShpInst_CurvedLeftArrow 103
+#define ESCHER_ShpInst_CurvedUpArrow 104
+#define ESCHER_ShpInst_CurvedDownArrow 105
+#define ESCHER_ShpInst_CloudCallout 106
+#define ESCHER_ShpInst_EllipseRibbon 107
+#define ESCHER_ShpInst_EllipseRibbon2 108
+#define ESCHER_ShpInst_FlowChartProcess 109
+#define ESCHER_ShpInst_FlowChartDecision 110
+#define ESCHER_ShpInst_FlowChartInputOutput 111
#define ESCHER_ShpInst_FlowChartPredefinedProcess 112
-#define ESCHER_ShpInst_FlowChartInternalStorage 113
-#define ESCHER_ShpInst_FlowChartDocument 114
-#define ESCHER_ShpInst_FlowChartMultidocument 115
-#define ESCHER_ShpInst_FlowChartTerminator 116
-#define ESCHER_ShpInst_FlowChartPreparation 117
-#define ESCHER_ShpInst_FlowChartManualInput 118
-#define ESCHER_ShpInst_FlowChartManualOperation 119
-#define ESCHER_ShpInst_FlowChartConnector 120
-#define ESCHER_ShpInst_FlowChartPunchedCard 121
-#define ESCHER_ShpInst_FlowChartPunchedTape 122
-#define ESCHER_ShpInst_FlowChartSummingJunction 123
-#define ESCHER_ShpInst_FlowChartOr 124
-#define ESCHER_ShpInst_FlowChartCollate 125
-#define ESCHER_ShpInst_FlowChartSort 126
-#define ESCHER_ShpInst_FlowChartExtract 127
-#define ESCHER_ShpInst_FlowChartMerge 128
-#define ESCHER_ShpInst_FlowChartOfflineStorage 129
-#define ESCHER_ShpInst_FlowChartOnlineStorage 130
-#define ESCHER_ShpInst_FlowChartMagneticTape 131
-#define ESCHER_ShpInst_FlowChartMagneticDisk 132
-#define ESCHER_ShpInst_FlowChartMagneticDrum 133
-#define ESCHER_ShpInst_FlowChartDisplay 134
-#define ESCHER_ShpInst_FlowChartDelay 135
-#define ESCHER_ShpInst_TextPlainText 136
-#define ESCHER_ShpInst_TextStop 137
-#define ESCHER_ShpInst_TextTriangle 138
-#define ESCHER_ShpInst_TextTriangleInverted 139
-#define ESCHER_ShpInst_TextChevron 140
-#define ESCHER_ShpInst_TextChevronInverted 141
-#define ESCHER_ShpInst_TextRingInside 142
-#define ESCHER_ShpInst_TextRingOutside 143
-#define ESCHER_ShpInst_TextArchUpCurve 144
-#define ESCHER_ShpInst_TextArchDownCurve 145
-#define ESCHER_ShpInst_TextCircleCurve 146
-#define ESCHER_ShpInst_TextButtonCurve 147
-#define ESCHER_ShpInst_TextArchUpPour 148
-#define ESCHER_ShpInst_TextArchDownPour 149
-#define ESCHER_ShpInst_TextCirclePour 150
-#define ESCHER_ShpInst_TextButtonPour 151
-#define ESCHER_ShpInst_TextCurveUp 152
-#define ESCHER_ShpInst_TextCurveDown 153
-#define ESCHER_ShpInst_TextCascadeUp 154
-#define ESCHER_ShpInst_TextCascadeDown 155
-#define ESCHER_ShpInst_TextWave1 156
-#define ESCHER_ShpInst_TextWave2 157
-#define ESCHER_ShpInst_TextWave3 158
-#define ESCHER_ShpInst_TextWave4 159
-#define ESCHER_ShpInst_TextInflate 160
-#define ESCHER_ShpInst_TextDeflate 161
-#define ESCHER_ShpInst_TextInflateBottom 162
-#define ESCHER_ShpInst_TextDeflateBottom 163
-#define ESCHER_ShpInst_TextInflateTop 164
-#define ESCHER_ShpInst_TextDeflateTop 165
-#define ESCHER_ShpInst_TextDeflateInflate 166
+#define ESCHER_ShpInst_FlowChartInternalStorage 113
+#define ESCHER_ShpInst_FlowChartDocument 114
+#define ESCHER_ShpInst_FlowChartMultidocument 115
+#define ESCHER_ShpInst_FlowChartTerminator 116
+#define ESCHER_ShpInst_FlowChartPreparation 117
+#define ESCHER_ShpInst_FlowChartManualInput 118
+#define ESCHER_ShpInst_FlowChartManualOperation 119
+#define ESCHER_ShpInst_FlowChartConnector 120
+#define ESCHER_ShpInst_FlowChartPunchedCard 121
+#define ESCHER_ShpInst_FlowChartPunchedTape 122
+#define ESCHER_ShpInst_FlowChartSummingJunction 123
+#define ESCHER_ShpInst_FlowChartOr 124
+#define ESCHER_ShpInst_FlowChartCollate 125
+#define ESCHER_ShpInst_FlowChartSort 126
+#define ESCHER_ShpInst_FlowChartExtract 127
+#define ESCHER_ShpInst_FlowChartMerge 128
+#define ESCHER_ShpInst_FlowChartOfflineStorage 129
+#define ESCHER_ShpInst_FlowChartOnlineStorage 130
+#define ESCHER_ShpInst_FlowChartMagneticTape 131
+#define ESCHER_ShpInst_FlowChartMagneticDisk 132
+#define ESCHER_ShpInst_FlowChartMagneticDrum 133
+#define ESCHER_ShpInst_FlowChartDisplay 134
+#define ESCHER_ShpInst_FlowChartDelay 135
+#define ESCHER_ShpInst_TextPlainText 136
+#define ESCHER_ShpInst_TextStop 137
+#define ESCHER_ShpInst_TextTriangle 138
+#define ESCHER_ShpInst_TextTriangleInverted 139
+#define ESCHER_ShpInst_TextChevron 140
+#define ESCHER_ShpInst_TextChevronInverted 141
+#define ESCHER_ShpInst_TextRingInside 142
+#define ESCHER_ShpInst_TextRingOutside 143
+#define ESCHER_ShpInst_TextArchUpCurve 144
+#define ESCHER_ShpInst_TextArchDownCurve 145
+#define ESCHER_ShpInst_TextCircleCurve 146
+#define ESCHER_ShpInst_TextButtonCurve 147
+#define ESCHER_ShpInst_TextArchUpPour 148
+#define ESCHER_ShpInst_TextArchDownPour 149
+#define ESCHER_ShpInst_TextCirclePour 150
+#define ESCHER_ShpInst_TextButtonPour 151
+#define ESCHER_ShpInst_TextCurveUp 152
+#define ESCHER_ShpInst_TextCurveDown 153
+#define ESCHER_ShpInst_TextCascadeUp 154
+#define ESCHER_ShpInst_TextCascadeDown 155
+#define ESCHER_ShpInst_TextWave1 156
+#define ESCHER_ShpInst_TextWave2 157
+#define ESCHER_ShpInst_TextWave3 158
+#define ESCHER_ShpInst_TextWave4 159
+#define ESCHER_ShpInst_TextInflate 160
+#define ESCHER_ShpInst_TextDeflate 161
+#define ESCHER_ShpInst_TextInflateBottom 162
+#define ESCHER_ShpInst_TextDeflateBottom 163
+#define ESCHER_ShpInst_TextInflateTop 164
+#define ESCHER_ShpInst_TextDeflateTop 165
+#define ESCHER_ShpInst_TextDeflateInflate 166
#define ESCHER_ShpInst_TextDeflateInflateDeflate 167
-#define ESCHER_ShpInst_TextFadeRight 168
-#define ESCHER_ShpInst_TextFadeLeft 169
-#define ESCHER_ShpInst_TextFadeUp 170
-#define ESCHER_ShpInst_TextFadeDown 171
-#define ESCHER_ShpInst_TextSlantUp 172
-#define ESCHER_ShpInst_TextSlantDown 173
-#define ESCHER_ShpInst_TextCanUp 174
-#define ESCHER_ShpInst_TextCanDown 175
+#define ESCHER_ShpInst_TextFadeRight 168
+#define ESCHER_ShpInst_TextFadeLeft 169
+#define ESCHER_ShpInst_TextFadeUp 170
+#define ESCHER_ShpInst_TextFadeDown 171
+#define ESCHER_ShpInst_TextSlantUp 172
+#define ESCHER_ShpInst_TextSlantDown 173
+#define ESCHER_ShpInst_TextCanUp 174
+#define ESCHER_ShpInst_TextCanDown 175
#define ESCHER_ShpInst_FlowChartAlternateProcess 176
#define ESCHER_ShpInst_FlowChartOffpageConnector 177
-#define ESCHER_ShpInst_Callout90 178
-#define ESCHER_ShpInst_AccentCallout90 179
-#define ESCHER_ShpInst_BorderCallout90 180
-#define ESCHER_ShpInst_AccentBorderCallout90 181
-#define ESCHER_ShpInst_LeftRightUpArrow 182
-#define ESCHER_ShpInst_Sun 183
-#define ESCHER_ShpInst_Moon 184
-#define ESCHER_ShpInst_BracketPair 185
-#define ESCHER_ShpInst_BracePair 186
-#define ESCHER_ShpInst_Seal4 187
-#define ESCHER_ShpInst_DoubleWave 188
-#define ESCHER_ShpInst_ActionButtonBlank 189
-#define ESCHER_ShpInst_ActionButtonHome 190
-#define ESCHER_ShpInst_ActionButtonHelp 191
-#define ESCHER_ShpInst_ActionButtonInformation 192
-#define ESCHER_ShpInst_ActionButtonForwardNext 193
-#define ESCHER_ShpInst_ActionButtonBackPrevious 194
-#define ESCHER_ShpInst_ActionButtonEnd 195
-#define ESCHER_ShpInst_ActionButtonBeginning 196
-#define ESCHER_ShpInst_ActionButtonReturn 197
-#define ESCHER_ShpInst_ActionButtonDocument 198
-#define ESCHER_ShpInst_ActionButtonSound 199
-#define ESCHER_ShpInst_ActionButtonMovie 200
-#define ESCHER_ShpInst_HostControl 201
-#define ESCHER_ShpInst_TextBox 202
-
-#define ESCHER_ShpInst_COUNT 203
-#define ESCHER_ShpInst_Max 0x0FFF
-#define ESCHER_ShpInst_Nil ESCHER_ShpInst_Max
+#define ESCHER_ShpInst_Callout90 178
+#define ESCHER_ShpInst_AccentCallout90 179
+#define ESCHER_ShpInst_BorderCallout90 180
+#define ESCHER_ShpInst_AccentBorderCallout90 181
+#define ESCHER_ShpInst_LeftRightUpArrow 182
+#define ESCHER_ShpInst_Sun 183
+#define ESCHER_ShpInst_Moon 184
+#define ESCHER_ShpInst_BracketPair 185
+#define ESCHER_ShpInst_BracePair 186
+#define ESCHER_ShpInst_Seal4 187
+#define ESCHER_ShpInst_DoubleWave 188
+#define ESCHER_ShpInst_ActionButtonBlank 189
+#define ESCHER_ShpInst_ActionButtonHome 190
+#define ESCHER_ShpInst_ActionButtonHelp 191
+#define ESCHER_ShpInst_ActionButtonInformation 192
+#define ESCHER_ShpInst_ActionButtonForwardNext 193
+#define ESCHER_ShpInst_ActionButtonBackPrevious 194
+#define ESCHER_ShpInst_ActionButtonEnd 195
+#define ESCHER_ShpInst_ActionButtonBeginning 196
+#define ESCHER_ShpInst_ActionButtonReturn 197
+#define ESCHER_ShpInst_ActionButtonDocument 198
+#define ESCHER_ShpInst_ActionButtonSound 199
+#define ESCHER_ShpInst_ActionButtonMovie 200
+#define ESCHER_ShpInst_HostControl 201
+#define ESCHER_ShpInst_TextBox 202
+#define ESCHER_ShpInst_COUNT 203
+#define ESCHER_ShpInst_Max 0x0FFF
+#define ESCHER_ShpInst_Nil ESCHER_ShpInst_Max
enum ESCHER_BlibType
{ // GEL provided types...
@@ -356,11 +355,11 @@ enum ESCHER_wMode
//
enum ESCHER_ShapePath
{
- ESCHER_ShapeLines, // A line of straight segments
- ESCHER_ShapeLinesClosed, // A closed polygonal object
- ESCHER_ShapeCurves, // A line of Bezier curve segments
- ESCHER_ShapeCurvesClosed, // A closed shape with curved edges
- ESCHER_ShapeComplex // pSegmentInfo must be non-empty
+ ESCHER_ShapeLines, // A line of straight segments
+ ESCHER_ShapeLinesClosed, // A closed polygonal object
+ ESCHER_ShapeCurves, // A line of Bezier curve segments
+ ESCHER_ShapeCurvesClosed, // A closed shape with curved edges
+ ESCHER_ShapeComplex // pSegmentInfo must be non-empty
};
@@ -376,18 +375,18 @@ enum ESCHER_WrapMode
//
enum ESCHER_bwMode
{
- ESCHER_bwColor, // only used for predefined shades
- ESCHER_bwAutomatic, // depends on object type
- ESCHER_bwGrayScale, // shades of gray only
- ESCHER_bwLightGrayScale, // shades of light gray only
- ESCHER_bwInverseGray, // dark gray mapped to light gray, etc.
- ESCHER_bwGrayOutline, // pure gray and white
- ESCHER_bwBlackTextLine, // black text and lines, all else grayscale
- ESCHER_bwHighContrast, // pure black and white mode (no grays)
- ESCHER_bwBlack, // solid black
- ESCHER_bwWhite, // solid white
- ESCHER_bwDontShow, // object not drawn
- ESCHER_bwNumModes // number of Black and white modes
+ ESCHER_bwColor, // only used for predefined shades
+ ESCHER_bwAutomatic, // depends on object type
+ ESCHER_bwGrayScale, // shades of gray only
+ ESCHER_bwLightGrayScale, // shades of light gray only
+ ESCHER_bwInverseGray, // dark gray mapped to light gray, etc.
+ ESCHER_bwGrayOutline, // pure gray and white
+ ESCHER_bwBlackTextLine, // black text and lines, all else grayscale
+ ESCHER_bwHighContrast, // pure black and white mode (no grays)
+ ESCHER_bwBlack, // solid black
+ ESCHER_bwWhite, // solid white
+ ESCHER_bwDontShow, // object not drawn
+ ESCHER_bwNumModes // number of Black and white modes
};
@@ -444,10 +443,10 @@ enum ESCHER_txDir
// Callout Type
enum ESCHER_spcot
{
- ESCHER_spcotRightAngle = 1,
- ESCHER_spcotOneSegment = 2,
- ESCHER_spcotTwoSegment = 3,
- ESCHER_spcotThreeSegment = 4
+ ESCHER_spcotRightAngle = 1,
+ ESCHER_spcotOneSegment = 2,
+ ESCHER_spcotTwoSegment = 3,
+ ESCHER_spcotThreeSegment= 4
};
// Callout Angle
@@ -473,30 +472,25 @@ enum ESCHER_spcod
// FontWork alignment
enum ESCHER_GeoTextAlign
{
- ESCHER_AlignTextStretch, /* Stretch each line of text to fit width. */
- ESCHER_AlignTextCenter, /* Center text on width. */
- ESCHER_AlignTextLeft, /* Left justify. */
- ESCHER_AlignTextRight, /* Right justify. */
- ESCHER_AlignTextLetterJust, /* Spread letters out to fit width. */
- ESCHER_AlignTextWordJust, /* Spread words out to fit width. */
- ESCHER_AlignTextInvalid /* Invalid */
+ ESCHER_AlignTextStretch, // Stretch each line of text to fit width.
+ ESCHER_AlignTextCenter, // Center text on width.
+ ESCHER_AlignTextLeft, // Left justify.
+ ESCHER_AlignTextRight, // Right justify.
+ ESCHER_AlignTextLetterJust, // Spread letters out to fit width.
+ ESCHER_AlignTextWordJust, // Spread words out to fit width.
+ ESCHER_AlignTextInvalid // Invalid
};
// flags for pictures
enum ESCHER_BlipFlags
{
ESCHER_BlipFlagDefault = 0,
- ESCHER_BlipFlagComment = 0, // Blip name is a comment
- ESCHER_BlipFlagFile, // Blip name is a file name
- ESCHER_BlipFlagURL, // Blip name is a full URL
- ESCHER_BlipFlagType = 3, // Mask to extract type
+ ESCHER_BlipFlagComment = 0, // Blip name is a comment
+ ESCHER_BlipFlagFile, // Blip name is a file name
+ ESCHER_BlipFlagURL, // Blip name is a full URL
+ ESCHER_BlipFlagType = 3, // Mask to extract type
/* Or the following flags with any of the above. */
- ESCHER_BlipFlagDontSave = 4, // A "dont" is the depression in the metal
- // body work of an automobile caused when a
- // cyclist violently thrusts his or her nose
- // at it, thus a DontSave is another name for
- // a cycle lane.
- ESCHER_BlipFlagDoNotSave = 4, // For those who prefer English
+ ESCHER_BlipFlagDoNotSave = 4,
ESCHER_BlipFlagLinkToFile = 8
};
@@ -530,20 +524,20 @@ enum ESCHER_ShadowType
// - the type of a (length) measurement
enum ESCHER_dzType
{
- ESCHER_dzTypeMin = 0,
- ESCHER_dzTypeDefault = 0, // Default size, ignore the values
- ESCHER_dzTypeA = 1, // Values are in EMUs
- ESCHER_dzTypeV = 2, // Values are in pixels
- ESCHER_dzTypeShape = 3, // Values are 16.16 fractions of shape size
- ESCHER_dzTypeFixedAspect = 4, // Aspect ratio is fixed
- ESCHER_dzTypeAFixed = 5, // EMUs, fixed aspect ratio
- ESCHER_dzTypeVFixed = 6, // Pixels, fixed aspect ratio
- ESCHER_dzTypeShapeFixed = 7, // Proportion of shape, fixed aspect ratio
+ ESCHER_dzTypeMin = 0,
+ ESCHER_dzTypeDefault = 0, // Default size, ignore the values
+ ESCHER_dzTypeA = 1, // Values are in EMUs
+ ESCHER_dzTypeV = 2, // Values are in pixels
+ ESCHER_dzTypeShape = 3, // Values are 16.16 fractions of shape size
+ ESCHER_dzTypeFixedAspect = 4, // Aspect ratio is fixed
+ ESCHER_dzTypeAFixed = 5, // EMUs, fixed aspect ratio
+ ESCHER_dzTypeVFixed = 6, // Pixels, fixed aspect ratio
+ ESCHER_dzTypeShapeFixed = 7, // Proportion of shape, fixed aspect ratio
ESCHER_dzTypeFixedAspectEnlarge= 8, // Aspect ratio is fixed, favor larger size
- ESCHER_dzTypeAFixedBig = 9, // EMUs, fixed aspect ratio
- ESCHER_dzTypeVFixedBig = 10, // Pixels, fixed aspect ratio
- ESCHER_dzTypeShapeFixedBig= 11, // Proportion of shape, fixed aspect ratio
- ESCHER_dzTypeMax = 11
+ ESCHER_dzTypeAFixedBig = 9, // EMUs, fixed aspect ratio
+ ESCHER_dzTypeVFixedBig = 10, // Pixels, fixed aspect ratio
+ ESCHER_dzTypeShapeFixedBig= 11, // Proportion of shape, fixed aspect ratio
+ ESCHER_dzTypeMax = 11
};
// how to interpret the colors in a shaded fill.
@@ -571,36 +565,36 @@ enum ESCHER_ShadeType
// compound line style
enum ESCHER_LineStyle
{
- ESCHER_LineSimple, // Single line (of width lineWidth)
- ESCHER_LineDouble, // Double lines of equal width
- ESCHER_LineThickThin, // Double lines, one thick, one thin
- ESCHER_LineThinThick, // Double lines, reverse order
- ESCHER_LineTriple // Three lines, thin, thick, thin
+ ESCHER_LineSimple, // Single line (of width lineWidth)
+ ESCHER_LineDouble, // Double lines of equal width
+ ESCHER_LineThickThin, // Double lines, one thick, one thin
+ ESCHER_LineThinThick, // Double lines, reverse order
+ ESCHER_LineTriple // Three lines, thin, thick, thin
};
// how to "fill" the line contour
enum ESCHER_LineType
{
- ESCHER_lineSolidType, // Fill with a solid color
- ESCHER_linePattern, // Fill with a pattern (bitmap)
- ESCHER_lineTexture, // A texture (pattern with its own color map)
- ESCHER_linePicture // Center a picture in the shape
+ ESCHER_lineSolidType, // Fill with a solid color
+ ESCHER_linePattern, // Fill with a pattern (bitmap)
+ ESCHER_lineTexture, // A texture (pattern with its own color map)
+ ESCHER_linePicture // Center a picture in the shape
};
// dashed line style
enum ESCHER_LineDashing
{
- ESCHER_LineSolid, // Solid (continuous) pen
- ESCHER_LineDashSys, // PS_DASH system dash style
- ESCHER_LineDotSys, // PS_DOT system dash style
- ESCHER_LineDashDotSys, // PS_DASHDOT system dash style
- ESCHER_LineDashDotDotSys, // PS_DASHDOTDOT system dash style
- ESCHER_LineDotGEL, // square dot style
- ESCHER_LineDashGEL, // dash style
- ESCHER_LineLongDashGEL, // long dash style
- ESCHER_LineDashDotGEL, // dash short dash
- ESCHER_LineLongDashDotGEL, // long dash short dash
- ESCHER_LineLongDashDotDotGEL // long dash short dash short dash
+ ESCHER_LineSolid, // Solid (continuous) pen
+ ESCHER_LineDashSys, // PS_DASH system dash style
+ ESCHER_LineDotSys, // PS_DOT system dash style
+ ESCHER_LineDashDotSys, // PS_DASHDOT system dash style
+ ESCHER_LineDashDotDotSys, // PS_DASHDOTDOT system dash style
+ ESCHER_LineDotGEL, // square dot style
+ ESCHER_LineDashGEL, // dash style
+ ESCHER_LineLongDashGEL, // long dash style
+ ESCHER_LineDashDotGEL, // dash short dash
+ ESCHER_LineLongDashDotGEL, // long dash short dash
+ ESCHER_LineLongDashDotDotGEL // long dash short dash short dash
};
// line end effect
@@ -645,6 +639,7 @@ enum ESCHER_LineCap
ESCHER_LineEndCapSquare, // Square protrudes by half line width
ESCHER_LineEndCapFlat // Line ends at end point
};
+
// Shape Properties
// 1pt = 12700 EMU (English Metric Units)
// 1pt = 20 Twip = 20/1440" = 1/72"
@@ -1000,6 +995,7 @@ struct MSFILTER_DLLPUBLIC EscherExContainer
EscherExContainer( SvStream& rSt, const sal_uInt16 nRecType, const sal_uInt16 nInstance = 0 );
~EscherExContainer();
};
+
struct MSFILTER_DLLPUBLIC EscherExAtom
{
sal_uInt32 nContPos;
@@ -1011,15 +1007,17 @@ struct MSFILTER_DLLPUBLIC EscherExAtom
struct EscherPropertyValueHelper
{
- static sal_Bool GetPropertyValue(
- ::com::sun::star::uno::Any& rAny,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
- const String& rPropertyName,
- sal_Bool bTestPropertyAvailability = sal_False );
-
- static ::com::sun::star::beans::PropertyState GetPropertyState(
- const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > &,
- const String& rPropertyName );
+ static sal_Bool GetPropertyValue(
+ ::com::sun::star::uno::Any& rAny,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
+ const String& rPropertyName,
+ sal_Bool bTestPropertyAvailability = sal_False
+ );
+
+ static ::com::sun::star::beans::PropertyState GetPropertyState(
+ const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > &,
+ const String& rPropertyName
+ );
};
// ---------------------------------------------------------------------------------------------
@@ -1028,7 +1026,8 @@ struct EscherPersistEntry
{
sal_uInt32 mnID;
sal_uInt32 mnOffset;
- EscherPersistEntry( sal_uInt32 nId, sal_uInt32 nOffset ) { mnID = nId; mnOffset = nOffset; };
+
+ EscherPersistEntry( sal_uInt32 nId, sal_uInt32 nOffset ) { mnID = nId; mnOffset = nOffset; };
};
@@ -1037,37 +1036,41 @@ struct EscherPersistEntry
class EscherBlibEntry
{
- friend class EscherGraphicProvider;
- friend class EscherEx;
+ friend class EscherGraphicProvider;
+ friend class EscherEx;
- protected:
+protected:
- sal_uInt32 mnIdentifier[ 4 ];
- sal_uInt32 mnPictureOffset; // offset auf die grafik im PictureStreams
- sal_uInt32 mnSize; // size of real graphic
+ sal_uInt32 mnIdentifier[ 4 ];
+ sal_uInt32 mnPictureOffset; // offset auf die grafik im PictureStreams
+ sal_uInt32 mnSize; // size of real graphic
- sal_uInt32 mnRefCount; // !! reference count
- sal_uInt32 mnSizeExtra; // !! size of preceding header
+ sal_uInt32 mnRefCount; // !! reference count
+ sal_uInt32 mnSizeExtra; // !! size of preceding header
- ESCHER_BlibType meBlibType;
+ ESCHER_BlibType meBlibType;
- Size maPrefSize;
- MapMode maPrefMapMode;
+ Size maPrefSize;
+ MapMode maPrefMapMode;
- sal_Bool mbIsEmpty;
- sal_Bool mbIsNativeGraphicPossible;
+ sal_Bool mbIsEmpty;
+ sal_Bool mbIsNativeGraphicPossible;
- public:
+public:
- EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject& rObj,
- const ByteString& rId, const GraphicAttr* pAttr = NULL );
+ EscherBlibEntry(
+ sal_uInt32 nPictureOffset,
+ const GraphicObject& rObj,
+ const ByteString& rId,
+ const GraphicAttr* pAttr = NULL
+ );
- ~EscherBlibEntry();
+ ~EscherBlibEntry();
- void WriteBlibEntry( SvStream& rSt, sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0 );
- sal_Bool IsEmpty() const { return mbIsEmpty; };
+ void WriteBlibEntry( SvStream& rSt, sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0 );
+ sal_Bool IsEmpty() const { return mbIsEmpty; };
- sal_Bool operator==( const EscherBlibEntry& ) const;
+ sal_Bool operator==( const EscherBlibEntry& ) const;
};
// ---------------------------------------------------------------------------------------------
@@ -1077,55 +1080,72 @@ class EscherBlibEntry
class MSFILTER_DLLPUBLIC EscherGraphicProvider
{
- sal_uInt32 mnFlags;
+ sal_uInt32 mnFlags;
- EscherBlibEntry** mpBlibEntrys;
- sal_uInt32 mnBlibBufSize;
- sal_uInt32 mnBlibEntrys;
+ EscherBlibEntry** mpBlibEntrys;
+ sal_uInt32 mnBlibBufSize;
+ sal_uInt32 mnBlibEntrys;
- protected :
+protected:
- sal_uInt32 ImplInsertBlib( EscherBlibEntry* p_EscherBlibEntry );
+ sal_uInt32 ImplInsertBlib( EscherBlibEntry* p_EscherBlibEntry );
- public :
+public:
- sal_uInt32 GetBlibStoreContainerSize( SvStream* pMergePicStreamBSE = NULL ) const;
- void WriteBlibStoreContainer( SvStream& rStrm, SvStream* pMergePicStreamBSE = NULL );
- sal_Bool WriteBlibStoreEntry(SvStream& rStrm, sal_uInt32 nBlipId,
- sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0);
- sal_uInt32 GetBlibID( SvStream& rPicOutStream, const ByteString& rGraphicId, const Rectangle& rBoundRect,
- const com::sun::star::awt::Rectangle* pVisArea = NULL, const GraphicAttr* pGrafikAttr = NULL );
- sal_Bool HasGraphics() const { return mnBlibEntrys != 0; };
+ sal_uInt32 GetBlibStoreContainerSize( SvStream* pMergePicStreamBSE = NULL ) const;
+ void WriteBlibStoreContainer( SvStream& rStrm, SvStream* pMergePicStreamBSE = NULL );
+ sal_Bool WriteBlibStoreEntry(SvStream& rStrm, sal_uInt32 nBlipId,
+ sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0);
+ sal_uInt32 GetBlibID(
+ SvStream& rPicOutStream,
+ const ByteString& rGraphicId,
+ const Rectangle& rBoundRect,
+ const com::sun::star::awt::Rectangle* pVisArea = NULL,
+ const GraphicAttr* pGrafikAttr = NULL
+ );
+ sal_Bool HasGraphics() const { return mnBlibEntrys != 0; };
- void SetNewBlipStreamOffset( sal_Int32 nOffset );
+ void SetNewBlipStreamOffset( sal_Int32 nOffset );
- sal_Bool GetPrefSize( const sal_uInt32 nBlibId, Size& rSize, MapMode& rMapMode );
+ sal_Bool GetPrefSize( const sal_uInt32 nBlibId, Size& rSize, MapMode& rMapMode );
- EscherGraphicProvider( sal_uInt32 nFlags = _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
- ~EscherGraphicProvider();
+ EscherGraphicProvider( sal_uInt32 nFlags = _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
+ ~EscherGraphicProvider();
};
+class EscherShapeListEntry;
+typedef ::std::vector< EscherShapeListEntry* > EscherShapeList_impl;
+typedef ::std::vector< EscherConnectorListEntry* > EscherConnectorList_impl;
+
class MSFILTER_DLLPUBLIC EscherSolverContainer
{
- List maShapeList;
- List maConnectorList;
+ EscherShapeList_impl maShapeList;
+ EscherConnectorList_impl maConnectorList;
public:
- sal_uInt32 GetShapeId( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rShape ) const;
+ sal_uInt32 GetShapeId(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rShape
+ ) const;
+
+ void AddShape(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &,
+ sal_uInt32 nId
+ );
- void AddShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &, sal_uInt32 nId );
- void AddConnector( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &,
- const ::com::sun::star::awt::Point& rA,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &,
- const ::com::sun::star::awt::Point& rB,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConB );
+ void AddConnector(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &,
+ const ::com::sun::star::awt::Point& rA,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &,
+ const ::com::sun::star::awt::Point& rB,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConB
+ );
- void WriteSolver( SvStream& );
+ void WriteSolver( SvStream& );
- EscherSolverContainer(){};
- ~EscherSolverContainer();
+ EscherSolverContainer(){};
+ ~EscherSolverContainer();
};
// ---------------------------------------------------------------------------------------------
@@ -1149,129 +1169,197 @@ typedef std::vector< EscherPropSortStruct > EscherProperties;
class MSFILTER_DLLPUBLIC EscherPropertyContainer
{
- EscherGraphicProvider* pGraphicProvider;
- SvStream* pPicOutStrm;
- Rectangle* pShapeBoundRect;
-
- EscherPropSortStruct* pSortStruct;
-
- sal_uInt32 nSortCount;
- sal_uInt32 nSortBufSize;
- sal_uInt32 nCountCount;
- sal_uInt32 nCountSize;
-
- sal_Bool bHasComplexData;
- sal_Bool bSuppressRotation;
-
-
- sal_uInt32 ImplGetColor( const sal_uInt32 rColor, sal_Bool bSwap = sal_True );
- void ImplCreateGraphicAttributes( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- sal_uInt32 nBlibId, sal_Bool bCreateCroppingAttributes );
- sal_Bool ImplCreateEmbeddedBmp( const ByteString& rUniqueId );
- void ImplInit();
-
- public :
+ EscherGraphicProvider* pGraphicProvider;
+ SvStream* pPicOutStrm;
+ Rectangle* pShapeBoundRect;
- EscherPropertyContainer();
- EscherPropertyContainer(
- EscherGraphicProvider& rGraphicProvider, // the PropertyContainer needs to know
- SvStream* pPicOutStrm, // the GraphicProvider to be able to write
- Rectangle& rShapeBoundRect ); // FillBitmaps or GraphicObjects.
- // under some cirumstances the ShapeBoundRect is adjusted
- // this will happen when rotated GraphicObjects
- // are saved to PowerPoint
- ~EscherPropertyContainer();
+ EscherPropSortStruct* pSortStruct;
- void AddOpt( sal_uInt16 nPropertyID, const rtl::OUString& rString );
+ sal_uInt32 nSortCount;
+ sal_uInt32 nSortBufSize;
+ sal_uInt32 nCountCount;
+ sal_uInt32 nCountSize;
- void AddOpt( sal_uInt16 nPropertyID, sal_uInt32 nPropValue,
- sal_Bool bBlib = sal_False );
+ sal_Bool bHasComplexData;
+ sal_Bool bSuppressRotation;
- void AddOpt( sal_uInt16 nPropertyID, sal_Bool bBlib, sal_uInt32 nPropValue,
- sal_uInt8* pProp, sal_uInt32 nPropSize );
- sal_Bool GetOpt( sal_uInt16 nPropertyID, sal_uInt32& rPropValue ) const;
+ sal_uInt32 ImplGetColor( const sal_uInt32 rColor, sal_Bool bSwap = sal_True );
+ void ImplCreateGraphicAttributes(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ sal_uInt32 nBlibId,
+ sal_Bool bCreateCroppingAttributes
+ );
+ sal_Bool ImplCreateEmbeddedBmp( const ByteString& rUniqueId );
+ void ImplInit();
- sal_Bool GetOpt( sal_uInt16 nPropertyID, EscherPropSortStruct& rPropValue ) const;
-
- EscherProperties GetOpts() const;
-
- void Commit( SvStream& rSt, sal_uInt16 nVersion = 3, sal_uInt16 nRecType = ESCHER_OPT );
-
- sal_Bool CreateShapeProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
- sal_Bool CreateOLEGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXOleObject );
+public:
- /** Creates a complex ESCHER_Prop_fillBlip containing the BLIP directly (for Excel charts). */
- sal_Bool CreateEmbeddedBitmapProperties( const ::rtl::OUString& rBitmapUrl,
- ::com::sun::star::drawing::BitmapMode eBitmapMode );
- /** Creates a complex ESCHER_Prop_fillBlip containing a hatch style (for Excel charts). */
- sal_Bool CreateEmbeddedHatchProperties( const ::com::sun::star::drawing::Hatch& rHatch,
- const Color& rBackColor, bool bFillBackground );
+ EscherPropertyContainer();
+ EscherPropertyContainer(
+ EscherGraphicProvider& rGraphicProvider, // the PropertyContainer needs to know
+ SvStream* pPicOutStrm, // the GraphicProvider to be able to write
+ Rectangle& rShapeBoundRect // FillBitmaps or GraphicObjects.
+ ); // under some circumstances the ShapeBoundRect
+ // is adjusted this will happen when rotated
+ // GraphicObjects are saved to PowerPoint
+ ~EscherPropertyContainer();
+
+ void AddOpt( sal_uInt16 nPropertyID, const rtl::OUString& rString );
+
+ void AddOpt(
+ sal_uInt16 nPropertyID,
+ sal_uInt32 nPropValue,
+ sal_Bool bBlib = sal_False
+ );
+
+ void AddOpt(
+ sal_uInt16 nPropertyID,
+ sal_Bool bBlib,
+ sal_uInt32 nPropValue,
+ sal_uInt8* pProp,
+ sal_uInt32 nPropSize
+ );
+
+ sal_Bool GetOpt( sal_uInt16 nPropertyID, sal_uInt32& rPropValue ) const;
+
+ sal_Bool GetOpt( sal_uInt16 nPropertyID, EscherPropSortStruct& rPropValue ) const;
+
+ EscherProperties GetOpts() const;
+
+ void Commit( SvStream& rSt, sal_uInt16 nVersion = 3, sal_uInt16 nRecType = ESCHER_OPT );
+
+ sal_Bool CreateShapeProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape
+ );
+ sal_Bool CreateOLEGraphicProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXOleObject
+ );
+
+ /** Creates a complex ESCHER_Prop_fillBlip containing the BLIP directly (for Excel charts). */
+ sal_Bool CreateEmbeddedBitmapProperties(
+ const ::rtl::OUString& rBitmapUrl,
+ ::com::sun::star::drawing::BitmapMode eBitmapMode
+ );
+ /** Creates a complex ESCHER_Prop_fillBlip containing a hatch style (for Excel charts). */
+ sal_Bool CreateEmbeddedHatchProperties(
+ const ::com::sun::star::drawing::Hatch& rHatch,
+ const Color& rBackColor,
+ bool bFillBackground
+ );
// the GraphicProperties will only be created if a GraphicProvider and PicOutStrm is known
// DR: #99897# if no GraphicProvider is present, a complex ESCHER_Prop_fillBlip
// will be created, containing the BLIP directly (e.g. for Excel charts).
- sal_Bool CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- const String& rSource, const sal_Bool bCreateFillBitmap, const sal_Bool bCreateCroppingAttributes = sal_False,
- const sal_Bool bFillBitmapModeAllowed = sal_True );
-
- sal_Bool CreatePolygonProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- sal_uInt32 nFlags, sal_Bool bBezier, ::com::sun::star::awt::Rectangle& rGeoRect, Polygon* pPolygon = NULL );
-
- static sal_uInt32 GetGradientColor( const ::com::sun::star::awt::Gradient* pGradient, sal_uInt32 nStartColor );
-
- void CreateGradientProperties( const ::com::sun::star::awt::Gradient & rGradient );
- void CreateGradientProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & );
- void CreateLineProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge );
- void CreateFillProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge );
- void CreateTextProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_uInt32 nText,
- const sal_Bool bIsCustomShape = sal_False, const sal_Bool bIsTextFrame = sal_True );
-
- sal_Bool CreateConnectorProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
- EscherSolverContainer& rSolver, ::com::sun::star::awt::Rectangle& rGeoRect,
- sal_uInt16& rShapeType, sal_uInt16& rShapeFlags );
-
- // Because shadow properties depends to the line and fillstyle, the CreateShadowProperties method should be called at last.
- // It activ only when at least a FillStyle or LineStyle is set.
- sal_Bool CreateShadowProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & );
+ sal_Bool CreateGraphicProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ const String& rSource,
+ const sal_Bool bCreateFillBitmap,
+ const sal_Bool bCreateCroppingAttributes = sal_False,
+ const sal_Bool bFillBitmapModeAllowed = sal_True
+ );
+
+ sal_Bool CreatePolygonProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ sal_uInt32 nFlags,
+ sal_Bool bBezier,
+ ::com::sun::star::awt::Rectangle& rGeoRect,
+ Polygon* pPolygon = NULL
+ );
+
+ static sal_uInt32 GetGradientColor(
+ const ::com::sun::star::awt::Gradient* pGradient,
+ sal_uInt32 nStartColor
+ );
+
+ void CreateGradientProperties( const ::com::sun::star::awt::Gradient & rGradient );
+ void CreateGradientProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &
+ );
+ void CreateLineProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
+ sal_Bool bEdge
+ );
+ void CreateFillProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge );
+ void CreateTextProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
+ sal_uInt32 nText,
+ const sal_Bool bIsCustomShape = sal_False,
+ const sal_Bool bIsTextFrame = sal_True
+ );
+
+ sal_Bool CreateConnectorProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
+ EscherSolverContainer& rSolver,
+ ::com::sun::star::awt::Rectangle& rGeoRect,
+ sal_uInt16& rShapeType,
+ sal_uInt16& rShapeFlags
+ );
+
+ // Because shadow properties depends to the line and fillstyle, the CreateShadowProperties method should be called at last.
+ // It activ only when at least a FillStyle or LineStyle is set.
+ sal_Bool CreateShadowProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &
+ );
// creates all necessary CustomShape properties, this includes also Text-, Shadow-, Fill-, and LineProperties
- void CreateCustomShapeProperties( const MSO_SPT eShapeType, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & );
- sal_Bool IsFontWork() const;
-
- // helper functions which are also used by the escher import
- static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
- static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Any& rSource );
- static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags );
- static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags, rtl::OUString& rShapeType );
+ void CreateCustomShapeProperties(
+ const MSO_SPT eShapeType,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &
+ );
+ sal_Bool IsFontWork() const;
+
+ // helper functions which are also used by the escher import
+ static PolyPolygon GetPolyPolygon(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape
+ );
+ static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Any& rSource );
+ static MSO_SPT GetCustomShapeType(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
+ sal_uInt32& nMirrorFlags
+ );
+ static MSO_SPT GetCustomShapeType(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
+ sal_uInt32& nMirrorFlags,
+ rtl::OUString& rShapeType
+ );
// helper functions which are also used in ooxml export
- static sal_Bool GetLineArrow( const sal_Bool bLineStart,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth );
- static sal_Bool IsDefaultObject( SdrObjCustomShape* pCustoShape );
- static void LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted );
- static sal_Bool GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue );
+ static sal_Bool GetLineArrow(
+ const sal_Bool bLineStart,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ ESCHER_LineEnd& reLineEnd,
+ sal_Int32& rnArrowLength,
+ sal_Int32& rnArrowWidth
+ );
+ static sal_Bool IsDefaultObject( SdrObjCustomShape* pCustoShape );
+ static void LookForPolarHandles(
+ const MSO_SPT eShapeType,
+ sal_Int32& nAdjustmentsWhichNeedsToBeConverted
+ );
+ static sal_Bool GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue );
};
// ---------------------------------------------------------------------------------------------
+typedef ::std::vector< EscherPersistEntry* > EscherPersistTable_impl;
+
class MSFILTER_DLLPUBLIC EscherPersistTable
{
- public:
- List maPersistTable;
+public:
+ EscherPersistTable_impl maPersistTable;
- sal_Bool PtIsID( sal_uInt32 nID );
- void PtInsert( sal_uInt32 nID, sal_uInt32 nOfs );
- sal_uInt32 PtDelete( sal_uInt32 nID );
- sal_uInt32 PtGetOffsetByID( sal_uInt32 nID );
- sal_uInt32 PtReplace( sal_uInt32 nID, sal_uInt32 nOfs );
- sal_uInt32 PtReplaceOrInsert( sal_uInt32 nID, sal_uInt32 nOfs );
- sal_uInt32 PtGetCount() const { return maPersistTable.Count(); };
+ sal_Bool PtIsID( sal_uInt32 nID );
+ void PtInsert( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtDelete( sal_uInt32 nID );
+ sal_uInt32 PtGetOffsetByID( sal_uInt32 nID );
+ sal_uInt32 PtReplace( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtReplaceOrInsert( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtGetCount() const { return maPersistTable.size(); };
EscherPersistTable();
- virtual ~EscherPersistTable();
+ virtual ~EscherPersistTable();
};
// ---------------------------------------------------------------------------------------------
@@ -1311,6 +1399,7 @@ class InteractionInfo
bool mbHasInteraction;
std::auto_ptr<SvMemoryStream> mpHyperlinkRecord;
InteractionInfo();
+
public:
InteractionInfo( SvMemoryStream* pStream, bool bInteraction ) : mbHasInteraction( bInteraction )
{
@@ -1489,8 +1578,7 @@ public:
/** Returns the graphic provider from the global object that has been
passed to the constructor.
*/
- inline EscherGraphicProvider&
- GetGraphicProvider() { return *mxGlobal; }
+ inline EscherGraphicProvider& GetGraphicProvider() { return *mxGlobal; }
/** Called if a picture shall be written and no picture stream is set at
class ImplEscherExSdr.
@@ -1522,19 +1610,19 @@ public:
current stream position are always expanded to include the inserted
data.
*/
- void InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom );
+ void InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom );
- void InsertPersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset ); // Es wird nicht geprueft, ob sich jener schluessel schon in der PersistantTable befindet
- void ReplacePersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset );
- sal_uInt32 GetPersistOffset( sal_uInt32 nKey );
- sal_Bool SeekToPersistOffset( sal_uInt32 nKey );
- virtual sal_Bool InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
+ void InsertPersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset ); // Es wird nicht geprueft, ob sich jener schluessel schon in der PersistantTable befindet
+ void ReplacePersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset );
+ sal_uInt32 GetPersistOffset( sal_uInt32 nKey );
+ sal_Bool SeekToPersistOffset( sal_uInt32 nKey );
+ virtual sal_Bool InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
// aktuelle StreamPosition aendert
- SvStream& GetStream() const { return *mpOutStrm; }
- sal_uLong GetStreamPos() const { return mpOutStrm->Tell(); }
+ SvStream& GetStream() const { return *mpOutStrm; }
+ sal_uLong GetStreamPos() const { return mpOutStrm->Tell(); }
- virtual sal_Bool SeekBehindRecHeader( sal_uInt16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen
+ virtual sal_Bool SeekBehindRecHeader( sal_uInt16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen
// features beim erzeugen folgender Container:
//
@@ -1543,42 +1631,42 @@ public:
// ESCHER_SpgrContainer:
// ESCHER_SpContainer:
- virtual void OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance = 0 );
- virtual void CloseContainer();
+ virtual void OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance = 0 );
+ virtual void CloseContainer();
- virtual void BeginAtom();
- virtual void EndAtom( sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
- virtual void AddAtom( sal_uInt32 nAtomSitze, sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
- virtual void AddChildAnchor( const Rectangle& rRectangle );
- virtual void AddClientAnchor( const Rectangle& rRectangle );
+ virtual void BeginAtom();
+ virtual void EndAtom( sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void AddAtom( sal_uInt32 nAtomSitze, sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void AddChildAnchor( const Rectangle& rRectangle );
+ virtual void AddClientAnchor( const Rectangle& rRectangle );
- virtual sal_uInt32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
- sal_uInt32 EnterGroup( const Rectangle* pBoundRect = NULL );
- sal_uInt32 GetGroupLevel() const { return mnGroupLevel; };
- virtual sal_Bool SetGroupSnapRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
- virtual sal_Bool SetGroupLogicRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
- virtual void LeaveGroup();
+ virtual sal_uInt32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
+ sal_uInt32 EnterGroup( const Rectangle* pBoundRect = NULL );
+ sal_uInt32 GetGroupLevel() const { return mnGroupLevel; };
+ virtual sal_Bool SetGroupSnapRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
+ virtual sal_Bool SetGroupLogicRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
+ virtual void LeaveGroup();
// ein ESCHER_Sp wird geschrieben ( Ein ESCHER_DgContainer muss dazu geoeffnet sein !!)
- virtual void AddShape( sal_uInt32 nShpInstance, sal_uInt32 nFlagIds, sal_uInt32 nShapeID = 0 );
+ virtual void AddShape( sal_uInt32 nShpInstance, sal_uInt32 nFlagIds, sal_uInt32 nShapeID = 0 );
- virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
+ virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
- sal_uInt32 GetColor( const sal_uInt32 nColor, sal_Bool bSwap = sal_True );
- sal_uInt32 GetColor( const Color& rColor, sal_Bool bSwap = sal_True );
+ sal_uInt32 GetColor( const sal_uInt32 nColor, sal_Bool bSwap = sal_True );
+ sal_uInt32 GetColor( const Color& rColor, sal_Bool bSwap = sal_True );
// ...Sdr... implemented in eschesdo.cxx
- void AddSdrPage( const SdrPage& rPage );
- void AddUnoShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
+ void AddSdrPage( const SdrPage& rPage );
+ void AddUnoShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
/// returns the ShapeID
- sal_uInt32 AddSdrObject( const SdrObject& rObj );
+ sal_uInt32 AddSdrObject( const SdrObject& rObj );
/// If objects are written through AddSdrObject the
/// SolverContainer has to be written, and maybe some
/// maintenance to be done.
- void EndSdrObjectPage();
+ void EndSdrObjectPage();
/// Called before a shape is written, application supplies
/// ClientRecords. May set AppData::bDontWriteShape so the
diff --git a/filter/inc/filter/msfilter/msdffimp.hxx b/filter/inc/filter/msfilter/msdffimp.hxx
index 81b4403f3938..e51791ec5b6c 100644
--- a/filter/inc/filter/msfilter/msdffimp.hxx
+++ b/filter/inc/filter/msfilter/msdffimp.hxx
@@ -44,6 +44,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <filter/msfilter/msfilterdllapi.h>
#include <sot/storage.hxx>
+#include <vector>
class Graphic;
class SvStream;
@@ -66,7 +67,7 @@ class MSFILTER_DLLPUBLIC DffRecordHeader
{
public:
- sal_uInt8 nRecVer; // may be DFF_PSFLAG_CONTAINER
+ sal_uInt8 nRecVer; // may be DFF_PSFLAG_CONTAINER
sal_uInt16 nRecInstance;
sal_uInt16 nImpVerInst;
sal_uInt16 nRecType;
@@ -74,12 +75,23 @@ public:
sal_uLong nFilePos;
public:
DffRecordHeader() : nRecVer(0), nRecInstance(0), nImpVerInst(0), nRecType(0), nRecLen(0), nFilePos(0) {}
- bool IsContainer() const { return nRecVer == DFF_PSFLAG_CONTAINER; }
- sal_uLong GetRecBegFilePos() const { return nFilePos; }
- sal_uLong GetRecEndFilePos() const { return nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; }
- void SeekToEndOfRecord(SvStream& rIn) const { rIn.Seek(nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen ); }
- void SeekToContent( SvStream& rIn) const { rIn.Seek(nFilePos + DFF_COMMON_RECORD_HEADER_SIZE ); }
- void SeekToBegOfRecord(SvStream& rIn) const { rIn.Seek( nFilePos ); }
+ bool IsContainer() const { return nRecVer == DFF_PSFLAG_CONTAINER; }
+ sal_uLong GetRecBegFilePos() const { return nFilePos; }
+ sal_uLong GetRecEndFilePos() const { return nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; }
+ bool SeekToEndOfRecord(SvStream& rIn) const
+ {
+ sal_Size nPos = nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen;
+ return nPos == rIn.Seek(nPos);
+ }
+ bool SeekToContent(SvStream& rIn) const
+ {
+ sal_Size nPos = nFilePos + DFF_COMMON_RECORD_HEADER_SIZE;
+ return nPos == rIn.Seek(nPos);
+ }
+ bool SeekToBegOfRecord(SvStream& rIn) const
+ {
+ return nFilePos == rIn.Seek(nFilePos);
+ }
MSFILTER_DLLPUBLIC friend SvStream& operator>>(SvStream& rIn, DffRecordHeader& rRec);
@@ -97,28 +109,31 @@ class SvxMSDffManager;
class MSFILTER_DLLPUBLIC DffPropSet : public Table
{
- protected :
+protected:
- sal_uInt32 mpContents[ 1024 ];
- DffPropFlags mpFlags[ 1024 ];
+ sal_uInt32 mpContents[ 1024 ];
+ DffPropFlags mpFlags[ 1024 ];
- public :
+public:
- DffPropSet( sal_Bool bInitialize = sal_False ){ if ( bInitialize )
- memset( mpFlags, 0, 0x400 * sizeof( DffPropFlags ) ); };
-
- inline sal_Bool IsProperty( sal_uInt32 nRecType ) const { return ( mpFlags[ nRecType & 0x3ff ].bSet ); };
- sal_Bool IsHardAttribute( sal_uInt32 nId ) const;
- sal_uInt32 GetPropertyValue( sal_uInt32 nId, sal_uInt32 nDefault = 0 ) const;
- /** Returns a boolean property by its real identifier. */
- bool GetPropertyBool( sal_uInt32 nId, bool bDefault = false ) const;
- /** Returns a string property. */
- ::rtl::OUString GetPropertyString( sal_uInt32 nId, SvStream& rStrm ) const;
- void SetPropertyValue( sal_uInt32 nId, sal_uInt32 nValue ) const;
- sal_Bool SeekToContent( sal_uInt32 nRecType, SvStream& rSt ) const;
- void Merge( DffPropSet& rMasterPropSet ) const;
- void InitializePropSet() const;
- friend SvStream& operator>>( SvStream& rIn, DffPropSet& rPropSet );
+ DffPropSet( sal_Bool bInitialize = sal_False )
+ {
+ if ( bInitialize )
+ memset( mpFlags, 0, 0x400 * sizeof( DffPropFlags ) );
+ };
+
+ inline sal_Bool IsProperty( sal_uInt32 nRecType ) const { return ( mpFlags[ nRecType & 0x3ff ].bSet ); };
+ sal_Bool IsHardAttribute( sal_uInt32 nId ) const;
+ sal_uInt32 GetPropertyValue( sal_uInt32 nId, sal_uInt32 nDefault = 0 ) const;
+ /** Returns a boolean property by its real identifier. */
+ bool GetPropertyBool( sal_uInt32 nId, bool bDefault = false ) const;
+ /** Returns a string property. */
+ ::rtl::OUString GetPropertyString( sal_uInt32 nId, SvStream& rStrm ) const;
+ void SetPropertyValue( sal_uInt32 nId, sal_uInt32 nValue ) const;
+ sal_Bool SeekToContent( sal_uInt32 nRecType, SvStream& rSt ) const;
+ void Merge( DffPropSet& rMasterPropSet ) const;
+ void InitializePropSet() const;
+ friend SvStream& operator>>( SvStream& rIn, DffPropSet& rPropSet );
};
class SfxItemSet;
@@ -215,17 +230,20 @@ struct SvxMSDffConnectorRule
sal_uInt32 nSpFlagsA; // SpFlags of shape A ( the original mirror flags must be known when solving the Solver Container )
sal_uInt32 nSpFlagsB; // SpFlags of shape A
- SdrObject* pAObj; // pPtr of object ( corresponding to shape A )
- SdrObject* pBObj; // "
- SdrObject* pCObj; // " of connector object
+ SdrObject* pAObj; // pPtr of object ( corresponding to shape A )
+ SdrObject* pBObj; // "
+ SdrObject* pCObj; // " of connector object
SvxMSDffConnectorRule() : nSpFlagsA( 0 ), nSpFlagsB( 0 ), pAObj( NULL ), pBObj( NULL ), pCObj( NULL ) {};
friend SvStream& operator>>( SvStream& rIn, SvxMSDffConnectorRule& rAtom );
};
+
+typedef ::std::vector< SvxMSDffConnectorRule* > SvxMSDffConnectorRuleList;
+
struct MSFILTER_DLLPUBLIC SvxMSDffSolverContainer
{
- List aCList;
+ SvxMSDffConnectorRuleList aCList;
SvxMSDffSolverContainer();
~SvxMSDffSolverContainer();
@@ -258,11 +276,11 @@ struct MSFILTER_DLLPUBLIC SvxMSDffImportRec
{
static const int RELTO_DEFAULT = 2;
- SdrObject* pObj;
- Polygon* pWrapPolygon;
- char* pClientAnchorBuffer;
+ SdrObject* pObj;
+ Polygon* pWrapPolygon;
+ char* pClientAnchorBuffer;
sal_uInt32 nClientAnchorLen;
- char* pClientDataBuffer;
+ char* pClientDataBuffer;
sal_uInt32 nClientDataLen;
sal_uInt32 nXAlign;
sal_uInt32 *pXRelTo;
@@ -270,24 +288,24 @@ struct MSFILTER_DLLPUBLIC SvxMSDffImportRec
sal_uInt32 *pYRelTo;
sal_uInt32 nLayoutInTableCell;
sal_uInt32 nFlags;
- long nTextRotationAngle;
- long nDxTextLeft; // Abstand der Textbox vom umgebenden Shape
- long nDyTextTop;
- long nDxTextRight;
- long nDyTextBottom;
- long nDxWrapDistLeft;
- long nDyWrapDistTop;
- long nDxWrapDistRight;
- long nDyWrapDistBottom;
- long nCropFromTop;
- long nCropFromBottom;
- long nCropFromLeft;
- long nCropFromRight;
- MSDffTxId aTextId; // Kennungen fuer Textboxen
+ long nTextRotationAngle;
+ long nDxTextLeft; // Abstand der Textbox vom umgebenden Shape
+ long nDyTextTop;
+ long nDxTextRight;
+ long nDyTextBottom;
+ long nDxWrapDistLeft;
+ long nDyWrapDistTop;
+ long nDxWrapDistRight;
+ long nDyWrapDistBottom;
+ long nCropFromTop;
+ long nCropFromBottom;
+ long nCropFromLeft;
+ long nCropFromRight;
+ MSDffTxId aTextId; // Kennungen fuer Textboxen
sal_uLong nNextShapeId; // fuer verlinkte Textboxen
sal_uLong nShapeId;
- MSO_SPT eShapeType;
- MSO_LineStyle eLineStyle; // Umrandungs-Arten
+ MSO_SPT eShapeType;
+ MSO_LineStyle eLineStyle; // Umrandungs-Arten
MSO_LineDashing eLineDashing;
sal_Bool bDrawHell :1;
sal_Bool bHidden :1;
@@ -303,11 +321,13 @@ struct MSFILTER_DLLPUBLIC SvxMSDffImportRec
~SvxMSDffImportRec();
sal_Bool operator==( const SvxMSDffImportRec& rEntry ) const
{ return nShapeId == rEntry.nShapeId; }
+
sal_Bool operator<( const SvxMSDffImportRec& rEntry ) const
{ return nShapeId < rEntry.nShapeId; }
private:
SvxMSDffImportRec &operator=(const SvxMSDffImportRec&);
};
+
typedef SvxMSDffImportRec* MSDffImportRec_Ptr;
// Liste aller SvxMSDffImportRec fuer eine Gruppe
@@ -345,8 +365,8 @@ struct DffObjData
Rectangle aBoundRect;
Rectangle aChildAnchor;
- sal_uInt32 nShapeId;
- sal_uInt32 nSpFlags;
+ sal_uInt32 nShapeId;
+ sal_uInt32 nSpFlags;
MSO_SPT eShapeType;
sal_Bool bShapeType : 1;
@@ -379,15 +399,15 @@ struct DffObjData
struct DffRecordList
{
- sal_uInt32 nCount;
- sal_uInt32 nCurrent;
- DffRecordList* pPrev;
- DffRecordList* pNext;
+ sal_uInt32 nCount;
+ sal_uInt32 nCurrent;
+ DffRecordList* pPrev;
+ DffRecordList* pNext;
- DffRecordHeader mHd[ DFF_RECORD_MANAGER_BUF_SIZE ];
+ DffRecordHeader mHd[ DFF_RECORD_MANAGER_BUF_SIZE ];
- DffRecordList( DffRecordList* pList );
- ~DffRecordList();
+ DffRecordList( DffRecordList* pList );
+ ~DffRecordList();
};
enum DffSeekToContentMode
@@ -406,7 +426,7 @@ class MSFILTER_DLLPUBLIC DffRecordManager : public DffRecordList
void Clear();
void Consume( SvStream& rIn, sal_Bool bAppend = sal_False, sal_uInt32 nStOfs = 0 );
- sal_Bool SeekToContent( SvStream& rIn, sal_uInt16 nRecType, DffSeekToContentMode eMode = SEEK_FROM_BEGINNING );
+ sal_Bool SeekToContent( SvStream& rIn, sal_uInt16 nRecType, DffSeekToContentMode eMode = SEEK_FROM_BEGINNING );
DffRecordHeader* GetRecordHeader( sal_uInt16 nRecType, DffSeekToContentMode eMode = SEEK_FROM_BEGINNING );
DffRecordManager();
@@ -437,23 +457,23 @@ class MSFILTER_DLLPUBLIC SvxMSDffManager : public DffPropertyReader
SvxMSDffBLIPInfos* pBLIPInfos;
SvxMSDffShapeInfos* pShapeInfos;
SvxMSDffShapeOrders* pShapeOrders;
- sal_uLong nDefaultFontHeight;
- long nOffsDgg;
- sal_uInt16 nBLIPCount;
- sal_uInt16 nShapeCount;
+ sal_uLong nDefaultFontHeight;
+ sal_uInt32 nOffsDgg;
+ sal_uInt16 nBLIPCount;
+ sal_uInt16 nShapeCount;
sal_uInt32 nGroupShapeFlags;
void CheckTxBxStoryChain();
- void GetFidclData( long nOffsDgg );
+ void GetFidclData(sal_uInt32 nOffsDgg);
protected :
- String maBaseURL;
- sal_uInt32 mnCurMaxShapeId; // we need this information to
- sal_uInt32 mnDrawingsSaved; // access the right drawing
- sal_uInt32 mnIdClusters; // while only knowing the shapeid
- FIDCL* mpFidcls;
- Table maDgOffsetTable; // array of fileoffsets
+ String maBaseURL;
+ sal_uInt32 mnCurMaxShapeId; // we need this information to
+ sal_uInt32 mnDrawingsSaved; // access the right drawing
+ sal_uInt32 mnIdClusters; // while only knowing the shapeid
+ FIDCL* mpFidcls;
+ Table maDgOffsetTable; // array of fileoffsets
friend class DffPropertyReader;
@@ -470,16 +490,16 @@ protected :
long nEmuDiv;
long nPntMul;
long nPntDiv;
- bool bNeedMap;
- sal_uInt32 nSvxMSDffSettings;
- sal_uInt32 nSvxMSDffOLEConvFlags;
+ bool bNeedMap;
+ sal_uInt32 nSvxMSDffSettings;
+ sal_uInt32 nSvxMSDffOLEConvFlags;
/** stores a reference to an imported SdrObject with its shape id if
it has one
*/
SvxMSDffShapeIdContainer maShapeIdContainer;
- void GetCtrlData( long nOffsDgg );
+ void GetCtrlData(sal_uInt32 nOffsDgg);
void GetDrawingGroupContainerData( SvStream& rSt,
sal_uLong nLenDgg );
// #156763#
@@ -522,9 +542,9 @@ protected :
/*
folgende Methoden sind zum Excel-Import zu ueberschreiben:
*/
- virtual sal_Bool ProcessClientAnchor(SvStream& rStData, sal_uLong nDatLen, char*& rpBuff, sal_uInt32& rBuffLen ) const;
+ virtual sal_Bool ProcessClientAnchor(SvStream& rStData, sal_uInt32 nDatLen, char*& rpBuff, sal_uInt32& rBuffLen ) const;
virtual void ProcessClientAnchor2( SvStream& rStData, DffRecordHeader& rHd, void* pData, DffObjData& );
- virtual sal_Bool ProcessClientData( SvStream& rStData, sal_uLong nDatLen, char*& rpBuff, sal_uInt32& rBuffLen ) const;
+ virtual sal_Bool ProcessClientData( SvStream& rStData, sal_uInt32 nDatLen, char*& rpBuff, sal_uInt32& rBuffLen ) const;
virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, Rectangle& rTextRect, SdrObject* pObj = NULL);
virtual sal_uLong Calc_nBLIPPos( sal_uLong nOrgVal, sal_uLong nStreamPos ) const;
virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
@@ -601,7 +621,7 @@ public:
*/
SvxMSDffManager( SvStream& rStCtrl,
const String& rBaseURL,
- long nOffsDgg,
+ sal_uInt32 nOffsDgg,
SvStream* pStData,
SdrModel* pSdrModel_ = 0,
long nApplicationScale = 0,
@@ -613,7 +633,7 @@ public:
// in PPT werden die Parameter DGGContainerOffset und PicStream
// mit Hilfe einer Init Routine Uebergeben.
SvxMSDffManager( SvStream& rStCtrl, const String& rBaseURL, MSFilterTracer* pTracer );
- void InitSvxMSDffManager( long nOffsDgg_, SvStream* pStData_, sal_uInt32 nSvxMSDffOLEConvFlags );
+ void InitSvxMSDffManager(sal_uInt32 nOffsDgg_, SvStream* pStData_, sal_uInt32 nSvxMSDffOLEConvFlags);
void SetDgContainer( SvStream& rSt );
virtual ~SvxMSDffManager();
@@ -729,16 +749,16 @@ public:
return pShapeOrders;
}
- void StoreShapeOrder(sal_uLong nId,
- sal_uLong nTxBx,
+ void StoreShapeOrder(sal_uLong nId,
+ sal_uLong nTxBx,
SdrObject* pObject,
SwFlyFrmFmt* pFly = 0,
short nHdFtSection = 0) const;
- void ExchangeInShapeOrder(SdrObject* pOldObject,
- sal_uLong nTxBx,
- SwFlyFrmFmt* pFly,
- SdrObject* pObject) const;
+ void ExchangeInShapeOrder(SdrObject* pOldObject,
+ sal_uLong nTxBx,
+ SwFlyFrmFmt* pFly,
+ SdrObject* pObject) const;
void RemoveFromShapeOrder( SdrObject* pObject ) const;
@@ -762,9 +782,10 @@ public:
static sal_Bool SetPropValue(
const ::com::sun::star::uno::Any& rAny,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- const String& rPropertyName,
- sal_Bool bTestPropertyAvailability = sal_False );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ const String& rPropertyName,
+ sal_Bool bTestPropertyAvailability = sal_False
+ );
void insertShapeId( sal_Int32 nShapeId, SdrObject* pShape );
void removeShapeId( SdrObject* pShape );
diff --git a/filter/inc/filter/msfilter/msocximex.hxx b/filter/inc/filter/msfilter/msocximex.hxx
index 5e1915d0406f..31b3732dbfdd 100644
--- a/filter/inc/filter/msfilter/msocximex.hxx
+++ b/filter/inc/filter/msfilter/msocximex.hxx
@@ -96,18 +96,12 @@ public:
virtual ~SvxMSConvertOCXControls();
//Reads a control from the given storage, constructed shape in pShapeRef
- sal_Bool ReadOCXStream( SotStorageRef& rSrc1,
+ virtual sal_Bool ReadOCXStream( SotStorageRef& rSrc1,
com::sun::star::uno::Reference<
com::sun::star::drawing::XShape > *pShapeRef=0,
- sal_Bool bFloatingCtrl=sal_False );
+ sal_Bool bFloatingCtrl=sal_False ) = 0;
- //Excel has a nasty kludged mechanism for this, read
- //the comments in the source to follow it
- sal_Bool ReadOCXExcelKludgeStream(SotStorageStreamRef& rSrc1,
- com::sun::star::uno::Reference <
- com::sun::star::drawing::XShape > *pShapeRef,sal_Bool bFloatingCtrl);
-
//Writes the given Uno Control into the given storage
diff --git a/filter/inc/filter/msfilter/svdfppt.hxx b/filter/inc/filter/msfilter/svdfppt.hxx
index d9f52434b101..57ab915cec71 100644
--- a/filter/inc/filter/msfilter/svdfppt.hxx
+++ b/filter/inc/filter/msfilter/svdfppt.hxx
@@ -633,6 +633,7 @@ public:
sal_uInt32* pTableArry,
SvxMSDffSolverContainer*
);
+ virtual bool ReadFormControl( com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& rxInStrm, com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rFormComp ) const = 0;
};
struct PPTTextCharacterStyleAtomInterpreter
@@ -1258,13 +1259,20 @@ class PPTConvertOCXControls : public SvxMSConvertOCXControls
{
virtual const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > & GetDrawPage();
PptPageKind ePageKind;
+ const SdrPowerPointImport* mpPPTImporter;
+ com::sun::star::uno::Reference< com::sun::star::io::XInputStream > mxInStrm;
public :
- PPTConvertOCXControls( SfxObjectShell* pDSh, PptPageKind ePKind ) :
+ PPTConvertOCXControls( const SdrPowerPointImport* pPPTImporter, com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& rxInStrm, SfxObjectShell* pDSh, PptPageKind ePKind ) :
SvxMSConvertOCXControls ( pDSh, NULL ),
- ePageKind ( ePKind )
+ ePageKind ( ePKind ),
+ mpPPTImporter ( pPPTImporter ),
+ mxInStrm ( rxInStrm )
{};
-
+ virtual sal_Bool ReadOCXStream( SotStorageRef& rSrc1,
+ com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShape > *pShapeRef=0,
+ sal_Bool bFloatingCtrl=sal_False );
virtual sal_Bool InsertControl(
const com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > &rFComp,
const com::sun::star::awt::Size& rSize,
diff --git a/filter/inc/registration.hxx b/filter/inc/registration.hxx
index 7bfe0d538b2a..060a77dd945a 100644
--- a/filter/inc/registration.hxx
+++ b/filter/inc/registration.hxx
@@ -49,17 +49,6 @@ namespace comphelper{
/** TODO doc
*/
-#define _COMPHELPER_COMPONENT_GETIMPLEMENTATIONENVIRONMENT \
- extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char** ppEnvironmentTypeName, \
- uno_Environment** /* ppEnvironment */ ) \
- { \
- *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \
- }
-
-//_______________________________________________
-
-/** TODO doc
- */
#define _COMPHELPER_MULTIINSTANCEFACTORY(IMPLEMENTATIONNAME, SERVICENAMES, FACTORYMETHOD) \
if (IMPLEMENTATIONNAME == sImplName) \
xFactory = ::cppu::createSingleFactory(xSMGR , \
diff --git a/filter/prj/d.lst b/filter/prj/d.lst
index 7b7bfc5d308d..53b7a14243d4 100644
--- a/filter/prj/d.lst
+++ b/filter/prj/d.lst
@@ -3,6 +3,7 @@ mkdir: %COMMON_DEST%\bin\hid
..\%__SRC%\bin\*.dll %_DEST%\bin\*.dll
..\%__SRC%\lib\lib*.so %_DEST%\lib
..\%__SRC%\lib\lib*.dylib %_DEST%\lib
+..\%__SRC%\lib\lib*.a %_DEST%\lib
..\%__SRC%\lib\imsfilter.lib %_DEST%\lib\imsfilter.lib
..\%__SRC%\class\*.jar %_DEST%\bin\*.jar
..\%__SRC%\class\XSLTFilter\*.jar %_DEST%\bin\*.jar
diff --git a/filter/source/config/cache/registration.cxx b/filter/source/config/cache/registration.cxx
index 26930a438b95..6d449c4aa0ca 100644
--- a/filter/source/config/cache/registration.cxx
+++ b/filter/source/config/cache/registration.cxx
@@ -99,9 +99,6 @@ static void InitConstants()
theConstantsInitializer::get();
}
-// extern "C" component_getImplementationEnvironment()
-_COMPHELPER_COMPONENT_GETIMPLEMENTATIONENVIRONMENT
-
// extern "C" component_getFactory()
_COMPHELPER_COMPONENT_GETFACTORY
(
diff --git a/filter/source/config/fragments/makefile.mk b/filter/source/config/fragments/makefile.mk
index 716c31891da8..6ad90259aa64 100644
--- a/filter/source/config/fragments/makefile.mk
+++ b/filter/source/config/fragments/makefile.mk
@@ -176,6 +176,15 @@ ALLTAR : $(ALL_FLAGS)
$(ALL_FLAGS) : $(INCLUDE_FRAGMENTS)
+.IF "$(CROSS_COMPILING)" == "YES"
+
+# Just assume cross-compiling from a sane system with a sane java
+# command... Too bored now to start propagating all the crazy
+# possibilities for Java as FOR_BUILD variants
+
+MERGE := java -jar $(SOLARBINDIR)$/FCFGMerge.jar
+
+.ELSE
.IF "$(SOLAR_JAVA)"==""
#cmc, hack to workaround the java build requirement
.IF "$(SYSTEM_PYTHON)" == "YES"
@@ -186,6 +195,7 @@ MERGE:=$(AUGMENT_LIBRARY_PATH) PYTHONPATH=$(SOLARLIBDIR)/python $(SOLARBINDIR)/p
.ELSE
MERGE := $(JAVAI) $(JAVAIFLAGS) -jar $(SOLARBINDIR)$/FCFGMerge.jar
.ENDIF
+.ENDIF
PACKLANG := $(XSLTPROC) --nonet
PACKLANG_IN :=
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_2003_XML.xcu b/filter/source/config/fragments/types/calc_MS_Excel_2003_XML.xcu
index a3af765eaeb4..f37923a6d1f0 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_2003_XML.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_2003_XML.xcu
@@ -1,7 +1,7 @@
<node oor:name="calc_MS_Excel_2003_XML" oor:op="replace">
<prop oor:name="DetectService"><value>com.sun.star.comp.filters.XMLFilterDetect</value></prop>
<prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>xml</value></prop>
+ <prop oor:name="Extensions"><value>xml xls</value></prop>
<prop oor:name="MediaType"/>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>MS Excel 2003 XML</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_97.xcu b/filter/source/config/fragments/types/calc_MS_Excel_97.xcu
index 24bbc6db7cff..0f7b643763c9 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_97.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_97.xcu
@@ -1,7 +1,7 @@
<node oor:name="calc_MS_Excel_97" oor:op="replace" >
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>xls xlc xlm xlw</value></prop>
+ <prop oor:name="Extensions"><value>xls xlc xlm xlw xlk</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>MS Excel 97</value></prop>
diff --git a/filter/source/config/fragments/types/calc_SYLK.xcu b/filter/source/config/fragments/types/calc_SYLK.xcu
index bcc970a91987..3f5d1f90b019 100644
--- a/filter/source/config/fragments/types/calc_SYLK.xcu
+++ b/filter/source/config/fragments/types/calc_SYLK.xcu
@@ -1,8 +1,8 @@
<node oor:name="calc_SYLK" oor:op="replace" >
<prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>slk</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="Extensions"><value>slk sylk</value></prop>
+ <prop oor:name="MediaType"><value>text/spreadsheet</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>SYLK</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/writer_MS_Word_2003_XML.xcu b/filter/source/config/fragments/types/writer_MS_Word_2003_XML.xcu
index 003b5870773c..be34153ccbb9 100644
--- a/filter/source/config/fragments/types/writer_MS_Word_2003_XML.xcu
+++ b/filter/source/config/fragments/types/writer_MS_Word_2003_XML.xcu
@@ -1,7 +1,7 @@
<node oor:name="writer_MS_Word_2003_XML" oor:op="replace">
<prop oor:name="DetectService"><value>com.sun.star.comp.filters.XMLFilterDetect</value></prop>
<prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>xml</value></prop>
+ <prop oor:name="Extensions"><value>xml doc</value></prop>
<prop oor:name="MediaType"/>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>MS Word 2003 XML</value></prop>
diff --git a/filter/source/filtertracer/exports.dxp b/filter/source/filtertracer/exports.dxp
index 0cb5620a1603..70033078921a 100644
--- a/filter/source/filtertracer/exports.dxp
+++ b/filter/source/filtertracer/exports.dxp
@@ -1,2 +1 @@
-component_getImplementationEnvironment
-component_getFactory \ No newline at end of file
+component_getFactory
diff --git a/filter/source/filtertracer/filtertraceruno.cxx b/filter/source/filtertracer/filtertraceruno.cxx
index 9cc865c889d6..a0ba7fa09c4a 100644
--- a/filter/source/filtertracer/filtertraceruno.cxx
+++ b/filter/source/filtertracer/filtertraceruno.cxx
@@ -43,15 +43,6 @@ static REF( NMSP_UNO::XInterface ) SAL_CALL create_FilterTracer( const REF( NMSP
return REF( NMSP_UNO::XInterface )( *new FilterTracer( rxFact ) );
}
-// ------------------------------------------
-// - component_getImplementationEnvironment -
-// ------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
// ------------------------
// - component_getFactory -
// ------------------------
diff --git a/filter/source/flash/swfuno.cxx b/filter/source/flash/swfuno.cxx
index 908b12b28bd9..80ab08ee7ef2 100644
--- a/filter/source/flash/swfuno.cxx
+++ b/filter/source/flash/swfuno.cxx
@@ -56,14 +56,6 @@ using namespace ::swf;
extern "C"
{
-//==================================================================================================
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-//==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
diff --git a/filter/source/graphicfilter/epbm/epbm.cxx b/filter/source/graphicfilter/epbm/epbm.cxx
index ff528153c5e7..f94ab01d7f85 100644
--- a/filter/source/graphicfilter/epbm/epbm.cxx
+++ b/filter/source/graphicfilter/epbm/epbm.cxx
@@ -188,13 +188,10 @@ void PBMWriter::ImplWriteBody()
// ------------------------------------------------------------------------
// eine Dezimalzahl im ASCII format wird in den Stream geschrieben
-void PBMWriter::ImplWriteNumber( sal_Int32 nNumber )
+void PBMWriter::ImplWriteNumber(sal_Int32 nNumber)
{
- const ByteString aNum( ByteString::CreateFromInt32( nNumber ) );
-
- for( sal_Int16 n = 0, nLen = aNum.Len(); n < nLen; n++ )
- m_rOStm << aNum.GetChar( n );
-
+ const rtl::OString aNum(rtl::OString::valueOf(nNumber));
+ m_rOStm << aNum.getStr();
}
// ------------------------------------------------------------------------
diff --git a/filter/source/graphicfilter/epgm/epgm.cxx b/filter/source/graphicfilter/epgm/epgm.cxx
index df16b793401d..747f0528813d 100644
--- a/filter/source/graphicfilter/epgm/epgm.cxx
+++ b/filter/source/graphicfilter/epgm/epgm.cxx
@@ -213,13 +213,10 @@ void PGMWriter::ImplWriteBody()
// ------------------------------------------------------------------------
// eine Dezimalzahl im ASCII format wird in den Stream geschrieben
-void PGMWriter::ImplWriteNumber( sal_Int32 nNumber )
+void PGMWriter::ImplWriteNumber(sal_Int32 nNumber)
{
- const ByteString aNum( ByteString::CreateFromInt32( nNumber ) );
-
- for( sal_Int16 n = 0UL, nLen = aNum.Len(); n < nLen; n++ )
- m_rOStm << aNum.GetChar( n );
-
+ const rtl::OString aNum(rtl::OString::valueOf(nNumber));
+ m_rOStm << aNum.getStr();
}
// ------------------------------------------------------------------------
diff --git a/filter/source/graphicfilter/eppm/eppm.cxx b/filter/source/graphicfilter/eppm/eppm.cxx
index cbe20d7a0668..80a0b25980b8 100644
--- a/filter/source/graphicfilter/eppm/eppm.cxx
+++ b/filter/source/graphicfilter/eppm/eppm.cxx
@@ -221,13 +221,10 @@ void PPMWriter::ImplWriteBody()
// ------------------------------------------------------------------------
// eine Dezimalzahl im ASCII format wird in den Stream geschrieben
-void PPMWriter::ImplWriteNumber( sal_Int32 nNumber )
+void PPMWriter::ImplWriteNumber(sal_Int32 nNumber)
{
- const ByteString aNum( ByteString::CreateFromInt32( nNumber ) );
-
- for( sal_Int16 n = 0, nLen = aNum.Len(); n < nLen; n++ )
- m_rOStm << aNum.GetChar( n );
-
+ const rtl::OString aNum(rtl::OString::valueOf(nNumber));
+ m_rOStm << aNum.getStr();
}
// ------------------------------------------------------------------------
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index b5dfaa932fc3..4dcb8ef3d775 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -2454,42 +2454,36 @@ void PSWriter::ImplWriteLineInfo( const LineInfo& rLineInfo )
//---------------------------------------------------------------------------------
-void PSWriter::ImplWriteLong( sal_Int32 nNumber, sal_uLong nMode )
+void PSWriter::ImplWriteLong(sal_Int32 nNumber, sal_uLong nMode)
{
- const ByteString aNumber( ByteString::CreateFromInt32( nNumber ) );
- sal_uLong nLen = aNumber.Len();
- mnCursorPos += nLen;
- for ( sal_uInt16 n = 0; n < nLen; n++ )
- *mpPS << aNumber.GetChar( n );
- ImplExecMode( nMode );
+ const rtl::OString aNumber(rtl::OString::valueOf(nNumber));
+ mnCursorPos += aNumber.getLength();
+ *mpPS << aNumber.getStr();
+ ImplExecMode(nMode);
}
//---------------------------------------------------------------------------------
void PSWriter::ImplWriteDouble( double fNumber, sal_uLong nMode )
{
- sal_Int32 nLength;
-
sal_Int32 nPTemp = (sal_Int32)fNumber;
sal_Int32 nATemp = labs( (sal_Int32)( ( fNumber - nPTemp ) * 100000 ) );
if ( !nPTemp && nATemp && ( fNumber < 0.0 ) )
*mpPS << (sal_Char)'-';
- ByteString aNumber1( ByteString::CreateFromInt32( nPTemp ) );
- nLength = aNumber1.Len();
- mnCursorPos += nLength;
- for ( sal_Int32 n = 0; n < nLength; n++ )
- *mpPS << aNumber1.GetChar( (sal_uInt16)n );
+ const rtl::OString aNumber1(rtl::OString::valueOf(nPTemp));
+ *mpPS << aNumber1.getStr();
+ mnCursorPos += aNumber1.getLength();
if ( nATemp )
{
int zCount = 0;
*mpPS << (sal_uInt8)'.';
mnCursorPos++;
- const ByteString aNumber2( ByteString::CreateFromInt32( nATemp ) );
+ const rtl::OString aNumber2(rtl::OString::valueOf(nATemp));
- sal_Int16 n, nLen = aNumber2.Len();
+ sal_Int16 n, nLen = aNumber2.getLength();
if ( nLen < 8 )
{
mnCursorPos += 6 - nLen;
@@ -2501,9 +2495,9 @@ void PSWriter::ImplWriteDouble( double fNumber, sal_uLong nMode )
mnCursorPos += nLen;
for ( n = 0; n < nLen; n++ )
{
- *mpPS << aNumber2.GetChar( n );
+ *mpPS << aNumber2[n];
zCount--;
- if ( aNumber2.GetChar( n ) != '0' )
+ if ( aNumber2[n] != '0' )
zCount = 0;
}
if ( zCount )
@@ -2524,8 +2518,8 @@ void PSWriter::ImplWriteF( sal_Int32 nNumber, sal_uLong nCount, sal_uLong nMode
nNumber = -nNumber;
mnCursorPos++;
}
- const ByteString aScaleFactor( ByteString::CreateFromInt32( nNumber ) );
- sal_uLong nLen = aScaleFactor.Len();
+ const rtl::OString aScaleFactor(rtl::OString::valueOf(nNumber));
+ sal_uLong nLen = aScaleFactor.getLength();
long nStSize = ( nCount + 1 ) - nLen;
if ( nStSize >= 1 )
{
@@ -2549,7 +2543,7 @@ void PSWriter::ImplWriteF( sal_Int32 nNumber, sal_uLong nCount, sal_uLong nMode
*mpPS << (sal_uInt8)'.';
mnCursorPos++;
}
- *mpPS << aScaleFactor.GetChar( n );
+ *mpPS << aScaleFactor[n];
}
ImplExecMode( nMode );
}
diff --git a/filter/source/graphicfilter/expm/expm.cxx b/filter/source/graphicfilter/expm/expm.cxx
index 8ea9ec4bb00a..2cd5fbf035b0 100644
--- a/filter/source/graphicfilter/expm/expm.cxx
+++ b/filter/source/graphicfilter/expm/expm.cxx
@@ -215,13 +215,10 @@ void XPMWriter::ImplWriteBody()
// ------------------------------------------------------------------------
// eine Dezimalzahl im ASCII format wird in den Stream geschrieben
-void XPMWriter::ImplWriteNumber( sal_Int32 nNumber )
+void XPMWriter::ImplWriteNumber(sal_Int32 nNumber)
{
- const ByteString aNum( ByteString::CreateFromInt32( nNumber ) );
-
- for( sal_Int16 n = 0UL, nLen = aNum.Len(); n < nLen; ++n )
- m_rOStm << aNum.GetChar( n );
-
+ const rtl::OString aNum(rtl::OString::valueOf(nNumber));
+ m_rOStm << aNum.getStr();
}
// ------------------------------------------------------------------------
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 1af5e63e6034..2bd758eb91c6 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -3283,32 +3283,36 @@ EscherPersistTable::EscherPersistTable()
EscherPersistTable::~EscherPersistTable()
{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- delete (EscherPersistEntry*)pPtr;
+ for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
+ delete maPersistTable[ i ];
+ }
}
sal_Bool EscherPersistTable::PtIsID( sal_uInt32 nID )
{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- {
- if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
+ for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
+ EscherPersistEntry* pPtr = maPersistTable[ i ];
+ if ( pPtr->mnID == nID ) {
return sal_True;
+ }
}
return sal_False;
}
void EscherPersistTable::PtInsert( sal_uInt32 nID, sal_uInt32 nOfs )
{
- maPersistTable.Insert( new EscherPersistEntry( nID, nOfs ) );
+ maPersistTable.push_back( new EscherPersistEntry( nID, nOfs ) );
}
sal_uInt32 EscherPersistTable::PtDelete( sal_uInt32 nID )
{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
+ EscherPersistTable_impl::iterator it = maPersistTable.begin();
+ for( ; it != maPersistTable.end() ; ++it )
{
- if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
- {
- delete (EscherPersistEntry*) maPersistTable.Remove();
+ if ( (*it)->mnID == nID ) {
+ delete *it;
+ maPersistTable.erase( it );
+ break;
}
}
return 0;
@@ -3316,22 +3320,22 @@ sal_uInt32 EscherPersistTable::PtDelete( sal_uInt32 nID )
sal_uInt32 EscherPersistTable::PtGetOffsetByID( sal_uInt32 nID )
{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- {
- if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
- return ((EscherPersistEntry*)pPtr)->mnOffset;
+ for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
+ EscherPersistEntry* pPtr = maPersistTable[ i ];
+ if ( pPtr->mnID == nID ) {
+ return pPtr->mnOffset;
+ }
}
return 0;
};
sal_uInt32 EscherPersistTable::PtReplace( sal_uInt32 nID, sal_uInt32 nOfs )
{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- {
- if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
- {
- sal_uInt32 nRetValue = ((EscherPersistEntry*)pPtr)->mnOffset;
- ((EscherPersistEntry*)pPtr)->mnOffset = nOfs;
+ for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
+ EscherPersistEntry* pPtr = maPersistTable[ i ];
+ if ( pPtr->mnID == nID ) {
+ sal_uInt32 nRetValue = pPtr->mnOffset;
+ pPtr->mnOffset = nOfs;
return nRetValue;
}
}
@@ -3340,12 +3344,11 @@ sal_uInt32 EscherPersistTable::PtReplace( sal_uInt32 nID, sal_uInt32 nOfs )
sal_uInt32 EscherPersistTable::PtReplaceOrInsert( sal_uInt32 nID, sal_uInt32 nOfs )
{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- {
- if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
- {
- sal_uInt32 nRetValue = ((EscherPersistEntry*)pPtr)->mnOffset;
- ((EscherPersistEntry*)pPtr)->mnOffset = nOfs;
+ for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
+ EscherPersistEntry* pPtr = maPersistTable[ i ];
+ if ( pPtr->mnID == nID ) {
+ sal_uInt32 nRetValue = pPtr->mnOffset;
+ pPtr->mnOffset = nOfs;
return nRetValue;
}
}
@@ -3355,10 +3358,10 @@ sal_uInt32 EscherPersistTable::PtReplaceOrInsert( sal_uInt32 nID, sal_uInt32 nOf
sal_Bool EscherPropertyValueHelper::GetPropertyValue(
::com::sun::star::uno::Any& rAny,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- const String& rString,
- sal_Bool bTestPropertyAvailability )
-{
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ const String& rString,
+ sal_Bool bTestPropertyAvailability
+) {
sal_Bool bRetValue = sal_True;
if ( bTestPropertyAvailability )
{
@@ -4140,33 +4143,35 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( sal_Bool bFirst )
EscherSolverContainer::~EscherSolverContainer()
{
- void* pP;
-
- for( pP = maShapeList.First(); pP; pP = maShapeList.Next() )
- delete (EscherShapeListEntry*)pP;
- for( pP = maConnectorList.First(); pP; pP = maConnectorList.Next() )
- delete (EscherConnectorListEntry*)pP;
+ for( size_t i = 0, n = maShapeList.size(); i < n; ++i ) {
+ delete maShapeList[ i ];
+ }
+ for( size_t i = 0, n = maConnectorList.size(); i < n; ++i ) {
+ delete maConnectorList[ i ];
+ }
}
void EscherSolverContainer::AddShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32 nId )
{
- maShapeList.Insert( new EscherShapeListEntry( rXShape, nId ), LIST_APPEND );
+ maShapeList.push_back( new EscherShapeListEntry( rXShape, nId ) );
}
-void EscherSolverContainer::AddConnector( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConnector,
- const ::com::sun::star::awt::Point& rPA,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConA,
- const ::com::sun::star::awt::Point& rPB,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConB )
+void EscherSolverContainer::AddConnector(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConnector,
+ const ::com::sun::star::awt::Point& rPA,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConA,
+ const ::com::sun::star::awt::Point& rPB,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConB
+)
{
- maConnectorList.Insert( new EscherConnectorListEntry( rConnector, rPA, rConA, rPB, rConB ), LIST_APPEND );
+ maConnectorList.push_back( new EscherConnectorListEntry( rConnector, rPA, rConA, rPB, rConB ) );
}
sal_uInt32 EscherSolverContainer::GetShapeId( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape ) const
{
- for ( EscherShapeListEntry* pPtr = (EscherShapeListEntry*)((List&)maShapeList).First();
- pPtr; pPtr = (EscherShapeListEntry*)((List&)maShapeList).Next() )
+ for ( size_t i = 0, n = maShapeList.size(); i < n; ++i )
{
+ EscherShapeListEntry* pPtr = maShapeList[ i ];
if ( rXShape == pPtr->aXShape )
return ( pPtr->n_EscherId );
}
@@ -4175,7 +4180,7 @@ sal_uInt32 EscherSolverContainer::GetShapeId( const ::com::sun::star::uno::Refer
void EscherSolverContainer::WriteSolver( SvStream& rStrm )
{
- sal_uInt32 nCount = maConnectorList.Count();
+ sal_uInt32 nCount = maConnectorList.size();
if ( nCount )
{
sal_uInt32 nRecHdPos, nCurrentPos, nSize;
@@ -4187,10 +4192,10 @@ void EscherSolverContainer::WriteSolver( SvStream& rStrm )
EscherConnectorRule aConnectorRule;
aConnectorRule.nRuleId = 2;
- for ( EscherConnectorListEntry* pPtr = (EscherConnectorListEntry*)maConnectorList.First();
- pPtr; pPtr = (EscherConnectorListEntry*)maConnectorList.Next() )
+ for ( size_t i = 0, n = maConnectorList.size(); i < n; ++i )
{
- aConnectorRule.ncptiA = aConnectorRule.ncptiB = 0xffffffff;
+ EscherConnectorListEntry* pPtr = maConnectorList[ i ];
+ aConnectorRule.ncptiA = aConnectorRule.ncptiB = 0xffffffff;
aConnectorRule.nShapeC = GetShapeId( pPtr->mXConnector );
aConnectorRule.nShapeA = GetShapeId( pPtr->mXConnectToA );
aConnectorRule.nShapeB = GetShapeId( pPtr->mXConnectToB );
@@ -4407,11 +4412,12 @@ void EscherEx::InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom )
sal_uInt8* pBuf;
// Persist table anpassen
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- {
- sal_uInt32 nOfs = ((EscherPersistEntry*)pPtr)->mnOffset;
- if ( nOfs >= nCurPos )
- ((EscherPersistEntry*)pPtr)->mnOffset += nBytes;
+ for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
+ EscherPersistEntry* pPtr = maPersistTable[ i ];
+ sal_uInt32 nOfs = pPtr->mnOffset;
+ if ( nOfs >= nCurPos ) {
+ pPtr->mnOffset += nBytes;
+ }
}
// container und atom sizes anpassen
diff --git a/filter/source/msfilter/makefile.mk b/filter/source/msfilter/makefile.mk
index cbc06ffb49ef..8070bc4f4f88 100644
--- a/filter/source/msfilter/makefile.mk
+++ b/filter/source/msfilter/makefile.mk
@@ -58,7 +58,11 @@ SLOFILES= \
$(SLO)$/mstoolbar.obj
SHL1TARGET= msfilter$(DLLPOSTFIX)
+.IF "$(COM)" == "MSC"
SHL1IMPLIB= i$(TARGET)
+.ELSE
+SHL1IMPLIB= msfilter$(DLLPOSTFIX)
+.ENDIF
SHL1OBJS= $(SLOFILES)
SHL1USE_EXPORTS=name
SHL1STDLIBS= \
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 0b34fac649a6..936669d24387 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -211,7 +211,9 @@ sal_Bool Impl_OlePres::Read( SvStream & rStm )
}
rStm.ResetError();
- rStm.Seek( nBeginPos );
+ if (nBeginPos != rStm.Seek(nBeginPos))
+ return sal_False;
+
nFormat = ReadClipboardFormat( rStm );
// JobSetup, bzw. TargetDevice ueberlesen
// Information aufnehmen, um sie beim Schreiben nicht zu verlieren
@@ -231,7 +233,7 @@ sal_Bool Impl_OlePres::Read( SvStream & rStm )
rStm.SetError( SVSTREAM_GENERALERROR );
return sal_False;
}
- sal_uInt32 nAsp;
+ sal_uInt32 nAsp(0);
rStm >> nAsp;
sal_uInt16 nSvAsp = sal_uInt16( nAsp );
SetAspect( nSvAsp );
@@ -315,49 +317,6 @@ void Impl_OlePres::Write( SvStream & rStm )
rStm.Seek( nEndPos );
}
-Impl_OlePres * CreateCache_Impl( SotStorage * pStor )
-{
- SotStorageStreamRef xOleObjStm =pStor->OpenSotStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Ole-Object" ) ),
- STREAM_READ | STREAM_NOCREATE );
- if( xOleObjStm->GetError() )
- return NULL;
- SotStorageRef xOleObjStor = new SotStorage( *xOleObjStm );
- if( xOleObjStor->GetError() )
- return NULL;
-
- String aStreamName;
- if( xOleObjStor->IsContained( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres000" ) ) ) )
- aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres000" ) );
- else if( xOleObjStor->IsContained( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) ) ) )
- aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) );
-
- if( aStreamName.Len() == 0 )
- return NULL;
-
-
- for( sal_uInt16 i = 1; i < 10; i++ )
- {
- SotStorageStreamRef xStm = xOleObjStor->OpenSotStream( aStreamName,
- STREAM_READ | STREAM_NOCREATE );
- if( xStm->GetError() )
- break;
-
- xStm->SetBufferSize( 8192 );
- Impl_OlePres * pEle = new Impl_OlePres( 0 );
- if( pEle->Read( *xStm ) && !xStm->GetError() )
- {
- if( pEle->GetFormat() == FORMAT_GDIMETAFILE || pEle->GetFormat() == FORMAT_BITMAP )
- return pEle;
- }
- delete pEle;
- aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres00" ) );
- aStreamName += String( i );
- };
- return NULL;
-}
-
-
-
//---------------------------------------------------------------------------
// Hilfs Klassen aus MSDFFDEF.HXX
//---------------------------------------------------------------------------
@@ -650,7 +609,10 @@ bool DffPropSet::GetPropertyBool( sal_uInt32 nId, bool bDefault ) const
if( (nBufferSize > 0) && SeekToContent( nId, rStrm ) )
{
sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufferSize / 2 );
- aBuffer.ensureCapacity( nStrLen );
+ //clip initial size of buffer to something sane in case of silly length
+ //strings. If there really is a silly amount of data available it still
+ //works out ok of course
+ aBuffer.ensureCapacity(std::min(nStrLen,static_cast<sal_Int32>(8192)));
for( sal_Int32 nCharIdx = 0; nCharIdx < nStrLen; ++nCharIdx )
{
sal_uInt16 nChar = 0;
@@ -894,9 +856,10 @@ SvxMSDffSolverContainer::SvxMSDffSolverContainer()
SvxMSDffSolverContainer::~SvxMSDffSolverContainer()
{
- for ( SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)aCList.First();
- pPtr; pPtr = (SvxMSDffConnectorRule*)aCList.Next() )
- delete pPtr;
+ for( size_t i = 0, n = aCList.size(); i < n; ++i ) {
+ delete aCList[ i ];
+ }
+ aCList.clear();
}
SvStream& operator>>( SvStream& rIn, SvxMSDffSolverContainer& rContainer )
@@ -913,7 +876,7 @@ SvStream& operator>>( SvStream& rIn, SvxMSDffSolverContainer& rContainer )
{
SvxMSDffConnectorRule* pRule = new SvxMSDffConnectorRule;
rIn >> *pRule;
- rContainer.aCList.Insert( pRule, LIST_APPEND );
+ rContainer.aCList.push_back( pRule );
}
aCRule.SeekToEndOfRecord( rIn );
}
@@ -923,10 +886,10 @@ SvStream& operator>>( SvStream& rIn, SvxMSDffSolverContainer& rContainer )
void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
{
- sal_Int32 i, nCnt;
- for ( i = 0, nCnt = rSolver.aCList.Count(); i < nCnt; i++ )
+ size_t i, nCnt;
+ for ( i = 0, nCnt = rSolver.aCList.size(); i < nCnt; i++ )
{
- SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)rSolver.aCList.GetObject( i );
+ SvxMSDffConnectorRule* pPtr = rSolver.aCList[ i ];
if ( pPtr->pCObj )
{
for ( int nN = 0; nN < 2; nN++ )
@@ -3260,7 +3223,9 @@ void DffRecordManager::Consume( SvStream& rIn, sal_Bool bAppend, sal_uInt32 nStO
if ( pCList->nCount == DFF_RECORD_MANAGER_BUF_SIZE )
pCList = new DffRecordList( pCList );
rIn >> pCList->mHd[ pCList->nCount ];
- pCList->mHd[ pCList->nCount++ ].SeekToEndOfRecord( rIn );
+ bool bSeekSucceeded = pCList->mHd[ pCList->nCount++ ].SeekToEndOfRecord(rIn);
+ if (!bSeekSucceeded)
+ break;
}
rIn.Seek( nOldPos );
}
@@ -4614,31 +4579,29 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
if( pShapeId )
*pShapeId = 0;
- rHd.SeekToContent( rSt );
+ if (!rHd.SeekToContent(rSt))
+ return pRet;
+
DffRecordHeader aRecHd; // the first atom has to be the SpContainer for the GroupObject
rSt >> aRecHd;
if ( aRecHd.nRecType == DFF_msofbtSpContainer )
{
- sal_Int32 nGroupRotateAngle = 0;
- sal_Int32 nSpFlags = 0;
mnFix16Angle = 0;
- aRecHd.SeekToBegOfRecord( rSt );
+ if (!aRecHd.SeekToBegOfRecord(rSt))
+ return pRet;
+
pRet = ImportObj( rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup + 1, pShapeId );
if ( pRet )
{
- nSpFlags = nGroupShapeFlags;
- nGroupRotateAngle = mnFix16Angle;
-
Rectangle aClientRect( rClientRect );
-
Rectangle aGlobalChildRect;
if ( !nCalledByGroup || rGlobalChildRect.IsEmpty() )
aGlobalChildRect = GetGlobalChildAnchor( rHd, rSt, aClientRect );
else
aGlobalChildRect = rGlobalChildRect;
- if ( ( nGroupRotateAngle > 4500 && nGroupRotateAngle <= 13500 )
- || ( nGroupRotateAngle > 22500 && nGroupRotateAngle <= 31500 ) )
+ if ( ( mnFix16Angle > 4500 && mnFix16Angle <= 13500 )
+ || ( mnFix16Angle > 22500 && mnFix16Angle <= 31500 ) )
{
sal_Int32 nHalfWidth = ( aClientRect.GetWidth() + 1 ) >> 1;
sal_Int32 nHalfHeight = ( aClientRect.GetHeight() + 1 ) >> 1;
@@ -4650,7 +4613,9 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
}
// now importing the inner objects of the group
- aRecHd.SeekToEndOfRecord( rSt );
+ if (!aRecHd.SeekToEndOfRecord(rSt))
+ return pRet;
+
while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
{
DffRecordHeader aRecHd2;
@@ -4659,10 +4624,11 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
{
Rectangle aGroupClientAnchor, aGroupChildAnchor;
GetGroupAnchors( aRecHd2, rSt, aGroupClientAnchor, aGroupChildAnchor, aClientRect, aGlobalChildRect );
- aRecHd2.SeekToBegOfRecord( rSt );
+ if (!aRecHd2.SeekToBegOfRecord(rSt))
+ return pRet;
sal_Int32 nShapeId;
SdrObject* pTmp = ImportGroup( aRecHd2, rSt, pClientData, aGroupClientAnchor, aGroupChildAnchor, nCalledByGroup + 1, &nShapeId );
- if ( pTmp )
+ if ( pTmp && pRet && ((SdrObjGroup*)pRet)->GetSubList() )
{
((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
if( nShapeId )
@@ -4671,31 +4637,33 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
}
else if ( aRecHd2.nRecType == DFF_msofbtSpContainer )
{
- aRecHd2.SeekToBegOfRecord( rSt );
+ if (!aRecHd2.SeekToBegOfRecord(rSt))
+ return pRet;
sal_Int32 nShapeId;
SdrObject* pTmp = ImportShape( aRecHd2, rSt, pClientData, aClientRect, aGlobalChildRect, nCalledByGroup + 1, &nShapeId );
- if ( pTmp )
+ if ( pTmp && pRet && ((SdrObjGroup*)pRet)->GetSubList())
{
((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
if( nShapeId )
insertShapeId( nShapeId, pTmp );
}
}
- aRecHd2.SeekToEndOfRecord( rSt );
+ if (!aRecHd2.SeekToEndOfRecord(rSt))
+ return pRet;
}
- if ( nGroupRotateAngle )
+ if ( mnFix16Angle )
{
- double a = nGroupRotateAngle * nPi180;
- pRet->NbcRotate( aClientRect.Center(), nGroupRotateAngle, sin( a ), cos( a ) );
+ double a = mnFix16Angle * nPi180;
+ pRet->NbcRotate( aClientRect.Center(), mnFix16Angle, sin( a ), cos( a ) );
}
- if ( nSpFlags & SP_FFLIPV ) // Vertikal gespiegelt?
+ if ( nGroupShapeFlags & SP_FFLIPV ) // Vertical flip?
{ // BoundRect in aBoundRect
Point aLeft( aClientRect.Left(), ( aClientRect.Top() + aClientRect.Bottom() ) >> 1 );
Point aRight( aLeft.X() + 1000, aLeft.Y() );
pRet->NbcMirror( aLeft, aRight );
}
- if ( nSpFlags & SP_FFLIPH ) // Horizontal gespiegelt?
+ if ( nGroupShapeFlags & SP_FFLIPH ) // Horizontal flip?
{ // BoundRect in aBoundRect
Point aTop( ( aClientRect.Left() + aClientRect.Right() ) >> 1, aClientRect.Top() );
Point aBottom( aTop.X(), aTop.Y() + 1000 );
@@ -4715,7 +4683,9 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
if( pShapeId )
*pShapeId = 0;
- rHd.SeekToBegOfRecord( rSt );
+ if (!rHd.SeekToBegOfRecord(rSt))
+ return pRet;
+
DffObjData aObjData( rHd, rClientRect, nCalledByGroup );
maShapeRecords.Consume( rSt, sal_False );
aObjData.bShapeType = maShapeRecords.SeekToContent( rSt, DFF_msofbtSp, SEEK_FROM_BEGINNING );
@@ -4743,7 +4713,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
aObjData.bOpt = maShapeRecords.SeekToContent( rSt, DFF_msofbtOPT, SEEK_FROM_CURRENT_AND_RESTART );
if ( aObjData.bOpt )
{
- maShapeRecords.Current()->SeekToBegOfRecord( rSt );
+ if (!maShapeRecords.Current()->SeekToBegOfRecord(rSt))
+ return pRet;
#ifdef DBG_AUTOSHAPE
ReadPropSet( rSt, pClientData, (sal_uInt32)aObjData.eShapeType );
#else
@@ -5307,7 +5278,9 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvStream& rSt, Rectangle& aClientRect )
{
Rectangle aChildAnchor;
- rHd.SeekToContent( rSt );
+ if (!rHd.SeekToContent(rSt))
+ return aChildAnchor;
+
while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
{
DffRecordHeader aShapeHd;
@@ -5358,10 +5331,12 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS
aChildAnchor.Union( aChild );
break;
}
- aShapeAtom.SeekToEndOfRecord( rSt );
+ if (!aShapeAtom.SeekToEndOfRecord(rSt))
+ break;
}
}
- aShapeHd.SeekToEndOfRecord( rSt );
+ if (!aShapeHd.SeekToEndOfRecord(rSt))
+ break;
}
return aChildAnchor;
}
@@ -5370,8 +5345,10 @@ void SvxMSDffManager::GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt
Rectangle& rGroupClientAnchor, Rectangle& rGroupChildAnchor,
const Rectangle& rClientRect, const Rectangle& rGlobalChildRect )
{
+ if (!rHd.SeekToContent(rSt))
+ return;
+
sal_Bool bFirst = sal_True;
- rHd.SeekToContent( rSt );
DffRecordHeader aShapeHd;
while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
{
@@ -5418,10 +5395,12 @@ void SvxMSDffManager::GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt
rGroupChildAnchor.Union( aChild );
break;
}
- aShapeAtom.SeekToEndOfRecord( rSt );
+ if (!aShapeAtom.SeekToEndOfRecord(rSt))
+ break;
}
}
- aShapeHd.SeekToEndOfRecord( rSt );
+ if (!aShapeHd.SeekToEndOfRecord(rSt))
+ break;
}
}
@@ -6008,14 +5987,14 @@ SV_IMPL_OP_PTRARR_SORT( SvxMSDffShapeTxBxSort, SvxMSDffShapeOrder_Ptr );
SV_IMPL_OP_PTRARR_SORT(MSDffImportRecords, MSDffImportRec_Ptr)
//---------------------------------------------------------------------------
-// exportierte Klasse: oeffentliche Methoden
+// exported class: Public Methods
//---------------------------------------------------------------------------
SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_,
const String& rBaseURL,
- long nOffsDgg_,
+ sal_uInt32 nOffsDgg_,
SvStream* pStData_,
- SdrModel* pSdrModel_,// s. unten: SetModel()
+ SdrModel* pSdrModel_,// see SetModel() below
long nApplicationScale,
ColorData mnDefaultColor_,
sal_uLong nDefaultFontHeight_,
@@ -6028,8 +6007,10 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_,
pShapeOrders( new SvxMSDffShapeOrders ),
nDefaultFontHeight( nDefaultFontHeight_),
nOffsDgg( nOffsDgg_ ),
- nBLIPCount( USHRT_MAX ), // mit Error initialisieren, da wir erst pruefen,
- nShapeCount( USHRT_MAX ), // ob Kontroll-Stream korrekte Daten enthaellt
+ nBLIPCount( USHRT_MAX ), // initialize with error, since we fist check if the
+ nShapeCount( USHRT_MAX ), // control stream has correct data
+ nGroupShapeFlags(0), //ensure initialization here, as some corrupted
+ //files may yield to this being unitialized
maBaseURL( rBaseURL ),
mpFidcls( NULL ),
rStCtrl( rStCtrl_ ),
@@ -6109,7 +6090,7 @@ SvxMSDffManager::~SvxMSDffManager()
delete[] mpFidcls;
}
-void SvxMSDffManager::InitSvxMSDffManager( long nOffsDgg_, SvStream* pStData_, sal_uInt32 nOleConvFlags )
+void SvxMSDffManager::InitSvxMSDffManager( sal_uInt32 nOffsDgg_, SvStream* pStData_, sal_uInt32 nOleConvFlags )
{
nOffsDgg = nOffsDgg_;
pStData = pStData_;
@@ -6149,13 +6130,15 @@ void SvxMSDffManager::SetDgContainer( SvStream& rSt )
}
}
-void SvxMSDffManager::GetFidclData( long nOffsDggL )
+void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL )
{
- if ( nOffsDggL )
- {
- sal_uInt32 nDummy, nMerk = rStCtrl.Tell();
- rStCtrl.Seek( nOffsDggL );
+ if (!nOffsDggL)
+ return;
+
+ sal_uInt32 nDummy, nMerk = rStCtrl.Tell();
+ if (nOffsDggL == rStCtrl.Seek(nOffsDggL))
+ {
DffRecordHeader aRecHd;
rStCtrl >> aRecHd;
@@ -6181,8 +6164,8 @@ void SvxMSDffManager::GetFidclData( long nOffsDggL )
}
}
}
- rStCtrl.Seek( nMerk );
}
+ rStCtrl.Seek( nMerk );
}
void SvxMSDffManager::CheckTxBxStoryChain()
@@ -6259,13 +6242,14 @@ void SvxMSDffManager::CheckTxBxStoryChain()
und merken des File-Offsets fuer jedes Blip
============
******************************************************************************/
-void SvxMSDffManager::GetCtrlData( long nOffsDgg_ )
+void SvxMSDffManager::GetCtrlData( sal_uInt32 nOffsDgg_ )
{
// Start Offset unbedingt merken, falls wir nochmal aufsetzen muessen
- long nOffsDggL = nOffsDgg_;
+ sal_uInt32 nOffsDggL = nOffsDgg_;
// Kontroll Stream positionieren
- rStCtrl.Seek( nOffsDggL );
+ if (nOffsDggL != rStCtrl.Seek(nOffsDggL))
+ return;
sal_uInt8 nVer;
sal_uInt16 nInst;
@@ -6281,21 +6265,23 @@ void SvxMSDffManager::GetCtrlData( long nOffsDgg_ )
{
GetDrawingGroupContainerData( rStCtrl, nLength );
- rStCtrl.Seek( STREAM_SEEK_TO_END );
+ rStCtrl.Seek( STREAM_SEEK_TO_END );
sal_uInt32 nMaxStrPos = rStCtrl.Tell();
nPos += nLength;
unsigned long nDrawingContainerId = 1;
do
{
- rStCtrl.Seek( nPos );
+ if (nPos != rStCtrl.Seek(nPos))
+ break;
bOk = ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength ) && ( DFF_msofbtDgContainer == nFbt );
if( !bOk )
{
nPos++;
- rStCtrl.Seek( nPos );
+ if (nPos != rStCtrl.Seek(nPos))
+ break;
bOk = ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength )
&& ( DFF_msofbtDgContainer == nFbt );
}
@@ -6682,10 +6668,10 @@ sal_Bool SvxMSDffManager::GetShape(sal_uLong nId, SdrObject*& rpShape,
sal_uLong nOldPosCtrl = rStCtrl.Tell();
sal_uLong nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
// das Shape im Steuer Stream anspringen
- rStCtrl.Seek( rInfo.nFilePos );
+ bool bSeeked = (rInfo.nFilePos == rStCtrl.Seek(rInfo.nFilePos));
// Falls missglueckt, den Fehlerstatus zuruecksetzen und Pech gehabt!
- if( rStCtrl.GetError() )
+ if (!bSeeked || rStCtrl.GetError())
rStCtrl.ResetError();
else
rpShape = ImportObj( rStCtrl, &rData, rData.aParentRect, rData.aParentRect );
@@ -6979,29 +6965,26 @@ sal_Bool SvxMSDffManager::ReadCommonRecordHeader( SvStream& rSt,
return rSt.GetError() == 0;
}
-
-
-
-sal_Bool SvxMSDffManager::ProcessClientAnchor(SvStream& rStData, sal_uLong nDatLen,
+sal_Bool SvxMSDffManager::ProcessClientAnchor(SvStream& rStData, sal_uInt32 nDatLen,
char*& rpBuff, sal_uInt32& rBuffLen ) const
{
if( nDatLen )
{
- rpBuff = new char[ nDatLen ];
- rBuffLen = nDatLen;
- rStData.Read( rpBuff, nDatLen );
+ rBuffLen = std::min(rStData.remainingSize(), static_cast<sal_Size>(nDatLen));
+ rpBuff = new char[rBuffLen];
+ rBuffLen = rStData.Read(rpBuff, rBuffLen);
}
return sal_True;
}
-sal_Bool SvxMSDffManager::ProcessClientData(SvStream& rStData, sal_uLong nDatLen,
+sal_Bool SvxMSDffManager::ProcessClientData(SvStream& rStData, sal_uInt32 nDatLen,
char*& rpBuff, sal_uInt32& rBuffLen ) const
{
if( nDatLen )
{
- rpBuff = new char[ nDatLen ];
- rBuffLen = nDatLen;
- rStData.Read( rpBuff, nDatLen );
+ rBuffLen = std::min(rStData.remainingSize(), static_cast<sal_Size>(nDatLen));
+ rpBuff = new char[rBuffLen];
+ rBuffLen = rStData.Read(rpBuff, rBuffLen);
}
return sal_True;
}
diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx
index fd8b15c99576..6c79d1b9b384 100644
--- a/filter/source/msfilter/msocximex.cxx
+++ b/filter/source/msfilter/msocximex.cxx
@@ -4371,95 +4371,6 @@ OCX_Control * SvxMSConvertOCXControls::OCX_Factory(
}
-sal_Bool SvxMSConvertOCXControls::ReadOCXStream( SvStorageRef& rSrc1,
- uno::Reference < drawing::XShape > *pShapeRef,sal_Bool bFloatingCtrl)
-{
-
- SvStorageStreamRef xCrash = rSrc1->OpenSotStream( WW8_ASCII2STR("contents") );
- sal_Bool bRet=sal_False;
-
- SvStorageStreamRef xSrc2 = rSrc1->OpenSotStream( WW8_ASCII2STR("\3OCXNAME") );
- SvStorageStream* pSt = xSrc2;
- pSt->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
-
- /* #117832# import control name */
- OUString controlName;
- bool hasCName = readOCXNAME( controlName, pSt );
-
- xSrc2 = rSrc1->OpenSotStream( WW8_ASCII2STR("contents") );
- pSt = xSrc2;
- pSt->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
-
- /*Get Class Id of this object, see if it is one of the types
- *that this importer can handle, call the appropiate handler
- to read that control, and call the appropiate handler to
- insert that control
- */
-
- SvGlobalName aTest = rSrc1->GetClassName();
- OCX_Control *pObj = OCX_Factory(aTest.GetHexName());
- if (pObj)
- {
- pObj->pDocSh = pDocSh;
- /* #117832# set imported control name */
- if ( hasCName )
- {
- pObj->sName = controlName;
- }
- com::sun::star::awt::Size aSz;
- uno::Reference< form::XFormComponent > xFComp;
- const uno::Reference< lang::XMultiServiceFactory > & rServiceFactory =
- GetServiceFactory();
- if(!rServiceFactory.is())
- return(sal_False);
- bRet = pObj->FullRead(pSt);
- if(bRet)
- if (pObj->Import(rServiceFactory,xFComp,aSz))
- bRet = InsertControl( xFComp, aSz,pShapeRef,bFloatingCtrl);
- delete pObj;
- }
- return bRet;
-}
-
-
-sal_Bool SvxMSConvertOCXControls::ReadOCXExcelKludgeStream(
- SvStorageStreamRef& rSrc1, uno::Reference < drawing::XShape > *
- pShapeRef,sal_Bool bFloatingCtrl)
-{
- sal_Bool bRet=sal_False;
- /*Get Class Id of this object, see if it is one of the types
- *that this importer can handle, call the appropiate handler
- to read that control, and call the appropiate handler to
- insert that control
- */
- /*The Excel Kludge is to concatenate a class id with a contents
- * stream, and then concatenate all the controls together,
- * This means that you should have the cnts stream wound to the
- * correct location before passing the control stream in here*/
- SvStream *pSt = rSrc1;
- pSt->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- SvGlobalName aTest;
- *pSt >> aTest;
- OCX_Control *pObj = OCX_Factory(aTest.GetHexName());
- if (pObj)
- {
-
- com::sun::star::awt::Size aSz;
- uno::Reference< form::XFormComponent > xFComp;
- const uno::Reference< lang::XMultiServiceFactory > & rServiceFactory =
- GetServiceFactory();
- if(!rServiceFactory.is())
- return(sal_False);
- bRet = pObj->FullRead(rSrc1);
- if(bRet)
- if (pObj->Import(rServiceFactory,xFComp,aSz))
- bRet = InsertControl( xFComp, aSz,pShapeRef,bFloatingCtrl);
- delete pObj;
- }
- return bRet;
-}
-
-
sal_Bool SvxMSConvertOCXControls::WriteOCXStream( SvStorageRef& rSrc1,
const uno::Reference< awt::XControlModel > &rControlModel,
const awt::Size &rSize, String &rName)
diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx
index 43e37650dbdd..398d281088f5 100644
--- a/filter/source/msfilter/mstoolbar.cxx
+++ b/filter/source/msfilter/mstoolbar.cxx
@@ -421,7 +421,7 @@ WString::Read( SvStream *pS )
{
OSL_TRACE("WString::Read() stream pos 0x%x", pS->Tell() );
nOffSet = pS->Tell();
- sal_Int8 nChars = 0;
+ sal_uInt8 nChars = 0;
*pS >> nChars;
sString = readUnicodeString( pS, nChars );
return true;
diff --git a/filter/source/msfilter/powerpoint/pptimporteruno.cxx b/filter/source/msfilter/powerpoint/pptimporteruno.cxx
index 0cf1998d15f2..119e8bc5038e 100644
--- a/filter/source/msfilter/powerpoint/pptimporteruno.cxx
+++ b/filter/source/msfilter/powerpoint/pptimporteruno.cxx
@@ -39,11 +39,6 @@ static REF( NMSP_UNO::XInterface ) SAL_CALL create_PptImporter( const REF( NMSP_
return REF( NMSP_UNO::XInterface )( *new PptImporter( rxFact ) );
}
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
{
REF( NMSP_LANG::XSingleServiceFactory ) xFactory;
diff --git a/filter/source/msfilter/services.cxx b/filter/source/msfilter/services.cxx
index 09a303f72141..cd081b5f7756 100644
--- a/filter/source/msfilter/services.cxx
+++ b/filter/source/msfilter/services.cxx
@@ -59,17 +59,7 @@ static ::cppu::ImplementationEntry const spServices[] =
} // namespace
-// ----------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ )
-{
- *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey )
{
return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices );
}
-
-// ============================================================================
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index b6d54ff2cf90..2d812f1c9178 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -127,6 +127,7 @@
#include <vcl/virdev.hxx>
#include <algorithm>
#include <set>
+#include <unotools/streamwrap.hxx>
// PPT ColorScheme Slots
#define PPT_COLSCHEME (0x08000000)
@@ -1235,9 +1236,9 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
if ( rPersistEntry.pSolverContainer )
{
- for ( SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)rPersistEntry.pSolverContainer->aCList.First();
- pPtr; pPtr = (SvxMSDffConnectorRule*)rPersistEntry.pSolverContainer->aCList.Next() )
+ for ( size_t i = 0; i < rPersistEntry.pSolverContainer->aCList.size(); ++i )
{
+ SvxMSDffConnectorRule* pPtr = rPersistEntry.pSolverContainer->aCList[ i ];
if ( rObjData.nShapeId == pPtr->nShapeC )
pPtr->pCObj = pRet;
else
@@ -1676,6 +1677,24 @@ SdrPowerPointImport::~SdrPowerPointImport()
delete[] pPersistPtr;
}
+sal_Bool PPTConvertOCXControls::ReadOCXStream( SotStorageRef& /*rSrc1*/,
+ com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShape > *pShapeRef,
+ sal_Bool bFloatingCtrl )
+{
+ bool bRes = false;
+ uno::Reference< form::XFormComponent > xFComp;
+ if ( mpPPTImporter && mpPPTImporter->ReadFormControl( mxInStrm, xFComp ) )
+ {
+ if ( xFComp.is() )
+ {
+ com::sun::star::awt::Size aSz; // not used in import
+ bRes = InsertControl( xFComp, aSz,pShapeRef,bFloatingCtrl);
+ }
+ }
+ return bRes;
+}
+
sal_Bool PPTConvertOCXControls::InsertControl(
const com::sun::star::uno::Reference<
com::sun::star::form::XFormComponent > &rFComp,
@@ -1731,7 +1750,6 @@ sal_Bool PPTConvertOCXControls::InsertControl(
}
return bRetValue;
};
-
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& PPTConvertOCXControls::GetDrawPage()
{
if( !xDrawPage.is() && pDocSh )
@@ -1890,10 +1908,12 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
}
if ( !pRet && ( pOe->nType == PPT_PST_ExControl ) )
{
- PPTConvertOCXControls aPPTConvertOCXControls( pOe->pShell, eAktPageKind );
+ uno::Reference< io::XInputStream > xIStrm = new utl::OSeekableInputStreamWrapper(*pDest );
+ PPTConvertOCXControls aPPTConvertOCXControls( this, xIStrm, pOe->pShell, eAktPageKind );
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape;
if ( aPPTConvertOCXControls.ReadOCXStream( xObjStor, &xShape, sal_False ) )
pRet = GetSdrObjectFromXShape( xShape );
+
}
if ( !pRet )
{
@@ -6581,7 +6601,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
// now will search for possible textextensions such as date/time fields
// or ParaTabStops and append them on this textobj
rIn.Seek( nFilePos );
- List* pFieldList = NULL;
+ ::std::vector< PPTFieldEntry* > FieldList;
while ( rIn.Tell() < aClientTextBoxHd.GetRecEndFilePos() )
{
rIn >> aTextHd;
@@ -6753,20 +6773,23 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
aTextHd.SeekToEndOfRecord( rIn );
if ( pEntry )
{
- if ( !pFieldList )
- pFieldList = new List;
- sal_uInt32 n;
- for ( n = 0; n < pFieldList->Count(); n++ )
- { // sorting fields ( hi >> lo )
- if ( ( (PPTFieldEntry*)pFieldList->GetObject( n ) )->nPos < pEntry->nPos )
+ // sorting fields ( hi >> lo )
+ ::std::vector< PPTFieldEntry* >::iterator it = FieldList.begin();
+ for( ; it < FieldList.end(); ++it ) {
+ if ( (*it)->nPos < pEntry->nPos ) {
break;
+ }
+ }
+ if ( it < FieldList.end() ) {
+ FieldList.insert( it, pEntry );
+ } else {
+ FieldList.push_back( pEntry );
}
- pFieldList->Insert( pEntry, (sal_uInt32)n );
}
}
- if ( pFieldList )
+ if ( !FieldList.empty() )
{
- PPTFieldEntry* pFE = (PPTFieldEntry*)pFieldList->First();
+ ::std::vector< PPTFieldEntry* >::iterator FE = FieldList.begin();
List& aCharPropList = aStyleTextPropReader.aCharPropList;
sal_Int32 i = nParagraphs - 1;
@@ -6774,21 +6797,21 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
// at this point we just have a list of textportions(aCharPropList)
// the next while loop tries to resolve the list of fields(pFieldList)
- while( pFE && ( n >= 0 ) && ( i >= 0 ) )
+ while( ( FE < FieldList.end() ) && ( n >= 0 ) && ( i >= 0 ) )
{
- PPTCharPropSet* pSet = (PPTCharPropSet*)aCharPropList.GetObject( n );
+ PPTCharPropSet* pSet = (PPTCharPropSet*)aCharPropList.GetObject( n );
String aString( pSet->maString );
sal_uInt32 nCount = aString.Len();
sal_uInt32 nPos = pSet->mnOriginalTextPos + nCount;
- while ( pFE && nCount-- )
+ while ( ( FE < FieldList.end() ) && nCount-- )
{
nPos--;
- while ( pFE && ( pFE->nPos > nPos ) )
- pFE = (PPTFieldEntry*)pFieldList->Next();
- if ( !pFE )
+ while ( ( FE < FieldList.end() ) && ( (*FE)->nPos > nPos ) )
+ ++FE;
+ if ( !(FE < FieldList.end()) )
break;
- if ( pFE->nPos == nPos )
+ if ( (*FE)->nPos == nPos )
{
if ( aString.GetChar( (sal_uInt16)nCount ) == 0x2a )
{
@@ -6800,10 +6823,10 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
pNewCPS->maString = String( aString, (sal_uInt16)nCount + 1, (sal_uInt16)nBehind );
aCharPropList.Insert( pNewCPS, n + 1 );
}
- if ( pFE->pField2 )
+ if ( (*FE)->pField2 )
{
PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pSet );
- pNewCPS->mpFieldItem = pFE->pField2, pFE->pField2 = NULL;
+ pNewCPS->mpFieldItem = (*FE)->pField2, (*FE)->pField2 = NULL;
aCharPropList.Insert( pNewCPS, n + 1 );
pNewCPS = new PPTCharPropSet( *pSet );
@@ -6816,18 +6839,18 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
pNewCPS->maString = String( aString, (sal_uInt16)0, (sal_uInt16)nCount );
aCharPropList.Insert( pNewCPS, n++ );
}
- if ( pFE->pField1 )
+ if ( (*FE)->pField1 )
{
- pSet->mpFieldItem = pFE->pField1, pFE->pField1 = NULL;
+ pSet->mpFieldItem = (*FE)->pField1, (*FE)->pField1 = NULL;
}
- else if ( pFE->pString )
- pSet->maString = *pFE->pString;
+ else if ( (*FE)->pString )
+ pSet->maString = *(*FE)->pString;
}
else
{
- if ( pFE->nTextRangeEnd ) // text range hyperlink
+ if ( (*FE)->nTextRangeEnd ) // text range hyperlink
{
- sal_uInt32 nHyperLen = pFE->nTextRangeEnd - nPos;
+ sal_uInt32 nHyperLen = (*FE)->nTextRangeEnd - nPos;
if ( nHyperLen )
{
PPTCharPropSet* pBefCPS = NULL;
@@ -6847,11 +6870,11 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
PPTCharPropSet* pCurrent = (PPTCharPropSet*)aCharPropList.GetObject( nIdx );
sal_Int32 nNextStringLen = pCurrent->maString.Len();
- DBG_ASSERT( pFE->pField1, "missing field!" );
- if (!pFE->pField1)
+ DBG_ASSERT( (*FE)->pField1, "missing field!" );
+ if (!(*FE)->pField1)
break;
- const SvxURLField* pField = (const SvxURLField*)pFE->pField1->GetField();
+ const SvxURLField* pField = (const SvxURLField*)(*FE)->pField1->GetField();
if ( pCurrent->mpFieldItem )
{
@@ -6893,7 +6916,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
}
nIdx++;
}
- delete pFE->pField1, pFE->pField1 = NULL;
+ delete (*FE)->pField1, (*FE)->pField1 = NULL;
if ( pBefCPS )
{
@@ -6909,9 +6932,9 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
}
n--;
}
- for ( void* pPtr = pFieldList->First(); pPtr; pPtr = pFieldList->Next() )
- delete (PPTFieldEntry*)pPtr;
- delete pFieldList;
+ for( size_t j = 0, n2 = FieldList.size(); j < n2; ++j ) {
+ delete FieldList[ j ];
+ }
}
mpImplTextObj->mpParagraphList = new PPTParagraphObj*[ nParagraphs ];
aStyleTextPropReader.aCharPropList.First();
@@ -7500,9 +7523,9 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
// possibly connections to the group object have to be removed.
if ( pSolverContainer )
{
- for ( SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)pSolverContainer->aCList.First();
- pPtr; pPtr = (SvxMSDffConnectorRule*)pSolverContainer->aCList.Next() )
+ for ( size_t i = 0; i < pSolverContainer->aCList.size(); ++i )
{
+ SvxMSDffConnectorRule* pPtr = pSolverContainer->aCList[ i ];
SdrObjListIter aIter( *pGroup, IM_DEEPWITHGROUPS );
while( aIter.IsMore() )
{
diff --git a/filter/source/odfflatxml/OdfFlatXml.cxx b/filter/source/odfflatxml/OdfFlatXml.cxx
index 005bc9a11c2b..4be92503fb1f 100644
--- a/filter/source/odfflatxml/OdfFlatXml.cxx
+++ b/filter/source/odfflatxml/OdfFlatXml.cxx
@@ -235,8 +235,6 @@ Reference< XInterface > SAL_CALL OdfFlatXml::impl_createInstance(const Reference
}
-_COMPHELPER_COMPONENT_GETIMPLEMENTATIONENVIRONMENT
-
// extern "C" component_getFactory()
_COMPHELPER_COMPONENT_GETFACTORY
(
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index adcb7135fd45..22823d9fb67f 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -434,6 +434,8 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent,
maCbReduceImageResolution( this, PDFFilterResId( CB_REDUCEIMAGERESOLUTION ) ),
maCoReduceImageResolution( this, PDFFilterResId( CO_REDUCEIMAGERESOLUTION ) ),
+ m_aVerticalLine(this, PDFFilterResId(FL_GENERAL_VERTICAL)),
+
maFlGeneral( this, PDFFilterResId( FL_GENERAL ) ),
maCbPDFA1b( this, PDFFilterResId( CB_PDFA_1B_SELECT ) ),
@@ -791,6 +793,8 @@ ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage( Window* pParent,
maRbMagnZoom( this, PDFFilterResId( RB_MAGNF_ZOOM ) ),
maNumZoom( this, PDFFilterResId( NUM_MAGNF_ZOOM ) ),
+ m_aVerticalLine(this, PDFFilterResId(FL_INITVIEW_VERTICAL)),
+
maFlPageLayout( this, PDFFilterResId( FL_PAGE_LAYOUT ) ),
maRbPgLyDefault( this, PDFFilterResId( RB_PGLY_DEFAULT ) ),
maRbPgLySinglePage( this, PDFFilterResId( RB_PGLY_SINGPG ) ),
@@ -955,6 +959,8 @@ ImpPDFTabViewerPage::ImpPDFTabViewerPage( Window* pParent,
maCbOpenFullScreen( this, PDFFilterResId( CB_WNDOPT_OPNFULL ) ),
maCbDispDocTitle( this, PDFFilterResId( CB_DISPDOCTITLE ) ),
+ m_aVerticalLine(this, PDFFilterResId(FL_VPREFER_VERTICAL)),
+
maFlUIOptions( this, PDFFilterResId( FL_USRIFOPT ) ),
maCbHideViewerMenubar( this, PDFFilterResId( CB_UOP_HIDEVMENUBAR ) ),
maCbHideViewerToolbar( this, PDFFilterResId( CB_UOP_HIDEVTOOLBAR ) ),
@@ -1053,6 +1059,8 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage( Window* i_pParent,
maOwnerPwdUnset( PDFFilterResId( STR_OWNER_PWD_UNSET ) ),
maOwnerPwdPdfa( PDFFilterResId( STR_OWNER_PWD_PDFA ) ),
+ m_aVerticalLine(this, PDFFilterResId(FL_SECURITY_VERTICAL)),
+
maFlPrintPermissions( this, PDFFilterResId( FL_PRINT_PERMISSIONS ) ),
maRbPrintNone( this, PDFFilterResId( RB_PRINT_NONE ) ),
maRbPrintLowRes( this, PDFFilterResId( RB_PRINT_LOWRES ) ),
diff --git a/filter/source/pdf/impdialog.hrc b/filter/source/pdf/impdialog.hrc
index cd7015f7ef99..eae1c8d53b06 100644
--- a/filter/source/pdf/impdialog.hrc
+++ b/filter/source/pdf/impdialog.hrc
@@ -187,3 +187,8 @@
#define CB_CNV_OOO_DOCTOPDF 155
#define CB_EXP_BMRK_TO_DEST 156
+
+#define FL_GENERAL_VERTICAL 157
+#define FL_INITVIEW_VERTICAL 158
+#define FL_VPREFER_VERTICAL 158
+#define FL_SECURITY_VERTICAL 160
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index be565eef93e6..b3e6c23e741f 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -190,6 +190,8 @@ class ImpPDFTabGeneralPage : public SfxTabPage
CheckBox maCbReduceImageResolution;
ComboBox maCoReduceImageResolution;
+ FixedLine m_aVerticalLine;
+
FixedLine maFlGeneral;
CheckBox maCbPDFA1b;
CheckBox maCbTaggedPDF;
@@ -254,6 +256,8 @@ class ImpPDFTabOpnFtrPage : public SfxTabPage
RadioButton maRbMagnZoom;
MetricField maNumZoom;
+ FixedLine m_aVerticalLine;
+
FixedLine maFlPageLayout;
RadioButton maRbPgLyDefault;
RadioButton maRbPgLySinglePage;
@@ -287,6 +291,8 @@ class ImpPDFTabViewerPage : public SfxTabPage
CheckBox maCbOpenFullScreen;
CheckBox maCbDispDocTitle;
+ FixedLine m_aVerticalLine;
+
FixedLine maFlUIOptions;
CheckBox maCbHideViewerMenubar;
CheckBox maCbHideViewerToolbar;
@@ -330,6 +336,8 @@ class ImpPDFTabSecurityPage : public SfxTabPage
String maOwnerPwdUnset;
String maOwnerPwdPdfa;
+ FixedLine m_aVerticalLine;
+
FixedLine maFlPrintPermissions;
RadioButton maRbPrintNone;
RadioButton maRbPrintLowRes;
diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src
index e65e4dd5da57..b54e1c8d761c 100644
--- a/filter/source/pdf/impdialog.src
+++ b/filter/source/pdf/impdialog.src
@@ -27,7 +27,7 @@
#include "impdialog.hrc"
-#define TAB_PDF_SIZE Size = MAP_APPFONT ( 176, 268 )
+#define TAB_PDF_SIZE Size = MAP_APPFONT ( 352, 155 )
//string for TabDialog standard buttons
String STR_PDF_EXPORT
{
@@ -153,16 +153,24 @@ TabPage RID_PDF_TAB_GENER
"1200 DPI" ;
};
};
+
+ FixedLine FL_GENERAL_VERTICAL
+ {
+ Pos = MAP_APPFONT ( 175 , 3 ) ;
+ Size = MAP_APPFONT ( 4 , 150 ) ;
+ Vert = TRUE;
+ };
+
FixedLine FL_GENERAL
{
- Pos = MAP_APPFONT ( 6 , 117 ) ;
+ Pos = MAP_APPFONT ( 182 , 3 ) ;
Size = MAP_APPFONT ( 164 , 8 ) ;
Text[ en-US ] = "General";
};
CheckBox CB_PDFA_1B_SELECT
{
HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_PDFA_1B_SELECT";
- Pos = MAP_APPFONT ( 12, 128 ) ;
+ Pos = MAP_APPFONT ( 188, 14 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "P~DF/A-1a";
@@ -170,7 +178,7 @@ TabPage RID_PDF_TAB_GENER
CheckBox CB_TAGGEDPDF
{
HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_TAGGEDPDF";
- Pos = MAP_APPFONT ( 12 , 141 ) ;
+ Pos = MAP_APPFONT ( 188 , 27 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "~Tagged PDF";
@@ -178,14 +186,14 @@ TabPage RID_PDF_TAB_GENER
CheckBox CB_EXPORTFORMFIELDS
{
HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTFORMFIELDS";
- Pos = MAP_APPFONT ( 12 , 154 ) ;
+ Pos = MAP_APPFONT ( 188 , 40 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "~Create PDF form";
};
FixedText FT_FORMSFORMAT
{
- Pos = MAP_APPFONT ( 30 , 168 ) ;
+ Pos = MAP_APPFONT ( 206 , 54 ) ;
Size = MAP_APPFONT ( 93, 8 ) ;
Text[ en-US ] = "Submit ~format";
};
@@ -193,7 +201,7 @@ TabPage RID_PDF_TAB_GENER
{
HelpID = "filter:ListBox:RID_PDF_TAB_GENER:LB_FORMSFORMAT";
Border = TRUE ;
- Pos = MAP_APPFONT ( 126, 166 ) ;
+ Pos = MAP_APPFONT ( 302, 52 ) ;
Size = MAP_APPFONT ( 38, 48 ) ;
DeltaLang = < Default ; Default ; Default ; Default ; > ;
TabStop = TRUE ;
@@ -209,7 +217,7 @@ TabPage RID_PDF_TAB_GENER
CheckBox CB_ALLOWDUPLICATEFIELDNAMES
{
HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_ALLOWDUPLICATEFIELDNAMES";
- Pos = MAP_APPFONT( 30, 178 );
+ Pos = MAP_APPFONT( 206, 64 );
Size = MAP_APPFONT( 128, 10 );
TabStop = TRUE;
Text [ en-US ] = "Allow duplicate field ~names";
@@ -217,7 +225,7 @@ TabPage RID_PDF_TAB_GENER
CheckBox CB_EXPORTBOOKMARKS
{
HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTBOOKMARKS";
- Pos = MAP_APPFONT ( 12 , 190 ) ;
+ Pos = MAP_APPFONT ( 188 , 76 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "Export ~bookmarks";
@@ -225,7 +233,7 @@ TabPage RID_PDF_TAB_GENER
CheckBox CB_EXPORTNOTES
{
HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTNOTES";
- Pos = MAP_APPFONT ( 12 , 203 ) ;
+ Pos = MAP_APPFONT ( 188 , 89 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "~Export comments";
@@ -233,7 +241,7 @@ TabPage RID_PDF_TAB_GENER
CheckBox CB_EXPORTNOTESPAGES
{
HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTNOTESPAGES";
- Pos = MAP_APPFONT ( 12 , 216 ) ;
+ Pos = MAP_APPFONT ( 188 , 102 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "Export ~notes pages";
@@ -241,7 +249,7 @@ TabPage RID_PDF_TAB_GENER
CheckBox CB_EXPORTEMPTYPAGES
{
HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTEMPTYPAGES";
- Pos = MAP_APPFONT ( 12 , 229 ) ;
+ Pos = MAP_APPFONT ( 188 , 115 ) ;
Size = MAP_APPFONT ( 158 , 16 ) ;
TabStop = TRUE ;
WordBreak = TRUE ;
@@ -250,7 +258,7 @@ TabPage RID_PDF_TAB_GENER
CheckBox CB_EMBEDSTANDARDFONTS
{
HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EMBEDSTANDARDFONTS";
- Pos = MAP_APPFONT ( 12 , 248 ) ;
+ Pos = MAP_APPFONT ( 188 , 134 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "E~mbed standard fonts";
@@ -258,7 +266,7 @@ TabPage RID_PDF_TAB_GENER
CheckBox CB_ADDSTREAM
{
HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_ADDSTREAM";
- Pos = MAP_APPFONT ( 12 , 261 ) ;
+ Pos = MAP_APPFONT ( 188 , 147 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "Create ~hybrid file";
@@ -385,45 +393,52 @@ TabPage RID_PDF_TAB_OPNFTR
Minimum = 50;
Maximum = 1600;
};
-////////////////////////////////////////
+
+ FixedLine FL_INITVIEW_VERTICAL
+ {
+ Pos = MAP_APPFONT ( 175 , 3 ) ;
+ Size = MAP_APPFONT ( 4 , 150 ) ;
+ Vert = TRUE;
+ };
+
FixedLine FL_PAGE_LAYOUT
{
- Pos = MAP_APPFONT ( 6 , 146 ) ;
- Size = MAP_APPFONT (164 , 8 ) ;
+ Pos = MAP_APPFONT ( 182 , 3 ) ;
+ Size = MAP_APPFONT (164 , 8 ) ;
Text[ en-US ] = "Page layout" ;
};
RadioButton RB_PGLY_DEFAULT
{
HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_DEFAULT";
- Pos = MAP_APPFONT ( 12 , 158 ) ;
+ Pos = MAP_APPFONT ( 188 , 15 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "D~efault" ;
};
RadioButton RB_PGLY_SINGPG
{
HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_SINGPG";
- Pos = MAP_APPFONT ( 12 , 170 ) ;
+ Pos = MAP_APPFONT ( 188 , 27 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "~Single page" ;
};
RadioButton RB_PGLY_CONT
{
HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_CONT";
- Pos = MAP_APPFONT ( 12 , 182 ) ;
+ Pos = MAP_APPFONT ( 188 , 39 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "~Continuous" ;
};
RadioButton RB_PGLY_CONTFAC
{
HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_CONTFAC";
- Pos = MAP_APPFONT ( 12 , 194 ) ;
+ Pos = MAP_APPFONT ( 188 , 51 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "C~ontinuous facing" ;
};
CheckBox CB_PGLY_FIRSTLEFT
{
HelpID = "filter:CheckBox:RID_PDF_TAB_OPNFTR:CB_PGLY_FIRSTLEFT";
- Pos = MAP_APPFONT ( 22 , 206 ) ;
+ Pos = MAP_APPFONT ( 198 , 63 ) ;
Size = MAP_APPFONT ( 148 , 10 ) ;
Text[ en-US ] = "First page is ~left" ;
};
@@ -478,17 +493,23 @@ TabPage RID_PDF_TAB_VPREFER
Text[ en-US ] = "~Display document title";
};
-////////////////////////////////
+ FixedLine FL_VPREFER_VERTICAL
+ {
+ Pos = MAP_APPFONT ( 175 , 3 ) ;
+ Size = MAP_APPFONT ( 4 , 150 ) ;
+ Vert = TRUE;
+ };
+
FixedLine FL_USRIFOPT
{
- Pos = MAP_APPFONT ( 6 , 64 ) ;
+ Pos = MAP_APPFONT ( 182 , 3 ) ;
Size = MAP_APPFONT ( 164 , 8 ) ;
Text[ en-US ] = "User interface options" ;
};
CheckBox CB_UOP_HIDEVMENUBAR
{
HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_UOP_HIDEVMENUBAR";
- Pos = MAP_APPFONT ( 12 , 76 ) ;
+ Pos = MAP_APPFONT ( 188 , 15 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "Hide ~menubar";
@@ -496,7 +517,7 @@ TabPage RID_PDF_TAB_VPREFER
CheckBox CB_UOP_HIDEVTOOLBAR
{
HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_UOP_HIDEVTOOLBAR";
- Pos = MAP_APPFONT ( 12 , 88 ) ;
+ Pos = MAP_APPFONT ( 188 , 27 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "Hide ~toolbar";
@@ -504,7 +525,7 @@ TabPage RID_PDF_TAB_VPREFER
CheckBox CB_UOP_HIDEVWINCTRL
{
HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_UOP_HIDEVWINCTRL";
- Pos = MAP_APPFONT ( 12 , 100 ) ;
+ Pos = MAP_APPFONT ( 188 , 39 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "Hide ~window controls";
@@ -513,14 +534,14 @@ TabPage RID_PDF_TAB_VPREFER
////////////////////////////////
FixedLine FL_TRANSITIONS
{
- Pos = MAP_APPFONT ( 6 , 114 ) ;
+ Pos = MAP_APPFONT ( 6 , 64 ) ;
Size = MAP_APPFONT ( 164 , 8 ) ;
Text[ en-US ] = "Transitions" ;
};
CheckBox CB_TRANSITIONEFFECTS
{
HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_TRANSITIONEFFECTS";
- Pos = MAP_APPFONT ( 12 , 126 ) ;
+ Pos = MAP_APPFONT ( 12 , 76 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "~Use transition effects";
@@ -528,28 +549,28 @@ TabPage RID_PDF_TAB_VPREFER
////////////////////////////////
FixedLine FL_BOOKMARKS
{
- Pos = MAP_APPFONT ( 6 , 140 ) ;
+ Pos = MAP_APPFONT ( 182 , 64 ) ;
Size = MAP_APPFONT ( 164 , 8 ) ;
Text[ en-US ] = "Bookmarks" ;
};
RadioButton RB_ALLBOOKMARKLEVELS
{
HelpID = "filter:RadioButton:RID_PDF_TAB_VPREFER:RB_ALLBOOKMARKLEVELS";
- Pos = MAP_APPFONT ( 12 , 152 ) ;
+ Pos = MAP_APPFONT ( 188 , 76 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "All bookmark levels";
};
RadioButton RB_VISIBLEBOOKMARKLEVELS
{
HelpID = "filter:RadioButton:RID_PDF_TAB_VPREFER:RB_VISIBLEBOOKMARKLEVELS";
- Pos = MAP_APPFONT ( 12 , 166 ) ;
+ Pos = MAP_APPFONT ( 188 , 90 ) ;
Size = MAP_APPFONT ( 117 , 10 ) ;
Text[ en-US ] = "Visible bookmark levels";
};
NumericField NUM_BOOKMARKLEVELS
{
HelpID = "filter:NumericField:RID_PDF_TAB_VPREFER:NUM_BOOKMARKLEVELS";
- Pos = MAP_APPFONT ( 132 , 165 ) ;
+ Pos = MAP_APPFONT ( 308 , 89 ) ;
Size = MAP_APPFONT ( 32 , 12 ) ;
Border = TRUE;
Spin = TRUE;
@@ -649,31 +670,37 @@ TabPage RID_PDF_TAB_SECURITY
Text [en-US] = "PDF document will not be restricted due to PDF/A export.";
};
-//////////////////////////////
+ FixedLine FL_SECURITY_VERTICAL
+ {
+ Pos = MAP_APPFONT ( 175 , 3 ) ;
+ Size = MAP_APPFONT ( 4 , 150 ) ;
+ Vert = TRUE;
+ };
+
FixedLine FL_PRINT_PERMISSIONS
{
- Pos = MAP_APPFONT ( 12 , 90 ) ;
+ Pos = MAP_APPFONT ( 182 , 5 ) ;
Size = MAP_APPFONT (156 , 8 ) ;
Text[ en-US ] = "Printing" ;
};
RadioButton RB_PRINT_NONE
{
HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_PRINT_NONE";
- Pos = MAP_APPFONT ( 18 , 101 ) ;
+ Pos = MAP_APPFONT ( 188 , 16 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "~Not permitted";
};
RadioButton RB_PRINT_LOWRES
{
HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_PRINT_LOWRES";
- Pos = MAP_APPFONT ( 18 , 112 ) ;
+ Pos = MAP_APPFONT ( 188 , 27 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "~Low resolution (150 dpi)";
};
RadioButton RB_PRINT_HIGHRES
{
HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_PRINT_HIGHRES";
- Pos = MAP_APPFONT ( 18 , 123 ) ;
+ Pos = MAP_APPFONT ( 188 , 38 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "~High resolution";
};
@@ -681,35 +708,35 @@ TabPage RID_PDF_TAB_SECURITY
/////////////////////////////
FixedLine FL_CHANGES_ALLOWED
{
- Pos = MAP_APPFONT ( 12 , 134 ) ;
+ Pos = MAP_APPFONT ( 182 , 49 ) ;
Size = MAP_APPFONT (156 , 8 ) ;
Text[ en-US ] = "Changes" ;
};
RadioButton RB_CHANGES_NONE
{
HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_NONE";
- Pos = MAP_APPFONT ( 18 , 145 ) ;
+ Pos = MAP_APPFONT ( 188 , 60 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "No~t permitted";
};
RadioButton RB_CHANGES_INSDEL
{
HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_INSDEL";
- Pos = MAP_APPFONT ( 18 , 157 ) ;
+ Pos = MAP_APPFONT ( 188 , 72 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "~Inserting, deleting, and rotating pages";
};
RadioButton RB_CHANGES_FILLFORM
{
HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_FILLFORM";
- Pos = MAP_APPFONT ( 18 , 168 ) ;
+ Pos = MAP_APPFONT ( 188 , 83 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "~Filling in form fields";
};
RadioButton RB_CHANGES_COMMENT
{
HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_COMMENT";
- Pos = MAP_APPFONT ( 18 , 179 ) ;
+ Pos = MAP_APPFONT ( 188 , 94 ) ;
Size = MAP_APPFONT ( 152 , 16 ) ;
WordBreak = TRUE ;
Text[ en-US ] = "~Commenting, filling in form fields";
@@ -717,7 +744,7 @@ TabPage RID_PDF_TAB_SECURITY
RadioButton RB_CHANGES_ANY_NOCOPY
{
HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_ANY_NOCOPY";
- Pos = MAP_APPFONT ( 18 , 198 ) ;
+ Pos = MAP_APPFONT ( 188 , 113 ) ;
Size = MAP_APPFONT ( 152 , 10 ) ;
Text[ en-US ] = "~Any except extracting pages";
};
@@ -725,7 +752,7 @@ TabPage RID_PDF_TAB_SECURITY
CheckBox CB_ENDAB_COPY
{
HelpID = "filter:CheckBox:RID_PDF_TAB_SECURITY:CB_ENDAB_COPY";
- Pos = MAP_APPFONT ( 12 , 211 ) ;
+ Pos = MAP_APPFONT ( 182 , 126 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "Ena~ble copying of content" ;
@@ -734,7 +761,7 @@ TabPage RID_PDF_TAB_SECURITY
CheckBox CB_ENAB_ACCESS
{
HelpID = "filter:CheckBox:RID_PDF_TAB_SECURITY:CB_ENAB_ACCESS";
- Pos = MAP_APPFONT ( 12 , 224 ) ;
+ Pos = MAP_APPFONT ( 182 , 139 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
Text[ en-US ] = "Enable text access for acce~ssibility tools" ;
diff --git a/filter/source/pdf/pdfuno.cxx b/filter/source/pdf/pdfuno.cxx
index 3dc446d4bad7..a1f4e99fe842 100644
--- a/filter/source/pdf/pdfuno.cxx
+++ b/filter/source/pdf/pdfuno.cxx
@@ -47,14 +47,6 @@ using namespace ::com::sun::star::registry;
extern "C"
{
- SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** )
- {
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
- }
-
- // -------------------------------------------------------------------------
-
SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
OUString aImplName( OUString::createFromAscii( pImplName ) );
diff --git a/filter/source/placeware/exports.dxp b/filter/source/placeware/exports.dxp
index f0e1c69934bc..70033078921a 100644
--- a/filter/source/placeware/exports.dxp
+++ b/filter/source/placeware/exports.dxp
@@ -1,2 +1 @@
-component_getImplementationEnvironment
component_getFactory
diff --git a/filter/source/placeware/uno.cxx b/filter/source/placeware/uno.cxx
index 49a5c599c1eb..6ebdbd12a006 100644
--- a/filter/source/placeware/uno.cxx
+++ b/filter/source/placeware/uno.cxx
@@ -53,13 +53,6 @@ using namespace ::pwp;
extern "C"
{
-//==================================================================================================
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-//==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
diff --git a/filter/source/svg/exports.map b/filter/source/svg/exports.map
index d679dfda4fb7..e28b04cb046a 100644
--- a/filter/source/svg/exports.map
+++ b/filter/source/svg/exports.map
@@ -1,6 +1,5 @@
UDK_3_0_0 {
global:
- component_getImplementationEnvironment;
component_getFactory;
GraphicImport;
diff --git a/filter/source/svg/makefile.mk b/filter/source/svg/makefile.mk
index 4c914539299d..425eae9489a2 100644
--- a/filter/source/svg/makefile.mk
+++ b/filter/source/svg/makefile.mk
@@ -84,7 +84,8 @@ SHL1STDLIBS=\
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(SALLIB) \
- $(LIBXML)
+ $(LIBXML) \
+ $(SVLLIB)
SHL1DEPN=
SHL1IMPLIB= i$(SHL1TARGET)
diff --git a/filter/source/svg/svgdialog.cxx b/filter/source/svg/svgdialog.cxx
index a3054537b7b4..6787a38fa7da 100644
--- a/filter/source/svg/svgdialog.cxx
+++ b/filter/source/svg/svgdialog.cxx
@@ -112,12 +112,6 @@ Reference< XInterface > SAL_CALL SVGDialog_createInstance( const Reference< XMul
SVGDialog::SVGDialog( const Reference< XMultiServiceFactory > &rxMSF ) :
OGenericUnoDialog( rxMSF )
{
- ByteString aResMgrName( "svgfilter" );
-
- aResMgrName.Append( ByteString::CreateFromInt32( 0/*SOLARUPD*/ ) );
-
- // !!! KA: enable ResMgr
- // mapResMgr.reset( ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ) );
}
// -----------------------------------------------------------------------------
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 6a523541c221..b23e40a91a7b 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -37,6 +37,7 @@
#include "svgwriter.hxx"
#include "svgfontexport.hxx"
#include "svgfilter.hxx"
+#include "svgscript.hxx"
#include "impsvgdialog.hxx"
#include <svtools/FilterConfigItem.hxx>
@@ -47,9 +48,273 @@
#include <editeng/outliner.hxx>
#include <editeng/flditem.hxx>
#include <editeng/numitem.hxx>
+#include <comphelper/processfactory.hxx>
+#include <i18npool/lang.h>
+#include <svl/zforlist.hxx>
+
+#include <boost/preprocessor/repetition/repeat.hpp>
+
using ::rtl::OUString;
+
+
+
+// -------------------------------
+// - ooo elements and attributes -
+// -------------------------------
+
+#define NSPREFIX "ooo:"
+
+// ooo xml elements
+static const char aOOOElemMetaSlides[] = NSPREFIX "meta_slides";
+static const char aOOOElemMetaSlide[] = NSPREFIX "meta_slide";
+static const char aOOOElemTextField[] = NSPREFIX "text_field";
+
+// ooo xml attributes for meta_slides
+static const char aOOOAttrNumberOfSlides[] = NSPREFIX "number-of-slides";
+static const char aOOOAttrNumberingType[] = NSPREFIX "page-numbering-type";
+
+// ooo xml attributes for meta_slide
+static const char aOOOAttrSlide[] = NSPREFIX "slide";
+static const char aOOOAttrMaster[] = NSPREFIX "master";
+static const char aOOOAttrBackgroundVisibility[] = NSPREFIX "background-visibility";
+static const char aOOOAttrMasterObjectsVisibility[] = NSPREFIX "master-objects-visibility";
+static const char aOOOAttrPageNumberVisibility[] = NSPREFIX "page-number-visibility";
+static const char aOOOAttrDateTimeVisibility[] = NSPREFIX "date-time-visibility";
+static const char aOOOAttrFooterVisibility[] = NSPREFIX "footer-visibility";
+static const char aOOOAttrDateTimeField[] = NSPREFIX "date-time-field";
+static const char aOOOAttrFooterField[] = NSPREFIX "footer-field";
+static const char aOOOAttrHeaderField[] = NSPREFIX "header-field";
+
+// ooo xml attributes for date_time_field
+static const char aOOOAttrDateTimeFormat[] = NSPREFIX "date-time-format";
+
+// ooo xml attributes for Placeholder Shapes
+static const char aOOOAttrTextAdjust[] = NSPREFIX "text-adjust";
+
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * - Text Field Class Hierarchy - *
+ * *
+ * This is a set of classes for exporting text field meta info. *
+ * *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#define TEXT_FIELD_GET_CLASS_NAME_METHOD( class_name ) \
+virtual ::rtl::OUString getClassName() const \
+{ \
+ static const char className[] = #class_name; \
+ return B2UCONST( className ); \
+}
+
+
+class TextField
+{
+protected:
+ SVGFilter::ObjectSet mMasterPageSet;
+public:
+
+ TEXT_FIELD_GET_CLASS_NAME_METHOD( TextField )
+ virtual sal_Bool equalTo( const TextField & aTextField ) const = 0;
+ virtual void growCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets ) const = 0;
+ virtual void elementExport( SVGExport* pSVGExport ) const
+ {
+ pSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", getClassName() );
+ }
+ void insertMasterPage( Reference< XDrawPage> xMasterPage )
+ {
+ mMasterPageSet.insert( xMasterPage );
+ }
+ virtual ~TextField() {}
+protected:
+ void implGrowCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets, ::rtl::OUString sText, ::rtl::OUString sTextFieldId ) const
+ {
+ const sal_Unicode * ustr = sText.getStr();
+ sal_Int32 nLength = sText.getLength();
+ SVGFilter::ObjectSet::const_iterator aMasterPageIt = mMasterPageSet.begin();
+ for( ; aMasterPageIt != mMasterPageSet.end(); ++aMasterPageIt )
+ {
+ const Reference< XInterface > & xMasterPage = *aMasterPageIt;
+ for( sal_Int32 i = 0; i < nLength; ++i )
+ {
+ aTextFieldCharSets[ xMasterPage ][ sTextFieldId ].insert( ustr[i] );
+ }
+ }
+ }
+};
+
+class FixedTextField : public TextField
+{
+public:
+ ::rtl::OUString text;
+
+ TEXT_FIELD_GET_CLASS_NAME_METHOD( FixedTextField )
+ virtual sal_Bool equalTo( const TextField & aTextField ) const
+ {
+ if( const FixedTextField* aFixedTextField = dynamic_cast< const FixedTextField* >( &aTextField ) )
+ {
+ return ( text == aFixedTextField->text );
+ }
+ return false;
+ }
+ virtual void elementExport( SVGExport* pSVGExport ) const
+ {
+ TextField::elementExport( pSVGExport );
+ SvXMLElementExport aExp( *pSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
+ pSVGExport->GetDocHandler()->characters( text );
+ }
+ virtual ~FixedTextField() {}
+};
+
+class FixedDateTimeField : public FixedTextField
+{
+public:
+ FixedDateTimeField() {}
+ TEXT_FIELD_GET_CLASS_NAME_METHOD( FixedDateTimeField )
+ virtual void growCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets ) const
+ {
+ static const ::rtl::OUString sFieldId = B2UCONST( aOOOAttrDateTimeField );
+ implGrowCharSet( aTextFieldCharSets, text, sFieldId );
+ }
+ virtual ~FixedDateTimeField() {}
+};
+
+class FooterField : public FixedTextField
+{
+public:
+ FooterField() {}
+ TEXT_FIELD_GET_CLASS_NAME_METHOD( FooterField )
+ virtual void growCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets ) const
+ {
+ static const ::rtl::OUString sFieldId = B2UCONST( aOOOAttrFooterField );
+ implGrowCharSet( aTextFieldCharSets, text, sFieldId );
+ }
+ virtual ~FooterField() {}
+};
+
+class HeaderField : public FixedTextField
+{
+public:
+ HeaderField() {}
+ TEXT_FIELD_GET_CLASS_NAME_METHOD( HeaderField )
+ virtual void growCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets ) const
+ {
+ static const ::rtl::OUString sFieldId = B2UCONST( aOOOAttrHeaderField );
+ implGrowCharSet( aTextFieldCharSets, text, sFieldId );
+ }
+ virtual ~HeaderField() {}
+};
+
+class VariableTextField : public TextField
+{
+public:
+ TEXT_FIELD_GET_CLASS_NAME_METHOD( VariableTextField )
+ virtual ~VariableTextField() {}
+};
+
+class VariableDateTimeField : public VariableTextField
+{
+public:
+ sal_Int32 format;
+
+ VariableDateTimeField() {}
+ TEXT_FIELD_GET_CLASS_NAME_METHOD( VariableDateTimeField )
+ virtual sal_Bool equalTo( const TextField & aTextField ) const
+ {
+ if( const VariableDateTimeField* aField = dynamic_cast< const VariableDateTimeField* >( &aTextField ) )
+ {
+ return ( format == aField->format );
+ }
+ return false;
+ }
+ virtual void elementExport( SVGExport* pSVGExport ) const
+ {
+ VariableTextField::elementExport( pSVGExport );
+ OUString sDateFormat, sTimeFormat;
+ SvxDateFormat eDateFormat = (SvxDateFormat)( format & 0x0f );
+ if( eDateFormat )
+ {
+ switch( eDateFormat )
+ {
+ case SVXDATEFORMAT_STDSMALL: ;
+ case SVXDATEFORMAT_A: // 13.02.96
+ sDateFormat = B2UCONST( "" );
+ break;
+ case SVXDATEFORMAT_C: // 13.Feb 1996
+ sDateFormat = B2UCONST( "" );
+ break;
+ case SVXDATEFORMAT_D: // 13.February 1996
+ sDateFormat = B2UCONST( "" );
+ break;
+ case SVXDATEFORMAT_E: // Tue, 13.February 1996
+ sDateFormat = B2UCONST( "" );
+ break;
+ case SVXDATEFORMAT_STDBIG: ;
+ case SVXDATEFORMAT_F: // Tuesday, 13.February 1996
+ sDateFormat = B2UCONST( "" );
+ break;
+ // default case
+ case SVXDATEFORMAT_B: ; // 13.02.1996
+ default:
+ sDateFormat = B2UCONST( "" );
+ break;
+ }
+ }
+
+ SvxTimeFormat eTimeFormat = (SvxTimeFormat)( ( format >> 4 ) & 0x0f );
+ if( eTimeFormat )
+ {
+ switch( eTimeFormat )
+ {
+ case SVXTIMEFORMAT_24_HMS: // 13:49:38
+ sTimeFormat = B2UCONST( "" );
+ break;
+ case SVXTIMEFORMAT_AM_HM: ; // 01:49 PM
+ case SVXTIMEFORMAT_12_HM:
+ sTimeFormat = B2UCONST( "" );
+ break;
+ case SVXTIMEFORMAT_AM_HMS: ; // 01:49:38 PM
+ case SVXTIMEFORMAT_12_HMS:
+ sTimeFormat = B2UCONST( "" );
+ break;
+ // default case
+ case SVXTIMEFORMAT_24_HM: ; // 13:49
+ default:
+ sTimeFormat = B2UCONST( "" );
+ break;
+ }
+ }
+
+ OUString sDateTimeFormat = sDateFormat;
+ sDateTimeFormat += OUString::valueOf( sal_Unicode(' ') );
+ sDateTimeFormat += sTimeFormat;
+
+ pSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrDateTimeFormat, sDateTimeFormat );
+ SvXMLElementExport aExp( *pSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
+ }
+ virtual void growCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets ) const
+ {
+ // we use the unicode char set in an improper way: we put in the date/time fortat
+ // in order to pass it to the CalcFieldValue method
+ static const ::rtl::OUString sFieldId = B2UCONST( aOOOAttrDateTimeField ) + B2UCONST( "-variable" );
+ SVGFilter::ObjectSet::const_iterator aMasterPageIt = mMasterPageSet.begin();
+ for( ; aMasterPageIt != mMasterPageSet.end(); ++aMasterPageIt )
+ {
+ aTextFieldCharSets[ *aMasterPageIt ][ sFieldId ].insert( (sal_Unicode)( format ) );
+ }
+ }
+ virtual ~VariableDateTimeField() {}
+};
+
+sal_Bool operator==( const TextField & aLhsTextField, const TextField & aRhsTextField )
+{
+ return aLhsTextField.equalTo( aRhsTextField );
+}
+
+
+
// -------------
// - SVGExport -
// -------------
@@ -62,6 +327,8 @@ SVGExport::SVGExport(
mrFilterData( rFilterData )
{
SetDocHandler( rxHandler );
+ sal_uInt16 nExportFlags = getExportFlags() | EXPORT_PRETTY;
+ setExportFlags( nExportFlags );
GetDocHandler()->startDocument();
}
@@ -233,11 +500,10 @@ sal_Bool ObjectRepresentation::operator==( const ObjectRepresentation& rPresenta
sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
throw (RuntimeException)
{
- Reference< XMultiServiceFactory > xServiceFactory( ::comphelper::getProcessServiceFactory() ) ;
+ Reference< XMultiServiceFactory > xServiceFactory( ::comphelper::getProcessServiceFactory() ) ;
Reference< XOutputStream > xOStm;
SvStream* pOStm = NULL;
- sal_Int32 nLength = rDescriptor.getLength();
- sal_Int32 nPageToExport = SVG_EXPORT_ALLPAGES;
+ sal_Int32 nLength = rDescriptor.getLength();
const PropertyValue* pValue = rDescriptor.getConstArray();
sal_Bool bRet = sal_False;
@@ -258,8 +524,6 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
if( pOStm )
xOStm = Reference< XOutputStream >( new ::utl::OOutputStreamWrapper ( *pOStm ) );
}
- else if( pValue[ i ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PagePos" ) ) )
- pValue[ i ].Value >>= nPageToExport;
else if( pValue[ i ].Name.equalsAscii( "FilterData" ) )
{
pValue[ i ].Value >>= maFilterData;
@@ -318,88 +582,57 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
if( xOStm.is() && xServiceFactory.is() )
{
- Reference< XMasterPagesSupplier > xMasterPagesSupplier( mxSrcDoc, UNO_QUERY );
- Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxSrcDoc, UNO_QUERY );
-
- if( xMasterPagesSupplier.is() && xDrawPagesSupplier.is() )
+ if( mSelectedPages.hasElements() && mMasterPageTargets.hasElements() )
{
- Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_QUERY );
- Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY );
+ Reference< XDocumentHandler > xDocHandler( implCreateExportDocumentHandler( xOStm ) );
- if( xMasterPages.is() && xMasterPages->getCount() && xDrawPages.is() && xDrawPages->getCount() )
+ if( xDocHandler.is() )
{
- Reference< XDocumentHandler > xDocHandler( implCreateExportDocumentHandler( xOStm ) );
+ mbPresentation = Reference< XPresentationSupplier >( mxSrcDoc, UNO_QUERY ).is();
+ mpObjects = new ObjectMap;
- if( xDocHandler.is() )
- {
- mbPresentation = Reference< XPresentationSupplier >( mxSrcDoc, UNO_QUERY ).is();
- mpObjects = new ObjectMap;
-
- // #110680#
- // mpSVGExport = new SVGExport( xDocHandler );
+ // #110680#
+ // mpSVGExport = new SVGExport( xDocHandler );
mpSVGExport = new SVGExport( xServiceFactory, xDocHandler, maFilterData );
- if( nPageToExport < 0 || nPageToExport >= xDrawPages->getCount() )
- nPageToExport = SVG_EXPORT_ALLPAGES;
+ try
+ {
+ mxDefaultPage = mSelectedPages[0];
- try
+ if( mxDefaultPage.is() )
{
- const sal_Int32 nDefaultPage = ( ( SVG_EXPORT_ALLPAGES == nPageToExport ) ? 0 : nPageToExport );
+ SvxDrawPage* pSvxDrawPage = SvxDrawPage::getImplementation( mxDefaultPage );
- xDrawPages->getByIndex( nDefaultPage ) >>= mxDefaultPage;
-
- if( mxDefaultPage.is() )
+ if( pSvxDrawPage )
{
- SvxDrawPage* pSvxDrawPage = SvxDrawPage::getImplementation( mxDefaultPage );
-
- if( pSvxDrawPage )
- {
- mpDefaultSdrPage = pSvxDrawPage->GetSdrPage();
- mpSdrModel = mpDefaultSdrPage->GetModel();
-
- if( mpSdrModel )
- {
- SdrOutliner& rOutl = mpSdrModel->GetDrawOutliner(NULL);
-
- maOldFieldHdl = rOutl.GetCalcFieldValueHdl();
- rOutl.SetCalcFieldValueHdl( LINK( this, SVGFilter, CalcFieldHdl) );
- }
- }
+ mpDefaultSdrPage = pSvxDrawPage->GetSdrPage();
+ mpSdrModel = mpDefaultSdrPage->GetModel();
- if( implCreateObjects( xMasterPages, xDrawPages, nPageToExport ) )
+ if( mpSdrModel )
{
- ObjectMap::const_iterator aIter( mpObjects->begin() );
- ::std::vector< ObjectRepresentation > aObjects( mpObjects->size() );
- sal_uInt32 nPos = 0;
+ SdrOutliner& rOutl = mpSdrModel->GetDrawOutliner(NULL);
- while( aIter != mpObjects->end() )
- {
- aObjects[ nPos++ ] = (*aIter).second;
- ++aIter;
- }
-
- mpSVGFontExport = new SVGFontExport( *mpSVGExport, aObjects );
- mpSVGWriter = new SVGActionWriter( *mpSVGExport, *mpSVGFontExport );
-
- bRet = implExportDocument( xMasterPages, xDrawPages, nPageToExport );
+ maOldFieldHdl = rOutl.GetCalcFieldValueHdl();
+ rOutl.SetCalcFieldValueHdl( LINK( this, SVGFilter, CalcFieldHdl) );
}
}
+ bRet = implExportDocument();
}
- catch( ... )
- {
- delete mpSVGDoc, mpSVGDoc = NULL;
- OSL_FAIL( "Exception caught" );
- }
+ }
+ catch( ... )
+ {
+ delete mpSVGDoc, mpSVGDoc = NULL;
+ OSL_FAIL( "Exception caught" );
+ }
- if( mpSdrModel )
- mpSdrModel->GetDrawOutliner( NULL ).SetCalcFieldValueHdl( maOldFieldHdl );
+ if( mpSdrModel )
+ mpSdrModel->GetDrawOutliner( NULL ).SetCalcFieldValueHdl( maOldFieldHdl );
- delete mpSVGWriter, mpSVGWriter = NULL;
- delete mpSVGExport, mpSVGExport = NULL;
- delete mpSVGFontExport, mpSVGFontExport = NULL;
- delete mpObjects, mpObjects = NULL;
- mbPresentation = sal_False;
- }
+ delete mpSVGWriter, mpSVGWriter = NULL;
+ delete mpSVGExport, mpSVGExport = NULL;
+ delete mpSVGFontExport, mpSVGFontExport = NULL;
+ delete mpObjects, mpObjects = NULL;
+ mbPresentation = sal_False;
}
}
}
@@ -436,20 +669,63 @@ Reference< XDocumentHandler > SVGFilter::implCreateExportDocumentHandler( const
// -----------------------------------------------------------------------------
-sal_Bool SVGFilter::implExportDocument( const Reference< XDrawPages >& rxMasterPages,
- const Reference< XDrawPages >& rxDrawPages,
- sal_Int32 nPageToExport )
+inline
+sal_Bool SVGFilter::implLookForFirstVisiblePage()
{
- DBG_ASSERT( rxMasterPages.is() && rxDrawPages.is(),
- "SVGFilter::implExportDocument: invalid parameter" );
+ sal_Int32 nCurPage = 0, nLastPage = mSelectedPages.getLength() - 1;
- OUString aAttr;
- sal_Int32 nDocWidth = 0, nDocHeight = 0;
- sal_Int32 nVisible = -1, nVisibleMaster = -1;
- sal_Bool bRet = sal_False;
- const sal_Bool bSinglePage = ( rxDrawPages->getCount() == 1 ) || ( SVG_EXPORT_ALLPAGES != nPageToExport );
- const sal_Int32 nFirstPage = ( ( SVG_EXPORT_ALLPAGES == nPageToExport ) ? 0 : nPageToExport );
- sal_Int32 nCurPage = nFirstPage, nLastPage = ( bSinglePage ? nFirstPage : ( rxDrawPages->getCount() - 1 ) );
+ while( ( nCurPage <= nLastPage ) && ( -1 == mnVisiblePage ) )
+ {
+ const Reference< XDrawPage > & xDrawPage = mSelectedPages[nCurPage];
+
+ if( xDrawPage.is() )
+ {
+ Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY );
+
+ if( xPropSet.is() )
+ {
+ sal_Bool bVisible = sal_False;
+
+ if( !mbPresentation || mbSinglePage ||
+ ( ( xPropSet->getPropertyValue( B2UCONST( "Visible" ) ) >>= bVisible ) && bVisible ) )
+ {
+ mnVisiblePage = nCurPage;
+
+ Reference< XMasterPageTarget > xMasterTarget( xDrawPage, UNO_QUERY );
+ if( xMasterTarget.is() )
+ {
+ Reference< XDrawPage > xMasterPage( xMasterTarget->getMasterPage() );
+
+ for( sal_Int32 nMaster = 0, nMasterCount = mMasterPageTargets.getLength();
+ ( nMaster < nMasterCount ) && ( -1 == mnVisibleMasterPage );
+ ++nMaster )
+ {
+ const Reference< XDrawPage > & xMasterTestPage = mMasterPageTargets[nMaster];
+
+ if( xMasterTestPage.is() && xMasterTestPage == xMasterPage )
+ mnVisibleMasterPage = nMaster;
+ }
+ }
+ }
+ }
+ }
+ ++nCurPage;
+ }
+
+ return ( mnVisiblePage != -1 );
+}
+
+// -----------------------------------------------------------------------------
+sal_Bool SVGFilter::implExportDocument()
+{
+ OUString aAttr;
+ sal_Int32 nDocWidth = 0, nDocHeight = 0;
+ sal_Bool bRet = sal_False;
+ sal_Int32 nLastPage = mSelectedPages.getLength() - 1;
+
+ mbSinglePage = (nLastPage == 0);
+ mnVisiblePage = -1;
+ mnVisibleMasterPage = -1;
const Reference< XPropertySet > xDefaultPagePropertySet( mxDefaultPage, UNO_QUERY );
const Reference< XExtendedDocumentHandler > xExtDocHandler( mpSVGExport->GetDocHandler(), UNO_QUERY );
@@ -470,6 +746,10 @@ sal_Bool SVGFilter::implExportDocument( const Reference< XDrawPages >& rxMasterP
if( mpSVGExport->IsUseTinyProfile() )
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "baseProfile", B2UCONST( "tiny" ) );
+// enabling _SVG_WRITE_EXTENTS means that the slide size is not adapted
+// to the size of the browser window, moreover the slide is top left aligned
+// instead of centered.
+#undef _SVG_WRITE_EXTENTS
#ifdef _SVG_WRITE_EXTENTS
aAttr = OUString::valueOf( nDocWidth * 0.01 );
aAttr += B2UCONST( "mm" );
@@ -485,19 +765,21 @@ sal_Bool SVGFilter::implExportDocument( const Reference< XDrawPages >& rxMasterP
aAttr += B2UCONST( " " );
aAttr += OUString::valueOf( nDocHeight );
+ msClipPathId = B2UCONST( "presentation_clip_path" );
+ OUString sClipPathAttrValue = B2UCONST( "url(#" ) + msClipPathId + B2UCONST( ")" );
+
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "viewBox", aAttr );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "preserveAspectRatio", B2UCONST( "xMidYMid" ) );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "fill-rule", B2UCONST( "evenodd" ) );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clip-path", sClipPathAttrValue );
// standard line width is based on 1 pixel on a 90 DPI device (0.28222mmm)
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "stroke-width", OUString::valueOf( 28.222 ) );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "stroke-linejoin", B2UCONST( "round" ) );
- if( !bSinglePage )
+ if( !mbSinglePage )
{
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:ooo", B2UCONST( "http://xml.openoffice.org/svg/export" ) );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "onclick", B2UCONST( "onClick(evt)" ) );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "onkeypress", B2UCONST( "onKeyPress(evt)" ) );
}
@@ -508,128 +790,312 @@ sal_Bool SVGFilter::implExportDocument( const Reference< XDrawPages >& rxMasterP
mpSVGDoc = new SvXMLElementExport( *mpSVGExport, XML_NAMESPACE_NONE, "svg", sal_True, sal_True );
- while( ( nCurPage <= nLastPage ) && ( -1 == nVisible ) )
+ // Create a ClipPath element that will be used for cutting bitmaps and other elements that could exceed the page margins.
{
- Reference< XDrawPage > xDrawPage;
+ SvXMLElementExport aDefsElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", sal_True, sal_True );
+ {
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", msClipPathId );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clipPathUnits", B2UCONST( "userSpaceOnUse" ) );
+ SvXMLElementExport aClipPathElem( *mpSVGExport, XML_NAMESPACE_NONE, "clipPath", sal_True, sal_True );
+ {
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "x", OUString::valueOf( sal_Int32(0) ) );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "y", OUString::valueOf( sal_Int32(0) ) );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "width", OUString::valueOf( nDocWidth ) );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "height", OUString::valueOf( nDocHeight ) );
+ SvXMLElementExport aRectElem( *mpSVGExport, XML_NAMESPACE_NONE, "rect", sal_True, sal_True );
+ }
+ }
+ }
- rxDrawPages->getByIndex( nCurPage ) >>= xDrawPage;
+ if( implLookForFirstVisiblePage() ) // OK! We found at least one visible page.
+ {
+ if( !mbSinglePage )
+ {
+ implGenerateMetaData();
+ }
+ else
+ {
+ implGetPagePropSet( mSelectedPages[0] );
+ }
- if( xDrawPage.is() )
+ // Create the (Shape, GDIMetaFile) map
+ if( implCreateObjects() )
{
- Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY );
+ ObjectMap::const_iterator aIter( mpObjects->begin() );
+ ::std::vector< ObjectRepresentation > aObjects( mpObjects->size() );
+ sal_uInt32 nPos = 0;
- if( xPropSet.is() )
+ while( aIter != mpObjects->end() )
{
- sal_Bool bVisible = sal_False;
-
- if( !mbPresentation || bSinglePage ||
- ( ( xPropSet->getPropertyValue( B2UCONST( "Visible" ) ) >>= bVisible ) && bVisible ) )
- {
- Reference< XMasterPageTarget > xMasterTarget( xDrawPage, UNO_QUERY );
+ aObjects[ nPos++ ] = (*aIter).second;
+ ++aIter;
+ }
- if( xMasterTarget.is() )
- {
- Reference< XDrawPage > xMasterPage( xMasterTarget->getMasterPage() );
+ mpSVGFontExport = new SVGFontExport( *mpSVGExport, aObjects );
+ mpSVGWriter = new SVGActionWriter( *mpSVGExport, *mpSVGFontExport );
- nVisible = nCurPage;
- for( sal_Int32 nMaster = 0, nMasterCount = rxMasterPages->getCount();
- ( nMaster < nMasterCount ) && ( -1 == nVisibleMaster );
- ++nMaster )
- {
- Reference< XDrawPage > xMasterTestPage;
+ if( mpSVGExport->IsEmbedFonts() )
+ {
+ mpSVGFontExport->EmbedFonts();
+ }
- rxMasterPages->getByIndex( nMaster ) >>= xMasterTestPage;
+ implExportPages( mMasterPageTargets, 0, mMasterPageTargets.getLength() - 1, mnVisibleMasterPage, sal_True /* is a master page */ );
+ implExportPages( mSelectedPages, 0, nLastPage, mnVisiblePage, sal_False /* is not a master page */ );
- if( xMasterTestPage == xMasterPage )
- nVisibleMaster = nMaster;
- }
- }
- }
+ if( !mbSinglePage )
+ {
+ implGenerateScript();
}
- }
- ++nCurPage;
+ delete mpSVGDoc, mpSVGDoc = NULL;
+ bRet = sal_True;
+ }
}
- if( mpSVGExport->IsEmbedFonts() )
- {
- mpSVGFontExport->EmbedFonts();
- }
+ return bRet;
+}
+
+
+//------------------------------------------------------------------------------
+// Append aField to aFieldSet if it is not already present in the set
+// and create the field id sFieldId
+//
- if( -1 != nVisible )
+template< typename TextFieldType >
+OUString implGenerateFieldId( std::vector< TextField* > & aFieldSet,
+ const TextFieldType & aField,
+ const OUString & sOOOElemField,
+ Reference< XDrawPage > xMasterPage )
+{
+ sal_Bool bFound = sal_False;
+ sal_Int32 i;
+ sal_Int32 nSize = aFieldSet.size();
+ for( i = 0; i < nSize; ++i )
{
- if( bSinglePage )
- implExportPages( rxMasterPages, nVisibleMaster, nVisibleMaster, nVisibleMaster, sal_True );
- else
+ if( *(aFieldSet[i]) == aField )
{
- implGenerateMetaData( rxMasterPages, rxDrawPages );
- implGenerateScript( rxMasterPages, rxDrawPages );
- implExportPages( rxMasterPages, 0, rxMasterPages->getCount() - 1, nVisibleMaster, sal_True );
+ bFound = sal_True;
+ break;
}
-
- implExportPages( rxDrawPages, nFirstPage, nLastPage, nVisible, sal_False );
-
- delete mpSVGDoc, mpSVGDoc = NULL;
- bRet = sal_True;
}
-
- return bRet;
+ OUString sFieldId( sOOOElemField );
+ sFieldId += OUString::valueOf( sal_Unicode('_') );
+ if( !bFound )
+ {
+ aFieldSet.push_back( new TextFieldType( aField ) );
+ }
+ aFieldSet[i]->insertMasterPage( xMasterPage );
+ sFieldId += OUString::valueOf( i );
+ return sFieldId;
}
-// -----------------------------------------------------------------------------
+//------------------------------------------------------------------------------
-sal_Bool SVGFilter::implGenerateMetaData( const Reference< XDrawPages >& /* rxMasterPages */,
- const Reference< XDrawPages >& rxDrawPages )
+sal_Bool SVGFilter::implGenerateMetaData()
{
sal_Bool bRet = sal_False;
-
- if( rxDrawPages->getCount() )
+ sal_Int32 nCount = mSelectedPages.getLength();
+ if( nCount != 0 )
{
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", B2UCONST( "meta_slides" ) );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "numberOfSlides", OUString::valueOf( rxDrawPages->getCount() ) );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", B2UCONST( aOOOElemMetaSlides ) );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrNumberOfSlides, OUString::valueOf( nCount ) );
+
+ /*
+ * Add a (global) Page Numbering Type attribute for the document
+ */
+ // NOTE:
+ // at present pSdrModel->GetPageNumType() returns always SVX_ARABIC
+ // so the following code fragment is pretty unuseful
+ sal_Int32 nPageNumberingType = SVX_ARABIC;
+ SvxDrawPage* pSvxDrawPage = SvxDrawPage::getImplementation( mSelectedPages[0] );
+ if( pSvxDrawPage )
+ {
+ SdrPage* pSdrPage = pSvxDrawPage->GetSdrPage();
+ SdrModel* pSdrModel = pSdrPage->GetModel();
+ nPageNumberingType = pSdrModel->GetPageNumType();
+ }
+ if( nPageNumberingType != SVX_NUMBER_NONE )
+ {
+ OUString sNumberingType;
+ switch( nPageNumberingType )
+ {
+ case SVX_CHARS_UPPER_LETTER:
+ sNumberingType = B2UCONST( "alpha-upper" );
+ break;
+ case SVX_CHARS_LOWER_LETTER:
+ sNumberingType = B2UCONST( "alpha-lower" );
+ break;
+ case SVX_ROMAN_UPPER:
+ sNumberingType = B2UCONST( "roman-upper" );
+ break;
+ case SVX_ROMAN_LOWER:
+ sNumberingType = B2UCONST( "roman-lower" );
+ break;
+ // arabic numbering type is the default, so we do not append any attribute for it
+ case SVX_ARABIC: ;
+ // in case the numbering type is not handled we fall back on arabic numbering
+ default: ;
+ break;
+ }
+ if( !sNumberingType.isEmpty() )
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrNumberingType, sNumberingType );
+ }
+
{
- SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "ooo:slidesInfo", sal_True, sal_True );
- const OUString aId( B2UCONST( "meta_slide" ) );
+ SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
+ const OUString aId( B2UCONST( aOOOElemMetaSlide ) );
+ const OUString aElemTextFieldId( B2UCONST( aOOOElemTextField ) );
+ std::vector< TextField* > aFieldSet;
- for( sal_Int32 i = 0, nCount = rxDrawPages->getCount(); i < nCount; ++i )
+ for( sal_Int32 i = 0; i < nCount; ++i )
{
- OUString aSlideId( aId );
- Reference< XDrawPage > xDrawPage( rxDrawPages->getByIndex( i ), UNO_QUERY );
- Reference< XMasterPageTarget > xMasterPageTarget( xDrawPage, UNO_QUERY );
- Reference< XDrawPage > xMasterPage( xMasterPageTarget->getMasterPage(), UNO_QUERY );
- sal_Bool bMasterVisible = sal_True;
- OUString aMasterVisibility;
-
+ const Reference< XDrawPage > & xDrawPage = mSelectedPages[i];
+ Reference< XMasterPageTarget > xMasterPageTarget( xDrawPage, UNO_QUERY );
+ Reference< XDrawPage > xMasterPage( xMasterPageTarget->getMasterPage(), UNO_QUERY );
+ OUString aSlideId( aId );
+ aSlideId += OUString::valueOf( sal_Unicode('_') );
aSlideId += OUString::valueOf( i );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aSlideId );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrSlide, implGetValidIDFromInterface( xDrawPage ) );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrMaster, implGetValidIDFromInterface( xMasterPage ) );
+
+
if( mbPresentation )
{
Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY );
if( xPropSet.is() )
- xPropSet->getPropertyValue( B2UCONST( "Background" ) ) >>= bMasterVisible;
+ {
+ sal_Bool bBackgroundVisibility = sal_True; // default: visible
+ sal_Bool bBackgroundObjectsVisibility = sal_True; // default: visible
+ sal_Bool bPageNumberVisibility = sal_False; // default: hidden
+ sal_Bool bDateTimeVisibility = sal_True; // default: visible
+ sal_Bool bFooterVisibility = sal_True; // default: visible
+ sal_Bool bHeaderVisibility = sal_True; // default: visible
+ sal_Bool bDateTimeFixed = sal_True; // default: fixed
+
+ FixedDateTimeField aFixedDateTimeField;
+ VariableDateTimeField aVariableDateTimeField;
+ FooterField aFooterField;
+
+ xPropSet->getPropertyValue( B2UCONST( "IsBackgroundVisible" ) ) >>= bBackgroundVisibility;
+ // in case the attribute is set to its default value it is not appended to the meta-slide element
+ if( !bBackgroundVisibility ) // visibility default value: 'visible'
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrBackgroundVisibility, B2UCONST( "hidden" ) );
+
+ // Page Number, Date/Time, Footer and Header Fields are regarded as background objects.
+ // So bBackgroundObjectsVisibility overrides visibility of master page text fields.
+ xPropSet->getPropertyValue( B2UCONST( "IsBackgroundObjectsVisible" ) ) >>= bBackgroundObjectsVisibility;
+ if( bBackgroundObjectsVisibility ) // visibility default value: 'visible'
+ {
+ /*
+ * Page Number Field
+ */
+ xPropSet->getPropertyValue( B2UCONST( "IsPageNumberVisible" ) ) >>= bPageNumberVisibility;
+ bPageNumberVisibility = bPageNumberVisibility && ( nPageNumberingType != SVX_NUMBER_NONE );
+ if( bPageNumberVisibility ) // visibility default value: 'hidden'
+ {
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrPageNumberVisibility, B2UCONST( "visible" ) );
+ }
+ /*
+ * Date/Time Field
+ */
+ xPropSet->getPropertyValue( B2UCONST( "IsDateTimeVisible" ) ) >>= bDateTimeVisibility;
+ if( bDateTimeVisibility ) // visibility default value: 'visible'
+ {
+ xPropSet->getPropertyValue( B2UCONST( "IsDateTimeFixed" ) ) >>= bDateTimeFixed;
+ if( bDateTimeFixed ) // we are interested only in the field text not in the date/time format
+ {
+ xPropSet->getPropertyValue( B2UCONST( "DateTimeText" ) ) >>= aFixedDateTimeField.text;
+ if( !aFixedDateTimeField.text.isEmpty() )
+ {
+ OUString sFieldId = implGenerateFieldId( aFieldSet, aFixedDateTimeField, aElemTextFieldId, xMasterPage );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrDateTimeField, sFieldId );
+ }
+ }
+ else // the inverse applies: we are interested only in the date/time format not in the field text
+ {
+ xPropSet->getPropertyValue( B2UCONST( "DateTimeFormat" ) ) >>= aVariableDateTimeField.format;
+ OUString sFieldId = implGenerateFieldId( aFieldSet, aVariableDateTimeField, aElemTextFieldId, xMasterPage );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrDateTimeField, sFieldId );
+ }
+ }
+ else
+ {
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrDateTimeVisibility, B2UCONST( "hidden" ) );
+ }
+ /*
+ * Footer Field
+ */
+ xPropSet->getPropertyValue( B2UCONST( "IsFooterVisible" ) ) >>= bFooterVisibility;
+ if( bFooterVisibility ) // visibility default value: 'visible'
+ {
+ xPropSet->getPropertyValue( B2UCONST( "FooterText" ) ) >>= aFooterField.text;
+ if( !aFooterField.text.isEmpty() )
+ {
+ OUString sFieldId = implGenerateFieldId( aFieldSet, aFooterField, aElemTextFieldId, xMasterPage );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrFooterField, sFieldId );
+ }
+ }
+ else
+ {
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrFooterVisibility, B2UCONST( "hidden" ) );
+ }
+ }
+ else
+ {
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrMasterObjectsVisibility, B2UCONST( "hidden" ) );
+ }
+ if( i == mnVisiblePage )
+ {
+ mVisiblePagePropSet.bIsBackgroundVisible = bBackgroundVisibility;
+ mVisiblePagePropSet.bAreBackgroundObjectsVisible = bBackgroundObjectsVisibility;
+ mVisiblePagePropSet.bIsPageNumberFieldVisible = bPageNumberVisibility;
+ mVisiblePagePropSet.bIsDateTimeFieldVisible = bDateTimeVisibility;
+ mVisiblePagePropSet.bIsFooterFieldVisible = bFooterVisibility;
+ mVisiblePagePropSet.bIsHeaderFieldVisible = bHeaderVisibility;
+ mVisiblePagePropSet.nPageNumberingType = nPageNumberingType;
+ mVisiblePagePropSet.bIsDateTimeFieldFixed = bDateTimeFixed;
+ mVisiblePagePropSet.nDateTimeFormat = aVariableDateTimeField.format;
+ mVisiblePagePropSet.sDateTimeText = aFixedDateTimeField.text;
+ mVisiblePagePropSet.sFooterText = aFooterField.text;
+ }
+ }
}
- if( bMasterVisible )
- aMasterVisibility = B2UCONST( "visible" );
- else
- aMasterVisibility = B2UCONST( "hidden" );
+ {
+ SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
+ } // when the aExp2 destructor is called the </g> tag is appended to the output file
+ }
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aSlideId );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "slide", implGetValidIDFromInterface( xDrawPage ) );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "master", implGetValidIDFromInterface( xMasterPage ) );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "master-visibility", aMasterVisibility );
+ // export text field elements
+ if( mbPresentation )
+ {
+ for( sal_Int32 i = 0, nSize = aFieldSet.size(); i < nSize; ++i )
+ {
+ OUString sElemId = B2UCONST( aOOOElemTextField );
+ sElemId += OUString::valueOf( sal_Unicode('_') );
+ sElemId += OUString::valueOf( i );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sElemId );
+ aFieldSet[i]->elementExport( mpSVGExport );
+
+ aFieldSet[i]->growCharSet( mTextFieldCharSets );
+ }
+ }
+ // text fields are used only for generating meta info so we don't need them anymore
+ for( sal_uInt32 i = 0; i < aFieldSet.size(); ++i )
+ {
+ if( aFieldSet[i] != NULL )
{
- SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "ooo:slideInfo", sal_True, sal_True );
+ delete aFieldSet[i];
}
}
}
-
-
- bRet =sal_True;
+ bRet = sal_True;
}
return bRet;
@@ -637,19 +1103,20 @@ sal_Bool SVGFilter::implGenerateMetaData( const Reference< XDrawPages >& /* rxMa
// -----------------------------------------------------------------------------
-sal_Bool SVGFilter::implGenerateScript( const Reference< XDrawPages >& /* rxMasterPages */,
- const Reference< XDrawPages >& /* rxDrawPages */ )
+#define SVGFILTER_EXPORT_SVGSCRIPT( z, n, aFragment ) \
+ xExtDocHandler->unknown( OUString::createFromAscii( aFragment ## n ) );
+
+sal_Bool SVGFilter::implGenerateScript()
{
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "type", B2UCONST( "text/ecmascript" ) );
{
- SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "script", sal_True, sal_True );
- Reference< XExtendedDocumentHandler > xExtDocHandler( mpSVGExport->GetDocHandler(), UNO_QUERY );
+ SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "script", sal_True, sal_True );
+ Reference< XExtendedDocumentHandler > xExtDocHandler( mpSVGExport->GetDocHandler(), UNO_QUERY );
if( xExtDocHandler.is() )
{
- xExtDocHandler->unknown( OUString::createFromAscii( aSVGScript1 ) );
- xExtDocHandler->unknown( OUString::createFromAscii( aSVGScript2 ) );
+ BOOST_PP_REPEAT( N_SVGSCRIPT_FRAGMENTS, SVGFILTER_EXPORT_SVGSCRIPT, aSVGScript )
}
}
@@ -658,7 +1125,86 @@ sal_Bool SVGFilter::implGenerateScript( const Reference< XDrawPages >& /* rxMast
// -----------------------------------------------------------------------------
-sal_Bool SVGFilter::implExportPages( const Reference< XDrawPages >& rxPages,
+Any SVGFilter::implSafeGetPagePropSet( const OUString & sPropertyName,
+ const Reference< XPropertySet > & rxPropSet,
+ const Reference< XPropertySetInfo > & rxPropSetInfo )
+{
+ Any result;
+ if( rxPropSetInfo->hasPropertyByName( sPropertyName ) )
+ {
+ result = rxPropSet->getPropertyValue( sPropertyName );
+ }
+ return result;
+}
+
+// -----------------------------------------------------------------------------
+
+/* SVGFilter::implGetPagePropSet
+ *
+ * We collect info on master page elements visibility,
+ * and placeholder text shape content.
+ * This method is used when exporting a single page
+ * as implGenerateMetaData is not invoked.
+ */
+sal_Bool SVGFilter::implGetPagePropSet( const Reference< XDrawPage > & rxPage )
+{
+ sal_Bool bRet = sal_False;
+
+ mVisiblePagePropSet.bIsBackgroundVisible = true;
+ mVisiblePagePropSet.bAreBackgroundObjectsVisible = true;
+ mVisiblePagePropSet.bIsPageNumberFieldVisible = false;;
+ mVisiblePagePropSet.bIsHeaderFieldVisible = false;
+ mVisiblePagePropSet.bIsFooterFieldVisible = true;
+ mVisiblePagePropSet.bIsDateTimeFieldVisible = true;
+ mVisiblePagePropSet.bIsDateTimeFieldFixed = true;
+ mVisiblePagePropSet.nDateTimeFormat = SVXDATEFORMAT_B;
+ mVisiblePagePropSet.nPageNumberingType = SVX_ARABIC;
+
+ /* We collect info on master page elements visibility,
+ * and placeholder text shape content.
+ */
+ Any result;
+ Reference< XPropertySet > xPropSet( rxPage, UNO_QUERY );
+ if( xPropSet.is() )
+ {
+ Reference< XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
+ if( xPropSetInfo.is() )
+ {
+ implSafeGetPagePropSet( B2UCONST( "IsBackgroundVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsBackgroundVisible;
+ implSafeGetPagePropSet( B2UCONST( "IsBackgroundObjectsVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bAreBackgroundObjectsVisible;
+ implSafeGetPagePropSet( B2UCONST( "IsPageNumberVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsPageNumberFieldVisible;
+ implSafeGetPagePropSet( B2UCONST( "IsHeaderVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsHeaderFieldVisible;
+ implSafeGetPagePropSet( B2UCONST( "IsFooterVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsFooterFieldVisible;
+ implSafeGetPagePropSet( B2UCONST( "IsDateTimeVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsDateTimeFieldVisible;
+
+ implSafeGetPagePropSet( B2UCONST( "IsDateTimeFixed" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsDateTimeFieldFixed;
+ implSafeGetPagePropSet( B2UCONST( "DateTimeFormat" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.nDateTimeFormat;
+ implSafeGetPagePropSet( B2UCONST( "Number" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.nPageNumber;
+ implSafeGetPagePropSet( B2UCONST( "DateTimeText" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sDateTimeText;
+ implSafeGetPagePropSet( B2UCONST( "FooterText" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sFooterText;
+ implSafeGetPagePropSet( B2UCONST( "HeaderText" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sHeaderText;
+
+ if( mVisiblePagePropSet.bIsPageNumberFieldVisible )
+ {
+ SvxDrawPage* pSvxDrawPage = SvxDrawPage::getImplementation( rxPage );
+ if( pSvxDrawPage )
+ {
+ SdrPage* pSdrPage = pSvxDrawPage->GetSdrPage();
+ SdrModel* pSdrModel = pSdrPage->GetModel();
+ mVisiblePagePropSet.nPageNumberingType = pSdrModel->GetPageNumType();
+ }
+ }
+
+ bRet = sal_True;
+ }
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------------
+
+sal_Bool SVGFilter::implExportPages( const SVGFilter::XDrawPageSequence & rxPages,
sal_Int32 nFirstPage, sal_Int32 nLastPage,
sal_Int32 nVisiblePage, sal_Bool bMaster )
{
@@ -669,36 +1215,15 @@ sal_Bool SVGFilter::implExportPages( const Reference< XDrawPages >& rxPages,
for( sal_Int32 i = nFirstPage; i <= nLastPage; ++i )
{
- Reference< XDrawPage > xDrawPage;
-
- rxPages->getByIndex( i ) >>= xDrawPage;
-
- if( xDrawPage.is() )
+ if( rxPages[i].is() )
{
- Reference< XShapes > xShapes( xDrawPage, UNO_QUERY );
+ Reference< XShapes > xShapes( rxPages[i], UNO_QUERY );
if( xShapes.is() )
{
- OUString aVisibility, aId, aSlideName( implGetValidIDFromInterface( xShapes, sal_True ) );
-
- // add visibility attribute
- if( i == nVisiblePage )
- aVisibility = B2UCONST( "visible" );
- else
- aVisibility = B2UCONST( "hidden" );
-
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", aVisibility );
-
// add id attribute
- if( bMaster )
- aId = ( B2UCONST( "MasterSlide_" ) ) += ::rtl::OUString::valueOf( ++mnMasterSlideId );
- else
- aId = ( B2UCONST( "Slide_" ) ) += ::rtl::OUString::valueOf( ++mnSlideId );
-
- if( aSlideName.getLength() )
- ( ( aId += B2UCONST( "(" ) ) += aSlideName ) += B2UCONST( ")" );
-
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aId );
+ OUString sPageId = implGetValidIDFromInterface( xShapes );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sPageId );
{
{
@@ -717,17 +1242,99 @@ sal_Bool SVGFilter::implExportPages( const Reference< XDrawPages >& rxPages,
}
}
+ // We don't set a visibility attribute for a master page element
+ // as the visibility of each master page sub element (background,
+ // placeholder shapes, background objects) is managed separately.
+ OUString aAttrVisibilityValue;
+ if( !bMaster )
+ {
+ if( i == nVisiblePage )
+ aAttrVisibilityValue = B2UCONST( "visible" );
+ else
+ aAttrVisibilityValue = B2UCONST( "hidden" );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", aAttrVisibilityValue );
+ }
+ else
+ { // when we export the shapes of a master page (implExportShape) we need
+ // to know if it is the master page targeted by the initially visible slide
+ mbIsPageVisible = ( i == nVisiblePage );
+ }
+
+ // Adding a clip path to each exported slide and master page,
+ // 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 = B2UCONST( "url(#" ) + msClipPathId + B2UCONST( ")" );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clip-path", sClipPathAttrValue );
+
+ // insert the <g> open tag related to the Slide/Master_Slide
SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
- const Point aNullPt;
- if( bMaster )
+ // In case the page has a background object we append it .
+ if( (mpObjects->find( rxPages[i] ) != mpObjects->end()) )
{
- const GDIMetaFile& rMtf = (*mpObjects)[ xDrawPage ].GetRepresentation();
- mpSVGWriter->WriteMetaFile( aNullPt, rMtf.GetPrefSize(), rMtf, SVGWRITER_WRITE_FILL );
+ const GDIMetaFile& rMtf = (*mpObjects)[ rxPages[i] ].GetRepresentation();
+ if( rMtf.GetActionSize() )
+ {
+ // background id = "bg-" + page id
+ OUString sBackgroundId = B2UCONST( "bg-" );
+ sBackgroundId += sPageId;
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sBackgroundId );
+
+ // At present (LibreOffice 3.4.0) the 'IsBackgroundVisible' property is not handled
+ // by Impress; anyway we handle this property as referring only to the visibility
+ // of the master page background. So if a slide has its own background object,
+ // the visibility of such a background object is always inherited from the visibility
+ // of the parent slide regardless of the value of the 'IsBackgroundVisible' property.
+ // This means that we need to set up the visibility attribute only for the background
+ // element of a master page.
+ if( bMaster )
+ {
+ if( i == nVisiblePage && mVisiblePagePropSet.bIsBackgroundVisible )
+ aAttrVisibilityValue = B2UCONST( "visible" );
+ else
+ aAttrVisibilityValue = B2UCONST( "hidden" );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", aAttrVisibilityValue );
+ }
+
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "Background" ) );
+
+ // insert the <g> open tag related to the Background
+ SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
+
+ // append all elements that make up the Background
+ const Point aNullPt;
+ mpSVGWriter->WriteMetaFile( aNullPt, rMtf.GetPrefSize(), rMtf, SVGWRITER_WRITE_FILL );
+ } // insert the </g> closing tag related to the Background
}
- bRet = implExportShapes( xShapes ) || bRet;
- }
+ // In case we are dealing with a master page we need to to group all its shapes
+ // into a group element, this group will make up the so named "background objects"
+ if( bMaster )
+ {
+ // background objects id = "bo-" + page id
+ OUString sBackgroundObjectsId = B2UCONST( "bo-" );
+ sBackgroundObjectsId += sPageId;
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sBackgroundObjectsId );
+
+ if( i == nVisiblePage && mVisiblePagePropSet.bAreBackgroundObjectsVisible )
+ aAttrVisibilityValue = B2UCONST( "visible" );
+ else
+ aAttrVisibilityValue = B2UCONST( "hidden" );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", aAttrVisibilityValue );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "BackgroundObjects" ) );
+
+ // insert the <g> open tag related to the Background Objects
+ SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
+
+ // append all shapes that make up the Master Slide
+ bRet = implExportShapes( xShapes ) || bRet;
+ } // append the </g> closing tag related to the Background Objects
+ else
+ {
+ // append all shapes that make up the Slide
+ bRet = implExportShapes( xShapes ) || bRet;
+ }
+ } // append the </g> closing tag related to the Slide/Master_Slide
}
}
}
@@ -768,52 +1375,6 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
if( mbPresentation )
{
xShapePropSet->getPropertyValue( B2UCONST( "IsEmptyPresentationObject" ) ) >>= bHideObj;
-
- if( !bHideObj )
- {
- const Reference< XPropertySet > xDefaultPagePropertySet( mxDefaultPage, UNO_QUERY );
- Reference< XPropertySetInfo > xPagePropSetInfo( xDefaultPagePropertySet->getPropertySetInfo() );
-
- if( xPagePropSetInfo.is() )
- {
- const ::rtl::OUString aHeaderString( B2UCONST( "IsHeaderVisible" ) );
- const ::rtl::OUString aFooterString( B2UCONST( "IsFooterVisible" ) );
- const ::rtl::OUString aDateTimeString( B2UCONST( "IsDateTimeVisible" ) );
- const ::rtl::OUString aPageNumberString( B2UCONST( "IsPageNumberVisible" ) );
-
- Any aProperty;
- sal_Bool bValue = sal_False;
-
- if( ( aShapeType.lastIndexOf( B2UCONST( "presentation.HeaderShape" ) ) != -1 ) &&
- xPagePropSetInfo->hasPropertyByName( aHeaderString ) &&
- ( ( aProperty = xDefaultPagePropertySet->getPropertyValue( aHeaderString ) ) >>= bValue ) &&
- !bValue )
- {
- bHideObj = sal_True;
- }
- else if( ( aShapeType.lastIndexOf( B2UCONST( "presentation.FooterShape" ) ) != -1 ) &&
- xPagePropSetInfo->hasPropertyByName( aFooterString ) &&
- ( ( aProperty = xDefaultPagePropertySet->getPropertyValue( aFooterString ) ) >>= bValue ) &&
- !bValue )
- {
- bHideObj = sal_True;
- }
- else if( ( aShapeType.lastIndexOf( B2UCONST( "presentation.DateTimeShape" ) ) != -1 ) &&
- xPagePropSetInfo->hasPropertyByName( aDateTimeString ) &&
- ( ( aProperty = xDefaultPagePropertySet->getPropertyValue( aDateTimeString ) ) >>= bValue ) &&
- !bValue )
- {
- bHideObj = sal_True;
- }
- else if( ( aShapeType.lastIndexOf( B2UCONST( "presentation.SlideNumberShape" ) ) != -1 ) &&
- xPagePropSetInfo->hasPropertyByName( aPageNumberString ) &&
- ( ( aProperty = xDefaultPagePropertySet->getPropertyValue( aPageNumberString ) ) >>= bValue ) &&
- !bValue )
- {
- bHideObj = sal_True;
- }
- }
- }
}
if( !bHideObj )
@@ -833,7 +1394,8 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
if( !bRet && mpObjects->find( rxShape ) != mpObjects->end() )
{
- Reference< XText > xText( rxShape, UNO_QUERY );
+ const ::rtl::OUString* pElementId = NULL;
+
::com::sun::star::awt::Rectangle aBoundRect;
const GDIMetaFile& rMtf = (*mpObjects)[ rxShape ].GetRepresentation();
@@ -843,8 +1405,57 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
const Size aSize( aBoundRect.Width, aBoundRect.Height );
if( rMtf.GetActionSize() )
- {
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", implGetClassFromShape( rxShape ) );
+ { // for text field shapes we set up visibility and text-adjust attributes
+ // TODO should we set up visibility for all text field shapes to hidden at start ?
+ OUString aShapeClass = implGetClassFromShape( rxShape );
+ if( mbPresentation )
+ {
+ sal_Bool bIsPageNumber = aShapeClass.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Slide_Number" ) );
+ sal_Bool bIsFooter = aShapeClass.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Footer" ) );
+ sal_Bool bIsDateTime = aShapeClass.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Date/Time" ) );
+ if( bIsPageNumber || bIsDateTime || bIsFooter )
+ {
+ // to notify to the SVGActionWriter::ImplWriteActions method
+ // that we are dealing with a placeholder shape
+ pElementId = &sPlaceholderTag;
+
+ // if the text field does not belong to the visible page its svg:visibility
+ // attribute is set to 'hidden'; else it depends on the related property of the visible page
+ OUString aAttrVisibilityValue( B2UCONST( "hidden" ) );
+ if(mbIsPageVisible && mVisiblePagePropSet.bAreBackgroundObjectsVisible && (
+ ( bIsPageNumber && mVisiblePagePropSet.bIsPageNumberFieldVisible ) ||
+ ( bIsDateTime && mVisiblePagePropSet.bIsDateTimeFieldVisible ) ||
+ ( bIsFooter && mVisiblePagePropSet.bIsFooterFieldVisible ) ) )
+ {
+ aAttrVisibilityValue = B2UCONST( "visible" );
+ }
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", aAttrVisibilityValue );
+
+ if( !mbSinglePage )
+ {
+ sal_uInt16 nTextAdjust = ParagraphAdjust_LEFT;
+ OUString sTextAdjust;
+ xShapePropSet->getPropertyValue( B2UCONST( "ParaAdjust" ) ) >>= nTextAdjust;
+
+ switch( nTextAdjust )
+ {
+ case ParagraphAdjust_LEFT:
+ sTextAdjust = B2UCONST( "left" );
+ break;
+ case ParagraphAdjust_CENTER:
+ sTextAdjust = B2UCONST( "center" );
+ break;
+ case ParagraphAdjust_RIGHT:
+ sTextAdjust = B2UCONST( "right" );
+ break;
+ default:
+ break;
+ }
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrTextAdjust, sTextAdjust );
+ }
+ }
+ }
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", aShapeClass );
SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
OUString aId( B2UCONST( "DrawingGroup_" ) );
OUString aObjName( implGetValidIDFromInterface( rxShape, true ) ), aObjDesc;
@@ -872,7 +1483,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
{
SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
- mpSVGWriter->WriteMetaFile( aTopLeft, aSize, rMtf, SVGWRITER_WRITE_ALL);
+ mpSVGWriter->WriteMetaFile( aTopLeft, aSize, rMtf, SVGWRITER_WRITE_ALL, pElementId );
}
}
@@ -886,81 +1497,60 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
// -----------------------------------------------------------------------------
-sal_Bool SVGFilter::implCreateObjects( const Reference< XDrawPages >& rxMasterPages,
- const Reference< XDrawPages >& rxDrawPages,
- sal_Int32 nPageToExport )
+sal_Bool SVGFilter::implCreateObjects()
{
- if( SVG_EXPORT_ALLPAGES == nPageToExport )
- {
- sal_Int32 i, nCount;
-
- for( i = 0, nCount = rxMasterPages->getCount(); i < nCount; ++i )
- {
- Reference< XDrawPage > xMasterPage;
-
- rxMasterPages->getByIndex( i ) >>= xMasterPage;
-
- if( xMasterPage.is() )
- {
- Reference< XShapes > xShapes( xMasterPage, UNO_QUERY );
+ sal_Int32 i, nCount;
- implCreateObjectsFromBackground( xMasterPage );
-
- if( xShapes.is() )
- implCreateObjectsFromShapes( xShapes );
- }
- }
+ for( i = 0, nCount = mMasterPageTargets.getLength(); i < nCount; ++i )
+ {
+ const Reference< XDrawPage > & xMasterPage = mMasterPageTargets[i];
- for( i = 0, nCount = rxDrawPages->getCount(); i < nCount; ++i )
+ if( xMasterPage.is() )
{
- Reference< XDrawPage > xDrawPage;
-
- rxDrawPages->getByIndex( i ) >>= xDrawPage;
+ mCreateOjectsCurrentMasterPage = xMasterPage;
+ implCreateObjectsFromBackground( xMasterPage );
- if( xDrawPage.is() )
- {
- Reference< XShapes > xShapes( xDrawPage, UNO_QUERY );
+ Reference< XShapes > xShapes( xMasterPage, UNO_QUERY );
- if( xShapes.is() )
- implCreateObjectsFromShapes( xShapes );
- }
+ if( xShapes.is() )
+ implCreateObjectsFromShapes( xShapes );
}
}
- else
- {
- DBG_ASSERT( nPageToExport >= 0 && nPageToExport < rxDrawPages->getCount(),
- "SVGFilter::implCreateObjects: invalid page number to export" );
-
- Reference< XDrawPage > xDrawPage;
- rxDrawPages->getByIndex( nPageToExport ) >>= xDrawPage;
-
- if( xDrawPage.is() )
- {
- Reference< XMasterPageTarget > xMasterTarget( xDrawPage, UNO_QUERY );
+ for( i = 0, nCount = mSelectedPages.getLength(); i < nCount; ++i )
+ {
+ const Reference< XDrawPage > & xDrawPage = mSelectedPages[i];
- if( xMasterTarget.is() )
+ if( xDrawPage.is() )
+ {
+#if ENABLE_EXPORT_CUSTOM_SLIDE_BACKGROUND
+ // TODO complete the implementation for exporting custom background for each slide
+ // implementation status:
+ // - hatch stroke color is set to 'none' so the hatch is not visible, why ?
+ // - gradient look is not really awesome, too few colors are used;
+ // - stretched bitmap, gradient and hatch are not exported only once
+ // and then referenced in case more than one slide uses them.
+ // - tiled bitmap: an image element is exported for each tile,
+ // this is really too expensive!
+ Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY );
+ Reference< XPropertySet > xBackground;
+ xPropSet->getPropertyValue( B2UCONST( "Background" ) ) >>= xBackground;
+ if( xBackground.is() )
{
- Reference< XDrawPage > xMasterPage( xMasterTarget->getMasterPage() );
-
- if( xMasterPage.is() )
+ drawing::FillStyle aFillStyle;
+ sal_Bool assigned = ( xBackground->getPropertyValue( B2UCONST( "FillStyle" ) ) >>= aFillStyle );
+ if( assigned && aFillStyle != drawing::FillStyle_NONE )
{
- Reference< XShapes > xShapes( xMasterPage, UNO_QUERY );
-
- implCreateObjectsFromBackground( xMasterPage );
-
- if( xShapes.is() )
- implCreateObjectsFromShapes( xShapes );
+ implCreateObjectsFromBackground( xDrawPage );
}
}
-
+#endif
Reference< XShapes > xShapes( xDrawPage, UNO_QUERY );
- if( xShapes.is() )
- implCreateObjectsFromShapes( xShapes );
- }
+ if( xShapes.is() )
+ implCreateObjectsFromShapes( xShapes );
+ }
}
-
return sal_True;
}
@@ -987,7 +1577,6 @@ sal_Bool SVGFilter::implCreateObjectsFromShapes( const Reference< XShapes >& rxS
sal_Bool SVGFilter::implCreateObjectsFromShape( const Reference< XShape >& rxShape )
{
sal_Bool bRet = sal_False;
-
if( rxShape->getShapeType().lastIndexOf( B2UCONST( "drawing.GroupShape" ) ) != -1 )
{
Reference< XShapes > xShapes( rxShape, UNO_QUERY );
@@ -1007,9 +1596,9 @@ sal_Bool SVGFilter::implCreateObjectsFromShape( const Reference< XShape >& rxSha
{
if( aGraphic.GetType() == GRAPHIC_BITMAP )
{
- GDIMetaFile aMtf;
- const Point aNullPt;
- const Size aSize( pObj->GetCurrentBoundRect().GetSize() );
+ GDIMetaFile aMtf;
+ const Point aNullPt;
+ const Size aSize( pObj->GetCurrentBoundRect().GetSize() );
aMtf.AddAction( new MetaBmpExScaleAction( aNullPt, aSize, aGraphic.GetBitmapEx() ) );
aMtf.SetPrefSize( aSize );
@@ -1030,14 +1619,14 @@ sal_Bool SVGFilter::implCreateObjectsFromShape( const Reference< XShape >& rxSha
// -----------------------------------------------------------------------------
-sal_Bool SVGFilter::implCreateObjectsFromBackground( const Reference< XDrawPage >& rxMasterPage )
+sal_Bool SVGFilter::implCreateObjectsFromBackground( const Reference< XDrawPage >& rxDrawPage )
{
- Reference< XExporter > xExporter( mxMSF->createInstance( B2UCONST( "com.sun.star.drawing.GraphicExportFilter" ) ), UNO_QUERY );
+ Reference< XExporter > xExporter( mxMSF->createInstance( B2UCONST( "com.sun.star.drawing.GraphicExportFilter" ) ), UNO_QUERY );
sal_Bool bRet = sal_False;
if( xExporter.is() )
{
- GDIMetaFile aMtf;
+ GDIMetaFile aMtf;
Reference< XFilter > xFilter( xExporter, UNO_QUERY );
utl::TempFile aFile;
@@ -1051,11 +1640,11 @@ sal_Bool SVGFilter::implCreateObjectsFromBackground( const Reference< XDrawPage
aDescriptor[2].Name = B2UCONST( "ExportOnlyBackground" );
aDescriptor[2].Value <<= (sal_Bool) sal_True;
- xExporter->setSourceDocument( Reference< XComponent >( rxMasterPage, UNO_QUERY ) );
+ xExporter->setSourceDocument( Reference< XComponent >( rxDrawPage, UNO_QUERY ) );
xFilter->filter( aDescriptor );
aMtf.Read( *aFile.GetStream( STREAM_READ ) );
- (*mpObjects)[ rxMasterPage ] = ObjectRepresentation( rxMasterPage, aMtf );
+ (*mpObjects)[ rxDrawPage ] = ObjectRepresentation( rxDrawPage, aMtf );
bRet = sal_True;
}
@@ -1085,7 +1674,8 @@ OUString SVGFilter::implGetClassFromShape( const Reference< XShape >& rxShape )
else if( aShapeType.lastIndexOf( B2UCONST( "presentation.SlideNumberShape" ) ) != -1 )
aRet = B2UCONST( "Slide_Number" );
else
- aRet = B2UCONST( "Drawing" );
+ aRet = aShapeType;
+ //aRet = B2UCONST( "Drawing" );
return aRet;
}
@@ -1125,87 +1715,219 @@ OUString SVGFilter::implGetValidIDFromInterface( const Reference< XInterface >&
IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo )
{
- OUString aRepresentation;
sal_Bool bFieldProcessed = sal_False;
-
- if( pInfo )
+ if( pInfo && mbPresentation )
{
- const ::rtl::OUString aHeaderText( B2UCONST( "HeaderText" ) );
- const ::rtl::OUString aFooterText( B2UCONST( "FooterText" ) );
- const ::rtl::OUString aDateTimeText( B2UCONST( "DateTimeText" ) );
- const ::rtl::OUString aPageNumberText( B2UCONST( "Number" ) );
-
- const Reference< XPropertySet > xDefaultPagePropertySet( mxDefaultPage, UNO_QUERY );
- Reference< XPropertySetInfo > xDefaultPagePropSetInfo( xDefaultPagePropertySet->getPropertySetInfo() );
+ bFieldProcessed = true;
+ // to notify to the SVGActionWriter::ImplWriteText method
+ // that we are dealing with a placeholder shape
+ OUString aRepresentation = sPlaceholderTag;
- if( xDefaultPagePropSetInfo.is() )
+ if( !mbSinglePage )
{
- const SvxFieldData* pField = pInfo->GetField().GetField();
- Any aProperty;
-
- if( pField->ISA( SvxHeaderField ) &&
- xDefaultPagePropSetInfo->hasPropertyByName( aHeaderText ) )
+ if( !mCreateOjectsCurrentMasterPage.is() )
+ {
+ OSL_FAIL( "error: !mCreateOjectsCurrentMasterPage.is()" );
+ return 0;
+ }
+ if( mTextFieldCharSets.find( mCreateOjectsCurrentMasterPage ) == mTextFieldCharSets.end() )
{
- xDefaultPagePropertySet->getPropertyValue( aHeaderText ) >>= aRepresentation;
- bFieldProcessed = sal_True;
+ OSL_FAIL( "error: mTextFieldCharSets.find( mCreateOjectsCurrentMasterPage ) == mTextFieldCharSets.end()" );
+ return 0;
}
- else if( pField->ISA( SvxFooterField ) &&
- xDefaultPagePropSetInfo->hasPropertyByName( aFooterText ) )
+
+ static const ::rtl::OUString aHeaderId( B2UCONST( aOOOAttrHeaderField ) );
+ static const ::rtl::OUString aFooterId( B2UCONST( aOOOAttrFooterField ) );
+ static const ::rtl::OUString aDateTimeId( B2UCONST( aOOOAttrDateTimeField ) );
+ static const ::rtl::OUString aVariableDateTimeId( B2UCONST( aOOOAttrDateTimeField ) + B2UCONST( "-variable" ) );
+
+ const UCharSet * pCharSet = NULL;
+ UCharSetMap & aCharSetMap = mTextFieldCharSets[ mCreateOjectsCurrentMasterPage ];
+ const SvxFieldData* pField = pInfo->GetField().GetField();
+ if( ( pField->GetClassId() == SVX_HEADERFIELD ) && ( aCharSetMap.find( aHeaderId ) != aCharSetMap.end() ) )
{
- xDefaultPagePropertySet->getPropertyValue( aFooterText ) >>= aRepresentation;
- bFieldProcessed = sal_True;
+ pCharSet = &( aCharSetMap[ aHeaderId ] );
}
- else if( pField->ISA( SvxDateTimeField ) &&
- xDefaultPagePropSetInfo->hasPropertyByName( aDateTimeText ) )
+ else if( ( pField->GetClassId() == SVX_FOOTERFIELD ) && ( aCharSetMap.find( aFooterId ) != aCharSetMap.end() ) )
{
- xDefaultPagePropertySet->getPropertyValue( aDateTimeText ) >>= aRepresentation;
- bFieldProcessed = sal_True;
+ pCharSet = &( aCharSetMap[ aFooterId ] );
}
- else if( pField->ISA( SvxPageField ) &&
- xDefaultPagePropSetInfo->hasPropertyByName( aPageNumberText ) )
+ else if( pField->GetClassId() == SVX_DATEFIMEFIELD )
{
- String aPageNumValue;
- sal_Int16 nPageNumber = 0;
-
- xDefaultPagePropertySet->getPropertyValue( aPageNumberText ) >>= nPageNumber;
+ if( aCharSetMap.find( aDateTimeId ) != aCharSetMap.end() )
+ {
+ pCharSet = &( aCharSetMap[ aDateTimeId ] );
+ }
+ if( ( aCharSetMap.find( aVariableDateTimeId ) != aCharSetMap.end() ) && !aCharSetMap[ aVariableDateTimeId ].empty() )
+ {
+ SvxDateFormat eDateFormat = SVXDATEFORMAT_B, eCurDateFormat;
+ const UCharSet & aCharSet = aCharSetMap[ aVariableDateTimeId ];
+ UCharSet::const_iterator aChar = aCharSet.begin();
+ // we look for the most verbose date format
+ for( ; aChar != aCharSet.end(); ++aChar )
+ {
+ eCurDateFormat = (SvxDateFormat)( (int)( *aChar ) & 0x0f );
+ switch( eDateFormat )
+ {
+ case SVXDATEFORMAT_STDSMALL: ;
+ case SVXDATEFORMAT_A: ; // 13.02.96
+ case SVXDATEFORMAT_B: // 13.02.1996
+ switch( eCurDateFormat )
+ {
+ case SVXDATEFORMAT_C: ; // 13.Feb 1996
+ case SVXDATEFORMAT_D: // 13.February 1996
+ case SVXDATEFORMAT_E: ; // Tue, 13.February 1996
+ case SVXDATEFORMAT_STDBIG: ;
+ case SVXDATEFORMAT_F: // Tuesday, 13.February 1996
+ eDateFormat = eCurDateFormat;
+ break;
+ default:
+ break;
+ }
+ case SVXDATEFORMAT_C: ; // 13.Feb 1996
+ case SVXDATEFORMAT_D: // 13.February 1996
+ switch( eCurDateFormat )
+ {
+ case SVXDATEFORMAT_E: ; // Tue, 13.February 1996
+ case SVXDATEFORMAT_STDBIG: ;
+ case SVXDATEFORMAT_F: // Tuesday, 13.February 1996
+ eDateFormat = eCurDateFormat;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ // Independently of the date format, we always put all these characters by default.
+ // They should be enough to cover every time format.
+ aRepresentation += B2UCONST( "0123456789.:/-APM" );
- if( mpSdrModel )
+ if( eDateFormat )
+ {
+ String sDate;
+ LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
+ SvNumberFormatter * pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), LANGUAGE_SYSTEM );
+ // We always collect the characters obtained by using the SVXDATEFORMAT_B (as: 13.02.1996)
+ // so we are sure to include any unusual day|month|year separator.
+ Date aDate( 1, 1, 1996 );
+ sDate += SvxDateField::GetFormatted( aDate, SVXDATEFORMAT_B, *pNumberFormatter, eLang );
+ switch( eDateFormat )
+ {
+ case SVXDATEFORMAT_E: ; // Tue, 13.February 1996
+ case SVXDATEFORMAT_STDBIG: ;
+ case SVXDATEFORMAT_F: // Tuesday, 13.February 1996
+ for( sal_uInt16 i = 1; i <= 7; ++i ) // we get all days in a week
+ {
+ aDate.SetDay( i );
+ sDate += SvxDateField::GetFormatted( aDate, eDateFormat, *pNumberFormatter, eLang );
+ }
+ // No break here! We need months too!
+ case SVXDATEFORMAT_C: ; // 13.Feb 1996
+ case SVXDATEFORMAT_D: // 13.February 1996
+ for( sal_uInt16 i = 1; i <= 12; ++i ) // we get all months in a year
+ {
+ aDate.SetMonth( i );
+ sDate += SvxDateField::GetFormatted( aDate, eDateFormat, *pNumberFormatter, eLang );
+ }
+ break;
+ case SVXDATEFORMAT_STDSMALL: ;
+ case SVXDATEFORMAT_A: ; // 13.02.96
+ case SVXDATEFORMAT_B: ; // 13.02.1996
+ default:
+ // nothing to do here, we always collect the characters needed for these cases.
+ break;
+ }
+ aRepresentation += sDate;
+ }
+ }
+ }
+ else if( pField->GetClassId() == SVX_PAGEFIELD )
+ {
+ switch( mVisiblePagePropSet.nPageNumberingType )
{
- sal_Bool bUpper = sal_False;
+ case SVX_CHARS_UPPER_LETTER:
+ aRepresentation += B2UCONST( "QWERTYUIOPASDFGHJKLZXCVBNM" );
+ break;
+ case SVX_CHARS_LOWER_LETTER:
+ aRepresentation += B2UCONST( "qwertyuiopasdfghjklzxcvbnm" );
+ break;
+ case SVX_ROMAN_UPPER:
+ aRepresentation += B2UCONST( "IVXLCDM" );
+ break;
+ case SVX_ROMAN_LOWER:
+ aRepresentation += B2UCONST( "ivxlcdm" );
+ break;
+ // arabic numbering type is the default
+ case SVX_ARABIC: ;
+ // in case the numbering type is not handled we fall back on arabic numbering
+ default:
+ aRepresentation += B2UCONST( "0123456789" );
+ break;
+ }
+ }
- switch( mpSdrModel->GetPageNumType() )
+ if( pCharSet != NULL )
+ {
+ UCharSet::const_iterator aChar = pCharSet->begin();
+ for( ; aChar != pCharSet->end(); ++aChar )
+ {
+ aRepresentation += OUString::valueOf( *aChar );
+ }
+ }
+ pInfo->SetRepresentation( aRepresentation );
+ }
+ else
+ {
+ if( mVisiblePagePropSet.bAreBackgroundObjectsVisible )
+ {
+ const SvxFieldData* pField = pInfo->GetField().GetField();
+ if( ( pField->GetClassId() == SVX_HEADERFIELD ) && mVisiblePagePropSet.bIsHeaderFieldVisible )
+ {
+ aRepresentation += mVisiblePagePropSet.sHeaderText;
+ }
+ else if( ( pField->GetClassId() == SVX_FOOTERFIELD ) && mVisiblePagePropSet.bIsFooterFieldVisible )
+ {
+ aRepresentation += mVisiblePagePropSet.sFooterText;
+ }
+ else if( ( pField->GetClassId() == SVX_DATEFIMEFIELD ) && mVisiblePagePropSet.bIsDateTimeFieldVisible )
+ {
+ // TODO: implement the variable case
+ aRepresentation += mVisiblePagePropSet.sDateTimeText;
+ }
+ else if( ( pField->GetClassId() == SVX_PAGEFIELD ) && mVisiblePagePropSet.bIsPageNumberFieldVisible )
+ {
+ sal_Int16 nPageNumber = mVisiblePagePropSet.nPageNumber;
+ switch( mVisiblePagePropSet.nPageNumberingType )
{
case SVX_CHARS_UPPER_LETTER:
- aPageNumValue += (sal_Unicode)(char)( ( nPageNumber - 1 ) % 26 + 'A' );
+ aRepresentation += OUString::valueOf( (sal_Unicode)(char)( ( nPageNumber - 1 ) % 26 + 'A' ) );
break;
case SVX_CHARS_LOWER_LETTER:
- aPageNumValue += (sal_Unicode)(char)( ( nPageNumber- 1 ) % 26 + 'a' );
+ aRepresentation += OUString::valueOf( (sal_Unicode)(char)( ( nPageNumber - 1 ) % 26 + 'a' ) );
break;
case SVX_ROMAN_UPPER:
- bUpper = sal_True;
+ aRepresentation += SvxNumberFormat::CreateRomanString( nPageNumber, true /* upper */ );
+ break;
case SVX_ROMAN_LOWER:
- aPageNumValue += SvxNumberFormat::CreateRomanString( nPageNumber, bUpper );
+ aRepresentation += SvxNumberFormat::CreateRomanString( nPageNumber, false /* lower */ );
break;
- case SVX_NUMBER_NONE:
- aPageNumValue.Erase();
- aPageNumValue += sal_Unicode(' ');
+ // arabic numbering type is the default
+ case SVX_ARABIC: ;
+ // in case the numbering type is not handled we fall back on arabic numbering
+ default:
+ aRepresentation += OUString::valueOf( sal_Int32(nPageNumber) );
break;
- default : break;
}
- }
-
- if( !aPageNumValue.Len() )
- aPageNumValue += String::CreateFromInt32( nPageNumber );
-
- aRepresentation = aPageNumValue;
- bFieldProcessed = sal_True;
+ }
}
- }
- pInfo->SetRepresentation( aRepresentation );
+ pInfo->SetRepresentation( aRepresentation );
+ }
}
-
- return( bFieldProcessed ? 0 : maOldFieldHdl.Call( pInfo ) );
+ return ( bFieldProcessed ? 0 : maOldFieldHdl.Call( pInfo ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index caf4fc67c71b..4baaa80d43cb 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -37,6 +37,30 @@
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/frame/XDesktop.hdl>
#include <com/sun/star/frame/XController.hdl>
+
+
+#include <com/sun/star/view/XSelectionSupplier.hdl>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/drawing/XDrawSubController.hdl>
+#include <com/sun/star/drawing/XDrawSubController.hpp>
+#include <com/sun/star/container/XNamed.hdl>
+#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/uno/XComponentContext.hdl>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/drawing/framework/XControllerManager.hdl>
+#include <com/sun/star/drawing/framework/XControllerManager.hpp>
+#include <com/sun/star/drawing/framework/XConfigurationController.hdl>
+#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
+#include <com/sun/star/drawing/framework/XResource.hdl>
+#include <com/sun/star/drawing/framework/XResource.hpp>
+#include <com/sun/star/drawing/framework/XView.hdl>
+#include <com/sun/star/drawing/framework/XView.hpp>
+#include <com/sun/star/drawing/framework/ResourceId.hpp>
+#include <comphelper/processfactory.hxx>
+
+
+
+
#include <osl/mutex.hxx>
#include "svgfilter.hxx"
@@ -58,7 +82,9 @@ SVGFilter::SVGFilter( const Reference< XComponentContext >& rxCtx ) :
mpDefaultSdrPage( NULL ),
mpSdrModel( NULL ),
mbPresentation( sal_False ),
+ mbExportAll( sal_False ),
mpObjects( NULL )
+
{
}
@@ -75,6 +101,7 @@ SVGFilter::~SVGFilter()
// -----------------------------------------------------------------------------
+
sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescriptor )
throw (RuntimeException)
{
@@ -90,47 +117,102 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
else
if( mxSrcDoc.is() )
{
- sal_Int16 nCurrentPageNumber = -1;
- uno::Reference< frame::XDesktop > xDesktop( mxMSF->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )) ),
- uno::UNO_QUERY);
- if( xDesktop.is() )
+ if( !mbExportAll )
{
- uno::Reference< frame::XFrame > xFrame( xDesktop->getCurrentFrame() );
-
- if( xFrame.is() )
+ uno::Reference< frame::XDesktop > xDesktop( mxMSF->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )) ),
+ uno::UNO_QUERY);
+ if( xDesktop.is() )
{
- uno::Reference< frame::XController > xController( xFrame->getController() );
+ uno::Reference< frame::XFrame > xFrame( xDesktop->getCurrentFrame() );
- if( xController.is() )
+ if( xFrame.is() )
{
- uno::Reference< drawing::XDrawView > xDrawView( xController, uno::UNO_QUERY );
+ uno::Reference< frame::XController > xController( xFrame->getController() );
- if( xDrawView.is() )
+ if( xController.is() )
{
- uno::Reference< drawing::XDrawPage > xDrawPage( xDrawView->getCurrentPage() );
-
- if( xDrawPage.is() )
+ /*
+ * Get the selection from the Slide Sorter Center Pane
+ */
+ if( !mSelectedPages.hasElements() )
{
- uno::Reference< beans::XPropertySet >( xDrawPage, uno::UNO_QUERY )->
- getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Number" ) ) ) >>= nCurrentPageNumber;
+ uno::Reference< beans::XPropertySet > xControllerPropertySet( xController, uno::UNO_QUERY );
+ uno::Reference< drawing::XDrawSubController > xSubController;
+ xControllerPropertySet->getPropertyValue(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SubController" ) ) )
+ >>= xSubController;
+
+ if( xSubController.is() )
+ {
+ uno::Any aSelection = xSubController->getSelection();
+ if( aSelection.hasValue() )
+ {
+ ObjectSequence aSelectedPageSequence;
+ aSelection >>= aSelectedPageSequence;
+ mSelectedPages.realloc( aSelectedPageSequence.getLength() );
+ for( sal_Int32 i = 0; i < mSelectedPages.getLength(); ++i )
+ {
+ uno::Reference< drawing::XDrawPage > xDrawPage( aSelectedPageSequence[i], uno::UNO_QUERY );
+ mSelectedPages[i] = xDrawPage;
+ }
+ }
+ }
}
}
}
}
}
- Sequence< PropertyValue > aNewDescriptor( rDescriptor );
-
- if( nCurrentPageNumber > 0 )
+ /*
+ * Export all slides
+ */
+ if( !mSelectedPages.hasElements() )
{
- const sal_uInt32 nOldLength = rDescriptor.getLength();
+ uno::Reference< drawing::XMasterPagesSupplier > xMasterPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
+ uno::Reference< drawing::XDrawPagesSupplier > xDrawPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
- aNewDescriptor.realloc( nOldLength + 1 );
- aNewDescriptor[ nOldLength ].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PagePos" ) );
- aNewDescriptor[ nOldLength ].Value <<= static_cast< sal_Int16 >( nCurrentPageNumber - 1 );
+ if( xMasterPagesSupplier.is() && xDrawPagesSupplier.is() )
+ {
+ uno::Reference< drawing::XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), uno::UNO_QUERY );
+ uno::Reference< drawing::XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), uno::UNO_QUERY );
+ if( xMasterPages.is() && xMasterPages->getCount() &&
+ xDrawPages.is() && xDrawPages->getCount() )
+ {
+ sal_Int32 nDPCount = xDrawPages->getCount();
+
+ mSelectedPages.realloc( nDPCount );
+ sal_Int32 i;
+ for( i = 0; i < nDPCount; ++i )
+ {
+ uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), uno::UNO_QUERY );
+ mSelectedPages[i] = xDrawPage;
+ }
+ }
+ }
+ }
+
+ /*
+ * We get all master page that are targeted by at least one draw page.
+ * The master page are put in an unordered set.
+ */
+ ObjectSet aMasterPageTargetSet;
+ for( sal_Int32 i = 0; i < mSelectedPages.getLength(); ++i )
+ {
+ uno::Reference< drawing::XMasterPageTarget > xMasterPageTarget( mSelectedPages[i], uno::UNO_QUERY );
+ if( xMasterPageTarget.is() )
+ {
+ aMasterPageTargetSet.insert( xMasterPageTarget->getMasterPage() );
+ }
+ }
+ // Later we move them to a uno::Sequence so we can get them by index
+ mMasterPageTargets.realloc( aMasterPageTargetSet.size() );
+ ObjectSet::const_iterator aElem = aMasterPageTargetSet.begin();
+ for( sal_Int32 i = 0; aElem != aMasterPageTargetSet.end(); ++aElem, ++i)
+ {
+ uno::Reference< drawing::XDrawPage > xMasterPage( *aElem, uno::UNO_QUERY );
+ mMasterPageTargets[i] = xMasterPage;
}
- bRet = implExport( aNewDescriptor );
+ bRet = implExport( rDescriptor );
}
else
bRet = sal_False;
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 8ef5b626042f..37037ac9766a 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -58,7 +58,14 @@
#include <com/sun/star/java/XJavaVM.hpp>
#include <com/sun/star/java/XJavaThreadRegister_11.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hdl>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hdl>
+
+#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
#include <osl/diagnose.h>
#include <rtl/process.h>
@@ -82,9 +89,6 @@
#include <svx/svdobj.hxx>
#include <xmloff/xmlexp.hxx>
-#include "svgfilter.hxx"
-#include "svgscript.hxx"
-
#include <cstdio>
using namespace ::com::sun::star::uno;
@@ -96,6 +100,7 @@ using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::presentation;
using namespace ::com::sun::star::document;
using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::style;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::xml::sax;
using namespace ::std;
@@ -106,6 +111,15 @@ using namespace ::std;
#define SVG_EXPORT_ALLPAGES ((sal_Int32)-1)
+
+// -----------
+// - statics -
+// -----------
+
+// Placeholder tag used into the ImplWriteActions method to filter text placeholder fields
+static const ::rtl::OUString sPlaceholderTag = ::rtl::OUString::createFromAscii( "<[:isPlaceholder:]>" );
+
+
// -------------
// - SVGExport -
// -------------
@@ -137,11 +151,11 @@ public:
protected:
-virtual void _ExportStyles( sal_Bool /* bUsed */ ) {}
-virtual void _ExportAutoStyles() {}
-virtual void _ExportContent() {}
-virtual void _ExportMasterStyles() {}
-virtual sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum /* eClass */ ) { return 0; }
+ virtual void _ExportStyles( sal_Bool /* bUsed */ ) {}
+ virtual void _ExportAutoStyles() {}
+ virtual void _ExportContent() {}
+ virtual void _ExportMasterStyles() {}
+ virtual sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum /* eClass */ ) { return 0; }
private:
@@ -164,20 +178,43 @@ private:
public:
- ObjectRepresentation();
- ObjectRepresentation( const Reference< XInterface >& rxIf,
- const GDIMetaFile& rMtf );
- ObjectRepresentation( const ObjectRepresentation& rPresentation );
- ~ObjectRepresentation();
+ ObjectRepresentation();
+ ObjectRepresentation( const Reference< XInterface >& rxIf,
+ const GDIMetaFile& rMtf );
+ ObjectRepresentation( const ObjectRepresentation& rPresentation );
+ ~ObjectRepresentation();
- ObjectRepresentation& operator=( const ObjectRepresentation& rPresentation );
- sal_Bool operator==( const ObjectRepresentation& rPresentation ) const;
+ ObjectRepresentation& operator=( const ObjectRepresentation& rPresentation );
+ sal_Bool operator==( const ObjectRepresentation& rPresentation ) const;
- const Reference< XInterface >& GetObject() const { return mxObject; }
- sal_Bool HasRepresentation() const { return mpMtf != NULL; }
- const GDIMetaFile& GetRepresentation() const { return *mpMtf; }
+ const Reference< XInterface >& GetObject() const { return mxObject; }
+ sal_Bool HasRepresentation() const { return mpMtf != NULL; }
+ const GDIMetaFile& GetRepresentation() const { return *mpMtf; }
};
+// -------------------
+// - PagePropertySet -
+// -------------------
+
+struct PagePropertySet
+{
+ sal_Bool bIsBackgroundVisible;
+ sal_Bool bAreBackgroundObjectsVisible;
+ sal_Bool bIsPageNumberFieldVisible;
+ sal_Bool bIsDateTimeFieldVisible;
+ sal_Bool bIsFooterFieldVisible;
+ sal_Bool bIsHeaderFieldVisible;
+ sal_Int32 nPageNumberingType;
+ sal_Bool bIsDateTimeFieldFixed;
+ sal_Int16 nPageNumber;
+ sal_Int32 nDateTimeFormat;
+ ::rtl::OUString sDateTimeText;
+ ::rtl::OUString sFooterText;
+ ::rtl::OUString sHeaderText;
+};
+
+
+
// ---------------------------
// - HashReferenceXInterface -
// ---------------------------
@@ -190,6 +227,25 @@ struct HashReferenceXInterface
}
};
+// ---------------------------
+// - HashOUString -
+// ---------------------------
+
+struct HashOUString
+{
+ size_t operator()( const ::rtl::OUString& oustr ) const { return static_cast< size_t >( oustr.hashCode() ); }
+};
+
+// ---------------------------
+// - HashUChar -
+// ---------------------------
+
+struct HashUChar
+{
+ size_t operator()( const sal_Unicode uchar ) const { return static_cast< size_t >( uchar ); }
+};
+
+
// -------------
// - SVGFilter -
// -------------
@@ -203,8 +259,16 @@ class SVGFilter : public cppu::WeakImplHelper4 < XFilter,
XExporter,
XExtendedFilterDetection >
{
- typedef ::boost::unordered_map< Reference< XInterface >, ObjectRepresentation, HashReferenceXInterface > ObjectMap;
+public:
+ typedef ::boost::unordered_map< Reference< XInterface >, ObjectRepresentation, HashReferenceXInterface > ObjectMap;
typedef ::std::vector< ::rtl::OUString > UniqueIdVector;
+ typedef ::boost::unordered_set< Reference< XInterface >, HashReferenceXInterface > ObjectSet;
+ typedef Sequence< Reference< XInterface > > ObjectSequence;
+ typedef Sequence< Reference< XDrawPage > > XDrawPageSequence;
+
+ typedef ::boost::unordered_set< sal_Unicode, HashUChar > UCharSet;
+ typedef ::boost::unordered_map< ::rtl::OUString, UCharSet, HashOUString > UCharSetMap;
+ typedef ::boost::unordered_map< Reference< XInterface >, UCharSetMap, HashReferenceXInterface > UCharSetMapMap;
private:
@@ -216,12 +280,24 @@ private:
SdrPage* mpDefaultSdrPage;
SdrModel* mpSdrModel;
sal_Bool mbPresentation;
+ sal_Bool mbExportAll;
+ sal_Bool mbSinglePage;
+ sal_Int32 mnVisiblePage;
+ sal_Int32 mnVisibleMasterPage;
+ sal_Bool mbIsPageVisible;
+ PagePropertySet mVisiblePagePropSet;
+ ::rtl::OUString msClipPathId;
+ UCharSetMapMap mTextFieldCharSets;
+ Reference< XInterface > mCreateOjectsCurrentMasterPage;
ObjectMap* mpObjects;
Reference< XComponent > mxSrcDoc;
Reference< XComponent > mxDstDoc;
Reference< XDrawPage > mxDefaultPage;
Sequence< PropertyValue > maFilterData;
+ XDrawPageSequence mSelectedPages;
+ XDrawPageSequence mMasterPageTargets;
+
UniqueIdVector maUniqueIdVector;
sal_Int32 mnMasterSlideId;
sal_Int32 mnSlideId;
@@ -234,32 +310,30 @@ private:
sal_Bool implExport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException);
Reference< XDocumentHandler > implCreateExportDocumentHandler( const Reference< XOutputStream >& rxOStm );
- sal_Bool implGenerateMetaData( const Reference< XDrawPages >& rxMasterPages,
- const Reference< XDrawPages >& rxDrawPages );
- sal_Bool implGenerateScript( const Reference< XDrawPages >& rxMasterPages,
- const Reference< XDrawPages >& rxDrawPages );
+ sal_Bool implGetPagePropSet( const Reference< XDrawPage > & rxPage );
+ sal_Bool implGenerateMetaData();
+ sal_Bool implGenerateScript();
- sal_Bool implExportDocument( const Reference< XDrawPages >& rxMasterPages,
- const Reference< XDrawPages >& rxDrawPages,
- sal_Int32 nPageToExport );
+ sal_Bool implExportDocument();
- sal_Bool implExportPages( const Reference< XDrawPages >& rxPages,
+ sal_Bool implExportPages( const XDrawPageSequence& rxPages,
sal_Int32 nFirstPage, sal_Int32 nLastPage,
sal_Int32 nVisiblePage, sal_Bool bMaster );
sal_Bool implExportShapes( const Reference< XShapes >& rxShapes );
sal_Bool implExportShape( const Reference< XShape >& rxShape );
- sal_Bool implCreateObjects( const Reference< XDrawPages >& rxMasterPages,
- const Reference< XDrawPages >& rxDrawPages,
- sal_Int32 nPageToExport );
+ sal_Bool implCreateObjects();
sal_Bool implCreateObjectsFromShapes( const Reference< XShapes >& rxShapes );
sal_Bool implCreateObjectsFromShape( const Reference< XShape >& rxShape );
sal_Bool implCreateObjectsFromBackground( const Reference< XDrawPage >& rxMasterPage );
::rtl::OUString implGetClassFromShape( const Reference< XShape >& rxShape );
::rtl::OUString implGetValidIDFromInterface( const Reference< XInterface >& rxIf, sal_Bool bUnique = sal_False );
-
+ sal_Bool implLookForFirstVisiblePage();
+ Any implSafeGetPagePropSet( const ::rtl::OUString & sPropertyName,
+ const Reference< XPropertySet > & rxPropSet,
+ const Reference< XPropertySetInfo > & rxPropSetInfo );
DECL_LINK( CalcFieldHdl, EditFieldInfo* );
protected:
@@ -280,9 +354,11 @@ protected:
public:
explicit SVGFilter( const Reference< XComponentContext >& rxCtx );
- virtual ~SVGFilter();
+ virtual ~SVGFilter();
};
+
+
// -----------------------------------------------------------------------------
class SvStream;
diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx
index d796234133d8..f78d24c9fa87 100644
--- a/filter/source/svg/svgfontexport.cxx
+++ b/filter/source/svg/svgfontexport.cxx
@@ -33,7 +33,13 @@
#include "precompiled_filter.hxx"
#include "svgfontexport.hxx"
+#include "svgfilter.hxx"
+#include "svgwriter.hxx"
+
+
#include <vcl/unohelp.hxx>
+#include <vcl/font.hxx>
+#include <vcl/outdev.hxx>
static const sal_Int32 nFontEM = 2048;
diff --git a/filter/source/svg/svgfontexport.hxx b/filter/source/svg/svgfontexport.hxx
index a5ebd677e6bc..c05ede336a58 100644
--- a/filter/source/svg/svgfontexport.hxx
+++ b/filter/source/svg/svgfontexport.hxx
@@ -33,13 +33,20 @@
#define SVGFONTEXPORT_HXX
#include <comphelper/stl_types.hxx>
-#include "svgfilter.hxx"
-#include "svgwriter.hxx"
+#include <tools/fontenum.hxx>
+
// -----------------
// - SVGFontExport -
// -----------------
+
+class ObjectRepresentation;
+class SVGExport;
+class Font;
+class OutputDevice;
+
+
class SVGFontExport
{
typedef ::std::vector< ObjectRepresentation > ObjectVector;
diff --git a/filter/source/svg/svgscript.hxx b/filter/source/svg/svgscript.hxx
index 2019994dced0..145de73b4565 100644
--- a/filter/source/svg/svgscript.hxx
+++ b/filter/source/svg/svgscript.hxx
@@ -1,3 +1,4 @@
+
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
@@ -26,97 +27,1675 @@
*
************************************************************************/
-static const char aSVGScript1[] =
+
+
+#define N_SVGSCRIPT_FRAGMENTS 9
+
+static const char aSVGScript0[] =
"<![CDATA[\n\
+\n\
+ /** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\
+ * - Presentation Engine v4.7 -\n\
+ *\n\
+ ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\
+ * This program is free software: you can redistribute it and/or modify\n\
+ * it under the terms of the GNU General Public License as published by\n\
+ * the Free Software Foundation, either version 3 of the License, or\n\
+ * (at your option) any later version.\n\
+ *\n\
+ * This program is distributed in the hope that it will be useful,\n\
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
+ * GNU General Public License for more details.\n\
+ *\n\
+ * You should have received a copy of the GNU General Public License\n\
+ * along with this program. If not, see http://www.gnu.org/licenses/.\n\
+ *\n\
+ ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\
+ * Some parts of this script are based on the JessyInk project:\n\
+ * http://code.google.com/p/jessyink/\n\
+ *\n\
+ ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\
+\n\
+ window.onload = init;\n\
+\n\
+\n\
+ // ooo elements\n\
+ var aOOOElemMetaSlides = 'ooo:meta_slides';\n\
+ var aOOOElemMetaSlide = 'ooo:meta_slide';\n\
+ var aOOOElemTextField = 'ooo:text_field';\n\
+\n\
+ // ooo attributes\n\
+ var aOOOAttrNumberOfSlides = 'number-of-slides';\n\
+ var aOOOAttrNumberingType = 'page-numbering-type';\n\
+\n\
+ var aOOOAttrSlide = 'slide';\n\
+ var aOOOAttrMaster = 'master';\n\
+ var aOOOAttrBackgroundVisibility = 'background-visibility';\n\
+ var aOOOAttrMasterObjectsVisibility = 'master-objects-visibility';\n\
+ var aOOOAttrPageNumberVisibility = 'page-number-visibility';\n\
+ var aOOOAttrDateTimeVisibility = 'date-time-visibility';\n\
+ var aOOOAttrFooterVisibility = 'footer-visibility';\n\
+ var aOOOAttrHeaderVisibility = 'header-visibility';\n\
+ var aOOOAttrDateTimeField = 'date-time-field';\n\
+ var aOOOAttrFooterField = 'footer-field';\n\
+ var aOOOAttrHeaderField = 'header-field';\n\
+\n\
+ var aOOOAttrDateTimeFormat = 'date-time-format';\n\
+\n\
+ var aOOOAttrTextAdjust = 'text-adjust';\n\
+\n\
+ // Placeholder class names\n\
+ var aSlideNumberClassName = 'Slide_Number';\n\
+ var aDateTimeClassName = 'Date/Time';\n\
+ var aFooterClassName = 'Footer';\n\
+ var aHeaderClassName = 'Header';\n\
+\n\
+ // Creating a namespace dictionary.\n\
+ var NSS = new Object();\n\
+ NSS['svg']='http://www.w3.org/2000/svg';\n\
+ NSS['rdf']='http://www.w3.org/1999/02/22-rdf-syntax-ns#';\n\
+ NSS['xlink']='http://www.w3.org/1999/xlink';\n\
+ NSS['xml']='http://www.w3.org/XML/1998/namespace';\n\
+ NSS['ooo'] = 'http://xml.openoffice.org/svg/export';\n\
+\n\
+ // Presentation modes.\n\
+ var SLIDE_MODE = 1;\n\
+ var INDEX_MODE = 2;\n\
+\n\
+ // Mouse handler actions.\n\
+ var MOUSE_UP = 1;\n\
+ var MOUSE_DOWN = 2;\n\
+ var MOUSE_MOVE = 3;\n\
+ var MOUSE_WHEEL = 4;\n\
+\n\
+ // Keycodes.\n\
+ var LEFT_KEY = 37; // cursor left keycode\n\
+ var UP_KEY = 38; // cursor up keycode\n\
+ var RIGHT_KEY = 39; // cursor right keycode\n\
+ var DOWN_KEY = 40; // cursor down keycode\n\
+ var PAGE_UP_KEY = 33; // page up keycode\n\
+ var PAGE_DOWN_KEY = 34; // page down keycode\n\
+ var HOME_KEY = 36; // home keycode\n\
+ var END_KEY = 35; // end keycode\n\
+ var ENTER_KEY = 13;\n\
+ var SPACE_KEY = 32;\n\
+ var ESCAPE_KEY = 27;\n\
+\n\
+ // Visibility Values\n\
+ var HIDDEN = 0;\n\
+ var VISIBLE = 1;\n\
+ var INHERIT = 2;\n\
+ var aVisibilityAttributeValue = [ 'hidden', 'visible', 'inherit' ];\n\
+ var aVisibilityValue = { 'hidden' : HIDDEN, 'visible' : VISIBLE, 'inherit' : INHERIT };\n\
+\n\
+ // Parameters\n\
+ var ROOT_NODE = document.getElementsByTagNameNS( NSS['svg'], 'svg' )[0];\n\
+ var WIDTH = 0;\n\
+ var HEIGHT = 0;\n\
+ var INDEX_COLUMNS_DEFAULT = 3;\n\
+ var INDEX_OFFSET = 0;\n\
+\n\
+ // Initialization.\n\
+ var theMetaDoc;\n\
+ var theSlideIndexPage;\n\
+ var currentMode = SLIDE_MODE;\n\
+ var processingEffect = false;\n\
var nCurSlide = 0;\n\
- var nSlides = 0;\n\
- var aSlides = new Object();\n\
- var aMasters = new Object();\n\
- var aMasterVisibilities = new Object();\n\
\n\
- function onClick( aEvt )\n\
+ // Initialize char and key code dictionaries.\n\
+ var charCodeDictionary = getDefaultCharCodeDictionary();\n\
+ var keyCodeDictionary = getDefaultKeyCodeDictionary();\n\
+\n\
+ // Initialize mouse handler dictionary.\n\
+ var mouseHandlerDictionary = getDefaultMouseHandlerDictionary();\n\
+\n\
+ /***************************\n\
+ ** OOP support functions **\n\
+ ***************************/\n\
+\n\
+ function object( aObject )\n\
{\n\
- var nOffset = 0;\n\
+ var F = function() {};\n\
+ F.prototype = aObject;\n\
+ return new F();\n\
+ }\n\
\n\
- if( aEvt.getButton() == 0 ) \n\
- nOffset = 1;\n\
- else if( aEvt.getButton() == 2 ) \n\
- nOffset = -1;\n\
+ function extend( aSubType, aSuperType )\n\
+ {\n\
+ if (!aSuperType || !aSubType) {\n\
+ alert('extend failed, verify dependencies');\n\
+ }\n\
+ var OP = Object.prototype;\n\
+ var sp = aSuperType.prototype;\n\
+ var rp = object( sp );\n\
+ aSubType.prototype = rp;\n\
\n\
- if( 0 != nOffset )\n\
- switchSlide( aEvt, nOffset );\n\
+ rp.constructor = aSubType;\n\
+ aSubType.superclass = sp;\n\
+\n\
+ // assign constructor property\n\
+ if (aSuperType != Object && sp.constructor == OP.constructor) {\n\
+ sp.constructor = aSuperType;\n\
+ }\n\
+\n\
+ return aSubType;\n\
}\n\
\n\
- function onKeyPress( aEvt ) \n\
+ // ------------------------------------------------------------------------------------------ //\n\
+ /**********************************\n\
+ ** Helper functions and classes **\n\
+ **********************************/\n\
+\n\
+ function Rectangle( aSVGRectElem )\n\
{\n\
- var nCode = String.fromCharCode( aEvt.getCharCode() );\n\
- var nOffset = 0;\n\
+ var x = parseInt( aSVGRectElem.getAttribute( 'x' ) );\n\
+ var y = parseInt( aSVGRectElem.getAttribute( 'y' ) );\n\
+ var width = parseInt( aSVGRectElem.getAttribute( 'width' ) );\n\
+ var height = parseInt( aSVGRectElem.getAttribute( 'height' ) );\n\
\n\
- if( ( ' ' == nCode ) || \n\
- ( ( !aEvt.getCtrlKey() && !aEvt.getAltKey() && !aEvt.getMetaKey() && !aEvt.getShiftKey() ) && \n\
- ( aEvt.getKeyCode() == aEvt.DOM_VK_PAGE_DOWN() ||\n\
- aEvt.getKeyCode() == aEvt.DOM_VK_PAGE_RIGHT() ) ) )\n\
+ this.left = x;\n\
+ this.right = x + width;\n\
+ this.top = y;\n\
+ this.bottom = y + height;\n\
+ }\n\
+\n\
+ function log( message )\n\
+ {\n\
+ if( typeof console == 'object' )\n\
{\n\
- nOffset = 1;\n\
+ console.log( message );\n\
}\n\
- else if( ( !aEvt.getCtrlKey() && !aEvt.getAltKey() && !aEvt.getMetaKey() && !aEvt.getShiftKey() ) && \n\
- ( aEvt.getKeyCode() == aEvt.DOM_VK_PAGE_UP() ||\n\
- aEvt.getKeyCode() == aEvt.DOM_VK_LEFT() ) )\n\
+ else if( typeof opera == 'object' )\n\
{\n\
- nOffset = -1\n\
+ opera.postError( message );\n\
}\n\
+ else if( typeof java == 'object' && typeof java.lang == 'object' )\n\
+ {\n\
+ java.lang.System.out.println( message );\n\
+ }\n\
+ }\n\
\n\
- if( 0 != nOffset )\n\
- switchSlide( aEvt, nOffset );\n\
+ function getNSAttribute( sNSPrefix, aElem, sAttrName )\n\
+ {\n\
+ if( !aElem ) return null;\n\
+ if( aElem.hasAttributeNS( NSS[sNSPrefix], sAttrName ) )\n\
+ {\n\
+ return aElem.getAttributeNS( NSS[sNSPrefix], sAttrName );\n\
+ }\n\
+ return null;\n\
+ }\n\
+\n\
+ function getOOOAttribute( aElem, sAttrName )\n\
+ {\n\
+ return getNSAttribute( 'ooo', aElem, sAttrName );\n\
+ }\n\
+\n\
+ function setNSAttribute( sNSPrefix, aElem, sAttrName, aValue )\n\
+";
+
+static const char aSVGScript1[] =
+"\
+ {\n\
+ if( !aElem ) return false;\n\
+ if( 'setAttributeNS' in aElem )\n\
+ {\n\
+ aElem.setAttributeNS( NSS[sNSPrefix], sAttrName, aValue );\n\
+ return true;\n\
+ }\n\
+ else\n\
+ {\n\
+ aElem.setAttribute(sNSPrefix + ':' + sAttrName, aValue );\n\
+ return true;\n\
+ }\n\
+ }\n\
+\n\
+ function setOOOAttribute( aElem, sAttrName, aValue )\n\
+ {\n\
+ return setNSAttribute( 'ooo', aElem, sAttrName, aValue );\n\
+ }\n\
+\n\
+ function checkElemAndSetAttribute( aElem, sAttrName, aValue )\n\
+ {\n\
+ if( aElem )\n\
+ aElem.setAttribute( sAttrName, aValue );\n\
+ }\n\
+\n\
+ function getElementsByProperty( node, name )\n\
+ {\n\
+ var elems = new Array();\n\
+\n\
+ if( node.getAttribute( name ) )\n\
+ elems.push( node );\n\
+\n\
+ for( var counter = 0; counter < node.childNodes.length; ++counter )\n\
+ {\n\
+ if( node.childNodes[counter].nodeType == 1 )\n\
+ elems = elems.concat( getElementsByProperty( node.childNodes[counter], name ) );\n\
+ }\n\
+ return elems;\n\
+ }\n\
+\n\
+ function getElementsByClassName( aElem, sClassName )\n\
+ {\n\
+\n\
+ var aElementSet = new Array();\n\
+ // not all browsers support the 'getElementsByClassName' method\n\
+ if( 'getElementsByClassName' in aElem )\n\
+ {\n\
+ aElementSet = aElem.getElementsByClassName( sClassName );\n\
+ }\n\
+ else\n\
+ {\n\
+ var aElementSetByClassProperty = getElementsByProperty( aElem, 'class' );\n\
+ for( var i = 0; i < aElementSetByClassProperty.length; ++i )\n\
+ {\n\
+ var sAttrClassName = aElementSetByClassProperty[i].getAttribute( 'class' );\n\
+ if( sAttrClassName == sClassName )\n\
+ {\n\
+ aElementSet.push( aElementSetByClassProperty[i] );\n\
+ }\n\
+ }\n\
+ }\n\
+ return aElementSet;\n\
+ }\n\
+\n\
+ function getElementByClassName( aElem, sClassName /*, sTagName */)\n\
+ {\n\
+ var aElementSet = getElementsByClassName( aElem, sClassName );\n\
+ if ( aElementSet.length == 1 )\n\
+ return aElementSet[0];\n\
+ else\n\
+ return null;\n\
+ }\n\
+\n\
+ function getClassAttribute( aElem )\n\
+ {\n\
+ if( aElem )\n\
+ return aElem.getAttribute( 'class' );\n\
+ return '';\n\
}\n\
\n\
+ function initVisibilityProperty( aElement )\n\
+ {\n\
+ var nVisibility = VISIBLE;\n\
+ var sVisibility = aElement.getAttribute( 'visibility' );\n\
+ if( sVisibility ) nVisibility = aVisibilityValue[ sVisibility ];\n\
+ return nVisibility;\n\
+ }\n\
+\n\
+ function setElementVisibility( aElement, nCurrentVisibility, nNewVisibility )\n\
+ {\n\
+ if( nCurrentVisibility != nNewVisibility )\n\
+ {\n\
+ checkElemAndSetAttribute( aElement, 'visibility', aVisibilityAttributeValue[nNewVisibility] );\n\
+ return nNewVisibility;\n\
+ }\n\
+ return nCurrentVisibility;\n\
+ }\n\
+\n\
+ function getSafeIndex( nIndex, nMin, nMax )\n\
+ {\n\
+ if( nIndex < nMin )\n\
+ return nMin;\n\
+ else if( nIndex > nMax )\n\
+ return nMax;\n\
+ else\n\
+ return nIndex;\n\
+ }\n\
+\n\
+\n\
+ // ------------------------------------------------------------------------------------------ //\n\
+ /******************\n\
+ ** Core Classes **\n\
+ ******************/\n\
+\n\
+ /** Class MetaDocument **\n\
+ * This class provides a pool of properties related to the whole presentation and\n\
+ * it is responsible for initializing the set of MetaSlide objects that handle\n\
+ * the meta information for each slide.\n\
+ */\n\
+ function MetaDocument( aMetaDocElem )\n\
+ {\n\
+ this.nNumberOfSlides = parseInt( aMetaDocElem.getAttributeNS( NSS['ooo'], aOOOAttrNumberOfSlides ) );\n\
+ assert( typeof this.nNumberOfSlides == 'number' && this.nNumberOfSlides > 0,\n\
+ 'MetaDocument: number of slides is zero or undefined.' );\n\
+ this.startSlideNumber = 0;\n\
+ this.sPageNumberingType = aMetaDocElem.getAttributeNS( NSS['ooo'], aOOOAttrNumberingType ) || 'arabic';\n\
+ this.aMetaSlideSet = new Array();\n\
+ this.aMasterPageSet = new Object();\n\
+ this.aTextFieldSet = new Array();\n\
+ this.slideNumberField = new SlideNumberField( this.sPageNumberingType );\n\
+\n\
+ for( var i = 0; i < this.nNumberOfSlides; ++i )\n\
+ {\n\
+ var sMetaSlideId = aOOOElemMetaSlide + '_' + i;\n\
+ this.aMetaSlideSet.push( new MetaSlide( sMetaSlideId, this ) );\n\
+ }\n\
+ assert( this.aMetaSlideSet.length == this.nNumberOfSlides,\n\
+ 'MetaDocument: aMetaSlideSet.length != nNumberOfSlides.' );\n\
+ this.aMetaSlideSet[ this.startSlideNumber ].show();\n\
+ }\n\
+\n\
+ MetaDocument.prototype.initPlaceholderShapes = function()\n\
+ {\n\
+ this.aMetaSlideSet[0].initPlaceholderShapes();\n\
+ };\n\
+\n\
+\n\
+ /** Class MetaSlide **\n\
+ * This class is responsible for managing the visibility of all master page shapes\n\
+ * and background related to a given slide element; it performs the creation and\n\
+ * the initialization of each Text Field object.\n\
+ */\n\
+ function MetaSlide( sMetaSlideId, aMetaDoc )\n\
+ {\n\
+ this.theDocument = document;\n\
+ this.id = sMetaSlideId;\n\
+ this.theMetaDoc = aMetaDoc;\n\
+ this.element = this.theDocument.getElementById( this.id );\n\
+ assert( this.element, 'MetaSlide: meta_slide element <' + this.id + '> not found.' );\n\
+ // - Initialize the Slide Element -\n\
+ this.slideId = this.element.getAttributeNS( NSS['ooo'], aOOOAttrSlide );\n\
+ this.slideElement = this.theDocument.getElementById( this.slideId );\n\
+ assert( this.slideElement, 'MetaSlide: slide element <' + this.slideId + '> not found.' );\n\
+ // - Initialize the Target Master Page Element -\n\
+ this.masterPage = this.initMasterPage();\n\
+ // - Initialize Background -\n\
+ //this.aBackground = getElementByClassName( this.aSlide, 'Background' );\n\
+ // - Initialize Visibility Properties -\n\
+ this.nAreMasterObjectsVisible = this.initVisibilityProperty( aOOOAttrMasterObjectsVisibility, VISIBLE );\n\
+ this.nIsBackgroundVisible = this.initVisibilityProperty( aOOOAttrBackgroundVisibility, VISIBLE );\n\
+ this.nIsPageNumberVisible = this.initVisibilityProperty( aOOOAttrPageNumberVisibility, HIDDEN );\n\
+ this.nIsDateTimeVisible = this.initVisibilityProperty( aOOOAttrDateTimeVisibility, VISIBLE );\n\
+ this.nIsFooterVisible = this.initVisibilityProperty( aOOOAttrFooterVisibility, VISIBLE );\n\
+ this.nIsHeaderVisible = this.initVisibilityProperty( aOOOAttrHeaderVisibility, VISIBLE );\n\
+ // - Initialize Master Page Text Fields (Placeholders)-\n\
+ this.aMPTextFieldSet = new Object();\n\
+ this.aMPTextFieldSet[aSlideNumberClassName] = this.initSlideNumberField();\n\
+ this.aMPTextFieldSet[aDateTimeClassName] = this.initDateTimeField( aOOOAttrDateTimeField );\n\
+ this.aMPTextFieldSet[aFooterClassName] = this.initFixedTextField( aOOOAttrFooterField );\n\
+ this.aMPTextFieldSet[aHeaderClassName] = this.initFixedTextField( aOOOAttrHeaderField );\n\
+ }\n\
+\n\
+ /*** MetaSlide methods ***/\n\
+ MetaSlide.prototype =\n\
+ {\n\
+ /*** public methods ***/\n\
+ hide : function()\n\
+ {\n\
+ checkElemAndSetAttribute( this.slideElement, 'visibility', 'hidden' );\n\
+\n\
+ this.masterPage.hide();\n\
+ this.masterPage.hideBackground();\n\
+\n\
+ var aFieldSet = this.aMPTextFieldSet;\n\
+ var aShapeSet = this.masterPage.aPlaceholderShapeSet;\n\
+ if( aFieldSet[aSlideNumberClassName] ) aFieldSet[aSlideNumberClassName].hide( aShapeSet[aSlideNumberClassName] );\n\
+ if( aFieldSet[aDateTimeClassName] ) aFieldSet[aDateTimeClassName].hide( aShapeSet[aDateTimeClassName] );\n\
+ if( aFieldSet[aFooterClassName] ) aFieldSet[aFooterClassName].hide( aShapeSet[aFooterClassName] );\n\
+ if( aFieldSet[aHeaderClassName] ) aFieldSet[aHeaderClassName].hide( aShapeSet[aHeaderClassName] );\n\
+ },\n\
";
static const char aSVGScript2[] =
-" function switchSlide( aEvt, nOffset ) \n\
+"\
+\n\
+ hideExceptMaster : function()\n\
+ {\n\
+ checkElemAndSetAttribute( this.slideElement, 'visibility', 'hidden' );\n\
+ },\n\
+\n\
+ show : function()\n\
+ {\n\
+ checkElemAndSetAttribute( this.slideElement, 'visibility', 'visible' );\n\
+\n\
+ this.masterPage.setVisibility( this.nAreMasterObjectsVisible );\n\
+ this.masterPage.setVisibilityBackground( this.nIsBackgroundVisible );\n\
+\n\
+\n\
+ this.setTextFieldVisibility( aSlideNumberClassName, this.nIsPageNumberVisible );\n\
+ this.setTextFieldVisibility( aDateTimeClassName, this.nIsDateTimeVisible );\n\
+ this.setTextFieldVisibility( aFooterClassName, this.nIsFooterVisible );\n\
+ this.setTextFieldVisibility( aHeaderClassName, this.nIsHeaderVisible );\n\
+ },\n\
+\n\
+ getMasterPageId : function()\n\
+ {\n\
+ return this.masterPage.id;\n\
+ },\n\
+\n\
+ getMasterPageElement : function()\n\
+ {\n\
+ return this.masterPage.element;\n\
+ },\n\
+\n\
+ getBackground : function()\n\
+ {\n\
+ return getElementByClassName( this.slideElement, 'Background' );\n\
+ },\n\
+\n\
+ getMasterPageBackground : function()\n\
+ {\n\
+ return this.masterPage.background;\n\
+ },\n\
+\n\
+ /*** private methods ***/\n\
+ initMasterPage : function()\n\
+ {\n\
+ var sMasterPageId = this.element.getAttributeNS( NSS['ooo'], aOOOAttrMaster );\n\
+ if( !this.theMetaDoc.aMasterPageSet.hasOwnProperty( sMasterPageId ) )\n\
+ this.theMetaDoc.aMasterPageSet[ sMasterPageId ] = new MasterPage( sMasterPageId );\n\
+ return this.theMetaDoc.aMasterPageSet[ sMasterPageId ];\n\
+ },\n\
+\n\
+ initVisibilityProperty : function( aVisibilityAttribute, nDefaultValue )\n\
+ {\n\
+ var nVisibility = nDefaultValue;\n\
+ var sVisibility = getOOOAttribute( this.element, aVisibilityAttribute );\n\
+ if( sVisibility )\n\
+ nVisibility = aVisibilityValue[ sVisibility ];\n\
+ return nVisibility;\n\
+ },\n\
+\n\
+ initSlideNumberField : function()\n\
+ {\n\
+ return this.theMetaDoc.slideNumberField;\n\
+ },\n\
+\n\
+ initDateTimeField : function( aOOOAttrDateTimeField )\n\
+ {\n\
+ var sTextFieldId = getOOOAttribute( this.element, aOOOAttrDateTimeField );\n\
+ if( !sTextFieldId ) return null;\n\
+\n\
+ var nLength = aOOOElemTextField.length + 1;\n\
+ var nIndex = parseInt(sTextFieldId.substring( nLength ) );\n\
+ if( typeof nIndex != 'number') return null;\n\
+\n\
+ if( !this.theMetaDoc.aTextFieldSet[ nIndex ] )\n\
+ {\n\
+ var aTextField;\n\
+ var aTextFieldElem = document.getElementById( sTextFieldId );\n\
+ var sClassName = getClassAttribute( aTextFieldElem );\n\
+ if( sClassName == 'FixedDateTimeField' )\n\
+ {\n\
+ aTextField = new FixedTextField( aTextFieldElem );\n\
+ }\n\
+ else if( sClassName == 'VariableDateTimeField' )\n\
+ {\n\
+ aTextField = new VariableDateTimeField( aTextFieldElem );\n\
+ }\n\
+ else\n\
+ {\n\
+ aTextField = null;\n\
+ }\n\
+ this.theMetaDoc.aTextFieldSet[ nIndex ] = aTextField;\n\
+ }\n\
+ return this.theMetaDoc.aTextFieldSet[ nIndex ];\n\
+ },\n\
+\n\
+ initFixedTextField : function( aOOOAttribute )\n\
+ {\n\
+ var sTextFieldId = getOOOAttribute( this.element, aOOOAttribute );\n\
+ if( !sTextFieldId ) return null;\n\
+\n\
+ var nLength = aOOOElemTextField.length + 1;\n\
+ var nIndex = parseInt( sTextFieldId.substring( nLength ) );\n\
+ if( typeof nIndex != 'number') return null;\n\
+\n\
+ if( !this.theMetaDoc.aTextFieldSet[ nIndex ] )\n\
+ {\n\
+ var aTextFieldElem = document.getElementById( sTextFieldId );\n\
+ this.theMetaDoc.aTextFieldSet[ nIndex ]\n\
+ = new FixedTextField( aTextFieldElem );\n\
+ }\n\
+ return this.theMetaDoc.aTextFieldSet[ nIndex ];\n\
+ },\n\
+\n\
+ setTextFieldVisibility : function( sClassName, nVisible )\n\
+ {\n\
+ var aTextField = this.aMPTextFieldSet[ sClassName ];\n\
+ var aPlaceholderShape = this.masterPage.aPlaceholderShapeSet[ sClassName ];\n\
+ if( !aTextField ) return;\n\
+ aTextField.setVisibility( this.nAreMasterObjectsVisible & nVisible, aPlaceholderShape );\n\
+ }\n\
+ };\n\
+\n\
+ /** Class MasterPage **\n\
+ * This class gives access to a master page element, its background and\n\
+ * each placeholder shape present in the master page element.\n\
+ */\n\
+ function MasterPage( sMasterPageId )\n\
{\n\
- var nNextSlide = nCurSlide + nOffset;\n\
+ this.id = sMasterPageId;\n\
+ this.element = document.getElementById( this.id );\n\
+ assert( this.element, 'MasterPage: master page element <' + this.id + '> not found.' );\n\
+ this.background = getElementByClassName( this.element, 'Background' );\n\
+ this.backgroundId = this.background.getAttribute( 'id' );\n\
+ this.backgroundVisibility = initVisibilityProperty( this.background );\n\
+ this.backgroundObjects = getElementByClassName( this.element, 'BackgroundObjects' );\n\
+ this.backgroundObjectsId = this.backgroundObjects.getAttribute( 'id' );\n\
+ this.backgroundObjectsVisibility = initVisibilityProperty( this.backgroundObjects );\n\
+ this.aPlaceholderShapeSet = new Object();\n\
+ this.initPlaceholderShapes();\n\
+ }\n\
+\n\
+ /*** MasterPage methods ***/\n\
+ MasterPage.prototype =\n\
+ {\n\
+ /*** public method ***/\n\
+ setVisibility : function( nVisibility )\n\
+ {\n\
+ this.backgroundObjectsVisibility = setElementVisibility( this.backgroundObjects, this.backgroundObjectsVisibility, nVisibility );\n\
+ },\n\
+\n\
+ setVisibilityBackground : function( nVisibility )\n\
+ {\n\
+ this.backgroundVisibility = setElementVisibility( this.background, this.backgroundVisibility, nVisibility );\n\
+ },\n\
+\n\
+ hide : function()\n\
+ {\n\
+ this.setVisibility( HIDDEN );\n\
+ },\n\
+\n\
+ show : function()\n\
+ {\n\
+ this.setVisibility( VISIBLE );\n\
+ },\n\
+\n\
+ hideBackground : function()\n\
+ {\n\
+ this.setVisibilityBackground( HIDDEN );\n\
+ },\n\
+\n\
+ showBackground : function()\n\
+ {\n\
+ this.setVisibilityBackground( VISIBLE );\n\
+ },\n\
+\n\
+ /*** private method ***/\n\
+ initPlaceholderShapes : function()\n\
+ {\n\
+ this.aPlaceholderShapeSet[ aSlideNumberClassName ] = new PlaceholderShape( this, aSlideNumberClassName );\n\
+ this.aPlaceholderShapeSet[ aDateTimeClassName ] = new PlaceholderShape( this, aDateTimeClassName );\n\
+ this.aPlaceholderShapeSet[ aFooterClassName ] = new PlaceholderShape( this, aFooterClassName );\n\
+ this.aPlaceholderShapeSet[ aHeaderClassName ] = new PlaceholderShape( this, aHeaderClassName );\n\
+ }\n\
+ };\n\
+\n\
+ /** Class PlaceholderShape **\n\
+ * This class manages the visibility and the text content of a placeholder shape.\n\
+ */\n\
+ function PlaceholderShape( aMasterPage, sClassName )\n\
+ {\n\
+ this.masterPage = aMasterPage;\n\
+ this.className = sClassName;\n\
+ this.element = null;\n\
+ this.textElement = null;\n\
+\n\
+ this.init();\n\
+ }\n\
+\n\
+ /* public methods */\n\
+ PlaceholderShape.prototype.setTextContent = function( sText )\n\
+ {\n\
+";
+
+static const char aSVGScript3[] =
+"\
+ if( !this.textElement )\n\
+ {\n\
+ log( 'error: PlaceholderShape.setTextContent: text element is not valid in placeholder of type '\n\
+ + this.className + ' that belongs to master slide ' + this.masterPage.id );\n\
+ return;\n\
+ }\n\
+ this.textElement.textContent = sText;\n\
+ };\n\
+\n\
+ PlaceholderShape.prototype.setVisibility = function( nVisibility )\n\
+ {\n\
+ this.element.setAttribute( 'visibility', aVisibilityAttributeValue[nVisibility] );\n\
+ };\n\
+\n\
+ PlaceholderShape.prototype.show = function()\n\
+ {\n\
+ this.element.setAttribute( 'visibility', 'visible' );\n\
+ };\n\
+\n\
+ PlaceholderShape.prototype.hide = function()\n\
+ {\n\
+ this.element.setAttribute( 'visibility', 'hidden' );\n\
+ };\n\
+\n\
+ /* private methods */\n\
+ PlaceholderShape.prototype.init = function()\n\
+ {\n\
+ var aShapeElem = getElementByClassName( this.masterPage.backgroundObjects, this.className );\n\
+ if( !aShapeElem ) return;\n\
+\n\
+ this.element = aShapeElem;\n\
+ this.element.setAttribute( 'visibility', 'hidden' );\n\
+\n\
+ this.textElement = getElementByClassName( this.element , 'PlaceholderText' );\n\
+ if( !this.textElement ) return;\n\
+\n\
+\n\
+ var aSVGRectElemSet = this.element.getElementsByTagName( 'rect' );\n\
+ if( aSVGRectElemSet.length != 1) return;\n\
+\n\
+ var aRect = new Rectangle( aSVGRectElemSet[0] );\n\
+\n\
+ var sTextAdjust = getOOOAttribute( this.element, aOOOAttrTextAdjust ) || 'left';\n\
+ var sTextAnchor, sX;\n\
+ if( sTextAdjust == 'left' )\n\
+ {\n\
+ sTextAnchor = 'start';\n\
+ sX = String( aRect.left );\n\
+ }\n\
+ else if( sTextAdjust == 'right' )\n\
+ {\n\
+ sTextAnchor = 'end';\n\
+ sX = String( aRect.right );\n\
+ }\n\
+ else if( sTextAdjust == 'center' )\n\
+ {\n\
+ sTextAnchor = 'middle';\n\
+ var nMiddle = ( aRect.left + aRect.right ) / 2;\n\
+ sX = String( parseInt( String( nMiddle ) ) );\n\
+ }\n\
+\n\
+\n\
+ this.textElement.setAttribute( 'text-anchor', sTextAnchor );\n\
+ this.textElement.setAttribute( 'x', sX );\n\
+ };\n\
+\n\
+\n\
+ // ------------------------------------------------------------------------------------------ //\n\
+ /********************************\n\
+ ** Text Field Class Hierarchy **\n\
+ ********************************/\n\
+\n\
+ /** Class TextField **\n\
+ * This class is the root abstract class of the hierarchy.\n\
+ * The 'shapeElement' property is the shape element to which\n\
+ * this TextField object provides the text content.\n\
+ */\n\
+ function TextField( aTextFieldElem )\n\
+ {\n\
+ this.bIsUpdated = false;\n\
+ }\n\
+\n\
+ /*** TextField public methods ***/\n\
+ TextField.prototype.getShapeElement = function()\n\
+ {\n\
+ return this.shapeElement;\n\
+ };\n\
+\n\
+ TextField.prototype.setVisibility = function( nVisibility, aPlaceholderShape )\n\
+ {\n\
+ if( !this.bIsUpdated )\n\
+ {\n\
+ if( nVisibility )\n\
+ {\n\
+ this.update( aPlaceholderShape );\n\
+ this.bIsUpdated = true;\n\
+ }\n\
+ aPlaceholderShape.setVisibility( nVisibility );\n\
+ }\n\
+ else if( !nVisibility )\n\
+ {\n\
+ aPlaceholderShape.hide();\n\
+ this.bIsUpdated = false;\n\
+ }\n\
+ };\n\
+\n\
+ TextField.prototype.show = function( aPlaceholderShape )\n\
+ {\n\
+ this.setVisibility( VISIBLE, aPlaceholderShape );\n\
+ };\n\
+\n\
+ TextField.prototype.hide = function( aPlaceholderShape )\n\
+ {\n\
+ this.setVisibility( HIDDEN, aPlaceholderShape );\n\
+ };\n\
+\n\
+\n\
+ /** Class FixedTextField **\n\
+ * This class handles text field with a fixed text.\n\
+ * The text content is provided by the 'text' property.\n\
+ */\n\
+ function FixedTextField( aTextFieldElem )\n\
+ {\n\
+ TextField.call( this, aTextFieldElem );\n\
+ this.text = aTextFieldElem.textContent;\n\
+ }\n\
+ extend( FixedTextField, TextField );\n\
+\n\
+ FixedTextField.prototype.update = function( aPlaceholderShape )\n\
+ {\n\
+ aPlaceholderShape.setTextContent( this.text );\n\
+ };\n\
+\n\
+\n\
+ /** Class VariableDateTimeField **\n\
+ * Provide the text content for the related shape by generating the current\n\
+ * date/time in the format specified by the 'dateTimeFormat' property.\n\
+ */\n\
+ function VariableDateTimeField( aTextFieldElem )\n\
+ {\n\
+ VariableDateTimeField.superclass.constructor.call( this, aTextFieldElem );\n\
+ this.dateTimeFormat = getOOOAttribute( aTextFieldElem, aOOOAttrDateTimeFormat );\n\
+ }\n\
+ extend( VariableDateTimeField, TextField );\n\
+\n\
+ /*** public methods ***/\n\
+ VariableDateTimeField.prototype.update = function( aPlaceholderShape )\n\
+ {\n\
+ var sText = this.createDateTimeText( this.dateTimeFormat );\n\
+ aPlaceholderShape.setTextContent( sText );\n\
+ };\n\
+\n\
+ VariableDateTimeField.prototype.createDateTimeText = function( sDateTimeFormat )\n\
+ {\n\
+ // TODO handle date/time format\n\
+ var aDate = Date();\n\
+ var sDate = aDate.toLocaleString();\n\
+ return sDate;\n\
+ };\n\
+\n\
+ /** Class SlideNumberField **\n\
+ * Provides the text content to the related shape by generating\n\
+ * the current page number in the given page numbering type.\n\
+ */\n\
+ function SlideNumberField( sPageNumberingType )\n\
+ {\n\
+ SlideNumberField.superclass.constructor.call( this, null );\n\
+ this.pageNumberingType = sPageNumberingType;\n\
+ }\n\
+ extend( SlideNumberField, TextField );\n\
+\n\
+ /*** public methods ***/\n\
+ SlideNumberField.prototype.getNumberingType = function()\n\
+ {\n\
+ return this.pageNumberingType;\n\
+ };\n\
\n\
- if( nNextSlide < 0 && nSlides > 0 )\n\
- nNextSlide = nSlides - 1;\n\
- else if( nNextSlide >= nSlides ) \n\
- nNextSlide = 0;\n\
+ SlideNumberField.prototype.update = function( aPlaceholderShape )\n\
+ {\n\
+ var sText = this.createSlideNumberText( nCurSlide + 1, this.getNumberingType() );\n\
+ aPlaceholderShape.setTextContent( sText );\n\
+ };\n\
+\n\
+ SlideNumberField.prototype.createSlideNumberText = function( nSlideNumber, sNumberingType )\n\
+ {\n\
+ // TODO handle page numbering type\n\
+ return String( nSlideNumber );\n\
+ };\n\
+\n\
+\n\
+\n\
+ //------------------------------------------------------------------------------------------- //\n\
+ /********************************\n\
+ ** Slide Index Classes **\n\
+ ********************************/\n\
+\n\
+ /** Class SlideIndePagex **\n\
+ * This class is responsible for handling the slide index page\n\
+ */\n\
+ function SlideIndexPage()\n\
+";
+
+static const char aSVGScript4[] =
+"\
+ {\n\
+ this.pageElementId = 'slide_index';\n\
+ this.pageBgColor = 'rgb(252,252,252)';\n\
+ this.pageElement = this.createPageElement();\n\
+ assert( this.pageElement, 'SlideIndexPage: pageElement is not valid' );\n\
+ this.indexColumns = INDEX_COLUMNS_DEFAULT;\n\
+ this.totalThumbnails = this.indexColumns * this.indexColumns;\n\
+ this.selectedSlideIndex = nCurSlide;\n\
+\n\
+ // set up layout paramers\n\
+ this.xSpacingFactor = 600/28000;\n\
+ this.ySpacingFactor = 450/21000;\n\
+ this.xSpacing = WIDTH * this.xSpacingFactor;\n\
+ this.ySpacing = HEIGHT * this.ySpacingFactor;\n\
+ this.halfBorderWidthFactor = ( 300/28000 ) * ( this.indexColumns / 3 );\n\
+ this.halfBorderWidth = WIDTH * this.halfBorderWidthFactor;\n\
+ this.borderWidth = 2 * this.halfBorderWidth;\n\
+ // the following formula is used to compute the slide shrinking factor:\n\
+ // scaleFactor = ( WIDTH - ( columns + 1 ) * xSpacing ) / ( columns * ( WIDTH + borderWidth ) )\n\
+ // indeed we can divide everything by WIDTH:\n\
+ this.scaleFactor = ( 1 - ( this.indexColumns + 1 ) * this.xSpacingFactor ) /\n\
+ ( this.indexColumns * ( 1 + 2 * this.halfBorderWidthFactor ) );\n\
+\n\
+ // We create a Thumbnail Border and Thumbnail MouseArea rectangle template that will be\n\
+ // used by every Thumbnail. The Mouse Area rectangle is used in order to trigger the\n\
+ // mouseover event properly even when the slide background is hidden.\n\
+ this.thumbnailMouseAreaTemplateId = 'thumbnail_mouse_area';\n\
+ this.thumbnailMouseAreaTemplateElement = null;\n\
+ this.thumbnailBorderTemplateId = 'thumbnail_border';\n\
+ this.thumbnailBorderTemplateElement = null;\n\
+ this.createTemplateElements();\n\
+\n\
+ // Now we create the grid of thumbnails\n\
+ this.aThumbnailSet = new Array( this.totalThumbnails );\n\
+ for( var i = 0; i < this.totalThumbnails; ++i )\n\
+ {\n\
+ this.aThumbnailSet[i] = new Thumbnail( this, i );\n\
+ this.aThumbnailSet[i].updateView();\n\
+ }\n\
+\n\
+ this.curThumbnailIndex = this.selectedSlideIndex % this.totalThumbnails;\n\
+ this.aThumbnailSet[ this.curThumbnailIndex ].select();\n\
+ }\n\
+\n\
+\n\
+ /* public methods */\n\
+ SlideIndexPage.prototype.getTotalThumbnails = function()\n\
+ {\n\
+ return this.totalThumbnails;\n\
+ };\n\
+\n\
+ SlideIndexPage.prototype.show = function()\n\
+ {\n\
+ this.pageElement.setAttribute( 'display', 'inherit' );\n\
+ };\n\
+\n\
+ SlideIndexPage.prototype.hide = function()\n\
+ {\n\
+ this.pageElement.setAttribute( 'display', 'none' );\n\
+ };\n\
+\n\
+ /** setSelection\n\
+ *\n\
+ * Change the selected thumbnail from the current one to the thumbnail with index nIndex.\n\
+ *\n\
+ * @param nIndex - the thumbnail index\n\
+ */\n\
+ SlideIndexPage.prototype.setSelection = function( nIndex )\n\
+ {\n\
+ nIndex = getSafeIndex( nIndex, 0, this.getTotalThumbnails() - 1 );\n\
+ if( this.curThumbnailIndex != nIndex )\n\
+ {\n\
+ this.aThumbnailSet[ this.curThumbnailIndex ].unselect();\n\
+ this.aThumbnailSet[ nIndex ].select();\n\
+ this.curThumbnailIndex = nIndex;\n\
+ }\n\
+ this.selectedSlideIndex = this.aThumbnailSet[ nIndex ].slideIndex;\n\
+ };\n\
+\n\
+ SlideIndexPage.prototype.createPageElement = function()\n\
+ {\n\
+ var aPageElement = document.createElementNS( NSS['svg'], 'g' );\n\
+ aPageElement.setAttribute( 'id', this.pageElementId );\n\
+ aPageElement.setAttribute( 'display', 'none' );\n\
+\n\
+ // the slide index page background\n\
+ var sPageBgColor = this.pageBgColor + ';';\n\
+ var aRectElement = document.createElementNS( NSS['svg'], 'rect' );\n\
+ aRectElement.setAttribute( 'x', 0 );\n\
+ aRectElement.setAttribute( 'y', 0 );\n\
+ aRectElement.setAttribute( 'width', WIDTH );\n\
+ aRectElement.setAttribute( 'height', HEIGHT );\n\
+ aRectElement.setAttribute( 'style', 'stroke:none;fill:' + sPageBgColor );\n\
+\n\
+ aPageElement.appendChild( aRectElement );\n\
+ // The index page is appended after all slide elements\n\
+ // so when it is displayed it covers them all\n\
+ ROOT_NODE.appendChild( aPageElement );\n\
+ return( document.getElementById( this.pageElementId ) );\n\
+ };\n\
+\n\
+ SlideIndexPage.prototype.createTemplateElements = function()\n\
+ {\n\
+ // We define a Rect element as a template of thumbnail border for all slide-thumbnails.\n\
+ // The stroke color is defined individually by each thumbnail according to\n\
+ // its selection status.\n\
+ var aDefsElement = document.createElementNS( NSS['svg'], 'defs' );\n\
+ var aRectElement = document.createElementNS( NSS['svg'], 'rect' );\n\
+ aRectElement.setAttribute( 'id', this.thumbnailBorderTemplateId );\n\
+ aRectElement.setAttribute( 'x', -this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'y', -this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'rx', this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'ry', this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'width', WIDTH + this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'height', HEIGHT + this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'stroke-width', this.borderWidth );\n\
+ aRectElement.setAttribute( 'fill', 'none' );\n\
+ aDefsElement.appendChild( aRectElement );\n\
+\n\
+ // We define a Rect element as a template of mouse area for triggering the mouseover event.\n\
+ // A copy is used by each thumbnail element.\n\
+ aRectElement = document.createElementNS( NSS['svg'], 'rect' );\n\
+ aRectElement.setAttribute( 'id', this.thumbnailMouseAreaTemplateId );\n\
+ aRectElement.setAttribute( 'x', 0 );\n\
+ aRectElement.setAttribute( 'y', 0 );\n\
+ aRectElement.setAttribute( 'width', WIDTH );\n\
+ aRectElement.setAttribute( 'height', HEIGHT );\n\
+ aRectElement.setAttribute( 'fill', this.pageBgColor );\n\
+ aDefsElement.appendChild( aRectElement );\n\
+\n\
+ this.pageElement.appendChild( aDefsElement );\n\
+\n\
+ this.thumbnailMouseAreaTemplateElement = document.getElementById( this.thumbnailMouseAreaTemplateId );\n\
+ this.thumbnailBorderTemplateElement = document.getElementById( this.thumbnailBorderTemplateId );\n\
+ };\n\
+\n\
+ SlideIndexPage.prototype.decreaseNumberOfColumns = function()\n\
+ {\n\
+ this.setNumberOfColumns( this.indexColumns - 1 );\n\
+ };\n\
+\n\
+ SlideIndexPage.prototype.increaseNumberOfColumns = function()\n\
+ {\n\
+ this.setNumberOfColumns( this.indexColumns + 1 );\n\
+ };\n\
+\n\
+ SlideIndexPage.prototype.resetNumberOfColumns = function()\n\
+ {\n\
+ this.setNumberOfColumns( INDEX_COLUMNS_DEFAULT );\n\
+ };\n\
+\n\
+ /** setNumberOfColumns\n\
+ *\n\
+ * Change the size of the thumbnail grid.\n\
+ *\n\
+ * @param nNumberOfColumns - the new number of columns/rows of the thumbnail grid\n\
+ */\n\
+ SlideIndexPage.prototype.setNumberOfColumns = function( nNumberOfColumns )\n\
+ {\n\
+ if( this.indexColumns == nNumberOfColumns ) return;\n\
+ if( nNumberOfColumns < 2 || nNumberOfColumns > 6 ) return;\n\
+\n\
+ var suspendHandle = ROOT_NODE.suspendRedraw(500);\n\
+\n\
+ var nOldTotalThumbnails = this.totalThumbnails;\n\
+ this.indexColumns = nNumberOfColumns;\n\
+ this.totalThumbnails = nNumberOfColumns * nNumberOfColumns;;\n\
+\n\
+ this.aThumbnailSet[this.curThumbnailIndex].unselect();\n\
+\n\
+ // if we decreased the number of used columns we remove the exceding thumbnail elements\n\
+ for( var i = this.totalThumbnails; i < nOldTotalThumbnails; ++i )\n\
+ {\n\
+ this.aThumbnailSet[i].removeElement();\n\
+ };\n\
+\n\
+ // if we increased the number of used columns we create the needed thumbnail objects\n\
+ for( var i = nOldTotalThumbnails; i < this.totalThumbnails; ++i )\n\
+ {\n\
+ this.aThumbnailSet[i] = new Thumbnail( this, i );\n\
+ };\n\
+\n\
+ // we set up layout parameters that depend on the number of columns\n\
+ this.halfBorderWidthFactor = ( 300/28000 ) * ( this.indexColumns / 3 );\n\
+ this.halfBorderWidth = WIDTH * this.halfBorderWidthFactor;\n\
+ this.borderWidth = 2 * this.halfBorderWidth;\n\
+ // scaleFactor = ( WIDTH - ( columns + 1 ) * xSpacing ) / ( columns * ( WIDTH + borderWidth ) )\n\
+ this.scaleFactor = ( 1 - ( this.indexColumns + 1 ) * this.xSpacingFactor ) /\n\
+ ( this.indexColumns * ( 1 + 2 * this.halfBorderWidthFactor ) );\n\
+\n\
+ // update the thumbnail border size\n\
+ var aRectElement = this.thumbnailBorderTemplateElement;\n\
+ aRectElement.setAttribute( 'x', -this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'y', -this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'rx', this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'ry', this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'width', WIDTH + this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'height', HEIGHT + this.halfBorderWidth );\n\
+ aRectElement.setAttribute( 'stroke-width', this.borderWidth );\n\
+\n\
+";
+
+static const char aSVGScript5[] =
+"\
+ // now we update the displacement on the index page of each thumbnail (old and new)\n\
+ for( var i = 0; i < this.totalThumbnails; ++i )\n\
+ {\n\
+ this.aThumbnailSet[i].updateView();\n\
+ }\n\
+\n\
+ this.curThumbnailIndex = this.selectedSlideIndex % this.totalThumbnails;\n\
+ this.aThumbnailSet[this.curThumbnailIndex].select();\n\
+\n\
+ // needed for forcing the indexSetPageSlide routine to update the INDEX_OFFSET\n\
+ INDEX_OFFSET = -1;\n\
+ indexSetPageSlide( this.selectedSlideIndex );\n\
+\n\
+ ROOT_NODE.unsuspendRedraw( suspendHandle );\n\
+ ROOT_NODE.forceRedraw();\n\
+ };\n\
+\n\
+\n\
+ /** Class Thumbnail **\n\
+ * This class handles a slide thumbnail.\n\
+ */\n\
+ function Thumbnail( aSlideIndexPage, nIndex )\n\
+ {\n\
+ this.container = aSlideIndexPage;\n\
+ this.index = nIndex;//= getSafeIndex( nIndex, 0, this.container.getTotalThumbnails() );\n\
+ this.pageElement = this.container.pageElement;\n\
+ this.thumbnailId = 'thumbnail' + this.index;\n\
+ this.thumbnailElement = this.createThumbnailElement();\n\
+ this.slideElement = getElementByClassName( this.thumbnailElement, 'Slide' );\n\
+ this.backgroundElement = getElementByClassName( this.thumbnailElement, 'Background' );\n\
+ this.backgroundObjectsElement = getElementByClassName( this.thumbnailElement, 'BackgroundObjects' );\n\
+ this.borderElement = getElementByClassName( this.thumbnailElement, 'Border' );\n\
+ this.aTransformSet = new Array( 3 );\n\
+ this.visibility = VISIBLE;\n\
+ this.isSelected = false;\n\
+ };\n\
+\n\
+ /* static const class member */\n\
+ Thumbnail.prototype.sNormalBorderColor = 'rgb(216,216,216)';\n\
+ Thumbnail.prototype.sSelectionBorderColor = 'rgb(92,92,255)';\n\
+\n\
+ /* public methods */\n\
+ Thumbnail.prototype.removeElement = function()\n\
+ {\n\
+ if( this.thumbnailElement )\n\
+ this.container.pageElement.removeChild( this.thumbnailElement );\n\
+ };\n\
+\n\
+ Thumbnail.prototype.show = function()\n\
+ {\n\
+ if( this.visibility == HIDDEN )\n\
+ {\n\
+ this.thumbnailElement.setAttribute( 'display', 'inherit' );\n\
+ this.visibility = VISIBLE;\n\
+ }\n\
+ };\n\
+\n\
+ Thumbnail.prototype.hide = function()\n\
+ {\n\
+ if( this.visibility == VISIBLE )\n\
+ {\n\
+ this.thumbnailElement.setAttribute( 'display', 'none' );\n\
+ this.visibility = HIDDEN;\n\
+ }\n\
+ };\n\
+\n\
+ Thumbnail.prototype.select = function()\n\
+ {\n\
+ if( !this.isSelected )\n\
+ {\n\
+ this.borderElement.setAttribute( 'stroke', this.sSelectionBorderColor );\n\
+ this.isSelected = true;\n\
+ }\n\
+ };\n\
+\n\
+ Thumbnail.prototype.unselect = function()\n\
+ {\n\
+ if( this.isSelected )\n\
+ {\n\
+ this.borderElement.setAttribute( 'stroke', this.sNormalBorderColor );\n\
+ this.isSelected = false;\n\
+ }\n\
+ };\n\
+\n\
+ /** updateView\n\
+ *\n\
+ * This method updates the displacement of the thumbnail on the slide index page,\n\
+ * the value of the row, column coordinates of the thumbnail in the grid, and\n\
+ * the onmouseover property of the thumbnail element.\n\
+ *\n\
+ */\n\
+ Thumbnail.prototype.updateView = function()\n\
+ {\n\
+ this.column = this.index % this.container.indexColumns;\n\
+ this.row = ( this.index - this.column ) / this.container.indexColumns;\n\
+ this.halfBorderWidth = this.container.halfBorderWidth;\n\
+ this.borderWidth = this.container.borderWidth;\n\
+ this.width = ( WIDTH + this.borderWidth ) * this.container.scaleFactor;\n\
+ this.height = ( HEIGHT + this.borderWidth ) * this.container.scaleFactor;\n\
+ this.aTransformSet[2] = 'translate(' + this.halfBorderWidth + ' ' + this.halfBorderWidth + ')';\n\
+ this.aTransformSet[1] = 'scale(' + this.container.scaleFactor + ')';\n\
+ var sTransformAttrValue = this.computeTransform();\n\
+ this.thumbnailElement.setAttribute( 'transform', sTransformAttrValue );\n\
+ this.thumbnailElement.setAttribute( 'onmouseover', 'theSlideIndexPage.aThumbnailSet[' + this.index + '].onMouseOver()' );\n\
+ };\n\
+\n\
+ /** update\n\
+ *\n\
+ * This method update the content of the thumbnail view\n\
+ *\n\
+ * @param nIndex - the index of the slide to be shown in the thumbnail\n\
+ */\n\
+ Thumbnail.prototype.update = function( nIndex )\n\
+ {\n\
+ if( this.slideIndex == nIndex ) return;\n\
+\n\
+ var aMetaSlide = theMetaDoc.aMetaSlideSet[nIndex];\n\
+ setNSAttribute( 'xlink', this.slideElement, 'href', '#' + aMetaSlide.slideId );\n\
+ if( aMetaSlide.nIsBackgroundVisible )\n\
+ {\n\
+ setNSAttribute( 'xlink', this.backgroundElement, 'href', '#' + aMetaSlide.masterPage.backgroundId );\n\
+ this.backgroundElement.setAttribute( 'visibility', 'inherit' );\n\
+ }\n\
+ else\n\
+ {\n\
+ this.backgroundElement.setAttribute( 'visibility', 'hidden' );\n\
+ }\n\
+ if( aMetaSlide.nAreMasterObjectsVisible )\n\
+ {\n\
+ setNSAttribute( 'xlink', this.backgroundObjectsElement, 'href', '#' + aMetaSlide.masterPage.backgroundObjectsId );\n\
+ this.backgroundObjectsElement.setAttribute( 'visibility', 'inherit' );\n\
+ }\n\
+ else\n\
+ {\n\
+ this.backgroundObjectsElement.setAttribute( 'visibility', 'hidden' );\n\
+ }\n\
+ this.slideIndex = nIndex;\n\
+ };\n\
+\n\
+ Thumbnail.prototype.clear = function( nIndex )\n\
+ {\n\
+ setNSAttribute( 'xlink', this.slideElement, 'href', '' );\n\
+ setNSAttribute( 'xlink', this.backgroundElement, 'href', '' );\n\
+ setNSAttribute( 'xlink', this.backgroundObjectsElement, 'href', '' );\n\
+ };\n\
+\n\
+ /* private methods */\n\
+ Thumbnail.prototype.createThumbnailElement = function()\n\
+ {\n\
+ var aThumbnailElement = document.createElementNS( NSS['svg'], 'g' );\n\
+ aThumbnailElement.setAttribute( 'id', this.thumbnailId );\n\
+ aThumbnailElement.setAttribute( 'display', 'inherit' );\n\
+\n\
+ var aMouseAreaElement = document.createElementNS( NSS['svg'], 'use' );\n\
+ setNSAttribute( 'xlink', aMouseAreaElement, 'href', '#' + this.container.thumbnailMouseAreaTemplateId );\n\
+ aMouseAreaElement.setAttribute( 'class', 'MouseArea' );\n\
+ aThumbnailElement.appendChild( aMouseAreaElement );\n\
+\n\
+ var aBackgroundElement = document.createElementNS( NSS['svg'], 'use' );\n\
+ setNSAttribute( 'xlink', aBackgroundElement, 'href', '' );\n\
+ aBackgroundElement.setAttribute( 'visibility', 'inherit');\n\
+ aBackgroundElement.setAttribute( 'class', 'Background' );\n\
+ aThumbnailElement.appendChild( aBackgroundElement );\n\
+\n\
+ var aBackgroundObjectsElement = document.createElementNS( NSS['svg'], 'use' );\n\
+ setNSAttribute( 'xlink', aBackgroundObjectsElement, 'href', '' );\n\
+ aBackgroundObjectsElement.setAttribute( 'visibility', 'inherit');\n\
+ aBackgroundObjectsElement.setAttribute( 'class', 'BackgroundObjects' );\n\
+ aThumbnailElement.appendChild( aBackgroundObjectsElement );\n\
+\n\
+ var aSlideElement = document.createElementNS( NSS['svg'], 'use' );\n\
+ setNSAttribute( 'xlink', aSlideElement, 'href', '' );\n\
+ aSlideElement.setAttribute( 'class', 'Slide' );\n\
+ aThumbnailElement.appendChild( aSlideElement );\n\
+\n\
+ var aBorderElement = document.createElementNS( NSS['svg'], 'use' );\n\
+ setNSAttribute( 'xlink', aBorderElement, 'href', '#' + this.container.thumbnailBorderTemplateId );\n\
+ aBorderElement.setAttribute( 'stroke', this.sNormalBorderColor );\n\
+ aBorderElement.setAttribute( 'class', 'Border' );\n\
+ aThumbnailElement.appendChild( aBorderElement );\n\
+\n\
+ this.container.pageElement.appendChild( aThumbnailElement );\n\
+ return( document.getElementById( this.thumbnailId ) );\n\
+ };\n\
+\n\
+ Thumbnail.prototype.computeTransform = function()\n\
+ {\n\
+ var nXSpacing = this.container.xSpacing;\n\
+ var nYSpacing = this.container.ySpacing;\n\
+\n\
+ var nXOffset = nXSpacing + ( this.width + nXSpacing ) * this.column;\n\
+ var nYOffset = nYSpacing + ( this.height + nYSpacing ) * this.row;\n\
+\n\
+ this.aTransformSet[0] = 'translate(' + nXOffset + ' ' + nYOffset + ')';\n\
+\n\
+ sTransform = this.aTransformSet.join( ' ' );\n\
+\n\
+ return sTransform;\n\
+ };\n\
+\n\
+";
+
+static const char aSVGScript6[] =
+"\
+ Thumbnail.prototype.onMouseOver = function()\n\
+ {\n\
+ if( ( currentMode == INDEX_MODE ) && ( this.container.curThumbnailIndex != this.index ) )\n\
+ {\n\
+ this.container.setSelection( this.index );\n\
+ }\n\
+ };\n\
+\n\
+\n\
+\n\
+\n\
+ // ------------------------------------------------------------------------------------------ //\n\
+ /** Initialization function.\n\
+ * The whole presentation is set-up in this function.\n\
+ */\n\
+ function init()\n\
+ {\n\
\n\
- aSlides[ nCurSlide ].setAttributeNS( null, \"visibility\", \"hidden\" );\n\
- aSlides[ nNextSlide ].setAttributeNS( null, \"visibility\", \"visible\" );\n\
+ var VIEWBOX = ROOT_NODE.getAttribute('viewBox');\n\
\n\
- var aCurMaster = aMasters[ nCurSlide ];\n\
- var aCurMasterVisibility = aMasterVisibilities[ nCurSlide ];\n\
- \n\
- var aNextMaster = aMasters[ nNextSlide ];\n\
- var aNextMasterVisibility = aMasterVisibilities[ nNextSlide ];\n\
+ if( VIEWBOX )\n\
+ {\n\
+ WIDTH = ROOT_NODE.viewBox.animVal.width;\n\
+ HEIGHT = ROOT_NODE.viewBox.animVal.height;\n\
+ }\n\
+\n\
+ var aMetaDocElem = document.getElementById( aOOOElemMetaSlides );\n\
+ assert( aMetaDocElem, 'init: meta document element not found' );\n\
+ theMetaDoc = new MetaDocument( aMetaDocElem );\n\
+ theSlideIndexPage = new SlideIndexPage();\n\
+\n\
+\n\
+ }\n\
+\n\
+ function presentationEngineStop()\n\
+ {\n\
+ alert( 'We are sorry! An unexpected error occurred.\\nThe presentation engine will be stopped' );\n\
+ document.onkeydown = null;\n\
+ document.onkeypress = null;\n\
+ document.onclick = null;\n\
+ window.onmousewheel = null;\n\
+ }\n\
+\n\
+ function assert( condition, message )\n\
+ {\n\
+ if (!condition)\n\
+ {\n\
+ presentationEngineStop();\n\
+ if (typeof console == 'object')\n\
+ console.trace();\n\
+ throw new Error( message );\n\
+ }\n\
+ }\n\
+\n\
+ /** Event handler for key press.\n\
+ *\n\
+ * @param aEvt the event\n\
+ */\n\
+ function onKeyDown( aEvt )\n\
+ {\n\
+ if ( !aEvt )\n\
+ aEvt = window.event;\n\
+\n\
+ code = aEvt.keyCode || aEvt.charCode;\n\
+\n\
+ if ( !processingEffect && keyCodeDictionary[currentMode] && keyCodeDictionary[currentMode][code] )\n\
+ return keyCodeDictionary[currentMode][code]();\n\
+ else\n\
+ document.onkeypress = onKeyPress;\n\
+ }\n\
+ // Set event handler for key down.\n\
+ document.onkeydown = onKeyDown;\n\
+\n\
+ /** Event handler for key press.\n\
+ *\n\
+ * @param aEvt the event\n\
+ */\n\
+ function onKeyPress( aEvt )\n\
+ {\n\
+ document.onkeypress = null;\n\
+\n\
+ if ( !aEvt )\n\
+ aEvt = window.event;\n\
+\n\
+ str = String.fromCharCode( aEvt.keyCode || aEvt.charCode );\n\
+\n\
+ if ( !processingEffect && charCodeDictionary[currentMode] && charCodeDictionary[currentMode][str] )\n\
+ return charCodeDictionary[currentMode][str]();\n\
+ }\n\
+\n\
+ /** Function to supply the default key code dictionary.\n\
+ *\n\
+ * @returns default key code dictionary\n\
+ */\n\
+ function getDefaultKeyCodeDictionary()\n\
+ {\n\
+ var keyCodeDict = new Object();\n\
+\n\
+ keyCodeDict[SLIDE_MODE] = new Object();\n\
+ keyCodeDict[INDEX_MODE] = new Object();\n\
+\n\
+ keyCodeDict[SLIDE_MODE][LEFT_KEY] = function() { return dispatchEffects(-1); };\n\
+ keyCodeDict[SLIDE_MODE][RIGHT_KEY] = function() { return dispatchEffects(1); };\n\
+ keyCodeDict[SLIDE_MODE][UP_KEY] = function() { return skipEffects(-1); };\n\
+ keyCodeDict[SLIDE_MODE][DOWN_KEY] = function() { return skipEffects(1); };\n\
+ keyCodeDict[SLIDE_MODE][PAGE_UP_KEY] = function() { return dispatchEffects(-1); };\n\
+ keyCodeDict[SLIDE_MODE][PAGE_DOWN_KEY] = function() { return dispatchEffects(1); };\n\
+ keyCodeDict[SLIDE_MODE][HOME_KEY] = function() { return slideSetActiveSlide(0); };\n\
+ keyCodeDict[SLIDE_MODE][END_KEY] = function() { return slideSetActiveSlide(theMetaDoc.nNumberOfSlides - 1); };\n\
+ keyCodeDict[SLIDE_MODE][SPACE_KEY] = function() { return dispatchEffects(1); };\n\
+\n\
+ keyCodeDict[INDEX_MODE][LEFT_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - 1 ); };\n\
+ keyCodeDict[INDEX_MODE][RIGHT_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + 1 ); };\n\
+ keyCodeDict[INDEX_MODE][UP_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - theSlideIndexPage.indexColumns ); };\n\
+ keyCodeDict[INDEX_MODE][DOWN_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + theSlideIndexPage.indexColumns ); };\n\
+ keyCodeDict[INDEX_MODE][PAGE_UP_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - theSlideIndexPage.getTotalThumbnails() ); };\n\
+ keyCodeDict[INDEX_MODE][PAGE_DOWN_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + theSlideIndexPage.getTotalThumbnails() ); };\n\
+ keyCodeDict[INDEX_MODE][HOME_KEY] = function() { return indexSetPageSlide( 0 ); };\n\
+ keyCodeDict[INDEX_MODE][END_KEY] = function() { return indexSetPageSlide( theMetaDoc.nNumberOfSlides - 1 ); };\n\
+ keyCodeDict[INDEX_MODE][ENTER_KEY] = function() { return toggleSlideIndex(); };\n\
+ keyCodeDict[INDEX_MODE][SPACE_KEY] = function() { return toggleSlideIndex(); };\n\
+ keyCodeDict[INDEX_MODE][ESCAPE_KEY] = function() { return abandonIndexMode(); };\n\
+\n\
+ return keyCodeDict;\n\
+ }\n\
+\n\
+ /** Function to supply the default char code dictionary.\n\
+ *\n\
+ * @returns default char code dictionary\n\
+ */\n\
+ function getDefaultCharCodeDictionary()\n\
+ {\n\
+ var charCodeDict = new Object();\n\
+\n\
+ charCodeDict[SLIDE_MODE] = new Object();\n\
+ charCodeDict[INDEX_MODE] = new Object();\n\
+\n\
+ charCodeDict[SLIDE_MODE]['i'] = function () { return toggleSlideIndex(); };\n\
+\n\
+ charCodeDict[INDEX_MODE]['i'] = function () { return toggleSlideIndex(); };\n\
+ charCodeDict[INDEX_MODE]['-'] = function () { return theSlideIndexPage.decreaseNumberOfColumns(); };\n\
+ charCodeDict[INDEX_MODE]['='] = function () { return theSlideIndexPage.increaseNumberOfColumns(); };\n\
+ charCodeDict[INDEX_MODE]['+'] = function () { return theSlideIndexPage.increaseNumberOfColumns(); };\n\
+ charCodeDict[INDEX_MODE]['0'] = function () { return theSlideIndexPage.resetNumberOfColumns(); };\n\
+\n\
+ return charCodeDict;\n\
+ }\n\
+\n\
+\n\
+ function slideOnMouseDown( aEvt )\n\
+ {\n\
+ if (!aEvt)\n\
+ aEvt = window.event;\n\
+\n\
+ var nOffset = 0;\n\
+\n\
+ if( aEvt.button == 0 )\n\
+ nOffset = 1;\n\
+ else if( aEvt.button == 2 )\n\
+ nOffset = -1;\n\
+\n\
+ if( 0 != nOffset )\n\
+ switchSlide( nOffset );\n\
+ }\n\
+\n\
+ /** Event handler for mouse wheel events in slide mode.\n\
+ * based on http://adomas.org/javascript-mouse-wheel/\n\
+ *\n\
+ * @param aEvt the event\n\
+ */\n\
+ function slideOnMouseWheel(aEvt)\n\
+ {\n\
+ var delta = 0;\n\
+\n\
+ if (!aEvt)\n\
+ aEvt = window.event;\n\
+\n\
+ if (aEvt.wheelDelta)\n\
+ { // IE Opera\n\
+ delta = aEvt.wheelDelta/120;\n\
+ }\n\
+ else if (aEvt.detail)\n\
+ { // MOZ\n\
+ delta = -aEvt.detail/3;\n\
+ }\n\
+\n\
+ if (delta > 0)\n\
+ skipEffects(-1);\n\
+ else if (delta < 0)\n\
+ skipEffects(1);\n\
+\n\
+ if (aEvt.preventDefault)\n\
+ aEvt.preventDefault();\n\
+\n\
+ aEvt.returnValue = false;\n\
+ }\n\
\n\
- if( ( aCurMaster != aNextMaster ) || ( aCurMasterVisibility != aNextMasterVisibility ) ) \n\
+ // Mozilla\n\
+ if( window.addEventListener )\n\
+ {\n\
+";
+
+static const char aSVGScript7[] =
+"\
+ window.addEventListener( 'DOMMouseScroll', function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_WHEEL ); }, false );\n\
+ }\n\
+\n\
+ // Opera Safari OK - may not work in IE\n\
+ window.onmousewheel = function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_WHEEL ); };\n\
+\n\
+ /** Function to handle all mouse events.\n\
+ *\n\
+ * @param aEvt event\n\
+ * @param anAction type of event (e.g. mouse up, mouse wheel)\n\
+ */\n\
+ function mouseHandlerDispatch( aEvt, anAction )\n\
+ {\n\
+ if( !aEvt )\n\
+ aEvt = window.event;\n\
+\n\
+ var retVal = true;\n\
+\n\
+ if ( mouseHandlerDictionary[currentMode] && mouseHandlerDictionary[currentMode][anAction] )\n\
{\n\
- if( aCurMaster != aNextMaster )\n\
- aCurMaster.setAttributeNS( null, \"visibility\", \"hidden\" );\n\
- \n\
- aNextMaster.setAttributeNS( null, \"visibility\", aNextMasterVisibility );\n\
+ var subRetVal = mouseHandlerDictionary[currentMode][anAction]( aEvt );\n\
+\n\
+ if( subRetVal != null && subRetVal != undefined )\n\
+ retVal = subRetVal;\n\
}\n\
\n\
- nCurSlide = nNextSlide; \n\
+ if( aEvt.preventDefault && !retVal )\n\
+ aEvt.preventDefault();\n\
+\n\
+ aEvt.returnValue = retVal;\n\
+\n\
+ return retVal;\n\
+ }\n\
+\n\
+ // Set mouse event handler.\n\
+ document.onmousedown = function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_DOWN ); };\n\
+ //document.onmousemove = function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_MOVE ); };\n\
+\n\
+ /** Function to supply the default mouse handler dictionary.\n\
+ *\n\
+ * @returns default mouse handler dictionary\n\
+ */\n\
+ function getDefaultMouseHandlerDictionary()\n\
+ {\n\
+ var mouseHandlerDict = new Object();\n\
+\n\
+ mouseHandlerDict[SLIDE_MODE] = new Object();\n\
+ mouseHandlerDict[INDEX_MODE] = new Object();\n\
+\n\
+\n\
+ mouseHandlerDict[SLIDE_MODE][MOUSE_DOWN] = function( aEvt ) { return slideOnMouseDown( aEvt ); };\n\
+ mouseHandlerDict[SLIDE_MODE][MOUSE_WHEEL] = function( aEvt ) { return slideOnMouseWheel( aEvt ); };\n\
+\n\
+ mouseHandlerDict[INDEX_MODE][MOUSE_DOWN] = function( aEvt ) { return toggleSlideIndex(); };\n\
+\n\
+ return mouseHandlerDict;\n\
+ }\n\
+\n\
+ /** Function to dispatch the next effect, if there is none left, change the slide.\n\
+ *\n\
+ * @param dir direction of the change (1 = forwards, -1 = backwards)\n\
+ */\n\
+ function dispatchEffects(dir)\n\
+ {\n\
+ // TODO to be implemented\n\
+ switchSlide(dir);\n\
+ }\n\
+\n\
+ /** Function to skip effects and directly either put the slide into start or end state or change slides.\n\
+ *\n\
+ * @param dir direction of the change (1 = forwards, -1 = backwards)\n\
+ */\n\
+ function skipEffects(dir)\n\
+ {\n\
+ // TODO to be implemented\n\
+ switchSlide(dir);\n\
+ }\n\
+\n\
+ /** Function to change between slides.\n\
+ *\n\
+ * @param nOffset direction (1 = forwards, -1 = backwards)\n\
+ */\n\
+ function switchSlide( nOffset )\n\
+ {\n\
+ var nNextSlide = nCurSlide + nOffset;\n\
+ slideSetActiveSlide( nNextSlide );\n\
}\n\
\n\
- function init() \n\
+ /** Function to display the index sheet.\n\
+ *\n\
+ * @param offsetNumber offset number\n\
+ */\n\
+ function displayIndex( offsetNumber )\n\
+ {\n\
+ var aMetaSlideSet = theMetaDoc.aMetaSlideSet;\n\
+ offsetNumber = getSafeIndex( offsetNumber, 0, aMetaSlideSet.length - 1 );\n\
+\n\
+ var nTotalThumbnails = theSlideIndexPage.getTotalThumbnails();\n\
+ var nEnd = Math.min( offsetNumber + nTotalThumbnails, aMetaSlideSet.length);\n\
+\n\
+ var aThumbnailSet = theSlideIndexPage.aThumbnailSet;\n\
+ var j = 0;\n\
+ for( var i = offsetNumber; i < nEnd; ++i, ++j )\n\
+ {\n\
+ aThumbnailSet[j].update( i );\n\
+ aThumbnailSet[j].show();\n\
+ }\n\
+ for( ; j < nTotalThumbnails; ++j )\n\
+ {\n\
+ aThumbnailSet[j].hide();\n\
+ }\n\
+\n\
+ //do we need to save the current offset?\n\
+ if (INDEX_OFFSET != offsetNumber)\n\
+ INDEX_OFFSET = offsetNumber;\n\
+ }\n\
+\n\
+ /** Function to set the active slide in the slide view.\n\
+ *\n\
+ * @param nNewSlide index of the active slide\n\
+ */\n\
+ function slideSetActiveSlide( nNewSlide )\n\
{\n\
- nSlides = document.getElementById( \"meta_slides\" ).getAttributeNS( null, \"numberOfSlides\" );\n\
+ var aMetaDoc = theMetaDoc;\n\
+ var nSlides = aMetaDoc.nNumberOfSlides;\n\
+ if( nNewSlide < 0 && nSlides > 0 )\n\
+ nNewSlide = nSlides - 1;\n\
+ else if( nNewSlide >= nSlides )\n\
+ nNewSlide = 0;\n\
+\n\
+ if( nNewSlide == nCurSlide ) return;\n\
+ var nOldSlide = nCurSlide;\n\
+ nCurSlide = nNewSlide;\n\
+\n\
+ var oldMetaSlide = aMetaDoc.aMetaSlideSet[nOldSlide];\n\
+ var newMetaSlide = aMetaDoc.aMetaSlideSet[nNewSlide];\n\
+\n\
+ oldMetaSlide.hide();\n\
+ newMetaSlide.show();\n\
+ }\n\
+\n\
+ /** Function to set the page and active slide in index view.\n\
+ *\n\
+ * @param nIndex index of the active slide\n\
+ *\n\
+ * NOTE: To force a redraw,\n\
+ * set INDEX_OFFSET to -1 before calling indexSetPageSlide().\n\
+ *\n\
+ * This is necessary for zooming (otherwise the index might not\n\
+ * get redrawn) and when switching to index mode.\n\
+ *\n\
+ * INDEX_OFFSET = -1\n\
+ * indexSetPageSlide(activeSlide);\n\
+ */\n\
+ function indexSetPageSlide( nIndex )\n\
+ {\n\
+ var aMetaSlideSet = theMetaDoc.aMetaSlideSet;\n\
+ nIndex = getSafeIndex( nIndex, 0, aMetaSlideSet.length - 1 );\n\
+\n\
+ //calculate the offset\n\
+ var nSelectedThumbnailIndex = nIndex % theSlideIndexPage.getTotalThumbnails();\n\
+ var offset = nIndex - nSelectedThumbnailIndex;\n\
+\n\
+ if( offset < 0 )\n\
+ offset = 0;\n\
+\n\
+ //if different from kept offset, then record and change the page\n\
+ if( offset != INDEX_OFFSET )\n\
+ {\n\
+ INDEX_OFFSET = offset;\n\
+ displayIndex( INDEX_OFFSET );\n\
+ }\n\
+\n\
+ //set the selected thumbnail and the current slide\n\
+ theSlideIndexPage.setSelection( nSelectedThumbnailIndex );\n\
+ }\n\
\n\
- for( i = 0; i < nSlides; i++ )\n\
+ /** Function to toggle between index and slide mode.\n\
+ */\n\
+ function toggleSlideIndex()\n\
+ {\n\
+ var suspendHandle = ROOT_NODE.suspendRedraw(500);\n\
+ var aMetaSlideSet = theMetaDoc.aMetaSlideSet;\n\
+\n\
+ if (currentMode == SLIDE_MODE)\n\
+ {\n\
+ aMetaSlideSet[nCurSlide].hide();\n\
+ for( var counter = 0; counter < aMetaSlideSet.length; ++counter )\n\
+ {\n\
+ checkElemAndSetAttribute( aMetaSlideSet[counter].slideElement, 'visibility', 'inherit' );\n\
+ aMetaSlideSet[counter].masterPage.setVisibilityBackground( INHERIT );\n\
+ aMetaSlideSet[counter].masterPage.setVisibility( INHERIT );\n\
+ }\n\
+ INDEX_OFFSET = -1;\n\
+ indexSetPageSlide( nCurSlide );\n\
+ theSlideIndexPage.show();\n\
+ currentMode = INDEX_MODE;\n\
+ }\n\
+ else if (currentMode == INDEX_MODE)\n\
{\n\
- var aSlide = document.getElementById( \"meta_slide\" + i );\n\
- \n\
- aSlides[ i ] = document.getElementById( aSlide.getAttributeNS( null, \"slide\" ) );\n\
- aMasters[ i ] = document.getElementById( aSlide.getAttributeNS( null, \"master\" ) );\n\
- aMasterVisibilities[ i ] = aSlide.getAttributeNS( null, \"master-visibility\" );\n\
+";
+
+static const char aSVGScript8[] =
+"\
+ theSlideIndexPage.hide();\n\
+ nCurSlide = theSlideIndexPage.selectedSlideIndex;\n\
+\n\
+ for( var counter = 0; counter < aMetaSlideSet.length; ++counter )\n\
+ {\n\
+ var aMetaSlide = aMetaSlideSet[counter];\n\
+ aMetaSlide.slideElement.setAttribute( 'visibility', 'hidden' );\n\
+ aMetaSlide.masterPage.setVisibilityBackground( HIDDEN );\n\
+ aMetaSlide.masterPage.setVisibility( HIDDEN );\n\
+ }\n\
+\n\
+ aMetaSlideSet[nCurSlide].show();\n\
+ //activeEffect = 0;\n\
+\n\
+ currentMode = SLIDE_MODE;\n\
+ //setSlideToState(nCurSlide, STATE_START);\n\
}\n\
+\n\
+ ROOT_NODE.unsuspendRedraw(suspendHandle);\n\
+ ROOT_NODE.forceRedraw();\n\
}\n\
\n\
- init();\n\
+ /** Function that exit from the index mode without changing the shown slide\n\
+ *\n\
+ */\n\
+ function abandonIndexMode()\n\
+ {\n\
+ theSlideIndexPage.selectedSlideIndex = nCurSlide;\n\
+ toggleSlideIndex();\n\
+ }\n\
]]>";
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 56b5af4fba0d..364036f35fb1 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -32,6 +32,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_filter.hxx"
+#include "svgfilter.hxx"
#include "svgfontexport.hxx"
#include "svgwriter.hxx"
#include <vcl/unohelp.hxx>
@@ -1174,67 +1175,101 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText,
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTransform, aTransform );
}
+
mpContext->AddPaintAttr( COL_TRANSPARENT, aTextColor );
- if( nLen > 1 )
- {
- aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rText.GetChar( nLen - 1 ) );
+ // for each line of text there should be at least one group element
+ SvXMLElementExport aSVGGElem( mrExport, XML_NAMESPACE_NONE, aXMLElemG, sal_True, sal_False );
- if( nWidth && aNormSize.Width() && ( nWidth != aNormSize.Width() ) )
- {
- const double fFactor = (double) nWidth / aNormSize.Width();
+ sal_Bool bIsPlaceholderField = sal_False;
- for( long i = 0; i < ( nLen - 1 ); i++ )
- pDX[ i ] = FRound( pDX[ i ] * fFactor );
+ if( mbIsPlacehlolderShape )
+ {
+ OUString sTextContent = rText;
+ bIsPlaceholderField = sTextContent.match( sPlaceholderTag );
+ // for a placeholder text field we export only one <text> svg element
+ if( bIsPlaceholderField )
+ {
+ OUString sCleanTextContent;
+ static const sal_Int32 nFrom = sPlaceholderTag.getLength();
+ if( sTextContent.getLength() > nFrom )
+ {
+ sCleanTextContent = sTextContent.copy( nFrom );
+ }
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "PlaceholderText" ) );
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, ::rtl::OUString::valueOf( aPos.X() ) );
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, ::rtl::OUString::valueOf( aPos.Y() ) );
+ {
+ SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, sal_True, sal_False );
+ // At least for the single slide case we need really to export placeholder text
+ mrExport.GetDocHandler()->characters( sCleanTextContent );
+ }
}
- else
+ }
+
+ if( !bIsPlaceholderField )
+ {
+ if( nLen > 1 )
{
- ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBI( ::vcl::unohelper::CreateBreakIterator() );
- const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetLocale();
- sal_Int32 nCurPos = 0, nLastPos = 0, nX = aPos.X();
+ aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rText.GetChar( nLen - 1 ) );
- // write single glyphs at absolute text positions
- for( sal_Bool bCont = sal_True; bCont; )
+ if( nWidth && aNormSize.Width() && ( nWidth != aNormSize.Width() ) )
{
- sal_Int32 nCount = 1;
-
- nLastPos = nCurPos;
- nCurPos = xBI->nextCharacters( rText, nCurPos, rLocale,
- ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL,
- nCount, nCount );
+ const double fFactor = (double) nWidth / aNormSize.Width();
- nCount = nCurPos - nLastPos;
- bCont = ( nCurPos < rText.Len() ) && nCount;
+ for( long i = 0; i < ( nLen - 1 ); i++ )
+ pDX[ i ] = FRound( pDX[ i ] * fFactor );
+ }
+ else
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBI( ::vcl::unohelper::CreateBreakIterator() );
+ const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetLocale();
+ sal_Int32 nCurPos = 0, nLastPos = 0, nX = aPos.X();
- if( nCount )
+ // write single glyphs at absolute text positions
+ for( sal_Bool bCont = sal_True; bCont; )
{
- const ::rtl::OUString aGlyph( rText.Copy( nLastPos, nCount ) );
+ sal_Int32 nCount = 1;
+
+ nLastPos = nCurPos;
+ nCurPos = xBI->nextCharacters( rText, nCurPos, rLocale,
+ ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL,
+ nCount, nCount );
- mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, ::rtl::OUString::valueOf( nX ) );
- mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, ::rtl::OUString::valueOf( aPos.Y() ) );
+ nCount = nCurPos - nLastPos;
+ bCont = ( nCurPos < rText.Len() ) && nCount;
+ if( nCount )
{
- SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, sal_True, sal_False );
- mrExport.GetDocHandler()->characters( aGlyph );
- }
+ const ::rtl::OUString aGlyph( rText.Copy( nLastPos, nCount ) );
+
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, ::rtl::OUString::valueOf( nX ) );
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, ::rtl::OUString::valueOf( aPos.Y() ) );
+
+ {
+ SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, sal_True, sal_False );
+ mrExport.GetDocHandler()->characters( aGlyph );
+ }
- if( bCont )
- nX = aPos.X() + pDXArray[ nCurPos - 1 ];
+ if( bCont )
+ nX = aPos.X() + pDXArray[ nCurPos - 1 ];
+ }
}
}
}
- }
- else
- {
- mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, ::rtl::OUString::valueOf( aPos.X() ) );
- mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, ::rtl::OUString::valueOf( aPos.Y() ) );
-
+ else
{
- SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, sal_True, sal_False );
- mrExport.GetDocHandler()->characters( rText );
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, ::rtl::OUString::valueOf( aPos.X() ) );
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, ::rtl::OUString::valueOf( aPos.Y() ) );
+
+ {
+ SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, sal_True, sal_False );
+ mrExport.GetDocHandler()->characters( rText );
+ }
}
}
+
if( !mrExport.IsUseNativeTextDecoration() )
{
if( rFont.GetStrikeout() != STRIKEOUT_NONE || rFont.GetUnderline() != UNDERLINE_NONE )
@@ -1332,6 +1367,14 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
if( mnInnerMtfCount )
nWriteFlags |= SVGWRITER_NO_SHAPE_COMMENTS;
+ mbIsPlacehlolderShape = false;
+ if( pElementId != NULL && ( *pElementId == sPlaceholderTag ) )
+ {
+ mbIsPlacehlolderShape = true;
+ // since we utilize pElementId in an improper way we reset it to NULL before to go on
+ pElementId = NULL;
+ }
+
for( sal_uLong nCurAction = 0, nCount = rMtf.GetActionSize(); nCurAction < nCount; nCurAction++ )
{
const MetaAction* pAction = rMtf.GetAction( nCurAction );
@@ -1840,7 +1883,10 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
ImplMap( Size( 0, aFont.GetHeight() ), aSz );
aFont.SetHeight( aSz.Height() );
- mpContext->AddPaintAttr( COL_TRANSPARENT, mpVDev->GetTextColor() );
+ // lead to a browser error since it duplicates the stroke and
+ // the fill attributes on the first glyph of each line when
+ // the text font is the same
+ //mpContext->AddPaintAttr( COL_TRANSPARENT, mpVDev->GetTextColor() );
mpContext->SetFontAttr( aFont );
ImplWriteText( pA->GetPoint(), aText, NULL, 0 );
}
@@ -1862,7 +1908,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
ImplMap( Size( 0, aFont.GetHeight() ), aSz );
aFont.SetHeight( aSz.Height() );
- mpContext->AddPaintAttr( COL_TRANSPARENT, mpVDev->GetTextColor() );
+ //mpContext->AddPaintAttr( COL_TRANSPARENT, mpVDev->GetTextColor() );
mpContext->SetFontAttr( aFont );
ImplWriteText( pA->GetRect().TopLeft(), pA->GetText(), NULL, 0 );
}
@@ -1885,7 +1931,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
ImplMap( Size( 0, aFont.GetHeight() ), aSz );
aFont.SetHeight( aSz.Height() );
- mpContext->AddPaintAttr( COL_TRANSPARENT, mpVDev->GetTextColor() );
+ //mpContext->AddPaintAttr( COL_TRANSPARENT, mpVDev->GetTextColor() );
mpContext->SetFontAttr( aFont );
ImplWriteText( pA->GetPoint(), aText, pA->GetDXArray(), 0 );
}
@@ -1908,7 +1954,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
ImplMap( Size( 0, aFont.GetHeight() ), aSz );
aFont.SetHeight( aSz.Height() );
- mpContext->AddPaintAttr( COL_TRANSPARENT, mpVDev->GetTextColor() );
+ //mpContext->AddPaintAttr( COL_TRANSPARENT, mpVDev->GetTextColor() );
mpContext->SetFontAttr( aFont );
ImplWriteText( pA->GetPoint(), aText, NULL, pA->GetWidth() );
}
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index b21d86095700..91a605a20b93 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -80,17 +80,17 @@
#define NMSP_REGISTRY com::sun::star::registry
-#define REF( _def_Obj ) NMSP_UNO::Reference< _def_Obj >
-#define SEQ( _def_Obj ) NMSP_UNO::Sequence< _def_Obj >
-#define B2UCONST( _def_pChar ) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(_def_pChar )))
-#define SVG_DTD_STRING B2UCONST( "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">" )
+#define REF( _def_Obj ) NMSP_UNO::Reference< _def_Obj >
+#define SEQ( _def_Obj ) NMSP_UNO::Sequence< _def_Obj >
+#define B2UCONST( _def_pChar ) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(_def_pChar )))
+#define SVG_DTD_STRING B2UCONST( "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">" )
#define SVG_TINY_DTD_STRING B2UCONST( "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG Tiny 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd\">" )
-#define SVGWRITER_WRITE_NONE 0x00000000
-#define SVGWRITER_WRITE_FILL 0x00000001
-#define SVGWRITER_WRITE_TEXT 0x00000002
+#define SVGWRITER_WRITE_NONE 0x00000000
+#define SVGWRITER_WRITE_FILL 0x00000001
+#define SVGWRITER_WRITE_TEXT 0x00000002
#define SVGWRITER_NO_SHAPE_COMMENTS 0x01000000
-#define SVGWRITER_WRITE_ALL 0xFFFFFFFF
+#define SVGWRITER_WRITE_ALL 0xFFFFFFFF
// ----------------------
// - SVGAttributeWriter -
@@ -104,13 +104,13 @@ class SVGAttributeWriter
{
private:
- Font maCurFont;
- Color maCurLineColor;
- Color maCurFillColor;
- SVGExport& mrExport;
- SVGFontExport& mrFontExport;
- SvXMLElementExport* mpElemFont;
- SvXMLElementExport* mpElemPaint;
+ Font maCurFont;
+ Color maCurLineColor;
+ Color maCurFillColor;
+ SVGExport& mrExport;
+ SVGFontExport& mrFontExport;
+ SvXMLElementExport* mpElemFont;
+ SvXMLElementExport* mpElemPaint;
SVGAttributeWriter();
@@ -165,24 +165,26 @@ class SVGActionWriter
{
private:
- sal_Int32 mnCurGradientId;
- sal_Int32 mnCurMaskId;
- sal_Int32 mnCurPatternId;
- Stack maContextStack;
- ::std::auto_ptr< SVGShapeDescriptor > mapCurShape;
- SVGExport& mrExport;
- SVGFontExport& mrFontExport;
- SVGAttributeWriter* mpContext;
- VirtualDevice* mpVDev;
- MapMode maTargetMapMode;
- sal_uInt32 mnInnerMtfCount;
- sal_Bool mbDestroyVDev;
- sal_Bool mbPaintAttrChanged;
- sal_Bool mbFontAttrChanged;
- sal_Bool mbClipAttrChanged;
+ sal_Int32 mnCurGradientId;
+ sal_Int32 mnCurMaskId;
+ sal_Int32 mnCurPatternId;
+ Stack maContextStack;
+ ::std::auto_ptr< SVGShapeDescriptor > mapCurShape;
+ SVGExport& mrExport;
+ SVGFontExport& mrFontExport;
+ SVGAttributeWriter* mpContext;
+ VirtualDevice* mpVDev;
+ MapMode maTargetMapMode;
+ sal_uInt32 mnInnerMtfCount;
+ sal_Bool mbDestroyVDev;
+ sal_Bool mbPaintAttrChanged;
+ sal_Bool mbFontAttrChanged;
+ sal_Bool mbClipAttrChanged;
+ sal_Bool mbIsPlacehlolderShape;
+
SVGAttributeWriter* ImplAcquireContext() { maContextStack.Push( mpContext = new SVGAttributeWriter( mrExport, mrFontExport ) ); return mpContext; }
- void ImplReleaseContext() { delete (SVGAttributeWriter*) maContextStack.Pop(); mpContext = (SVGAttributeWriter*) maContextStack.Top(); }
+ void ImplReleaseContext() { delete (SVGAttributeWriter*) maContextStack.Pop(); mpContext = (SVGAttributeWriter*) maContextStack.Top(); }
long ImplMap( sal_Int32 nVal ) const;
Point& ImplMap( const Point& rPt, Point& rDstPt ) const;
@@ -208,8 +210,7 @@ private:
Color ImplGetColorWithIntensity( const Color& rColor, sal_uInt16 nIntensity );
Color ImplGetGradientColor( const Color& rStartColor, const Color& rEndColor, double fOffset );
void ImplWriteMask( GDIMetaFile& rMtf, const Point& rDestPt, const Size& rDestSize, const Gradient& rGradient, sal_uInt32 nWriteFlags );
- void ImplWriteText( const Point& rPos, const String& rText, const sal_Int32* pDXArray, long nWidth,
- sal_Bool bApplyMapping = sal_True );
+ void ImplWriteText( const Point& rPos, const String& rText, const sal_Int32* pDXArray, long nWidth, sal_Bool bApplyMapping = sal_True );
void ImplWriteText( const Point& rPos, const String& rText, const sal_Int32* pDXArray, long nWidth, Color aTextColor, sal_Bool bApplyMapping );
void ImplWriteBmp( const BitmapEx& rBmpEx, const Point& rPt, const Size& rSz, const Point& rSrcPt, const Size& rSrcSz,
sal_Bool bApplyMapping = sal_True );
diff --git a/filter/source/t602/filterenv.cxx b/filter/source/t602/filterenv.cxx
index 5202c38c3c91..7bd954484cb6 100644
--- a/filter/source/t602/filterenv.cxx
+++ b/filter/source/t602/filterenv.cxx
@@ -46,13 +46,6 @@ using namespace T602ImportFilter;
extern "C"
{
-//==================================================================================================
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-//==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
diff --git a/filter/source/xmlfilteradaptor/genericfilter.cxx b/filter/source/xmlfilteradaptor/genericfilter.cxx
index 67d364c608e0..f530d90c51e8 100644
--- a/filter/source/xmlfilteradaptor/genericfilter.cxx
+++ b/filter/source/xmlfilteradaptor/genericfilter.cxx
@@ -47,13 +47,6 @@ using namespace ::com::sun::star::registry;
extern "C"
{
-//==================================================================================================
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-//==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
diff --git a/filter/source/xmlfilterdetect/fdcomp.cxx b/filter/source/xmlfilterdetect/fdcomp.cxx
index 43d80512b9dc..e3a590bf4502 100644
--- a/filter/source/xmlfilterdetect/fdcomp.cxx
+++ b/filter/source/xmlfilterdetect/fdcomp.cxx
@@ -48,13 +48,6 @@ using namespace ::com::sun::star::registry;
extern "C"
{
-//==================================================================================================
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-//==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
diff --git a/filter/source/xsltdialog/exports.dxp b/filter/source/xsltdialog/exports.dxp
index f0e1c69934bc..70033078921a 100644
--- a/filter/source/xsltdialog/exports.dxp
+++ b/filter/source/xsltdialog/exports.dxp
@@ -1,2 +1 @@
-component_getImplementationEnvironment
component_getFactory
diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
index df5dde22dd1f..e826ef58dd44 100644
--- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
+++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
@@ -398,14 +398,6 @@ void SAL_CALL XMLFilterDialogComponent::initialize( const Sequence< Any >& aArgu
extern "C"
{
-//==================================================================================================
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-//==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
diff --git a/filter/source/xsltfilter/XSLTFilter.cxx b/filter/source/xsltfilter/XSLTFilter.cxx
index 3d6aefefb8b3..9d17c05d3ada 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -588,12 +588,6 @@ using namespace XSLT;
extern "C"
{
- SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,
- uno_Environment ** /* ppEnv */)
- {
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
- }
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_Char * pImplName,
void * pServiceManager, void * /* pRegistryKey */)
{
diff --git a/filter/source/xsltfilter/makefile.mk b/filter/source/xsltfilter/makefile.mk
index 539469f55fc7..567b37f1bb65 100644
--- a/filter/source/xsltfilter/makefile.mk
+++ b/filter/source/xsltfilter/makefile.mk
@@ -43,6 +43,10 @@ LIBXSLTINCDIR=external$/libxslt
CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXSLTINCDIR)
.ENDIF
+.IF "$(SYSTEM_LIBXML)" == "YES"
+CFLAGS+= $(LIBXML_CFLAGS)
+.ENDIF
+
SLOFILES=$(SLO)$/XSLTFilter.obj $(SLO)$/LibXSLTTransformer.obj $(SLO)/OleHandler.obj
LIBNAME=xsltfilter
SHL1TARGETDEPN=makefile.mk