summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-07-21 18:38:50 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-07-21 18:38:50 +0200
commit112be98c928c38c5cc63c99e86e0b58b8d2dfe29 (patch)
tree053e3d7dfa670c6c1924d4095d9cfbe622b4b5ba
parent03e6f1338cc18d047582fdb22787ebf0f693d8a2 (diff)
parentd90e0b5999ff65ab9bceb4cbd5ecbd5af232ac3b (diff)
resyncing to master
-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
-rw-r--r--hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk7
-rw-r--r--hwpfilter/Library_hwp.mk7
-rw-r--r--hwpfilter/prj/build.lst2
-rw-r--r--hwpfilter/source/htags.cxx7
-rw-r--r--hwpfilter/source/htags.h4
-rw-r--r--hwpfilter/source/hwpreader.cxx5
-rw-r--r--hwpfilter/source/hwpreader.hxx11
-rw-r--r--lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk7
-rw-r--r--lotuswordpro/Library_lwpft.mk6
-rw-r--r--lotuswordpro/prj/build.lst2
-rw-r--r--lotuswordpro/qa/cppunit/test_lotuswordpro.cxx4
-rw-r--r--lotuswordpro/source/filter/genericfilter.cxx5
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx2
-rw-r--r--lotuswordpro/source/filter/tocread.cxx2
-rw-r--r--lotuswordpro/source/filter/xfilter/xffilestream.cxx9
-rw-r--r--lotuswordpro/source/filter/xfilter/xfutil.cxx32
-rw-r--r--lotuswordpro/source/filter/xfilter/xfutil.hxx4
-rw-r--r--oox/Library_oox.mk6
-rw-r--r--oox/Package_inc.mk1
-rw-r--r--oox/inc/oox/core/contexthandler.hxx2
-rw-r--r--oox/inc/oox/ole/axcontrol.hxx21
-rw-r--r--oox/inc/oox/ole/olehelper.hxx40
-rw-r--r--oox/inc/oox/ppt/backgroundproperties.hxx8
-rw-r--r--oox/inc/oox/ppt/customshowlistcontext.hxx10
-rw-r--r--oox/inc/oox/ppt/layoutfragmenthandler.hxx3
-rw-r--r--oox/inc/oox/ppt/presentationfragmenthandler.hxx10
-rw-r--r--oox/inc/oox/ppt/slidefragmenthandler.hxx8
-rw-r--r--oox/inc/oox/ppt/slidemastertextstylescontext.hxx8
-rw-r--r--oox/inc/oox/ppt/slidetimingcontext.hxx11
-rw-r--r--oox/inc/oox/ppt/slidetransitioncontext.hxx16
-rw-r--r--oox/inc/oox/ppt/soundactioncontext.hxx10
-rw-r--r--oox/inc/oox/ppt/timenodelistcontext.hxx17
-rw-r--r--oox/inc/oox/xls/worksheethelper.hxx8
-rw-r--r--oox/source/core/contexthandler.cxx2
-rw-r--r--oox/source/core/services.cxx10
-rw-r--r--oox/source/core/xmlfilterbase.cxx4
-rw-r--r--oox/source/drawingml/chart/axisconverter.cxx4
-rw-r--r--oox/source/drawingml/chart/chartconverter.cxx6
-rw-r--r--oox/source/drawingml/chart/seriesconverter.cxx45
-rw-r--r--oox/source/export/chartexport.cxx24
-rw-r--r--oox/source/ole/axcontrol.cxx100
-rw-r--r--oox/source/ole/olehelper.cxx137
-rw-r--r--oox/source/ppt/animvariantcontext.cxx41
-rw-r--r--oox/source/ppt/animvariantcontext.hxx10
-rw-r--r--oox/source/ppt/backgroundproperties.cxx16
-rw-r--r--oox/source/ppt/buildlistcontext.cxx35
-rw-r--r--oox/source/ppt/buildlistcontext.hxx10
-rw-r--r--oox/source/ppt/commonbehaviorcontext.cxx31
-rw-r--r--oox/source/ppt/commonbehaviorcontext.hxx15
-rw-r--r--oox/source/ppt/commontimenodecontext.cxx43
-rw-r--r--oox/source/ppt/commontimenodecontext.hxx6
-rw-r--r--oox/source/ppt/conditioncontext.cxx37
-rw-r--r--oox/source/ppt/conditioncontext.hxx8
-rw-r--r--oox/source/ppt/customshowlistcontext.cxx39
-rw-r--r--oox/source/ppt/headerfootercontext.cxx23
-rw-r--r--oox/source/ppt/headerfootercontext.hxx8
-rw-r--r--oox/source/ppt/layoutfragmenthandler.cxx17
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx43
-rw-r--r--oox/source/ppt/slidefragmenthandler.cxx69
-rw-r--r--oox/source/ppt/slidemastertextstylescontext.cxx13
-rw-r--r--oox/source/ppt/slidetimingcontext.cxx32
-rw-r--r--oox/source/ppt/slidetransitioncontext.cxx65
-rw-r--r--oox/source/ppt/soundactioncontext.cxx29
-rw-r--r--oox/source/ppt/timeanimvaluecontext.cxx27
-rw-r--r--oox/source/ppt/timeanimvaluecontext.hxx11
-rw-r--r--oox/source/ppt/timenodelistcontext.cxx281
-rw-r--r--oox/source/ppt/timetargetelementcontext.cxx60
-rw-r--r--oox/source/ppt/timetargetelementcontext.hxx9
-rw-r--r--oox/source/token/properties.txt2
-rw-r--r--oox/source/vml/vmldrawingfragment.cxx7
-rw-r--r--oox/source/xls/formulaparser.cxx6
-rwxr-xr-xoox/source/xls/sheetdatabuffer.cxx3
-rw-r--r--oox/source/xls/sheetdatacontext.cxx18
-rw-r--r--oox/source/xls/workbookfragment.cxx7
-rw-r--r--oox/source/xls/worksheethelper.cxx14
-rw-r--r--unoxml/Library_unordf.mk8
-rw-r--r--unoxml/Library_unoxml.mk6
-rw-r--r--unoxml/prj/build.lst2
-rw-r--r--unoxml/source/rdf/librdf_services.cxx8
-rw-r--r--unoxml/source/rdf/unordf.component2
-rw-r--r--unoxml/source/service/services.cxx7
-rw-r--r--unoxml/source/service/unoxml.component2
-rw-r--r--writerfilter/Library_writerfilter.mk9
-rw-r--r--writerfilter/Module_writerfilter.mk4
-rw-r--r--writerfilter/inc/WriterFilterDllApi.hxx6
-rw-r--r--writerfilter/inc/dmapper/DomainMapper.hxx1
-rw-r--r--writerfilter/inc/rtftok/RTFDocument.hxx72
-rw-r--r--writerfilter/inc/rtftok/RTFInputSource.hxx45
-rw-r--r--writerfilter/inc/rtftok/RTFParseException.hxx45
-rw-r--r--writerfilter/inc/rtftok/RTFScanner.hxx68
-rw-r--r--writerfilter/inc/rtftok/RTFScannerHandler.hxx53
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx14
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx8
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx4
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx2
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx226
-rw-r--r--writerfilter/source/doctok/DffImpl.cxx5
-rw-r--r--writerfilter/source/doctok/WW8DocumentImpl.cxx131
-rw-r--r--writerfilter/source/doctok/WW8PropertySetImpl.cxx35
-rw-r--r--writerfilter/source/doctok/WW8ResourceModelImpl.cxx12
-rw-r--r--writerfilter/source/filter/RtfFilter.cxx39
-rw-r--r--writerfilter/source/filter/WriterFilter.cxx5
-rw-r--r--writerfilter/source/rtftok/FlexLexer.h151
-rw-r--r--writerfilter/source/rtftok/RTFParseException.cxx35
-rw-r--r--writerfilter/source/rtftok/RTFScanner.lex333
-rw-r--r--writerfilter/source/rtftok/RTFScanner.skl1527
-rw-r--r--writerfilter/source/rtftok/rtfcharsets.cxx75
-rw-r--r--writerfilter/source/rtftok/rtfcontrolwords.cxx1855
-rw-r--r--writerfilter/source/rtftok/rtfcontrolwords.hxx1854
-rw-r--r--writerfilter/source/rtftok/rtfdocumentfactory.cxx44
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx2547
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx305
-rw-r--r--writerfilter/source/rtftok/rtfreferenceproperties.cxx69
-rw-r--r--writerfilter/source/rtftok/rtfreferenceproperties.hxx58
-rw-r--r--writerfilter/source/rtftok/rtfreferencetable.cxx56
-rw-r--r--writerfilter/source/rtftok/rtfreferencetable.hxx57
-rw-r--r--writerfilter/source/rtftok/rtfsprm.cxx121
-rw-r--r--writerfilter/source/rtftok/rtfsprm.hxx68
-rw-r--r--writerfilter/source/rtftok/rtftypes.hxx58
-rw-r--r--writerfilter/source/rtftok/rtfvalue.cxx174
-rw-r--r--writerfilter/source/rtftok/rtfvalue.hxx76
-rw-r--r--writerfilter/unocomponent/component.cxx6
-rw-r--r--writerfilter/unocomponent/exports.dxp1
-rw-r--r--writerperfect/source/filter/OdgGenerator.cxx336
-rw-r--r--writerperfect/source/vsdimp/visioimport_genericfilter.cxx5
-rw-r--r--writerperfect/source/wpdimp/wpft_genericfilter.cxx7
-rw-r--r--writerperfect/source/wpgimp/wpgimport_genericfilter.cxx5
-rw-r--r--writerperfect/source/wpsimp/msworks_genericfilter.cxx5
-rw-r--r--xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/DefColWidth.java2
-rw-r--r--xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/ExtendedFormat.java2
-rw-r--r--xmerge/source/xmerge/java/org/openoffice/xmerge/util/ColourConverter.java2
185 files changed, 13019 insertions, 5141 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
diff --git a/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk b/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk
index 5e053286fc86..386e6fa04da3 100644
--- a/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk
+++ b/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk
@@ -46,10 +46,14 @@ $(eval $(call gb_CppunitTest_add_linked_libs,hwpfilter_test_hwpfilter, \
$(eval $(call gb_CppunitTest_set_include,hwpfilter_test_hwpfilter,\
$$(INCLUDE) \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
))
+$(eval $(call gb_CppunitTest_add_api,hwpfilter_test_hwpfilter,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_CppunitTest_uses_ure,hwpfilter_test_hwpfilter))
$(eval $(call gb_CppunitTest_add_type_rdbs,hwpfilter_test_hwpfilter,\
@@ -63,6 +67,7 @@ $(eval $(call gb_CppunitTest_add_service_rdbs,hwpfilter_test_hwpfilter,\
$(eval $(call gb_CppunitTest_set_args,hwpfilter_test_hwpfilter,\
--headless \
--invisible \
+ --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
))
$(eval $(call gb_RdbTarget_RdbTarget,hwpfilter_test_hwpfilter))
diff --git a/hwpfilter/Library_hwp.mk b/hwpfilter/Library_hwp.mk
index 87fef9fa66de..ee337a47a2a7 100644
--- a/hwpfilter/Library_hwp.mk
+++ b/hwpfilter/Library_hwp.mk
@@ -32,7 +32,11 @@ $(eval $(call gb_Library_add_precompiled_header,hwp,$(SRCDIR)/hwpfilter/inc/pch/
$(eval $(call gb_Library_set_include,hwp,\
$$(INCLUDE) \
-I$(realpath $(SRCDIR)/hwpfilter/inc/pch) \
- -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Library_add_api,hwp,\
+ offapi \
+ udkapi \
))
$(eval $(call gb_Library_add_linked_libs,hwp,\
@@ -49,6 +53,7 @@ ifeq ($(OS),WNT)
$(eval $(call gb_Library_add_linked_libs,hwp,\
ole32 \
+ user32 \
uuid \
))
diff --git a/hwpfilter/prj/build.lst b/hwpfilter/prj/build.lst
index 3fa47f767bfe..5eb79927bdd0 100644
--- a/hwpfilter/prj/build.lst
+++ b/hwpfilter/prj/build.lst
@@ -1,2 +1,2 @@
-hw hwpfilter : offuh cppuhelper ZLIB:zlib LIBXSLT:libxslt ucbhelper ucb ure NULL
+hw hwpfilter : offapi cppuhelper ZLIB:zlib LIBXSLT:libxslt ucbhelper ucb ure test NULL
hw hwpfilter\prj nmake - all hw_prj NULL
diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx
index 30244a83f9b8..94cc05058d7c 100644
--- a/hwpfilter/source/htags.cxx
+++ b/hwpfilter/source/htags.cxx
@@ -59,9 +59,10 @@ bool HyperText::Read(HWPFile & hwpf)
}
-EmPicture::EmPicture(int tsize):size(tsize - 32)
+EmPicture::EmPicture(size_t tsize)
+ : size(tsize >= 32 ? tsize - 32 : 0)
{
- if (size <= 0)
+ if (size == 0)
data = 0;
else
data = new uchar[size];
@@ -82,7 +83,7 @@ EmPicture::~EmPicture(void)
bool EmPicture::Read(HWPFile & hwpf)
{
- if (size <= 0)
+ if (size == 0)
return false;
hwpf.Read1b(name, 16);
hwpf.Read1b(type, 16);
diff --git a/hwpfilter/source/htags.h b/hwpfilter/source/htags.h
index bb244c07dd59..21c610db4e9d 100644
--- a/hwpfilter/source/htags.h
+++ b/hwpfilter/source/htags.h
@@ -39,12 +39,12 @@ class HWPFile;
*/
struct EmPicture
{
- int size;
+ size_t size;
char name[16];
char type[16];
uchar *data;
- EmPicture(int size);
+ EmPicture(size_t size);
~EmPicture(void);
bool Read(HWPFile& hwpf);
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 47e8a50d5cbe..8bcef10460df 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -538,12 +538,13 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo )
if( (fd = open( filename , O_CREAT | O_WRONLY , 0666)) >= 0 )
#endif
{
- write( fd, emp->data, emp->size );
+ size_t nWritten = write(fd, emp->data, emp->size);
+ OSL_VERIFY(nWritten == emp->size);
close(fd);
}
#ifdef _WIN32
int j;
- for( j = 0 ; j < (int)strlen( dirname ) ; j++)
+ for(j = 0 ; j < (int)strlen( dirname ) ; j++)
{
if( dirname[j] == '\\' ) buf[j] = '/';
else buf[j] = dirname[j];
diff --git a/hwpfilter/source/hwpreader.hxx b/hwpfilter/source/hwpreader.hxx
index 7676aafe0dc3..6a7ce4faa4de 100644
--- a/hwpfilter/source/hwpreader.hxx
+++ b/hwpfilter/source/hwpreader.hxx
@@ -338,19 +338,8 @@ Sequence< OUString> HwpImportFilter::getSupportedServiceNames() throw(::com::sun
return aRet;
}
-/////////////////////////////////////////////////////////////////////////////////////
-// The below three C functions are nessesary for this shared library is treaded as
-// UNO component library.
-/////////////////////////////////////////////////////////////////////////////////////
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 * )
{
void * pRet = 0;
diff --git a/lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk b/lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk
index 0def1a7e3724..5bebd75b7849 100644
--- a/lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk
+++ b/lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk
@@ -46,10 +46,14 @@ $(eval $(call gb_CppunitTest_add_linked_libs,lotuswordpro_test_lotuswordpro, \
$(eval $(call gb_CppunitTest_set_include,lotuswordpro_test_lotuswordpro,\
$$(INCLUDE) \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
))
+$(eval $(call gb_CppunitTest_add_api,lotuswordpro_test_lotuswordpro,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_CppunitTest_uses_ure,lotuswordpro_test_lotuswordpro))
$(eval $(call gb_CppunitTest_add_type_rdbs,lotuswordpro_test_lotuswordpro,\
@@ -63,6 +67,7 @@ $(eval $(call gb_CppunitTest_add_service_rdbs,lotuswordpro_test_lotuswordpro,\
$(eval $(call gb_CppunitTest_set_args,lotuswordpro_test_lotuswordpro,\
--headless \
--invisible \
+ --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
))
$(eval $(call gb_RdbTarget_RdbTarget,lotuswordpro_test_lotuswordpro))
diff --git a/lotuswordpro/Library_lwpft.mk b/lotuswordpro/Library_lwpft.mk
index db1cf5854e02..988d101f8d89 100644
--- a/lotuswordpro/Library_lwpft.mk
+++ b/lotuswordpro/Library_lwpft.mk
@@ -30,7 +30,11 @@ $(eval $(call gb_Library_Library,lwpft))
$(eval $(call gb_Library_set_include,lwpft,\
$$(INCLUDE) \
-I$(OUTDIR)/inc \
- -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Library_add_api,lwpft,\
+ offapi \
+ udkapi \
))
$(eval $(call gb_Library_add_linked_libs,lwpft,\
diff --git a/lotuswordpro/prj/build.lst b/lotuswordpro/prj/build.lst
index bee325f8146d..f6c70c5971df 100644
--- a/lotuswordpro/prj/build.lst
+++ b/lotuswordpro/prj/build.lst
@@ -1,2 +1,2 @@
-wp lotuswordpro : sfx2 sot svx comphelper BOOST:boost ure NULL
+wp lotuswordpro : sfx2 sot svx comphelper BOOST:boost ure test NULL
wp lotuswordpro\prj nmake - all lwp_prj NULL
diff --git a/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx b/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx
index 276625397487..cb7075ce9752 100644
--- a/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx
+++ b/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx
@@ -70,7 +70,9 @@ namespace
int m_nLoadedDocs;
};
- LotusWordProTest::LotusWordProTest() : m_aSrcRoot( RTL_CONSTASCII_USTRINGPARAM( "file://" ) ), m_nLoadedDocs(0)
+ LotusWordProTest::LotusWordProTest()
+ : m_aSrcRoot(RTL_CONSTASCII_USTRINGPARAM("file://" ))
+ , m_nLoadedDocs(0)
{
m_xContext = cppu::defaultBootstrap_InitialComponentContext();
m_xFactory = m_xContext->getServiceManager();
diff --git a/lotuswordpro/source/filter/genericfilter.cxx b/lotuswordpro/source/filter/genericfilter.cxx
index 5f82b1e9da5f..d889515acb4e 100644
--- a/lotuswordpro/source/filter/genericfilter.cxx
+++ b/lotuswordpro/source/filter/genericfilter.cxx
@@ -19,11 +19,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/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index e36f9e8feb67..a269a6e61edb 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -620,7 +620,7 @@ void LwpTableLayout::RegisterColumns()
// justifiable columns will share the remain width averagely
dDefaultColumn = dTableWidth/nJustifiableColumn;
- // register defualt column style
+ // register default column style
XFColStyle *pColStyle = new XFColStyle();
pColStyle->SetWidth(static_cast<float>(dDefaultColumn));
diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx
index ee6e5c65b7f8..84aaf24adcc6 100644
--- a/lotuswordpro/source/filter/tocread.cxx
+++ b/lotuswordpro/source/filter/tocread.cxx
@@ -384,7 +384,7 @@ CBenTOCReader::ReadSegment(pCBenValue pValue, BenByte * pLookAhead)
UtBool Immediate = UT_FALSE;
UtBool EightByteOffset = UT_FALSE;
- unsigned long Offset(0), Length;
+ unsigned long Offset(0), Length(0);
switch (*pLookAhead)
{
diff --git a/lotuswordpro/source/filter/xfilter/xffilestream.cxx b/lotuswordpro/source/filter/xfilter/xffilestream.cxx
index c868d2fb753d..9cba19ac6900 100644
--- a/lotuswordpro/source/filter/xfilter/xffilestream.cxx
+++ b/lotuswordpro/source/filter/xfilter/xffilestream.cxx
@@ -61,7 +61,6 @@
#include "xffileattrlist.hxx"
#include "ixfattrlist.hxx"
-void WriteStartTag(std::ofstream& ofs, const char *pStr, int len);
void WriteEndTag(std::ofstream& ofs, const char *pStr, int len);
void WriteString(std::ofstream& ofs, const char *pStr, int len);
void WriteXmlString(std::ofstream& ofs, const char *pStr, int len);
@@ -133,14 +132,6 @@ IXFAttrList* XFFileStream::GetAttrList()
return m_pAttrList;
}
-//------------------------------------------------------------------------------
-
-void WriteStartTag(std::ofstream& ofs, const char *pStr, int len)
-{
- ofs.write("\n<",2);
- ofs.write(pStr,len);
-}
-
void WriteEndTag(std::ofstream& ofs, const char *pStr, int len)
{
ofs.write("</",2);
diff --git a/lotuswordpro/source/filter/xfilter/xfutil.cxx b/lotuswordpro/source/filter/xfilter/xfutil.cxx
index 62b61ca84391..8471ff65940a 100644
--- a/lotuswordpro/source/filter/xfilter/xfutil.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfutil.cxx
@@ -109,38 +109,6 @@ rtl::OUString DoubleToOUString(double num, sal_Int32 /*precision*/)
return rtl::OUString::valueOf(num);
}
-rtl::OUString OEMToOUString(const std::string& /*str*/)
-{
- return rtl::OUString();
-}
-
-rtl::OUString ColorToOUString( sal_uInt32 color)
-{
- unsigned int c = color&0x00ffffff;
- unsigned char r;
- unsigned char g;
- unsigned char b;
- char buf[8];
-
- unsigned int temp = c;
- r = temp&0x000000ff;
-
- temp = c;
- g = (temp&0x0000ff00)>>8;
-
- temp = c;
- b = (temp&0x00ff0000)>>16;
-
- rtl_zeroMemory(buf,8);
- sprintf(buf,"#%2x%2x%2x",r,g,b);
- for( int i=0; i<6; i++ )
- {
- if( buf[i] == ' ' )
- buf[i] = '0';
- }
- return rtl::OUString::createFromAscii(buf);
-}
-
rtl::OUString DateTimeToOUString(XFDateTime& dt)
{
rtl::OUStringBuffer buf;
diff --git a/lotuswordpro/source/filter/xfilter/xfutil.hxx b/lotuswordpro/source/filter/xfilter/xfutil.hxx
index 3515871b18f9..df49ff4c1797 100644
--- a/lotuswordpro/source/filter/xfilter/xfutil.hxx
+++ b/lotuswordpro/source/filter/xfilter/xfutil.hxx
@@ -77,10 +77,6 @@ rtl::OUString FloatToOUString(float num, sal_Int32 precision=6);
rtl::OUString DoubleToOUString(double num, sal_Int32 precision=6);
-rtl::OUString OEMToOUString(const std::string& str);
-
-rtl::OUString ColorToOUString( sal_uInt32 color);
-
rtl::OUString DateTimeToOUString(XFDateTime& dt);
rtl::OUString GetTableColName(sal_Int32 col);
diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index 2abfb960c461..69ddb25d65ea 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -34,7 +34,6 @@ $(eval $(call gb_Library_add_package_headers,oox,\
$(eval $(call gb_Library_set_include,oox,\
$$(INCLUDE) \
-I$(OUTDIR)/inc \
- -I$(OUTDIR)/inc/offuh \
-I$(realpath $(SRCDIR)/oox/inc) \
))
@@ -42,6 +41,11 @@ $(eval $(call gb_Library_add_defs,oox,\
-DOOX_DLLIMPLEMENTATION \
))
+$(eval $(call gb_Library_add_api,oox,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_Library_add_linked_libs,oox,\
basegfx \
comphelper \
diff --git a/oox/Package_inc.mk b/oox/Package_inc.mk
index d9b23dbfd266..b51b51b79559 100644
--- a/oox/Package_inc.mk
+++ b/oox/Package_inc.mk
@@ -48,6 +48,7 @@ $(eval $(call gb_Package_add_file,oox_inc,inc/oox/helper/refmap.hxx,oox/helper/r
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/helper/refvector.hxx,oox/helper/refvector.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/helper/storagebase.hxx,oox/helper/storagebase.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/helper/zipstorage.hxx,oox/helper/zipstorage.hxx))
+$(eval $(call gb_Package_add_file,oox_inc,inc/oox/ole/olehelper.hxx,oox/ole/olehelper.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/ole/oleobjecthelper.hxx,oox/ole/oleobjecthelper.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/ole/olestorage.hxx,oox/ole/olestorage.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/ole/vbaproject.hxx,oox/ole/vbaproject.hxx))
diff --git a/oox/inc/oox/core/contexthandler.hxx b/oox/inc/oox/core/contexthandler.hxx
index 118d9396e354..94a095b22c0c 100644
--- a/oox/inc/oox/core/contexthandler.hxx
+++ b/oox/inc/oox/core/contexthandler.hxx
@@ -63,7 +63,7 @@ typedef ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastContextHandler
class ContextHandler : public ContextHandler_BASE
{
public:
- explicit ContextHandler( ContextHandler& rParent );
+ explicit ContextHandler( const ContextHandler& rParent );
virtual ~ContextHandler();
/** Returns the filter instance. */
diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx
index 273bacd5121a..2f06aca5ee7d 100644
--- a/oox/inc/oox/ole/axcontrol.hxx
+++ b/oox/inc/oox/ole/axcontrol.hxx
@@ -77,6 +77,11 @@ const sal_uInt16 COMCTL_VERSION_60 = 6;
#define AX_GUID_SCROLLBAR "{DFD181E0-5E2F-11CE-A449-00AA004A803D}"
#define AX_GUID_FRAME "{6E182020-F460-11CE-9BCD-00AA00608E01}"
+// Html control GUID(s)
+
+#define HTML_GUID_SELECT "{5512D122-5CC6-11CF-8D67-00AA00BDCE1D}"
+#define HTML_GUID_TEXTBOX "{5512D124-5CC6-11CF-8D67-00AA00BDCE1D}"
+
const sal_uInt32 AX_SYSCOLOR_WINDOWBACK = 0x80000005;
const sal_uInt32 AX_SYSCOLOR_WINDOWFRAME = 0x80000006;
const sal_uInt32 AX_SYSCOLOR_WINDOWTEXT = 0x80000008;
@@ -853,6 +858,22 @@ public:
virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
};
+class HtmlSelectModel : public AxListBoxModel
+{
+ com::sun::star::uno::Sequence< rtl::OUString > msListData;
+ com::sun::star::uno::Sequence< sal_Int16 > msIndices;
+public:
+ HtmlSelectModel();
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+};
+
+class HtmlTextBoxModel : public AxTextBoxModel
+{
+public:
+ explicit HtmlTextBoxModel();
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+};
// ============================================================================
/** A form control embedded in a document draw page. Contains a specific model
diff --git a/oox/inc/oox/ole/olehelper.hxx b/oox/inc/oox/ole/olehelper.hxx
index 9881eebc21dc..efe0b40c2938 100644
--- a/oox/inc/oox/ole/olehelper.hxx
+++ b/oox/inc/oox/ole/olehelper.hxx
@@ -31,15 +31,29 @@
#include <rtl/ustring.hxx>
#include "oox/helper/binarystreambase.hxx"
+#include "oox/helper/storagebase.hxx"
+#include "oox/helper/graphichelper.hxx"
+#include "com/sun/star/form/XFormComponent.hpp"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/frame/XModel.hpp"
+#include "com/sun/star/frame/XFrame.hpp"
+#include "com/sun/star/awt/XControl.hpp"
+#include "com/sun/star/io/XInputStream.hpp"
+#include "oox/dllapi.h"
namespace oox {
class BinaryInputStream;
+ class BinaryXInputStream;
class GraphicHelper;
}
namespace oox {
+
+typedef ::boost::shared_ptr< oox::BinaryXInputStream > BinaryXInputStreamRef;
+
namespace ole {
+
// ============================================================================
#define OLE_GUID_STDFONT "{0BE35203-8F91-11CE-9DE3-00AA004BB851}"
@@ -87,7 +101,7 @@ struct StdHlinkInfo
// ============================================================================
/** Static helper functions for OLE import/export. */
-class OleHelper
+class OOX_DLLPUBLIC OleHelper
{
public:
/** Returns the UNO RGB color from the passed encoded OLE color.
@@ -139,6 +153,30 @@ private:
~OleHelper(); // not implemented
};
+class OOX_DLLPUBLIC OleFormCtrlImportHelper
+{
+ ::oox::StorageRef mpRoot;
+ ::oox::StorageRef mpPoolStrg;
+ ::oox::BinaryXInputStreamRef mpCtlsStrm;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxCtx;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
+ ::oox::GraphicHelper maGrfHelper;
+ bool importControlFromStream( ::oox::BinaryInputStream& rInStrm,
+ ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp,
+ const ::rtl::OUString& rGuidString );
+ bool importControlFromStorage( ::oox::StorageRef rxObjStrg,
+ ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp );
+public:
+ OleFormCtrlImportHelper( const ::com::sun::star::uno::Reference< com::sun::star::io::XInputStream > & xInStrm,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxCtx,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel );
+ ~OleFormCtrlImportHelper();
+ bool importFormControlFromObjStorage( ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp);
+ bool importFormControlFromCtls( ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp,
+ sal_Int32 nPos, sal_Int32 nSize );
+ bool importFormControlFromObjPool( ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp,
+ const ::rtl::OUString& rPoolName );
+};
// ============================================================================
} // namespace ole
diff --git a/oox/inc/oox/ppt/backgroundproperties.hxx b/oox/inc/oox/ppt/backgroundproperties.hxx
index 7f254e8c386e..4be1177fc55f 100644
--- a/oox/inc/oox/ppt/backgroundproperties.hxx
+++ b/oox/inc/oox/ppt/backgroundproperties.hxx
@@ -29,18 +29,18 @@
#ifndef OOX_POWERPOINT_BACKGROUNDPROPERTIES_HXX
#define OOX_POWERPOINT_BACKGROUNDPROPERTIES_HXX
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
#include "oox/drawingml/fillproperties.hxx"
namespace oox { namespace ppt {
// ---------------------------------------------------------------------
-class BackgroundPropertiesContext : public ::oox::core::ContextHandler
+class BackgroundPropertiesContext : public ::oox::core::FragmentHandler2
{
public:
- BackgroundPropertiesContext( ::oox::core::ContextHandler& rParent, ::oox::drawingml::FillProperties& rFillProperties ) throw();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ BackgroundPropertiesContext( ::oox::core::FragmentHandler2& rParent, ::oox::drawingml::FillProperties& rFillProperties );
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
protected:
::oox::drawingml::FillProperties& mrFillProperties;
diff --git a/oox/inc/oox/ppt/customshowlistcontext.hxx b/oox/inc/oox/ppt/customshowlistcontext.hxx
index df5ca3a7a6fe..d10976b3ad46 100644
--- a/oox/inc/oox/ppt/customshowlistcontext.hxx
+++ b/oox/inc/oox/ppt/customshowlistcontext.hxx
@@ -31,7 +31,7 @@
#ifndef OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX
#define OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
#include <vector>
namespace oox { namespace ppt {
@@ -45,18 +45,16 @@ namespace oox { namespace ppt {
};
/** CT_ */
- class CustomShowListContext : public ::oox::core::ContextHandler
+ class CustomShowListContext : public ::oox::core::FragmentHandler2
{
std::vector< CustomShow >& mrCustomShowList;
public:
- CustomShowListContext( ::oox::core::ContextHandler& rParent,
+ CustomShowListContext( ::oox::core::FragmentHandler2& rParent,
std::vector< CustomShow >& rCustomShowList );
~CustomShowListContext( );
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
- createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ )
- throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
};
} }
diff --git a/oox/inc/oox/ppt/layoutfragmenthandler.hxx b/oox/inc/oox/ppt/layoutfragmenthandler.hxx
index bc29d732ee28..4e7ae5d28f8e 100644
--- a/oox/inc/oox/ppt/layoutfragmenthandler.hxx
+++ b/oox/inc/oox/ppt/layoutfragmenthandler.hxx
@@ -41,8 +41,7 @@ public:
LayoutFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const ::rtl::OUString& rFragmentPath, SlidePersistPtr pMasterPersistPtr ) throw();
virtual ~LayoutFragmentHandler() throw();
- virtual void SAL_CALL endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
};
} }
diff --git a/oox/inc/oox/ppt/presentationfragmenthandler.hxx b/oox/inc/oox/ppt/presentationfragmenthandler.hxx
index f4d46dba9afc..77db0d6dbdb4 100644
--- a/oox/inc/oox/ppt/presentationfragmenthandler.hxx
+++ b/oox/inc/oox/ppt/presentationfragmenthandler.hxx
@@ -33,7 +33,9 @@
#include <com/sun/star/awt/Size.hpp>
#include "oox/drawingml/textliststyle.hxx"
#include "oox/ppt/slidepersist.hxx"
+#include "oox/core/contexthandler.hxx"
#include "oox/core/fragmenthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
#include "oox/core/relations.hxx"
#include "oox/ppt/customshowlistcontext.hxx"
@@ -42,15 +44,13 @@
namespace oox { namespace ppt {
-class PresentationFragmentHandler : public ::oox::core::FragmentHandler
+class PresentationFragmentHandler : public ::oox::core::FragmentHandler2
{
public:
PresentationFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const ::rtl::OUString& rFragmentPath ) throw();
virtual ~PresentationFragmentHandler() throw();
-
- virtual void SAL_CALL startDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void finalizeImport();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
protected:
bool importSlide( const ::oox::core::FragmentHandlerRef& rxSlideFragmentHandler,
diff --git a/oox/inc/oox/ppt/slidefragmenthandler.hxx b/oox/inc/oox/ppt/slidefragmenthandler.hxx
index b530d8cb2550..ce518e214511 100644
--- a/oox/inc/oox/ppt/slidefragmenthandler.hxx
+++ b/oox/inc/oox/ppt/slidefragmenthandler.hxx
@@ -31,7 +31,7 @@
#include <com/sun/star/drawing/XDrawPage.hpp>
#include "oox/helper/propertymap.hxx"
-#include "oox/core/fragmenthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
#include "oox/ppt/slidepersist.hxx"
#include <stack>
@@ -40,14 +40,14 @@
namespace oox { namespace ppt {
-class SlideFragmentHandler : public ::oox::core::FragmentHandler
+class SlideFragmentHandler : public ::oox::core::FragmentHandler2
{
public:
SlideFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const ::rtl::OUString& rFragmentPath, SlidePersistPtr pPersistPtr, const ShapeLocation eShapeLocation ) throw();
virtual ~SlideFragmentHandler() throw();
- virtual void SAL_CALL endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void finalizeImport();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
protected:
SlidePersistPtr mpSlidePersistPtr;
diff --git a/oox/inc/oox/ppt/slidemastertextstylescontext.hxx b/oox/inc/oox/ppt/slidemastertextstylescontext.hxx
index 9f232ee853c8..4381a289a6e1 100644
--- a/oox/inc/oox/ppt/slidemastertextstylescontext.hxx
+++ b/oox/inc/oox/ppt/slidemastertextstylescontext.hxx
@@ -31,17 +31,17 @@
#include "oox/drawingml/theme.hxx"
#include "oox/core/contexthandler.hxx"
-#include "oox/core/fragmenthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
#include "oox/ppt/slidepersist.hxx"
namespace oox { namespace ppt {
-class SlideMasterTextStylesContext : public oox::core::ContextHandler
+class SlideMasterTextStylesContext : public oox::core::FragmentHandler2
{
public:
- SlideMasterTextStylesContext( ::oox::core::ContextHandler& rParent, SlidePersistPtr pSlidePersistPtr );
+ SlideMasterTextStylesContext( ::oox::core::FragmentHandler2& rParent, SlidePersistPtr pSlidePersistPtr );
~SlideMasterTextStylesContext();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
protected:
SlidePersistPtr mpSlidePersistPtr;
diff --git a/oox/inc/oox/ppt/slidetimingcontext.hxx b/oox/inc/oox/ppt/slidetimingcontext.hxx
index 76dbb7cd2790..a1ba2dd5e936 100644
--- a/oox/inc/oox/ppt/slidetimingcontext.hxx
+++ b/oox/inc/oox/ppt/slidetimingcontext.hxx
@@ -31,23 +31,20 @@
#include <com/sun/star/animations/XTimeContainer.hpp>
#include "oox/ppt/timenode.hxx"
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
#include <stack>
#include <vector>
namespace oox { namespace ppt {
-class SlideTimingContext : public ::oox::core::ContextHandler
+class SlideTimingContext : public ::oox::core::FragmentHandler2
{
public:
- SlideTimingContext( ::oox::core::ContextHandler& rParent, TimeNodePtrList & aTimeNodeList ) throw();
+ SlideTimingContext( ::oox::core::FragmentHandler2& rParent, TimeNodePtrList & aTimeNodeList ) throw();
virtual ~SlideTimingContext() throw();
- virtual void SAL_CALL endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
private:
TimeNodePtrList & maTimeNodeList;
diff --git a/oox/inc/oox/ppt/slidetransitioncontext.hxx b/oox/inc/oox/ppt/slidetransitioncontext.hxx
index 361a06f4b556..e6d2cbb729b1 100644
--- a/oox/inc/oox/ppt/slidetransitioncontext.hxx
+++ b/oox/inc/oox/ppt/slidetransitioncontext.hxx
@@ -29,26 +29,24 @@
#ifndef OOX_PPT_SLIDETRANSITIONCONTEXT
#define OOX_PPT_SLIDETRANSITIONCONTEXT
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
#include "oox/ppt/slidetransition.hxx"
namespace oox { class PropertyMap; }
namespace oox { namespace ppt {
- class SlideTransitionContext : public ::oox::core::ContextHandler
+ class SlideTransitionContext : public ::oox::core::FragmentHandler2
{
public:
- SlideTransitionContext( ::oox::core::ContextHandler& rParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes,
+ SlideTransitionContext( ::oox::core::FragmentHandler2& rParent,
+ const AttributeList& rAttributes,
PropertyMap & aProperties ) throw();
virtual ~SlideTransitionContext() throw();
- virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
- createFastChildContext( ::sal_Int32 Element,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs )
- throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void onEndElement();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+
private:
PropertyMap& maSlideProperties;
diff --git a/oox/inc/oox/ppt/soundactioncontext.hxx b/oox/inc/oox/ppt/soundactioncontext.hxx
index 0ee8a88dc5dc..d368c1fad649 100644
--- a/oox/inc/oox/ppt/soundactioncontext.hxx
+++ b/oox/inc/oox/ppt/soundactioncontext.hxx
@@ -30,20 +30,20 @@
#ifndef OOX_PPT_SOUNDACTIONCONTEXT
#define OOX_PPT_SOUNDACTIONCONTEXT
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
namespace oox { class PropertyMap; }
namespace oox { namespace ppt {
-class SoundActionContext : public ::oox::core::ContextHandler
+class SoundActionContext : public ::oox::core::FragmentHandler2
{
public:
- SoundActionContext( ::oox::core::ContextHandler& rParent, PropertyMap & aProperties ) throw();
+ SoundActionContext( ::oox::core::FragmentHandler2& rParent, PropertyMap & aProperties ) throw();
virtual ~SoundActionContext() throw();
- virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void onEndElement();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
private:
PropertyMap& maSlideProperties;
diff --git a/oox/inc/oox/ppt/timenodelistcontext.hxx b/oox/inc/oox/ppt/timenodelistcontext.hxx
index 25c929cdaf67..75949a419077 100644
--- a/oox/inc/oox/ppt/timenodelistcontext.hxx
+++ b/oox/inc/oox/ppt/timenodelistcontext.hxx
@@ -29,7 +29,7 @@
#ifndef OOX_PPT_TIMENODELISTCONTEXT
#define OOX_PPT_TIMENODELISTCONTEXT
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
#include "oox/ppt/timenode.hxx"
#include <com/sun/star/animations/XTimeContainer.hpp>
@@ -37,15 +37,15 @@
namespace oox { namespace ppt {
- class TimeNodeContext : public ::oox::core::ContextHandler
+ class TimeNodeContext : public ::oox::core::FragmentHandler2
{
public:
virtual ~TimeNodeContext() throw();
- static TimeNodeContext * SAL_CALL makeContext( ::oox::core::ContextHandler& rParent, sal_Int32 aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode );
+ static TimeNodeContext * SAL_CALL makeContext( ::oox::core::FragmentHandler2& rParent, sal_Int32 aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode );
protected:
- TimeNodeContext( ::oox::core::ContextHandler& rParent, sal_Int32 aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode ) throw();
+ TimeNodeContext( ::oox::core::FragmentHandler2& rParent, sal_Int32 aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode ) throw();
sal_Int32 mnElement;
TimeNodePtr mpNode;
@@ -54,17 +54,14 @@ namespace oox { namespace ppt {
/** FastParser context for XML_tnLst, XML_subTnLst and XML_childTnLst */
-class TimeNodeListContext : public ::oox::core::ContextHandler
+class TimeNodeListContext : public ::oox::core::FragmentHandler2
{
public:
- TimeNodeListContext( ::oox::core::ContextHandler& rParent, TimeNodePtrList & aList ) throw();
+ TimeNodeListContext( ::oox::core::FragmentHandler2& rParent, TimeNodePtrList & aList ) throw();
virtual ~TimeNodeListContext() throw();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
- createFastChildContext( ::sal_Int32 Element,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs )
- throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
private:
TimeNodePtrList & maList;
diff --git a/oox/inc/oox/xls/worksheethelper.hxx b/oox/inc/oox/xls/worksheethelper.hxx
index e31c8f69711b..c824c4eb922b 100644
--- a/oox/inc/oox/xls/worksheethelper.hxx
+++ b/oox/inc/oox/xls/worksheethelper.hxx
@@ -43,6 +43,7 @@ namespace com { namespace sun { namespace star {
namespace sheet { class XSheetCellRanges; }
namespace sheet { class XSpreadsheet; }
namespace table { class XCell; }
+ namespace table { class XCell2; }
namespace table { class XCellRange; }
namespace table { class XTableColumns; }
namespace table { class XTableRows; }
@@ -323,6 +324,13 @@ public:
void putValue(
const ::com::sun::star::table::CellAddress& rAddress,
double fValue ) const;
+ void putFormulaResult(
+ const ::com::sun::star::table::CellAddress& rAddress,
+ double fValue ) const;
+ void putFormulaString(
+ const ::com::sun::star::table::CellAddress& rAddress,
+ const ::rtl::OUString& rText ) const;
+
/** Inserts a string cell directly into the Calc sheet. */
void putString(
const ::com::sun::star::table::CellAddress& rAddress,
diff --git a/oox/source/core/contexthandler.cxx b/oox/source/core/contexthandler.cxx
index d781a811d520..8b73a5f47885 100644
--- a/oox/source/core/contexthandler.cxx
+++ b/oox/source/core/contexthandler.cxx
@@ -42,7 +42,7 @@ using ::rtl::OUString;
// ============================================================================
-ContextHandler::ContextHandler( ContextHandler& rParent ) :
+ContextHandler::ContextHandler( const ContextHandler& rParent ) :
ContextHandler_BASE(),
mxBaseData( rParent.mxBaseData )
{
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
index f05524f4d046..199d8a695048 100644
--- a/oox/source/core/services.cxx
+++ b/oox/source/core/services.cxx
@@ -81,17 +81,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/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 6638ffe5d4d9..1daea946eb33 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -538,13 +538,13 @@ XmlFilterBase& XmlFilterBase::exportDocumentProperties( Reference< XDocumentProp
writeCoreProperties( *this, xProperties );
writeAppProperties( *this, xProperties );
Sequence< ::com::sun::star::beans::NamedValue > aStats = xProperties->getDocumentStatistics();
- printf( "# Document Statistics:\n" );
+ OSL_TRACE( "# Document Statistics:\n" );
for( sal_Int32 i = 0, end = aStats.getLength(); i < end; ++i )
{
::com::sun::star::uno::Any aValue = aStats[ i ].Value;
::rtl::OUString sValue;
bool bHaveString = aValue >>= sValue;
- printf ("#\t%s=%s [%s]\n",
+ OSL_TRACE ("#\t%s=%s [%s]\n",
OUStringToOString( aStats[ i ].Name, RTL_TEXTENCODING_UTF8 ).getStr(),
bHaveString
? OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr()
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx
index 2225d7f5ae27..d07d28c79ae8 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -315,7 +315,11 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
// number format ------------------------------------------------------
if( (aScaleData.AxisType == cssc2::AxisType::REALNUMBER) || (aScaleData.AxisType == cssc2::AxisType::PERCENT) )
+ {
+ if( mrModel.maNumberFormat.maFormatCode.indexOfAsciiL("%",1) >= 0)
+ mrModel.maNumberFormat.mbSourceLinked = false;
getFormatter().convertNumberFormat( aAxisProp, mrModel.maNumberFormat );
+ }
// position of crossing axis ------------------------------------------
diff --git a/oox/source/drawingml/chart/chartconverter.cxx b/oox/source/drawingml/chart/chartconverter.cxx
index e66eca6bc0e2..261494327efd 100644
--- a/oox/source/drawingml/chart/chartconverter.cxx
+++ b/oox/source/drawingml/chart/chartconverter.cxx
@@ -59,7 +59,7 @@ static const sal_Unicode API_TOKEN_ARRAY_CLOSE = '}';
static const sal_Unicode API_TOKEN_ARRAY_ROWSEP = '|';
static const sal_Unicode API_TOKEN_ARRAY_COLSEP = ';';
-// Code similar to oox/source/xls/FormulaParser.cxx
+// Code similar to oox/source/xls/formulabase.cxx
static OUString lclGenerateApiString( const OUString& rString )
{
OUString aRetString = rString;
@@ -69,7 +69,7 @@ static OUString lclGenerateApiString( const OUString& rString )
return OUStringBuffer().append( sal_Unicode( '"' ) ).append( aRetString ).append( sal_Unicode( '"' ) ).makeStringAndClear();
}
- static ::rtl::OUString lclGenerateApiArray( const Matrix< Any >& rMatrix )
+static ::rtl::OUString lclGenerateApiArray( const Matrix< Any >& rMatrix )
{
OSL_ENSURE( !rMatrix.empty(), "ChartConverter::lclGenerateApiArray - missing matrix values" );
OUStringBuffer aBuffer;
@@ -156,7 +156,7 @@ Reference< XDataSequence > ChartConverter::createDataSequence( const Reference<
}
catch( Exception& )
{
- OSL_FAIL( "ExcelChartConverter::createDataSequence - cannot create data sequence" );
+ OSL_FAIL( "ChartConverter::createDataSequence - cannot create data sequence" );
}
}
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index f6f1ad8523ec..8a98471abca9 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/chart2/XRegressionCurve.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
+#include <basegfx/numeric/ftools.hxx>
#include "oox/drawingml/chart/datasourceconverter.hxx"
#include "oox/drawingml/chart/seriesmodel.hxx"
#include "oox/drawingml/chart/titleconverter.hxx"
@@ -59,6 +60,15 @@ using ::rtl::OUString;
namespace {
+/** nastied-up sgn function - employs some gratuity around 0 - values
+ smaller than 0.33 are clamped to 0
+ */
+int lclSgn( double nVal )
+{
+ const int intVal=nVal*3;
+ return intVal == 0 ? 0 : (intVal < 0 ? -1 : 1);
+}
+
Reference< XLabeledDataSequence > lclCreateLabeledDataSequence(
const ConverterRoot& rParent,
DataSourceModel* pValues, const OUString& rRole,
@@ -114,6 +124,13 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatt
bool bShowValue = !rDataLabel.mbDeleted && rDataLabel.mobShowVal.get( false );
bool bShowPercent = !rDataLabel.mbDeleted && rDataLabel.mobShowPercent.get( false ) && (rTypeInfo.meTypeCategory == TYPECATEGORY_PIE);
+ if( bShowValue &&
+ !bShowPercent && rTypeInfo.meTypeCategory == TYPECATEGORY_PIE &&
+ rDataLabel.maNumberFormat.maFormatCode.indexOfAsciiL("%", 1) >= 0 )
+ {
+ bShowValue = false;
+ bShowPercent = true;
+ }
bool bShowCateg = !rDataLabel.mbDeleted && rDataLabel.mobShowCatName.get( false );
bool bShowSymbol = !rDataLabel.mbDeleted && rDataLabel.mobShowLegendKey.get( false );
@@ -178,6 +195,27 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat
{
PropertySet aPropSet( rxDataSeries->getDataPointByIndex( mrModel.mnIndex ) );
lclConvertLabelFormatting( aPropSet, getFormatter(), mrModel, rTypeGroup, false );
+
+ if( !mrModel.mxLayout->mbAutoLayout )
+ {
+ // bnc#694340 - nasty hack - chart2 cannot individually
+ // place data labels, let's try to find a useful
+ // compromise instead
+ namespace csscd = ::com::sun::star::chart::DataLabelPlacement;
+ const sal_Int32 aPositionsLookupTable[] =
+ {
+ csscd::TOP_LEFT, csscd::TOP, csscd::TOP_RIGHT,
+ csscd::LEFT, csscd::CENTER, csscd::RIGHT,
+ csscd::BOTTOM_LEFT, csscd::BOTTOM, csscd::BOTTOM_RIGHT
+ };
+ const double nMax=std::max(
+ fabs(mrModel.mxLayout->mfX),
+ fabs(mrModel.mxLayout->mfY));
+ const int simplifiedX=lclSgn(mrModel.mxLayout->mfX/nMax);
+ const int simplifiedY=lclSgn(mrModel.mxLayout->mfY/nMax);
+ aPropSet.setProperty( PROP_LabelPlacement,
+ aPositionsLookupTable[ simplifiedX+1 + 3*(simplifiedY+1) ] );
+ }
}
catch( Exception& )
{
@@ -206,6 +244,7 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa
// data point label settings
for( DataLabelsModel::DataLabelVector::iterator aIt = mrModel.maPointLabels.begin(), aEnd = mrModel.maPointLabels.end(); aIt != aEnd; ++aIt )
{
+ (*aIt)->maNumberFormat.maFormatCode = mrModel.maNumberFormat.maFormatCode;
DataLabelConverter aLabelConv( *this, **aIt );
aLabelConv.convertFromModel( rxDataSeries, rTypeGroup );
}
@@ -596,6 +635,12 @@ Reference< XDataSeries > SeriesConverter::createDataSeries( const TypeGroupConve
ModelRef< DataLabelsModel > xLabels = mrModel.mxLabels.is() ? mrModel.mxLabels : rTypeGroup.getModel().mxLabels;
if( xLabels.is() )
{
+ if( xLabels->maNumberFormat.maFormatCode.isEmpty() )
+ {
+ // Use number format code from Value series
+ DataSourceModel* pValues = mrModel.maSources.get( SeriesModel::VALUES ).get();
+ xLabels->maNumberFormat.maFormatCode = pValues->mxDataSeq->maFormatCode;
+ }
DataLabelsConverter aLabelsConv( *this, *xLabels );
aLabelsConv.convertFromModel( xDataSeries, rTypeGroup );
}
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 4bb7663daf34..fb4d01356b59 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -377,30 +377,6 @@ sal_Int32 lcl_getSequenceLengthByRole(
return 0;
}
-bool lcl_hasChartType( const Reference< chart2::XDiagram > & xDiagram, const OUString & rChartType )
-{
- try
- {
- Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
- Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems());
- for( sal_Int32 nCooSysIdx=0; nCooSysIdx<aCooSysSeq.getLength(); ++nCooSysIdx )
- {
- Reference< chart2::XChartTypeContainer > xCTCnt( aCooSysSeq[nCooSysIdx], uno::UNO_QUERY_THROW );
- Sequence< Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes());
- for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
- {
- if( aChartTypes[nCTIdx]->getChartType().equals( rChartType ))
- return true;
- }
- }
- }
- catch( uno::Exception & )
- {
- OSL_FAIL( "Exception while searching for chart type in diagram" );
- }
- return false;
-}
-
OUString lcl_flattenStringSequence( const Sequence< OUString > & rSequence )
{
OUStringBuffer aResult;
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 9e971e602da6..95a791d86b11 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -61,6 +61,7 @@
#include "oox/helper/containerhelper.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/propertymap.hxx"
+#include "tools/string.hxx"
namespace oox {
namespace ole {
@@ -1748,6 +1749,103 @@ void AxUserFormModel::convertProperties( PropertyMap& rPropMap, const ControlCon
AxContainerModelBase::convertProperties( rPropMap, rConv );
}
+HtmlSelectModel::HtmlSelectModel()
+{
+}
+
+bool
+HtmlSelectModel::importBinaryModel( BinaryInputStream& rInStrm )
+{
+ static OUString sTerm( RTL_CONSTASCII_USTRINGPARAM("</SELECT") );
+ static String sMultiple( RTL_CONSTASCII_USTRINGPARAM("<SELECT MULTIPLE") );
+ static String sSelected( RTL_CONSTASCII_USTRINGPARAM("OPTION SELECTED") );
+
+ OUString sStringContents = rInStrm.readUnicodeArray( rInStrm.size() );
+
+ String data = sStringContents;
+
+ // replace crlf with lf
+ data.SearchAndReplaceAll( String( RTL_CONSTASCII_USTRINGPARAM( "\x0D\x0A" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "\x0A" ) ) );
+ std::vector< rtl::OUString > listValues;
+ std::vector< sal_Int16 > selectedIndices;
+
+ // Ultra hacky parser for the info
+ sal_Int32 nTokenCount = data.GetTokenCount( '\n' );
+
+ for ( sal_Int32 nToken = 0; nToken < nTokenCount; ++nToken )
+ {
+ String sLine( data.GetToken( nToken, '\n' ) );
+ if ( !nToken ) // first line will tell us if multiselect is enabled
+ {
+ if ( sLine.CompareTo( sMultiple, sMultiple.Len() ) == COMPARE_EQUAL )
+ mnMultiSelect = true;
+ }
+ // skip first and last lines, no data there
+ else if ( nToken < nTokenCount - 1)
+ {
+ if ( sLine.GetTokenCount( '>' ) )
+ {
+ String displayValue = sLine.GetToken( 1, '>' );
+ if ( displayValue.Len() )
+ {
+ // Really we should be using a proper html parser
+ // escaping some common bits to be escaped
+ displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "&lt;" ) ), String( RTL_CONSTASCII_USTRINGPARAM("<") ) );
+ displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "&gt;" ) ), String( RTL_CONSTASCII_USTRINGPARAM(">") ) );
+ displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "&quot;" ) ), String( RTL_CONSTASCII_USTRINGPARAM("\"") ) );
+ displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "&amp;" ) ), String( RTL_CONSTASCII_USTRINGPARAM("&") ) );
+ listValues.push_back( displayValue );
+ if( sLine.Search( sSelected ) != STRING_NOTFOUND )
+ selectedIndices.push_back( static_cast< sal_Int16 >( listValues.size() ) - 1 );
+ }
+ }
+ }
+ }
+ if ( listValues.size() )
+ {
+ msListData.realloc( listValues.size() );
+ sal_Int32 index = 0;
+ for( std::vector< rtl::OUString >::iterator it = listValues.begin(); it != listValues.end(); ++it, ++index )
+ msListData[ index ] = *it;
+ }
+ if ( selectedIndices.size() )
+ {
+ msIndices.realloc( selectedIndices.size() );
+ sal_Int32 index = 0;
+ for( std::vector< sal_Int16 >::iterator it = selectedIndices.begin(); it != selectedIndices.end(); ++it, ++index )
+ msIndices[ index ] = *it;
+ }
+ return sal_True;
+}
+
+
+void
+HtmlSelectModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const
+{
+ rPropMap.setProperty( PROP_StringItemList, msListData );
+ rPropMap.setProperty( PROP_SelectedItems, msIndices );
+ rPropMap.setProperty( PROP_Dropdown, true );
+ AxListBoxModel::convertProperties( rPropMap, rConv );
+}
+
+HtmlTextBoxModel::HtmlTextBoxModel()
+{
+}
+
+bool
+HtmlTextBoxModel::importBinaryModel( BinaryInputStream& rInStrm )
+{
+ OUString sStringContents = rInStrm.readUnicodeArray( rInStrm.size() );
+#ifdef DEBUG
+ // in msocximex ( where this is ported from, it appears *nothing* is read
+ // from the control stream ), surely there is some useful info there ?
+ OSL_TRACE("HtmlTextBoxModel::importBinaryModel - string contents of stream :");
+ OSL_TRACE("%s", rtl::OUStringToOString( sStringContents, RTL_TEXTENCODING_UTF8 ).getStr() );
+#else
+ (void) rInStrm;
+#endif
+ return true;
+}
// ============================================================================
EmbeddedControl::EmbeddedControl( const OUString& rName ) :
@@ -1776,6 +1874,8 @@ ControlModelBase* EmbeddedControl::createModelFromGuid( const OUString& rClassId
if( aClassId.equalsAscii( AX_GUID_SCROLLBAR ) ) return &createModel< AxScrollBarModel >();
if( aClassId.equalsAscii( AX_GUID_FRAME ) ) return &createModel< AxFrameModel >();
if( aClassId.equalsAscii( COMCTL_GUID_SCROLLBAR_60 ) ) return &createModel< ComCtlScrollBarModel >( COMCTL_VERSION_60 );
+ if( aClassId.equalsAscii( HTML_GUID_SELECT ) ) return &createModel< HtmlSelectModel >();
+ if( aClassId.equalsAscii( HTML_GUID_TEXTBOX ) ) return &createModel< HtmlTextBoxModel >();
mxModel.reset();
return 0;
diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx
index 95678f147cd4..2bcafc9a2882 100644
--- a/oox/source/ole/olehelper.cxx
+++ b/oox/source/ole/olehelper.cxx
@@ -32,6 +32,11 @@
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/token/tokens.hxx"
+#include "oox/ole/axcontrol.hxx"
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include "oox/helper/propertymap.hxx"
+#include "oox/helper/propertyset.hxx"
+#include "oox/ole/olestorage.hxx"
namespace oox {
namespace ole {
@@ -41,6 +46,12 @@ namespace ole {
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
+using ::com::sun::star::form::XFormComponent;
+using ::com::sun::star::awt::XControlModel;
+using ::com::sun::star::beans::XPropertySet;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::UNO_QUERY;
+
// ============================================================================
namespace {
@@ -308,6 +319,132 @@ StdFontInfo::StdFontInfo( const ::rtl::OUString& rName, sal_uInt32 nHeight,
return !rInStrm.isEof();
}
+Reference< ::com::sun::star::frame::XFrame >
+lcl_getFrame( const Reference< ::com::sun::star::frame::XModel >& rxModel )
+{
+ Reference< ::com::sun::star::frame::XFrame > xFrame;
+ if ( rxModel.is() )
+ {
+ Reference< ::com::sun::star::frame::XController > xController = rxModel->getCurrentController();
+ xFrame = xController.is() ? xController->getFrame() : NULL;
+ }
+ return xFrame;
+}
+
+OleFormCtrlImportHelper::OleFormCtrlImportHelper( const Reference< com::sun::star::io::XInputStream > & rxInStrm, const Reference< ::com::sun::star::uno::XComponentContext >& rxCtx, const Reference< ::com::sun::star::frame::XModel >& rxModel ) : mpRoot( new ::oox::ole::OleStorage( rxCtx, rxInStrm, true ) ), mxCtx( rxCtx ), mxModel( rxModel ), maGrfHelper( rxCtx, lcl_getFrame( rxModel ), mpRoot )
+{
+}
+
+OleFormCtrlImportHelper::~OleFormCtrlImportHelper()
+{
+}
+
+bool
+OleFormCtrlImportHelper::importControlFromStream( ::oox::BinaryInputStream& rInStrm, Reference< XFormComponent >& rxFormComp, const ::rtl::OUString& rGuidString )
+{
+ ::oox::ole::EmbeddedControl aControl( CREATE_OUSTRING( "Unknown" ) );
+ if( ::oox::ole::ControlModelBase* pModel = aControl.createModelFromGuid( rGuidString ) )
+ {
+ pModel->importBinaryModel( rInStrm );
+ rxFormComp.set( mxCtx->getServiceManager()->createInstanceWithContext( pModel->getServiceName(), mxCtx ), UNO_QUERY );
+ Reference< XControlModel > xCtlModel( rxFormComp, UNO_QUERY );
+ ::oox::ole::ControlConverter aConv( mxModel, maGrfHelper );
+ aControl.convertProperties( xCtlModel, aConv );
+ }
+ return rxFormComp.is();
+}
+
+bool
+OleFormCtrlImportHelper::importFormControlFromCtls( Reference< XFormComponent > & rxFormComp,
+ sal_Int32 nPos,
+ sal_Int32 nStreamSize)
+{
+ if ( mpRoot.get() && mpRoot->isStorage() )
+ {
+ if ( !mpCtlsStrm.get() )
+ mpCtlsStrm.reset( new BinaryXInputStream( mpRoot->openInputStream( CREATE_OUSTRING( "Ctls" ) ), true ) );
+ mpCtlsStrm->seek( nPos );
+ OUString aStrmClassId = ::oox::ole::OleHelper::importGuid( *mpCtlsStrm );
+
+ bool bOneOfHtmlControls = false;
+ if ( aStrmClassId.toAsciiUpperCase().equalsAscii( HTML_GUID_SELECT )
+ || aStrmClassId.toAsciiUpperCase().equalsAscii( HTML_GUID_TEXTBOX ) )
+ bOneOfHtmlControls = false;
+
+ if ( bOneOfHtmlControls )
+ {
+ // html controls don't seem have a handy record length following the GUID
+ // in the binary stream.
+ // Given the control stream length create a stream of nStreamSize bytes starting from
+ // nPos ( offset by the guid already read in )
+ const int nGuidSize = 0x10;
+ StreamDataSequence aDataSeq;
+ sal_Int32 nBytesToRead = nStreamSize - nGuidSize;
+ while ( nBytesToRead )
+ nBytesToRead -= mpCtlsStrm->readData( aDataSeq, nBytesToRead );
+ SequenceInputStream aInSeqStream( aDataSeq );
+ importControlFromStream( aInSeqStream, rxFormComp, aStrmClassId );
+ }
+ else
+ {
+ importControlFromStream( *mpCtlsStrm, rxFormComp, aStrmClassId );
+ }
+ }
+ return rxFormComp.is();
+}
+
+bool OleFormCtrlImportHelper::importControlFromStorage( ::oox::StorageRef xObjStrg,
+ Reference< XFormComponent > & rxFormComp )
+{
+ if ( xObjStrg.get() && xObjStrg->isStorage() )
+ {
+ BinaryXInputStream aNameStream( xObjStrg->openInputStream( CREATE_OUSTRING("\3OCXNAME") ), true );
+ BinaryXInputStream aInStrm( xObjStrg->openInputStream( CREATE_OUSTRING("contents") ), true );
+ BinaryXInputStream aClsStrm( xObjStrg->openInputStream( CREATE_OUSTRING("\1CompObj") ), true );
+ aClsStrm.skip(12);
+ OUString aStrmClassId = ::oox::ole::OleHelper::importGuid( aClsStrm );
+ if ( importControlFromStream( aInStrm, rxFormComp, aStrmClassId ) )
+ {
+ OUString aName = aNameStream.readNulUnicodeArray();
+ Reference< XControlModel > xCtlModel( rxFormComp, UNO_QUERY );
+ if ( aName.getLength() && xCtlModel.is() )
+ {
+ PropertyMap aPropMap;
+ aPropMap.setProperty( PROP_Name, aName );
+ PropertySet aPropSet( xCtlModel );
+ aPropSet.setProperties( aPropMap );
+ }
+ }
+ }
+ return rxFormComp.is();
+}
+
+bool
+OleFormCtrlImportHelper::importFormControlFromObjStorage( Reference< XFormComponent > & rxFormComp )
+{
+ return importControlFromStorage( mpRoot, rxFormComp );
+}
+
+bool
+OleFormCtrlImportHelper::importFormControlFromObjPool( Reference< XFormComponent > & rxFormComp,
+ const ::rtl::OUString& rPoolName )
+{
+ bool bRet = false;
+ if ( mpRoot.get() )
+ {
+ if ( !mpPoolStrg.get() )
+ mpPoolStrg = mpRoot->openSubStorage( CREATE_OUSTRING( "ObjectPool" ), false );
+ if ( !mpPoolStrg.get() )
+ return false;
+ if ( mpPoolStrg->isStorage() )
+ {
+ StorageRef xObjStrg = mpPoolStrg->openSubStorage( rPoolName, false );
+ bRet = importControlFromStorage( xObjStrg, rxFormComp );
+ }
+ }
+ return bRet;
+}
+
// ============================================================================
} // namespace ole
diff --git a/oox/source/ppt/animvariantcontext.cxx b/oox/source/ppt/animvariantcontext.cxx
index 7d0c9a6c153e..c559cbb56d18 100644
--- a/oox/source/ppt/animvariantcontext.cxx
+++ b/oox/source/ppt/animvariantcontext.cxx
@@ -48,8 +48,8 @@ using namespace ::com::sun::star::xml::sax;
namespace oox { namespace ppt {
- AnimVariantContext::AnimVariantContext( ContextHandler& rParent, sal_Int32 aElement, Any & aValue )
- : ContextHandler( rParent )
+ AnimVariantContext::AnimVariantContext( FragmentHandler2& rParent, sal_Int32 aElement, Any & aValue )
+ : FragmentHandler2( rParent )
, mnElement( aElement )
, maValue( aValue )
{
@@ -59,63 +59,52 @@ namespace oox { namespace ppt {
{
}
- void SAL_CALL AnimVariantContext::endFastElement( sal_Int32 aElement )
- throw ( SAXException, RuntimeException)
+ void AnimVariantContext::onEndElement()
{
- if( ( aElement == mnElement ) && maColor.isUsed() )
+ if( isCurrentElement( mnElement ) && maColor.isUsed() )
{
maValue = makeAny( maColor.getColor( getFilter().getGraphicHelper() ) );
}
}
- Reference< XFastContextHandler >
- SAL_CALL AnimVariantContext::createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+ ContextHandlerRef AnimVariantContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
- AttributeList attribs(xAttribs);
-
switch( aElementToken )
{
case PPT_TOKEN( boolVal ):
{
- bool val = attribs.getBool( XML_val, false );
+ bool val = rAttribs.getBool( XML_val, false );
maValue = makeAny( val );
- break;
+ return this;
}
case PPT_TOKEN( clrVal ):
- xRet.set( new ::oox::drawingml::ColorContext( *this, maColor ) );
+ return new ::oox::drawingml::ColorContext( *this, maColor );
// we'll defer setting the Any until the end.
- break;
case PPT_TOKEN( fltVal ):
{
- double val = attribs.getDouble( XML_val, 0.0 );
+ double val = rAttribs.getDouble( XML_val, 0.0 );
maValue = makeAny( val );
- break;
+ return this;
}
case PPT_TOKEN( intVal ):
{
- sal_Int32 val = attribs.getInteger( XML_val, 0 );
+ sal_Int32 val = rAttribs.getInteger( XML_val, 0 );
maValue = makeAny( val );
- break;
+ return this;
}
case PPT_TOKEN( strVal ):
{
- OUString val = attribs.getString( XML_val, OUString() );
+ OUString val = rAttribs.getString( XML_val, OUString() );
convertMeasure( val ); // ignore success or failure if it fails, use as is
maValue = makeAny( val );
- break;
+ return this;
}
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
diff --git a/oox/source/ppt/animvariantcontext.hxx b/oox/source/ppt/animvariantcontext.hxx
index 7508cbef40b9..3c0c2a029bb5 100644
--- a/oox/source/ppt/animvariantcontext.hxx
+++ b/oox/source/ppt/animvariantcontext.hxx
@@ -34,20 +34,20 @@
#include <com/sun/star/uno/Any.hxx>
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
#include "oox/drawingml/color.hxx"
namespace oox { namespace ppt {
/** context CT_TLAnimVariant */
class AnimVariantContext
- : public ::oox::core::ContextHandler
+ : public ::oox::core::FragmentHandler2
{
public:
- AnimVariantContext( ::oox::core::ContextHandler& rParent, ::sal_Int32 aElement, ::com::sun::star::uno::Any & aValue );
+ AnimVariantContext( ::oox::core::FragmentHandler2& rParent, ::sal_Int32 aElement, ::com::sun::star::uno::Any & aValue );
~AnimVariantContext( ) throw( );
- virtual void SAL_CALL endFastElement( sal_Int32 /*aElement*/ ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void onEndElement();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
private:
::sal_Int32 mnElement;
diff --git a/oox/source/ppt/backgroundproperties.cxx b/oox/source/ppt/backgroundproperties.cxx
index e3a3714417ff..bbc9940ad10b 100644
--- a/oox/source/ppt/backgroundproperties.cxx
+++ b/oox/source/ppt/backgroundproperties.cxx
@@ -29,6 +29,7 @@
#include "oox/ppt/backgroundproperties.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/core/contexthandler2.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -38,27 +39,22 @@ using namespace ::com::sun::star::xml::sax;
namespace oox { namespace ppt {
// ---------------------------------------------------------------------
-BackgroundPropertiesContext::BackgroundPropertiesContext( ContextHandler& rParent, ::oox::drawingml::FillProperties& rFillProperties ) throw()
-: ContextHandler( rParent )
+BackgroundPropertiesContext::BackgroundPropertiesContext( FragmentHandler2& rParent, ::oox::drawingml::FillProperties& rFillProperties )
+: FragmentHandler2( rParent )
, mrFillProperties( rFillProperties )
{
}
-Reference< XFastContextHandler > BackgroundPropertiesContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+::oox::core::ContextHandlerRef BackgroundPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch( aElementToken )
{
case PPT_TOKEN( fill ): // a:CT_FillEffect
- break;
+ return this;
}
// FillPropertiesGroupContext
- if( !xRet.is() )
- xRet = ::oox::drawingml::FillPropertiesContext::createFillContext( *this, aElementToken, xAttribs, mrFillProperties );
-
- return xRet;
+ return dynamic_cast <ContextHandler *> (::oox::drawingml::FillPropertiesContext::createFillContext( *this, aElementToken, rAttribs.getFastAttributeList(), mrFillProperties ).get());
}
} }
diff --git a/oox/source/ppt/buildlistcontext.cxx b/oox/source/ppt/buildlistcontext.cxx
index 11c07c484a91..cd0ea90964a6 100644
--- a/oox/source/ppt/buildlistcontext.cxx
+++ b/oox/source/ppt/buildlistcontext.cxx
@@ -38,10 +38,10 @@ using ::rtl::OUString;
namespace oox { namespace ppt {
- BuildListContext::BuildListContext( ContextHandler& rParent,
+ BuildListContext::BuildListContext( FragmentHandler2& rParent,
const Reference< XFastAttributeList >& /*xAttribs*/,
TimeNodePtrList & aTimeNodeList)
- : ContextHandler( rParent )
+ : FragmentHandler2( rParent )
, maTimeNodeList( aTimeNodeList )
, mbInBldGraphic( false )
, mbBuildAsOne( false )
@@ -52,9 +52,9 @@ namespace oox { namespace ppt {
{
}
- void SAL_CALL BuildListContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
+ void BuildListContext::onEndElement()
{
- switch( aElement )
+ switch( getCurrentElement() )
{
case PPT_TOKEN( bldGraphic ):
mbInBldGraphic = false;
@@ -64,12 +64,8 @@ namespace oox { namespace ppt {
}
}
- Reference< XFastContextHandler > SAL_CALL BuildListContext::createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+ ::oox::core::ContextHandlerRef BuildListContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch( aElementToken )
{
case PPT_TOKEN( bldAsOne ):
@@ -77,36 +73,31 @@ namespace oox { namespace ppt {
{
mbBuildAsOne = true;
}
- break;
+ return this;
case PPT_TOKEN( bldSub ):
if( mbInBldGraphic )
{
}
- break;
+ return this;
case PPT_TOKEN( bldGraphic ):
{
mbInBldGraphic = true;
- AttributeList attribs( xAttribs );
- OUString sShapeId = xAttribs->getOptionalValue( XML_spid );
+ OUString sShapeId = rAttribs.getString( XML_spid, OUString() );
// TODO
-// bool uiExpand = attribs.getBool( XML_uiExpand, true );
+// bool uiExpand = rAttribs.getBool( XML_uiExpand, true );
/* this is unsigned */
-// sal_uInt32 nGroupId = attribs.getUnsignedInteger( XML_grpId, 0 );
- break;
+// sal_uInt32 nGroupId = rAttribs.getUnsignedInteger( XML_grpId, 0 );
+ return this;
}
case A_TOKEN( bldDgm ):
case A_TOKEN( bldOleChart ):
case A_TOKEN( bldP ):
-
- break;
+ return this;
default:
break;
}
- if( !xRet.is() )
- xRet.set(this);
-
- return xRet;
+ return this;
}
diff --git a/oox/source/ppt/buildlistcontext.hxx b/oox/source/ppt/buildlistcontext.hxx
index 1c4e3949fa7b..f147fa8af215 100644
--- a/oox/source/ppt/buildlistcontext.hxx
+++ b/oox/source/ppt/buildlistcontext.hxx
@@ -32,25 +32,25 @@
#define OOX_PPT_BUILDLISTCONTEXT
#include "oox/ppt/timenode.hxx"
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
namespace oox { namespace ppt {
/** CT_BuildList */
class BuildListContext
- : public ::oox::core::ContextHandler
+ : public ::oox::core::FragmentHandler2
{
public:
- BuildListContext( ::oox::core::ContextHandler& rParent,
+ BuildListContext( ::oox::core::FragmentHandler2& rParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
TimeNodePtrList & aTimeNodeList);
~BuildListContext( );
- virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void onEndElement();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
private:
TimeNodePtrList & maTimeNodeList;
bool mbInBldGraphic;
diff --git a/oox/source/ppt/commonbehaviorcontext.cxx b/oox/source/ppt/commonbehaviorcontext.cxx
index 72c59f730053..2e24aa43adb6 100644
--- a/oox/source/ppt/commonbehaviorcontext.cxx
+++ b/oox/source/ppt/commonbehaviorcontext.cxx
@@ -53,7 +53,7 @@ using namespace ::com::sun::star::animations;
namespace oox { namespace ppt {
- CommonBehaviorContext::CommonBehaviorContext( ContextHandler& rParent,
+ CommonBehaviorContext::CommonBehaviorContext( FragmentHandler2& rParent,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode )
: TimeNodeContext( rParent, PPT_TOKEN( cBhvr ), xAttribs, pNode )
@@ -69,10 +69,9 @@ namespace oox { namespace ppt {
- void SAL_CALL CommonBehaviorContext::endFastElement( sal_Int32 aElement )
- throw ( SAXException, RuntimeException)
+ void CommonBehaviorContext::onEndElement()
{
- switch( aElement )
+ switch( getCurrentElement() )
{
case PPT_TOKEN( cBhvr ):
{
@@ -126,8 +125,7 @@ namespace oox { namespace ppt {
}
- void CommonBehaviorContext::characters( const OUString& aChars )
- throw( SAXException, RuntimeException )
+ void CommonBehaviorContext::onCharacters( const OUString& aChars )
{
if( mbIsInAttrName )
{
@@ -136,23 +134,17 @@ namespace oox { namespace ppt {
}
- Reference< XFastContextHandler > SAL_CALL CommonBehaviorContext::createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+ ::oox::core::ContextHandlerRef CommonBehaviorContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( cTn ):
- xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
- break;
+ return new CommonTimeNodeContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode );
case PPT_TOKEN( tgtEl ):
- xRet.set( new TimeTargetElementContext( *this, mpNode->getTarget() ) );
- break;
+ return new TimeTargetElementContext( *this, mpNode->getTarget() );
case PPT_TOKEN( attrNameLst ):
mbInAttrList = true;
- break;
+ return this;
case PPT_TOKEN( attrName ):
{
if( mbInAttrList )
@@ -164,16 +156,13 @@ namespace oox { namespace ppt {
{
OSL_TRACE( "OOX: Attribute Name outside an Attribute List" );
}
- break;
+ return this;
}
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
} }
diff --git a/oox/source/ppt/commonbehaviorcontext.hxx b/oox/source/ppt/commonbehaviorcontext.hxx
index e047bbc46c7f..4415687f0b06 100644
--- a/oox/source/ppt/commonbehaviorcontext.hxx
+++ b/oox/source/ppt/commonbehaviorcontext.hxx
@@ -50,24 +50,17 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- CommonBehaviorContext( ::oox::core::ContextHandler& rParent,
+ CommonBehaviorContext( ::oox::core::FragmentHandler2& rParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode );
~CommonBehaviorContext( )
throw( );
- virtual void SAL_CALL endFastElement( sal_Int32 aElement )
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
+ virtual void onEndElement();
- virtual void SAL_CALL characters( const ::rtl::OUString& aChars )
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
+ virtual void onCharacters( const ::rtl::OUString& aChars );
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ )
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
private:
bool mbInAttrList;
diff --git a/oox/source/ppt/commontimenodecontext.cxx b/oox/source/ppt/commontimenodecontext.cxx
index ac88c8c67a1a..30b630cacf72 100644
--- a/oox/source/ppt/commontimenodecontext.cxx
+++ b/oox/source/ppt/commontimenodecontext.cxx
@@ -374,7 +374,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
// END
CommonTimeNodeContext::CommonTimeNodeContext(
- ContextHandler& rParent,
+ FragmentHandler2& rParent,
sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode )
@@ -614,39 +614,34 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
}
- void SAL_CALL CommonTimeNodeContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
+ void CommonTimeNodeContext::onEndElement()
{
- if( aElement == ( PPT_TOKEN( iterate ) ) )
+ if( isCurrentElement( PPT_TOKEN( iterate ) ) )
{
mbIterate = false;
}
}
- Reference< XFastContextHandler > SAL_CALL CommonTimeNodeContext::createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+ ::oox::core::ContextHandlerRef CommonTimeNodeContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
switch ( aElementToken )
{
case PPT_TOKEN( childTnLst ):
case PPT_TOKEN( subTnLst ):
- xRet.set( new TimeNodeListContext( *this, mpNode->getChildren() ) );
- break;
+ return new TimeNodeListContext( *this, mpNode->getChildren() );
case PPT_TOKEN( stCondLst ):
- xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getStartCondition() ) );
- break;
+ return new CondListContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode, mpNode->getStartCondition() );
case PPT_TOKEN( endCondLst ):
- xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getEndCondition() ) );
- break;
+ return new CondListContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode, mpNode->getEndCondition() );
case PPT_TOKEN( endSync ):
- xRet.set( new CondContext( *this, xAttribs, mpNode, mpNode->getEndSyncValue() ) );
- break;
+ return new CondContext( *this, rAttribs.getFastAttributeList(), mpNode, mpNode->getEndSyncValue() );
case PPT_TOKEN( iterate ):
{
- sal_Int32 nVal = xAttribs->getOptionalValueToken( XML_type, XML_el );
+ sal_Int32 nVal = rAttribs.getToken( XML_type, XML_el );
if( nVal != 0 )
{
// TODO put that in a function
@@ -671,37 +666,31 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
mpNode->getNodeProperties()[ NP_ITERATETYPE ] <<= nEnum;
}
// in case of exception we ignore the whole tag.
- AttributeList attribs( xAttribs );
// TODO what to do with this
- /*bool bBackwards =*/ attribs.getBool( XML_backwards, false );
+ /*bool bBackwards =*/ rAttribs.getBool( XML_backwards, false );
mbIterate = true;
- break;
+ return this;
}
case PPT_TOKEN( tmAbs ):
if( mbIterate )
{
- AttributeList attribs( xAttribs );
- double fTime = attribs.getUnsigned( XML_val, 0 );
+ double fTime = rAttribs.getUnsigned( XML_val, 0 );
// time in ms. property is in % TODO
mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fTime;
}
- break;
+ return this;
case PPT_TOKEN( tmPct ):
if( mbIterate )
{
- AttributeList attribs( xAttribs );
- double fPercent = (double)attribs.getUnsigned( XML_val, 0 ) / 100000.0;
+ double fPercent = (double)rAttribs.getUnsigned( XML_val, 0 ) / 100000.0;
mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fPercent;
}
- break;
+ return this;
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
} }
diff --git a/oox/source/ppt/commontimenodecontext.hxx b/oox/source/ppt/commontimenodecontext.hxx
index cb67433ee398..0cdb8be7868e 100644
--- a/oox/source/ppt/commontimenodecontext.hxx
+++ b/oox/source/ppt/commontimenodecontext.hxx
@@ -44,12 +44,12 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- CommonTimeNodeContext( ::oox::core::ContextHandler& rParent, sal_Int32 aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode);
+ CommonTimeNodeContext( ::oox::core::FragmentHandler2& rParent, sal_Int32 aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode);
~CommonTimeNodeContext( ) throw( );
- virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void onEndElement();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
private:
bool mbIterate;
diff --git a/oox/source/ppt/conditioncontext.cxx b/oox/source/ppt/conditioncontext.cxx
index 97dd7f9bfcd5..6be6b1f0753a 100644
--- a/oox/source/ppt/conditioncontext.cxx
+++ b/oox/source/ppt/conditioncontext.cxx
@@ -51,7 +51,7 @@ using namespace ::com::sun::star::animations;
namespace oox { namespace ppt {
- CondContext::CondContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs,
+ CondContext::CondContext( FragmentHandler2& rParent, const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode, AnimationCondition & aValue )
: TimeNodeContext( rParent, PPT_TOKEN( cond ), xAttribs, pNode )
, maCond( aValue )
@@ -116,10 +116,8 @@ namespace oox { namespace ppt {
}
}
- Reference< XFastContextHandler > SAL_CALL CondContext::createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+ ::oox::core::ContextHandlerRef CondContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch( aElementToken )
{
case PPT_TOKEN( rtn ):
@@ -127,7 +125,7 @@ namespace oox { namespace ppt {
// ST_TLTriggerRuntimeNode { first, last, all }
sal_Int32 aTok;
sal_Int16 nEnum;
- aTok = xAttribs->getOptionalValueToken( XML_val, XML_first );
+ aTok = rAttribs.getToken( XML_val, XML_first );
switch( aTok )
{
case XML_first:
@@ -144,28 +142,23 @@ namespace oox { namespace ppt {
}
maCond.mnType = aElementToken;
maCond.maValue = makeAny( nEnum );
- break;
+ return this;
}
case PPT_TOKEN( tn ):
{
maCond.mnType = aElementToken;
- AttributeList attribs( xAttribs );
- sal_uInt32 nId = attribs.getUnsigned( XML_val, 0 );
+ sal_uInt32 nId = rAttribs.getUnsigned( XML_val, 0 );
maCond.maValue = makeAny( nId );
- break;
+ return this;
}
case PPT_TOKEN( tgtEl ):
// CT_TLTimeTargetElement
- xRet.set( new TimeTargetElementContext( *this, maCond.getTarget() ) );
- break;
+ return new TimeTargetElementContext( *this, maCond.getTarget() );
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
@@ -173,7 +166,7 @@ namespace oox { namespace ppt {
/** CT_TLTimeConditionList */
CondListContext::CondListContext(
- ContextHandler& rParent, sal_Int32 aElement,
+ FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode,
AnimationConditionList & aCond )
@@ -187,25 +180,19 @@ namespace oox { namespace ppt {
{
}
- Reference< XFastContextHandler > CondListContext::createFastChildContext( ::sal_Int32 aElement, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+ ::oox::core::ContextHandlerRef CondListContext::onCreateContext( sal_Int32 aElement, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch( aElement )
{
case PPT_TOKEN( cond ):
// add a condition to the list
maConditions.push_back( AnimationCondition() );
- xRet.set( new CondContext( *this, xAttribs, mpNode, maConditions.back() ) );
+ return new CondContext( *this, rAttribs.getFastAttributeList(), mpNode, maConditions.back() );
break;
default:
break;
}
-
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
diff --git a/oox/source/ppt/conditioncontext.hxx b/oox/source/ppt/conditioncontext.hxx
index 3abd050da006..ff387a123193 100644
--- a/oox/source/ppt/conditioncontext.hxx
+++ b/oox/source/ppt/conditioncontext.hxx
@@ -46,11 +46,11 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- CondContext( ::oox::core::ContextHandler& rParent,
+ CondContext( ::oox::core::FragmentHandler2& rParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode, AnimationCondition & aCond );
~CondContext( ) throw( );
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
private:
// ::com::sun::star::uno::Any & maCond;
@@ -66,13 +66,13 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- CondListContext( ::oox::core::ContextHandler& rParent,
+ CondListContext( ::oox::core::FragmentHandler2& rParent,
sal_Int32 aElement,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode, AnimationConditionList & aCondList );
~CondListContext( ) throw( );
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
private:
AnimationConditionList & maConditions;
diff --git a/oox/source/ppt/customshowlistcontext.cxx b/oox/source/ppt/customshowlistcontext.cxx
index 76bac5b7467c..c75ee4e8a370 100644
--- a/oox/source/ppt/customshowlistcontext.cxx
+++ b/oox/source/ppt/customshowlistcontext.cxx
@@ -34,24 +34,22 @@ using namespace ::com::sun::star::xml::sax;
namespace oox { namespace ppt {
-class CustomShowContext : public ::oox::core::ContextHandler
+class CustomShowContext : public ::oox::core::FragmentHandler2
{
CustomShow mrCustomShow;
public:
- CustomShowContext( ::oox::core::ContextHandler& rParent,
+ CustomShowContext( ::oox::core::FragmentHandler2& rParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
CustomShow& rCustomShow );
~CustomShowContext( );
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
- createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ )
- throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
};
-CustomShowContext::CustomShowContext( ContextHandler& rParent,
+CustomShowContext::CustomShowContext( FragmentHandler2& rParent,
const Reference< XFastAttributeList >& rxAttribs,
CustomShow& rCustomShow )
-: ContextHandler( rParent )
+: FragmentHandler2( rParent )
, mrCustomShow( rCustomShow )
{
mrCustomShow.maName = rxAttribs->getOptionalValue( XML_name );
@@ -62,29 +60,25 @@ CustomShowContext::~CustomShowContext( )
{
}
-Reference< XFastContextHandler > SAL_CALL CustomShowContext::createFastChildContext( sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+::oox::core::ContextHandlerRef CustomShowContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
case PPT_TOKEN( sld ) :
- mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
+ mrCustomShow.maSldLst.push_back( rAttribs.getString( R_TOKEN( id ), rtl::OUString() ) );
+ return this;
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
- return xRet;
+ return this;
}
//---------------------------------------------------------------------------
-CustomShowListContext::CustomShowListContext( ContextHandler& rParent,
+CustomShowListContext::CustomShowListContext( FragmentHandler2& rParent,
std::vector< CustomShow >& rCustomShowList )
-: ContextHandler( rParent )
+: FragmentHandler2( rParent )
, mrCustomShowList( rCustomShowList )
{
}
@@ -93,26 +87,21 @@ CustomShowListContext::~CustomShowListContext( )
{
}
-Reference< XFastContextHandler > SAL_CALL CustomShowListContext::createFastChildContext( sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+::oox::core::ContextHandlerRef CustomShowListContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
case PPT_TOKEN( custShow ) :
{
CustomShow aCustomShow;
mrCustomShowList.push_back( aCustomShow );
- xRet = new CustomShowContext( *this, xAttribs, mrCustomShowList.back() );
+ return new CustomShowContext( *this, rAttribs.getFastAttributeList(), mrCustomShowList.back() );
}
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
- return xRet;
+ return this;
}
diff --git a/oox/source/ppt/headerfootercontext.cxx b/oox/source/ppt/headerfootercontext.cxx
index 88a1e7c60894..83963585bd0d 100644
--- a/oox/source/ppt/headerfootercontext.cxx
+++ b/oox/source/ppt/headerfootercontext.cxx
@@ -35,26 +35,25 @@ using namespace ::com::sun::star::xml::sax;
namespace oox { namespace ppt {
- HeaderFooterContext::HeaderFooterContext( ContextHandler& rParent,
- const Reference< XFastAttributeList >& xAttribs, HeaderFooter& rHeaderFooter )
- : ContextHandler( rParent )
+ HeaderFooterContext::HeaderFooterContext( FragmentHandler2& rParent,
+ const AttributeList& rAttribs, HeaderFooter& rHeaderFooter )
+ : FragmentHandler2( rParent )
{
- AttributeList aAttribs( xAttribs );
- if ( xAttribs->hasAttribute( XML_sldNum ) )
+ if ( rAttribs.hasAttribute( XML_sldNum ) )
{
- rHeaderFooter.mbSlideNumber = aAttribs.getBool( XML_sldNum, sal_True );
+ rHeaderFooter.mbSlideNumber = rAttribs.getBool( XML_sldNum, sal_True );
}
- if ( xAttribs->hasAttribute( XML_hdr ) )
+ if ( rAttribs.hasAttribute( XML_hdr ) )
{
- rHeaderFooter.mbHeader = aAttribs.getBool( XML_hdr, sal_True );
+ rHeaderFooter.mbHeader = rAttribs.getBool( XML_hdr, sal_True );
}
- if ( xAttribs->hasAttribute( XML_ftr ) )
+ if ( rAttribs.hasAttribute( XML_ftr ) )
{
- rHeaderFooter.mbFooter = aAttribs.getBool( XML_ftr, sal_True );
+ rHeaderFooter.mbFooter = rAttribs.getBool( XML_ftr, sal_True );
}
- if ( xAttribs->hasAttribute( XML_dt ) )
+ if ( rAttribs.hasAttribute( XML_dt ) )
{
- rHeaderFooter.mbDateTime = aAttribs.getBool( XML_dt, sal_True );
+ rHeaderFooter.mbDateTime = rAttribs.getBool( XML_dt, sal_True );
}
}
diff --git a/oox/source/ppt/headerfootercontext.hxx b/oox/source/ppt/headerfootercontext.hxx
index 7cd83b5f53e4..4cc78b9e7dcf 100644
--- a/oox/source/ppt/headerfootercontext.hxx
+++ b/oox/source/ppt/headerfootercontext.hxx
@@ -32,16 +32,16 @@
#define OOX_PPT_HEADERFOOTERCONTEXT
#include "oox/ppt/headerfooter.hxx"
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
namespace oox { namespace ppt {
/** CT_HeaderFooter */
- class HeaderFooterContext : public ::oox::core::ContextHandler
+ class HeaderFooterContext : public ::oox::core::FragmentHandler2
{
public:
- HeaderFooterContext( ::oox::core::ContextHandler& rParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, HeaderFooter& rHeaderFooter );
+ HeaderFooterContext( ::oox::core::FragmentHandler2& rParent,
+ const AttributeList& rAttribs, HeaderFooter& rHeaderFooter );
~HeaderFooterContext( );
};
diff --git a/oox/source/ppt/layoutfragmenthandler.cxx b/oox/source/ppt/layoutfragmenthandler.cxx
index 19a9e6ead026..6697f8190db2 100644
--- a/oox/source/ppt/layoutfragmenthandler.cxx
+++ b/oox/source/ppt/layoutfragmenthandler.cxx
@@ -60,27 +60,20 @@ LayoutFragmentHandler::~LayoutFragmentHandler()
}
-Reference< XFastContextHandler > LayoutFragmentHandler::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs )
- throw (SAXException, RuntimeException)
+ContextHandlerRef LayoutFragmentHandler::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet = getFastContextHandler();
switch( aElementToken )
{
case PPT_TOKEN( sldLayout ): // CT_SlideLayout
- mpSlidePersistPtr->setLayoutValueToken( xAttribs->getOptionalValueToken( XML_type, 0 ) ); // CT_SlideLayoutType
+ mpSlidePersistPtr->setLayoutValueToken( rAttribs.getToken( XML_type, 0 ) ); // CT_SlideLayoutType
break;
case PPT_TOKEN( hf ): // CT_HeaderFooter
- xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) );
+ return new HeaderFooterContext( *this, rAttribs, mpSlidePersistPtr->getHeaderFooter() );
break;
default:
- xRet.set( SlideFragmentHandler::createFastChildContext( aElementToken, xAttribs ) );
+ return SlideFragmentHandler::onCreateContext( aElementToken, rAttribs );
}
- return xRet;
-}
-
-void SAL_CALL LayoutFragmentHandler::endDocument()
- throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
+ return this;
}
} }
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 31a2781d845b..e9fe6994472e 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -61,7 +61,7 @@ using namespace ::com::sun::star::xml::sax;
namespace oox { namespace ppt {
PresentationFragmentHandler::PresentationFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath ) throw()
-: FragmentHandler( rFilter, rFragmentPath )
+: FragmentHandler2( rFilter, rFragmentPath )
, mpTextListStyle( new TextListStyle )
{
TextParagraphPropertiesVector& rParagraphDefaulsVector( mpTextListStyle->getListStyle() );
@@ -76,10 +76,6 @@ PresentationFragmentHandler::PresentationFragmentHandler( XmlFilterBase& rFilter
PresentationFragmentHandler::~PresentationFragmentHandler() throw()
{
-
-}
-void PresentationFragmentHandler::startDocument() throw (SAXException, RuntimeException)
-{
}
void ResolveTextFields( XmlFilterBase& rFilter )
@@ -142,7 +138,7 @@ void ResolveTextFields( XmlFilterBase& rFilter )
}
}
-void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeException)
+void PresentationFragmentHandler::finalizeImport()
{
// todo: localized progress bar text
const Reference< task::XStatusIndicator >& rxStatusIndicator( getFilter().getStatusIndicator() );
@@ -300,41 +296,36 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
}
// CT_Presentation
-Reference< XFastContextHandler > PresentationFragmentHandler::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+::oox::core::ContextHandlerRef PresentationFragmentHandler::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
case PPT_TOKEN( presentation ):
case PPT_TOKEN( sldMasterIdLst ):
case PPT_TOKEN( notesMasterIdLst ):
case PPT_TOKEN( sldIdLst ):
- break;
+ return this;
case PPT_TOKEN( sldMasterId ):
- maSlideMasterVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
- break;
+ maSlideMasterVector.push_back( rAttribs.getString( R_TOKEN( id ), OUString() ) );
+ return this;
case PPT_TOKEN( sldId ):
- maSlidesVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
- break;
+ maSlidesVector.push_back( rAttribs.getString( R_TOKEN( id ), OUString() ) );
+ return this;
case PPT_TOKEN( notesMasterId ):
- maNotesMasterVector.push_back( xAttribs->getOptionalValue(R_TOKEN( id ) ) );
- break;
+ maNotesMasterVector.push_back( rAttribs.getString( R_TOKEN( id ), OUString() ) );
+ return this;
case PPT_TOKEN( sldSz ):
- maSlideSize = GetSize2D( xAttribs );
- break;
+ maSlideSize = GetSize2D( rAttribs.getFastAttributeList() );
+ return this;
case PPT_TOKEN( notesSz ):
- maNotesSize = GetSize2D( xAttribs );
- break;
+ maNotesSize = GetSize2D( rAttribs.getFastAttributeList() );
+ return this;
case PPT_TOKEN( custShowLst ):
- xRet.set( new CustomShowListContext( *this, maCustomShowList ) );
- break;
+ return new CustomShowListContext( *this, maCustomShowList );
case PPT_TOKEN( defaultTextStyle ):
- xRet.set( new TextListStyleContext( *this, *mpTextListStyle ) );
- break;
+ return new TextListStyleContext( *this, *mpTextListStyle );
}
- if ( !xRet.is() )
- xRet = getFastContextHandler();
- return xRet;
+ return this;
}
bool PresentationFragmentHandler::importSlide( const FragmentHandlerRef& rxSlideFragmentHandler,
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index 48a53a5f7e1f..4652690e7765 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -59,7 +59,7 @@ using namespace ::com::sun::star::container;
namespace oox { namespace ppt {
SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, SlidePersistPtr pPersistPtr, const ShapeLocation eShapeLocation ) throw()
-: FragmentHandler( rFilter, rFragmentPath )
+: FragmentHandler2( rFilter, rFragmentPath )
, mpSlidePersistPtr( pPersistPtr )
, meShapeLocation( eShapeLocation )
{
@@ -75,109 +75,102 @@ SlideFragmentHandler::~SlideFragmentHandler() throw()
mpSlidePersistPtr->getDrawing()->convertAndInsert();
}
-Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+::oox::core::ContextHandlerRef SlideFragmentHandler::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
- AttributeList aAttribs( xAttribs );
-
switch( aElementToken )
{
case PPT_TOKEN( sldMaster ): // CT_SlideMaster
case PPT_TOKEN( handoutMaster ): // CT_HandoutMaster
case PPT_TOKEN( sld ): // CT_CommonSlideData
{
- AttributeList attribs( xAttribs );
-
Reference< XDrawPage > xSlide( mpSlidePersistPtr->getPage() );
PropertyMap aPropMap;
PropertySet aSlideProp( xSlide );
- aPropMap[ PROP_Visible ] = Any( attribs.getBool( XML_show, sal_True ) );
+ aPropMap[ PROP_Visible ] = Any( rAttribs.getBool( XML_show, sal_True ) );
aSlideProp.setProperties( aPropMap );
- break;
+ return this;
}
case PPT_TOKEN( notes ): // CT_NotesSlide
case PPT_TOKEN( notesMaster ): // CT_NotesMaster
- break;
+ return this;
case PPT_TOKEN( cSld ): // CT_CommonSlideData
- maSlideName = xAttribs->getOptionalValue(XML_name);
- break;
+ maSlideName = rAttribs.getString(XML_name, OUString());
+ return this;
case PPT_TOKEN( spTree ): // CT_GroupShape
{
- xRet.set( new PPTShapeGroupContext(
+ // TODO Convert this to FragmentHandler2
+ return new PPTShapeGroupContext(
*this, mpSlidePersistPtr, meShapeLocation, mpSlidePersistPtr->getShapes(),
- oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) ) );
+ oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) );
}
break;
case PPT_TOKEN( controls ):
- xRet = getFastContextHandler();
- break;
+ return this;
case PPT_TOKEN( control ):
{
::oox::vml::ControlInfo aInfo;
- aInfo.setShapeId( aAttribs.getInteger( XML_spid, 0 ) );
- aInfo.maFragmentPath = getFragmentPathFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) );
- aInfo.maName = aAttribs.getXString( XML_name, OUString() );
+ aInfo.setShapeId( rAttribs.getInteger( XML_spid, 0 ) );
+ aInfo.maFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
+ aInfo.maName = rAttribs.getXString( XML_name, OUString() );
mpSlidePersistPtr->getDrawing()->registerControl( aInfo );
}
- return xRet;
+ return this;
case PPT_TOKEN( timing ): // CT_SlideTiming
- xRet.set( new SlideTimingContext( *this, mpSlidePersistPtr->getTimeNodeList() ) );
- break;
+ return new SlideTimingContext( *this, mpSlidePersistPtr->getTimeNodeList() );
case PPT_TOKEN( transition ): // CT_SlideTransition
- xRet.set( new SlideTransitionContext( *this, xAttribs, maSlideProperties ) );
- break;
+ return new SlideTransitionContext( *this, rAttribs, maSlideProperties );
case PPT_TOKEN( hf ):
- xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) );
- break;
+ return new HeaderFooterContext( *this, rAttribs, mpSlidePersistPtr->getHeaderFooter() );
// BackgroundGroup
+ case PPT_TOKEN( bg ):
+ return this;
case PPT_TOKEN( bgPr ): // CT_BackgroundProperties
{
FillPropertiesPtr pFillPropertiesPtr( new FillProperties );
- xRet.set( new BackgroundPropertiesContext( *this, *pFillPropertiesPtr ) );
mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr );
+ return new BackgroundPropertiesContext( *this, *pFillPropertiesPtr );
}
break;
case PPT_TOKEN( bgRef ): // a:CT_StyleMatrixReference
{
FillPropertiesPtr pFillPropertiesPtr( new FillProperties(
- *mpSlidePersistPtr->getTheme()->getFillStyle( xAttribs->getOptionalValue( XML_idx ).toInt32() ) ) );
- xRet.set( new ColorContext( *this, mpSlidePersistPtr->getBackgroundColor() ) );
+ *mpSlidePersistPtr->getTheme()->getFillStyle( rAttribs.getInteger( XML_idx, -1 ) ) ) );
+ ContextHandlerRef ret = new ColorContext( *this, mpSlidePersistPtr->getBackgroundColor() );
mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr );
+ return ret;
}
break;
case PPT_TOKEN( clrMap ): // CT_ColorMapping
{
oox::drawingml::ClrMapPtr pClrMapPtr( new oox::drawingml::ClrMap() );
- xRet.set( new oox::drawingml::clrMapContext( *this, xAttribs, *pClrMapPtr ) );
+ ContextHandlerRef ret = new oox::drawingml::clrMapContext( *this, rAttribs.getFastAttributeList(), *pClrMapPtr );
mpSlidePersistPtr->setClrMap( pClrMapPtr );
+ return ret;
}
break;
case PPT_TOKEN( clrMapOvr ): // CT_ColorMappingOverride
case PPT_TOKEN( sldLayoutIdLst ): // CT_SlideLayoutIdList
- break;
+ return this;
case PPT_TOKEN( txStyles ): // CT_SlideMasterTextStyles
- xRet.set( new SlideMasterTextStylesContext( *this, mpSlidePersistPtr ) );
+ return new SlideMasterTextStylesContext( *this, mpSlidePersistPtr );
break;
case PPT_TOKEN( custDataLst ): // CT_CustomerDataList
case PPT_TOKEN( tagLst ): // CT_TagList
- break;
+ return this;
}
- if( !xRet.is() )
- xRet = getFastContextHandler();
-
- return xRet;
+ return this;
}
-void SAL_CALL SlideFragmentHandler::endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+void SlideFragmentHandler::finalizeImport()
{
try
{
diff --git a/oox/source/ppt/slidemastertextstylescontext.cxx b/oox/source/ppt/slidemastertextstylescontext.cxx
index 08b7aaf4af7c..2d1e59c0382d 100644
--- a/oox/source/ppt/slidemastertextstylescontext.cxx
+++ b/oox/source/ppt/slidemastertextstylescontext.cxx
@@ -37,8 +37,8 @@ using namespace ::com::sun::star::xml::sax;
namespace oox { namespace ppt {
-SlideMasterTextStylesContext::SlideMasterTextStylesContext( ContextHandler& rParent, SlidePersistPtr pSlidePersistPtr )
-: ContextHandler( rParent )
+SlideMasterTextStylesContext::SlideMasterTextStylesContext( FragmentHandler2& rParent, SlidePersistPtr pSlidePersistPtr )
+: FragmentHandler2( rParent )
, mpSlidePersistPtr( pSlidePersistPtr )
{
}
@@ -47,10 +47,9 @@ SlideMasterTextStylesContext::~SlideMasterTextStylesContext()
{
}
-Reference< XFastContextHandler > SlideMasterTextStylesContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& /* xAttribs */ ) throw (SAXException, RuntimeException)
+::oox::core::ContextHandlerRef SlideMasterTextStylesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& /*rAttribs*/ )
{
oox::drawingml::TextListStylePtr aTextListStylePtr;
- Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
case PPT_TOKEN( titleStyle ):
@@ -78,12 +77,10 @@ Reference< XFastContextHandler > SlideMasterTextStylesContext::createFastChildCo
{ // are obtained. i got some documents without having the textsize set at
for ( int i = 0; i < 9; i++ ) // any point, the master reference application is using 18pt then
aTextListStylePtr->getListStyle()[ i ]->getTextCharacterProperties().moHeight = 1800;
- xRet.set( new oox::drawingml::TextListStyleContext( *this, *aTextListStylePtr ) );
+ return new oox::drawingml::TextListStyleContext( *this, *aTextListStylePtr );
}
- if( !xRet.is() )
- xRet.set( this );
- return xRet;
+ return this;
}
} }
diff --git a/oox/source/ppt/slidetimingcontext.cxx b/oox/source/ppt/slidetimingcontext.cxx
index 6c4fcf76a9d2..31738a580e57 100644
--- a/oox/source/ppt/slidetimingcontext.cxx
+++ b/oox/source/ppt/slidetimingcontext.cxx
@@ -49,8 +49,8 @@ using namespace ::com::sun::star::container;
namespace oox { namespace ppt {
-SlideTimingContext::SlideTimingContext( ContextHandler& rParent, TimeNodePtrList & aTimeNodeList ) throw()
- : ContextHandler( rParent )
+SlideTimingContext::SlideTimingContext( FragmentHandler2& rParent, TimeNodePtrList & aTimeNodeList ) throw()
+ : FragmentHandler2( rParent )
, maTimeNodeList( aTimeNodeList )
{
}
@@ -60,42 +60,26 @@ SlideTimingContext::~SlideTimingContext() throw()
}
-void SlideTimingContext::endFastElement( sal_Int32 /*aElement*/ ) throw ( SAXException, RuntimeException)
+::oox::core::ContextHandlerRef SlideTimingContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
-}
-
-
-Reference< XFastContextHandler > SlideTimingContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
-{
- Reference< XFastContextHandler > xRet;
-
switch( aElementToken )
{
case PPT_TOKEN( bldLst ):
- xRet.set( new BuildListContext( *this, xAttribs, maTimeNodeList ) );
- break;
+ return new BuildListContext( *this, rAttribs.getFastAttributeList(), maTimeNodeList );
case PPT_TOKEN( extLst ):
- return xRet;
+ return this;
case PPT_TOKEN( tnLst ):
// timing nodes
{
- xRet.set( new TimeNodeListContext( *this, maTimeNodeList ) );
+ return new TimeNodeListContext( *this, maTimeNodeList );
}
break;
default:
- break;
+ return this;
}
- if( !xRet.is() )
- xRet.set(this);
-
- return xRet;
-}
-
-void SAL_CALL SlideTimingContext::endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
-
+ return this;
}
} }
diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx
index c7f61912f44e..c74e0d89a2a7 100644
--- a/oox/source/ppt/slidetransitioncontext.cxx
+++ b/oox/source/ppt/slidetransitioncontext.cxx
@@ -51,23 +51,21 @@ using namespace ::com::sun::star::container;
namespace oox { namespace ppt {
-SlideTransitionContext::SlideTransitionContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs, PropertyMap & aProperties ) throw()
-: ContextHandler( rParent )
+SlideTransitionContext::SlideTransitionContext( FragmentHandler2& rParent, const AttributeList& rAttribs, PropertyMap & aProperties ) throw()
+: FragmentHandler2( rParent )
, maSlideProperties( aProperties )
, mbHasTransition( sal_False )
{
- AttributeList attribs(xAttribs);
-
// ST_TransitionSpeed
- maTransition.setOoxTransitionSpeed( xAttribs->getOptionalValueToken( XML_spd, XML_fast ) );
+ maTransition.setOoxTransitionSpeed( rAttribs.getToken( XML_spd, XML_fast ) );
// TODO
- attribs.getBool( XML_advClick, true );
+ rAttribs.getBool( XML_advClick, true );
// careful. if missing, no auto advance... 0 looks like a valid value
// for auto advance
- if(attribs.hasAttribute( XML_advTm ))
- maTransition.setOoxAdvanceTime( attribs.getInteger( XML_advTm, -1 ) );
+ if(rAttribs.hasAttribute( XML_advTm ))
+ maTransition.setOoxAdvanceTime( rAttribs.getInteger( XML_advTm, -1 ) );
}
SlideTransitionContext::~SlideTransitionContext() throw()
@@ -75,10 +73,8 @@ SlideTransitionContext::~SlideTransitionContext() throw()
}
-Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+::oox::core::ContextHandlerRef SlideTransitionContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch( aElementToken )
{
case PPT_TOKEN( blinds ):
@@ -88,67 +84,65 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
if (!mbHasTransition)
{
mbHasTransition = true;
- maTransition.setOoxTransitionType( aElementToken, xAttribs->getOptionalValueToken( XML_dir, XML_horz ), 0);
+ maTransition.setOoxTransitionType( aElementToken, rAttribs.getToken( XML_dir, XML_horz ), 0);
// ST_Direction { XML_horz, XML_vert }
}
- break;
+ return this;
case PPT_TOKEN( cover ):
case PPT_TOKEN( pull ):
if (!mbHasTransition)
{
mbHasTransition = true;
- maTransition.setOoxTransitionType( aElementToken, xAttribs->getOptionalValueToken( XML_dir, XML_l ), 0 );
+ maTransition.setOoxTransitionType( aElementToken, rAttribs.getToken( XML_dir, XML_l ), 0 );
// ST_TransitionEightDirectionType { ST_TransitionSideDirectionType {
// XML_d, XML_d, XML_r, XML_u },
// ST_TransitionCornerDirectionType {
// XML_ld, XML_lu, XML_rd, XML_ru }
}
- break;
+ return this;
case PPT_TOKEN( cut ):
case PPT_TOKEN( fade ):
if (!mbHasTransition)
{
mbHasTransition = true;
- AttributeList attribs(xAttribs);
// CT_OptionalBlackTransition xdb:bool
- maTransition.setOoxTransitionType( aElementToken, attribs.getBool( XML_thruBlk, false ), 0);
+ maTransition.setOoxTransitionType( aElementToken, rAttribs.getBool( XML_thruBlk, false ), 0);
}
- break;
+ return this;
case PPT_TOKEN( push ):
case PPT_TOKEN( wipe ):
if (!mbHasTransition)
{
mbHasTransition = true;
- maTransition.setOoxTransitionType( aElementToken, xAttribs->getOptionalValueToken( XML_dir, XML_l ), 0 );
+ maTransition.setOoxTransitionType( aElementToken, rAttribs.getToken( XML_dir, XML_l ), 0 );
// ST_TransitionSideDirectionType { XML_d, XML_l, XML_r, XML_u }
}
- break;
+ return this;
case PPT_TOKEN( split ):
if (!mbHasTransition)
{
mbHasTransition = true;
- maTransition.setOoxTransitionType( aElementToken, xAttribs->getOptionalValueToken( XML_orient, XML_horz ), xAttribs->getOptionalValueToken( XML_dir, XML_out ) );
+ maTransition.setOoxTransitionType( aElementToken, rAttribs.getToken( XML_orient, XML_horz ), rAttribs.getToken( XML_dir, XML_out ) );
// ST_Direction { XML_horz, XML_vert }
// ST_TransitionInOutDirectionType { XML_out, XML_in }
}
- break;
+ return this;
case PPT_TOKEN( zoom ):
if (!mbHasTransition)
{
mbHasTransition = true;
- maTransition.setOoxTransitionType( aElementToken, xAttribs->getOptionalValueToken( XML_dir, XML_out ), 0 );
+ maTransition.setOoxTransitionType( aElementToken, rAttribs.getToken( XML_dir, XML_out ), 0 );
// ST_TransitionInOutDirectionType { XML_out, XML_in }
}
- break;
+ return this;
case PPT_TOKEN( wheel ):
if (!mbHasTransition)
{
mbHasTransition = true;
- AttributeList attribs(xAttribs);
- maTransition.setOoxTransitionType( aElementToken, attribs.getUnsigned( XML_spokes, 4 ), 0 );
+ maTransition.setOoxTransitionType( aElementToken, rAttribs.getUnsigned( XML_spokes, 4 ), 0 );
// unsignedInt
}
- break;
+ return this;
case PPT_TOKEN( circle ):
case PPT_TOKEN( diamond ):
case PPT_TOKEN( dissolve ):
@@ -162,28 +156,23 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
mbHasTransition = true;
maTransition.setOoxTransitionType( aElementToken, 0, 0 );
}
- break;
-
+ return this;
case PPT_TOKEN( sndAc ): // CT_TransitionSoundAction
//"Sound"
- xRet.set( new SoundActionContext ( *this, maSlideProperties ) );
- break;
+ return new SoundActionContext ( *this, maSlideProperties );
case PPT_TOKEN( extLst ): // CT_OfficeArtExtensionList
- return xRet;
+ return this;
default:
break;
}
- if( !xRet.is() )
- xRet.set(this);
-
- return xRet;
+ return this;
}
-void SlideTransitionContext::endFastElement( sal_Int32 aElement ) throw (::com::sun::star::xml::sax::SAXException, RuntimeException)
+void SlideTransitionContext::onEndElement()
{
- if( aElement == (PPT_TOKEN( transition )) )
+ if( isCurrentElement(PPT_TOKEN( transition )) )
{
if( mbHasTransition )
{
diff --git a/oox/source/ppt/soundactioncontext.cxx b/oox/source/ppt/soundactioncontext.cxx
index 64a24963ab66..7b510beda983 100644
--- a/oox/source/ppt/soundactioncontext.cxx
+++ b/oox/source/ppt/soundactioncontext.cxx
@@ -44,8 +44,8 @@ using namespace ::com::sun::star::uno;
namespace oox { namespace ppt {
- SoundActionContext::SoundActionContext( ContextHandler& rParent, PropertyMap & aProperties ) throw()
- : ContextHandler( rParent )
+ SoundActionContext::SoundActionContext( FragmentHandler2& rParent, PropertyMap & aProperties ) throw()
+ : FragmentHandler2( rParent )
, maSlideProperties( aProperties )
, mbHasStartSound( false )
, mbLoopSound( false )
@@ -59,9 +59,9 @@ namespace oox { namespace ppt {
}
- void SoundActionContext::endFastElement( sal_Int32 aElement ) throw (SAXException, RuntimeException)
+ void SoundActionContext::onEndElement()
{
- if ( aElement == PPT_TOKEN( sndAc ) )
+ if ( isCurrentElement( PPT_TOKEN( sndAc ) ) )
{
if( mbHasStartSound )
{
@@ -97,37 +97,32 @@ namespace oox { namespace ppt {
}
- Reference< XFastContextHandler > SoundActionContext::createFastChildContext( ::sal_Int32 aElement, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+ ::oox::core::ContextHandlerRef SoundActionContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
- AttributeList attribs(xAttribs);
-
- switch( aElement )
+ switch( aElementToken )
{
case PPT_TOKEN( snd ):
if( mbHasStartSound )
{
drawingml::EmbeddedWAVAudioFile aAudio;
- drawingml::getEmbeddedWAVAudioFile( getRelations(), xAttribs, aAudio);
+ drawingml::getEmbeddedWAVAudioFile( getRelations(), rAttribs.getFastAttributeList(), aAudio);
msSndName = ( aAudio.mbBuiltIn ? aAudio.msName : aAudio.msEmbed );
}
- break;
+ return this;
case PPT_TOKEN( endSnd ):
// CT_Empty
mbStopSound = true;
- break;
+ return this;
case PPT_TOKEN( stSnd ):
mbHasStartSound = true;
- mbLoopSound = attribs.getBool( XML_loop, false );
+ mbLoopSound = rAttribs.getBool( XML_loop, false );
+ return this;
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
diff --git a/oox/source/ppt/timeanimvaluecontext.cxx b/oox/source/ppt/timeanimvaluecontext.cxx
index fd247de41a86..8feb1e623d28 100644
--- a/oox/source/ppt/timeanimvaluecontext.cxx
+++ b/oox/source/ppt/timeanimvaluecontext.cxx
@@ -36,10 +36,10 @@ using namespace ::com::sun::star::xml::sax;
namespace oox { namespace ppt {
- TimeAnimValueListContext::TimeAnimValueListContext( ContextHandler& rParent,
+ TimeAnimValueListContext::TimeAnimValueListContext( FragmentHandler2& rParent,
const Reference< XFastAttributeList >& /*xAttribs*/,
TimeAnimationValueList & aTavList )
- : ContextHandler( rParent )
+ : FragmentHandler2( rParent )
, maTavList( aTavList )
, mbInValue( false )
{
@@ -51,21 +51,17 @@ namespace oox { namespace ppt {
}
- void SAL_CALL TimeAnimValueListContext::endFastElement( sal_Int32 aElement )
- throw ( SAXException, RuntimeException)
+ void TimeAnimValueListContext::onEndElement()
{
- if( aElement == PPT_TOKEN( tav ) )
+ if( isCurrentElement( PPT_TOKEN( tav ) ) )
{
mbInValue = false;
}
}
- Reference< XFastContextHandler > SAL_CALL TimeAnimValueListContext::createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+ ::oox::core::ContextHandlerRef TimeAnimValueListContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
switch ( aElementToken )
{
@@ -73,26 +69,23 @@ namespace oox { namespace ppt {
{
mbInValue = true;
TimeAnimationValue val;
- val.msFormula = xAttribs->getOptionalValue( XML_fmla );
- val.msTime = xAttribs->getOptionalValue( XML_tm );
+ val.msFormula = rAttribs.getString( XML_fmla, rtl::OUString() );
+ val.msTime = rAttribs.getString( XML_tm, rtl::OUString() );
maTavList.push_back( val );
- break;
+ return this;
}
case PPT_TOKEN( val ):
if( mbInValue )
{
// CT_TLAnimVariant
- xRet.set( new AnimVariantContext( *this, aElementToken, maTavList.back().maValue ) );
+ return new AnimVariantContext( *this, aElementToken, maTavList.back().maValue );
}
break;
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
diff --git a/oox/source/ppt/timeanimvaluecontext.hxx b/oox/source/ppt/timeanimvaluecontext.hxx
index 10041e2ac413..173e9c19bf5b 100644
--- a/oox/source/ppt/timeanimvaluecontext.hxx
+++ b/oox/source/ppt/timeanimvaluecontext.hxx
@@ -31,26 +31,25 @@
#ifndef OOX_PPT_TIMEANIMVALUELISTCONTEXT
#define OOX_PPT_TIMEANIMVALUELISTCONTEXT
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
#include "oox/ppt/animationspersist.hxx"
namespace oox { namespace ppt {
/** CT_TLTimeAnimateValueList */
class TimeAnimValueListContext
- : public ::oox::core::ContextHandler
+ : public ::oox::core::FragmentHandler2
{
public:
- TimeAnimValueListContext( ::oox::core::ContextHandler& rParent,
+ TimeAnimValueListContext( ::oox::core::FragmentHandler2& rParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
TimeAnimationValueList & aTavList );
~TimeAnimValueListContext( );
- virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void onEndElement();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
private:
TimeAnimationValueList & maTavList;
diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx
index 9aa72213dfe6..ab250d98d10f 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -117,7 +117,7 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- MediaNodeContext( ContextHandler& rParent, sal_Int32 aElement,
+ MediaNodeContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode )
: TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -139,9 +139,9 @@ namespace oox { namespace ppt {
}
}
- virtual void SAL_CALL endFastElement( sal_Int32 aElement )
- throw ( SAXException, RuntimeException)
+ virtual void onEndElement()
{
+ sal_Int32 aElement = getCurrentElement();
if( aElement == PPT_TOKEN( audio ) )
{
// TODO deal with mbIsNarration
@@ -152,25 +152,18 @@ namespace oox { namespace ppt {
}
}
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( cBhvr ):
- xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
+ return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
break;
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
private:
@@ -185,7 +178,7 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- SetTimeNodeContext( ContextHandler& rParent, sal_Int32 aElement,
+ SetTimeNodeContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode )
: TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -212,35 +205,20 @@ namespace oox { namespace ppt {
}
- virtual void SAL_CALL endFastElement( sal_Int32 /*aElement*/ )
- throw ( SAXException, RuntimeException)
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- }
-
-
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
- {
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( cBhvr ):
- xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
- break;
+ return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
case PPT_TOKEN( to ):
// CT_TLAnimVariant
- xRet.set( new AnimVariantContext( *this, aElementToken, maTo ) );
- break;
+ return new AnimVariantContext( *this, aElementToken, maTo );
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
private:
Any maTo;
@@ -252,7 +230,7 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- CmdTimeNodeContext( ContextHandler& rParent, sal_Int32 aElement,
+ CmdTimeNodeContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode )
: TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -273,10 +251,9 @@ namespace oox { namespace ppt {
{
}
- virtual void SAL_CALL endFastElement( sal_Int32 aElement )
- throw ( SAXException, RuntimeException)
+ virtual void onEndElement()
{
- if( aElement == PPT_TOKEN( cmd ) )
+ if( isCurrentElement( PPT_TOKEN( cmd ) ) )
{
try {
// see sd/source/filter/ppt/pptinanimations.cxx
@@ -347,25 +324,17 @@ namespace oox { namespace ppt {
}
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( cBhvr ):
- xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
- break;
+ return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
private:
@@ -380,7 +349,7 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- SequenceTimeNodeContext( ContextHandler& rParent, sal_Int32 aElement,
+ SequenceTimeNodeContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode )
: TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -400,33 +369,23 @@ namespace oox { namespace ppt {
}
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( cTn ):
- xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
- break;
+ return new CommonTimeNodeContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode );
case PPT_TOKEN( nextCondLst ):
- xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode,
- mpNode->getNextCondition() ) );
- break;
+ return new CondListContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode,
+ mpNode->getNextCondition() );
case PPT_TOKEN( prevCondLst ):
- xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode,
- mpNode->getPrevCondition() ) );
- break;
+ return new CondListContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode,
+ mpNode->getPrevCondition() );
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
private:
bool mbConcurrent;
@@ -441,32 +400,24 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- ParallelExclTimeNodeContext( ContextHandler& rParent, sal_Int32 aElement,
+ ParallelExclTimeNodeContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode )
: TimeNodeContext( rParent, aElement, xAttribs, pNode )
{
}
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( cTn ):
- xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
- break;
+ return new CommonTimeNodeContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode );
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
protected:
@@ -479,7 +430,7 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- AnimColorContext( ContextHandler& rParent, sal_Int32 aElement,
+ AnimColorContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode ) throw()
: TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -495,10 +446,10 @@ namespace oox { namespace ppt {
{
}
- virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
+ virtual void onEndElement()
{
//xParentNode
- if( aElement == mnElement )
+ if( isCurrentElement( mnElement ) )
{
NodePropertyMap & pProps(mpNode->getNodeProperties());
pProps[ NP_DIRECTION ] = makeAny( mnDir == XML_cw );
@@ -514,10 +465,8 @@ namespace oox { namespace ppt {
}
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( hsl ):
@@ -526,12 +475,11 @@ namespace oox { namespace ppt {
if( mbHasByColor )
{
m_byColor.colorSpace = AnimationColorSpace::HSL;
- m_byColor.one = xAttribs->getOptionalValue( XML_h ).toInt32( );
- m_byColor.two = xAttribs->getOptionalValue( XML_s ).toInt32( );
- m_byColor.three = xAttribs->getOptionalValue( XML_l ).toInt32( );
+ m_byColor.one = rAttribs.getInteger( XML_h, 0 );
+ m_byColor.two = rAttribs.getInteger( XML_s, 0 );
+ m_byColor.three = rAttribs.getInteger( XML_l, 0 );
}
- xRet.set(this);
- break;
+ return this;
}
case PPT_TOKEN( rgb ):
{
@@ -539,38 +487,30 @@ namespace oox { namespace ppt {
{
// CT_TLByRgbColorTransform
m_byColor.colorSpace = AnimationColorSpace::RGB;
- m_byColor.one = xAttribs->getOptionalValue( XML_r ).toInt32();
- m_byColor.two = xAttribs->getOptionalValue( XML_g ).toInt32();
- m_byColor.three = xAttribs->getOptionalValue( XML_b ).toInt32();
+ m_byColor.one = rAttribs.getInteger( XML_r, 0 );
+ m_byColor.two = rAttribs.getInteger( XML_g, 0 );
+ m_byColor.three = rAttribs.getInteger( XML_b, 0 );
}
- xRet.set(this);
- break;
+ return this;
}
case PPT_TOKEN( by ):
// CT_TLByAnimateColorTransform
mbHasByColor = true;
- xRet.set(this);
- break;
+ return this;
case PPT_TOKEN( cBhvr ):
- xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
- break;
+ return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
case PPT_TOKEN( to ):
// CT_Color
- xRet.set( new ColorContext( *this, maToClr ) );
- break;
+ return new ColorContext( *this, maToClr );
case PPT_TOKEN( from ):
// CT_Color
- xRet.set( new ColorContext( *this, maFromClr ) );
- break;
+ return new ColorContext( *this, maFromClr );
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
@@ -589,7 +529,7 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- AnimContext( ContextHandler& rParent, sal_Int32 aElement,
+ AnimContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode ) throw()
: TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -671,26 +611,21 @@ namespace oox { namespace ppt {
}
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( cBhvr ):
- xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
+ return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
break;
case PPT_TOKEN( tavLst ):
- xRet.set( new TimeAnimValueListContext ( *this, xAttribs, maTavList ) );
+ return new TimeAnimValueListContext ( *this, rAttribs.getFastAttributeList(), maTavList );
break;
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
private:
sal_Int32 mnValueType;
@@ -703,7 +638,7 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- AnimScaleContext( ContextHandler& rParent, sal_Int32 aElement,
+ AnimScaleContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode ) throw()
: TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -720,9 +655,9 @@ namespace oox { namespace ppt {
{
}
- virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
+ virtual void onEndElement()
{
- if( aElement == mnElement )
+ if( isCurrentElement( mnElement ) )
{
if( maTo.hasValue() )
{
@@ -739,49 +674,41 @@ namespace oox { namespace ppt {
}
}
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( cBhvr ):
- xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
- break;
+ return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
case PPT_TOKEN( to ):
{
// CT_TLPoint
- Point p = GetPointPercent( xAttribs );
+ Point p = GetPointPercent( rAttribs.getFastAttributeList() );
maTo <<= p.X;
maTo <<= p.Y;
- break;
+ return this;
}
case PPT_TOKEN( from ):
{
// CT_TLPoint
- Point p = GetPointPercent( xAttribs );
+ Point p = GetPointPercent( rAttribs.getFastAttributeList() );
maFrom <<= p.X;
maFrom <<= p.Y;
- break;
+ return this;
}
case PPT_TOKEN( by ):
{
// CT_TLPoint
- Point p = GetPointPercent( xAttribs );
+ Point p = GetPointPercent( rAttribs.getFastAttributeList() );
maBy <<= p.X;
maBy <<= p.Y;
- break;
+ return this;
}
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
private:
Any maBy;
@@ -796,7 +723,7 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- AnimRotContext( ContextHandler& rParent, sal_Int32 aElement,
+ AnimRotContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode ) throw()
: TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -827,23 +754,17 @@ namespace oox { namespace ppt {
{
}
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( cBhvr ):
- xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
- break;
+ return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
};
@@ -854,7 +775,7 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- AnimMotionContext( ContextHandler& rParent, sal_Int32 aElement,
+ AnimMotionContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode ) throw()
: TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -893,63 +814,55 @@ namespace oox { namespace ppt {
}
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( cBhvr ):
- xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
- break;
+ return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
case PPT_TOKEN( to ):
{
// CT_TLPoint
- Point p = GetPointPercent( xAttribs );
+ Point p = GetPointPercent( rAttribs.getFastAttributeList() );
Any rAny;
rAny <<= p.X;
rAny <<= p.Y;
mpNode->setTo( rAny );
- break;
+ return this;
}
case PPT_TOKEN( from ):
{
// CT_TLPoint
- Point p = GetPointPercent( xAttribs );
+ Point p = GetPointPercent( rAttribs.getFastAttributeList() );
Any rAny;
rAny <<= p.X;
rAny <<= p.Y;
mpNode->setFrom( rAny );
- break;
+ return this;
}
case PPT_TOKEN( by ):
{
// CT_TLPoint
- Point p = GetPointPercent( xAttribs );
+ Point p = GetPointPercent( rAttribs.getFastAttributeList() );
Any rAny;
rAny <<= p.X;
rAny <<= p.Y;
mpNode->setBy( rAny );
- break;
+ return this;
}
case PPT_TOKEN( rCtr ):
{
// CT_TLPoint
- Point p = GetPointPercent( xAttribs );
+ Point p = GetPointPercent( rAttribs.getFastAttributeList() );
// TODO push
(void)p;
- break;
+ return this;
}
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
private:
OUString msPtsTypes;
@@ -963,7 +876,7 @@ namespace oox { namespace ppt {
: public TimeNodeContext
{
public:
- AnimEffectContext( ContextHandler& rParent, sal_Int32 aElement,
+ AnimEffectContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode ) throw()
: TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -987,27 +900,20 @@ namespace oox { namespace ppt {
}
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch ( aElementToken )
{
case PPT_TOKEN( cBhvr ):
- xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
- break;
+ return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
case PPT_TOKEN( progress ):
- xRet.set( new AnimVariantContext( *this, aElementToken, maProgress ) );
+ return new AnimVariantContext( *this, aElementToken, maProgress );
// TODO handle it.
- break;
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
private:
Any maProgress;
@@ -1018,7 +924,7 @@ namespace oox { namespace ppt {
TimeNodeContext * TimeNodeContext::makeContext(
- ContextHandler& rParent, sal_Int32 aElement,
+ FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode )
{
@@ -1069,10 +975,10 @@ namespace oox { namespace ppt {
}
- TimeNodeContext::TimeNodeContext( ContextHandler& rParent, sal_Int32 aElement,
+ TimeNodeContext::TimeNodeContext( FragmentHandler2& rParent, sal_Int32 aElement,
const Reference< XFastAttributeList >& /*xAttribs*/,
const TimeNodePtr & pNode ) throw()
- : ContextHandler( rParent )
+ : FragmentHandler2( rParent )
, mnElement( aElement )
, mpNode( pNode )
{
@@ -1085,9 +991,9 @@ namespace oox { namespace ppt {
}
- TimeNodeListContext::TimeNodeListContext( ContextHandler& rParent, TimeNodePtrList & aList )
+ TimeNodeListContext::TimeNodeListContext( FragmentHandler2& rParent, TimeNodePtrList & aList )
throw()
- : ContextHandler( rParent )
+ : FragmentHandler2( rParent )
, maList( aList )
{
}
@@ -1098,10 +1004,8 @@ namespace oox { namespace ppt {
}
- Reference< XFastContextHandler > SAL_CALL TimeNodeListContext::createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+ ::oox::core::ContextHandlerRef TimeNodeListContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
sal_Int16 nNodeType;
switch( aElementToken )
@@ -1155,10 +1059,9 @@ namespace oox { namespace ppt {
TimeNodePtr pNode(new TimeNode(nNodeType));
maList.push_back( pNode );
- ContextHandler * pContext = TimeNodeContext::makeContext( *this, aElementToken, xAttribs, pNode );
- xRet.set( pContext ? pContext : this );
+ FragmentHandler2 * pContext = TimeNodeContext::makeContext( *this, aElementToken, rAttribs.getFastAttributeList(), pNode );
- return xRet;
+ return pContext ? pContext : this;
}
diff --git a/oox/source/ppt/timetargetelementcontext.cxx b/oox/source/ppt/timetargetelementcontext.cxx
index 2a0f61c0c4a3..93cbcf701625 100644
--- a/oox/source/ppt/timetargetelementcontext.cxx
+++ b/oox/source/ppt/timetargetelementcontext.cxx
@@ -49,55 +49,49 @@ namespace oox { namespace ppt {
// CT_TLShapeTargetElement
class ShapeTargetElementContext
- : public ContextHandler
+ : public FragmentHandler2
{
public:
- ShapeTargetElementContext( ContextHandler& rParent, ShapeTargetElement & aValue )
- : ContextHandler( rParent )
+ ShapeTargetElementContext( FragmentHandler2& rParent, ShapeTargetElement & aValue )
+ : FragmentHandler2( rParent )
, bTargetSet(false)
, maShapeTarget(aValue)
{
}
- virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
- const Reference< XFastAttributeList >& xAttribs )
- throw ( SAXException, RuntimeException )
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch( aElementToken )
{
case PPT_TOKEN( bg ):
bTargetSet = true;
maShapeTarget.mnType = XML_bg;
- break;
+ return this;
case PPT_TOKEN( txEl ):
bTargetSet = true;
maShapeTarget.mnType = XML_txEl;
- break;
+ return this;
case PPT_TOKEN( subSp ):
bTargetSet = true;
maShapeTarget.mnType = XML_subSp;
- maShapeTarget.msSubShapeId = xAttribs->getOptionalValue( XML_spid );
- break;
+ maShapeTarget.msSubShapeId = rAttribs.getString( XML_spid, OUString() );
+ return this;
case PPT_TOKEN( graphicEl ):
case PPT_TOKEN( oleChartEl ):
bTargetSet = true;
// TODO
- break;
+ return this;
case PPT_TOKEN( charRg ):
case PPT_TOKEN( pRg ):
if( bTargetSet && maShapeTarget.mnType == XML_txEl )
{
maShapeTarget.mnRangeType = getBaseToken( aElementToken );
- maShapeTarget.maRange = drawingml::GetIndexRange( xAttribs );
+ maShapeTarget.maRange = drawingml::GetIndexRange( rAttribs.getFastAttributeList() );
}
- break;
+ return this;
default:
break;
}
- if( !xRet.is() )
- xRet.set( this );
- return xRet;
+ return this;
}
private:
@@ -107,8 +101,8 @@ namespace oox { namespace ppt {
- TimeTargetElementContext::TimeTargetElementContext( ContextHandler& rParent, const AnimTargetElementPtr & pValue )
- : ContextHandler( rParent ),
+ TimeTargetElementContext::TimeTargetElementContext( FragmentHandler2& rParent, const AnimTargetElementPtr & pValue )
+ : FragmentHandler2( rParent ),
mpTarget( pValue )
{
OSL_ENSURE( mpTarget, "no valid target passed" );
@@ -119,34 +113,28 @@ namespace oox { namespace ppt {
{
}
- void SAL_CALL TimeTargetElementContext::endFastElement( sal_Int32 /*aElement*/ ) throw ( SAXException, RuntimeException)
- {
- }
-
- Reference< XFastContextHandler > SAL_CALL TimeTargetElementContext::createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+ ::oox::core::ContextHandlerRef TimeTargetElementContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
- Reference< XFastContextHandler > xRet;
-
switch( aElementToken )
{
case PPT_TOKEN( inkTgt ):
{
mpTarget->mnType = XML_inkTgt;
- OUString aId = xAttribs->getOptionalValue( XML_spid );
+ OUString aId = rAttribs.getString( XML_spid, OUString() );
if( aId.getLength() )
{
mpTarget->msValue = aId;
}
- break;
+ return this;
}
case PPT_TOKEN( sldTgt ):
mpTarget->mnType = XML_sldTgt;
- break;
+ return this;
case PPT_TOKEN( sndTgt ):
{
mpTarget->mnType = XML_sndTgt;
drawingml::EmbeddedWAVAudioFile aAudio;
- drawingml::getEmbeddedWAVAudioFile( getRelations(), xAttribs, aAudio);
+ drawingml::getEmbeddedWAVAudioFile( getRelations(), rAttribs.getFastAttributeList(), aAudio);
OUString sSndName = ( aAudio.mbBuiltIn ? aAudio.msName : aAudio.msEmbed );
mpTarget->msValue = sSndName;
@@ -155,20 +143,16 @@ namespace oox { namespace ppt {
case PPT_TOKEN( spTgt ):
{
mpTarget->mnType = XML_spTgt;
- OUString aId = xAttribs->getOptionalValue( XML_spid );
+ OUString aId = rAttribs.getString( XML_spid, OUString() );
mpTarget->msValue = aId;
- xRet.set( new ShapeTargetElementContext( *this, mpTarget->maShapeTarget ) );
- break;
+ return new ShapeTargetElementContext( *this, mpTarget->maShapeTarget );
}
default:
OSL_TRACE( "OOX: unhandled tag %ld in TL_TimeTargetElement.", getBaseToken( aElementToken ) );
break;
}
- if( !xRet.is() )
- xRet.set( this );
-
- return xRet;
+ return this;
}
diff --git a/oox/source/ppt/timetargetelementcontext.hxx b/oox/source/ppt/timetargetelementcontext.hxx
index 8ee22fd26aae..f20890f1899a 100644
--- a/oox/source/ppt/timetargetelementcontext.hxx
+++ b/oox/source/ppt/timetargetelementcontext.hxx
@@ -29,20 +29,19 @@
#ifndef OOX_PPT_TIMETARGETELEMENTCONTEXT
#define OOX_PPT_TIMETARGETELEMENTCONTEXT
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
#include "oox/ppt/animationspersist.hxx"
namespace oox { namespace ppt {
/** context CT_TLTimeTargetElement */
class TimeTargetElementContext
- : public ::oox::core::ContextHandler
+ : public ::oox::core::FragmentHandler2
{
public:
- TimeTargetElementContext( ::oox::core::ContextHandler& rParent, const AnimTargetElementPtr & aValue );
+ TimeTargetElementContext( ::oox::core::FragmentHandler2& rParent, const AnimTargetElementPtr & aValue );
~TimeTargetElementContext( ) throw( );
- virtual void SAL_CALL endFastElement( sal_Int32 /*aElement*/ ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
private:
AnimTargetElementPtr mpTarget;
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index d3bf0b776c25..a4b270ab4124 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -383,6 +383,7 @@ ScrollValue
ScrollValueMax
ScrollValueMin
Segments
+SelectedItems
SelectedPage
Show
ShowBorder
@@ -426,6 +427,7 @@ StartPosition
StartWith
StartingAngle
State
+StringItemList
Subtotals
Suffix
SwapXAndYAxis
diff --git a/oox/source/vml/vmldrawingfragment.cxx b/oox/source/vml/vmldrawingfragment.cxx
index 12dd0a42fabf..0f92632f0e00 100644
--- a/oox/source/vml/vmldrawingfragment.cxx
+++ b/oox/source/vml/vmldrawingfragment.cxx
@@ -50,6 +50,13 @@ DrawingFragment::DrawingFragment( XmlFilterBase& rFilter, const OUString& rFragm
FragmentHandler2( rFilter, rFragmentPath, false ), // do not trim whitespace, has been preprocessed by the input stream
mrDrawing( rDrawing )
{
+ RelationsRef xLegacyRels = getRelations().getRelationsFromType( CREATE_MSOFFICE_RELATION_TYPE( "legacyDiagramText" ) );
+ for( Relations::const_iterator aIt = xLegacyRels->begin(), aEnd = xLegacyRels->end(); aIt != aEnd; ++aIt )
+ {
+ OUString aLegacyFragmentPath = getFragmentPathFromRelation( aIt->second );
+ // TODO: import legacyDiagramText from aLegacyFragmentPath - this is a binary import.
+ // printf("legacyDiagram: %s\n", ::rtl::OUStringToOString( aLegacyFragmentPath, RTL_TEXTENCODING_UTF8).getStr());
+ }
}
Reference< XInputStream > DrawingFragment::openFragmentStream() const
diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx
index fa96869afadc..fb4ca7b6bd50 100644
--- a/oox/source/xls/formulaparser.cxx
+++ b/oox/source/xls/formulaparser.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/sheet/ComplexReference.hpp>
#include <com/sun/star/sheet/ExternalReference.hpp>
#include <com/sun/star/sheet/FormulaToken.hpp>
+#include <com/sun/star/sheet/NameToken.hpp>
#include <com/sun/star/sheet/ReferenceFlags.hpp>
#include <com/sun/star/sheet/SingleReference.hpp>
#include "oox/core/filterbase.hxx"
@@ -2860,7 +2861,10 @@ ApiTokenSequence FormulaParser::convertNameToFormula( sal_Int32 nTokenIndex ) co
ApiTokenSequence aTokens( 1 );
aTokens[ 0 ].OpCode = OPCODE_NAME;
- aTokens[ 0 ].Data <<= nTokenIndex;
+ NameToken aNameTokenData;
+ aNameTokenData.Global = sal_True;
+ aNameTokenData.Index = nTokenIndex;
+ aTokens[ 0 ].Data <<= aNameTokenData;
return aTokens;
}
diff --git a/oox/source/xls/sheetdatabuffer.cxx b/oox/source/xls/sheetdatabuffer.cxx
index 4eb1349e9438..04551e21840e 100755
--- a/oox/source/xls/sheetdatabuffer.cxx
+++ b/oox/source/xls/sheetdatabuffer.cxx
@@ -238,6 +238,9 @@ void CellBlockBuffer::setColSpans( sal_Int32 nRow, const ValueRangeSet& rColSpan
CellBlock* CellBlockBuffer::getCellBlock( const CellAddress& rCellAddr )
{
+ // Temporarily disabled. TODO: Fix this.
+ return NULL;
+
OSL_ENSURE( rCellAddr.Row >= mnCurrRow, "CellBlockBuffer::getCellBlock - passed row out of order" );
// prepare cell blocks, if row changes
if( rCellAddr.Row != mnCurrRow )
diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx
index 569126e0ebad..dfb9db03ed0e 100644
--- a/oox/source/xls/sheetdatacontext.cxx
+++ b/oox/source/xls/sheetdatacontext.cxx
@@ -163,8 +163,15 @@ void SheetDataContext::onCharacters( const OUString& rChars )
maCellValue = rChars;
break;
case XLS_TOKEN( f ):
- if( maFmlaData.mnFormulaType != XML_TOKEN_INVALID )
+ if( 0 && maFmlaData.mnFormulaType == XML_normal )
+ {
+ maCellValue = rChars;
+ mrSheetData.putFormulaString( maCellData.maCellAddr, maCellValue );
+ }
+ else if( maFmlaData.mnFormulaType != XML_TOKEN_INVALID )
+ {
maTokens = mrFormulaParser.importFormula( maCellData.maCellAddr, rChars );
+ }
break;
}
}
@@ -178,7 +185,7 @@ void SheetDataContext::onEndElement()
{
case XML_normal:
mrSheetData.setFormulaCell( maCellData, maTokens );
- break;
+ break;
case XML_shared:
if( maFmlaData.mnSharedId >= 0 )
{
@@ -240,6 +247,13 @@ void SheetDataContext::onEndElement()
mrSheetData.setBlankCell( maCellData );
}
}
+ else if( maCellValue.getLength() > 0 ) switch( maCellData.mnCellType )
+ {
+ case XML_n:
+ /* Set the pre-loaded value */
+ mrSheetData.putFormulaResult( maCellData.maCellAddr, maCellValue.toDouble() );
+ break;
+ }
}
}
diff --git a/oox/source/xls/workbookfragment.cxx b/oox/source/xls/workbookfragment.cxx
index 96fd34f0c100..9d22f5fdf937 100644
--- a/oox/source/xls/workbookfragment.cxx
+++ b/oox/source/xls/workbookfragment.cxx
@@ -29,6 +29,7 @@
#include "oox/xls/workbookfragment.hxx"
#include <com/sun/star/table/CellAddress.hpp>
+#include <com/sun/star/sheet/XCalculatable.hpp>
#include "oox/core/filterbase.hxx"
#include "oox/drawingml/themefragmenthandler.hxx"
#include "oox/helper/attributelist.hxx"
@@ -59,6 +60,7 @@ namespace xls {
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::table;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::sheet;
using namespace ::oox::core;
using ::oox::drawingml::ThemeFragmentHandler;
@@ -313,6 +315,11 @@ void WorkbookFragment::finalizeImport()
// final conversions, e.g. calculation settings and view settings
finalizeWorkbookImport();
+
+ // Recalculate (only changed ones)
+ Reference< XCalculatable > xCalculatable( getDocument(), UNO_QUERY );
+ if( xCalculatable.is() )
+ xCalculatable->calculate();
}
// private --------------------------------------------------------------------
diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx
index 068c89cde2d9..a74e24f3343b 100644
--- a/oox/source/xls/worksheethelper.cxx
+++ b/oox/source/xls/worksheethelper.cxx
@@ -48,6 +48,7 @@
#include <com/sun/star/sheet/XSheetOutline.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/table/XColumnRowRange.hpp>
+#include <com/sun/star/table/XCell2.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/XText.hpp>
#include <rtl/ustrbuf.hxx>
@@ -1654,6 +1655,19 @@ void WorksheetHelper::putValue( const CellAddress& rAddress, double fValue ) con
if( xCell.is() ) xCell->setValue( fValue );
}
+void WorksheetHelper::putFormulaResult( const CellAddress& rAddress, double fValue ) const
+{
+ Reference< XCell2 > xCell( getCell( rAddress ), UNO_QUERY );
+ OSL_ENSURE( xCell.is(), "WorksheetHelper::putFormulaResult - missing cell interface" );
+ if( xCell.is() ) xCell->setFormulaResult( fValue );
+}
+
+void WorksheetHelper::putFormulaString( const CellAddress& rAddress, const OUString& rFormula ) const
+{
+ Reference< XCell2 > xCell( getCell( rAddress ), UNO_QUERY );
+ if( xCell.is() ) xCell->setFormulaString( rFormula );
+}
+
void WorksheetHelper::putString( const CellAddress& rAddress, const OUString& rText ) const
{
Reference< XText > xText( getCell( rAddress ), UNO_QUERY );
diff --git a/unoxml/Library_unordf.mk b/unoxml/Library_unordf.mk
index 0e1fe61e816a..f716cf2afa59 100644
--- a/unoxml/Library_unordf.mk
+++ b/unoxml/Library_unordf.mk
@@ -31,7 +31,11 @@ $(eval $(call gb_Library_set_componentfile,unordf,unoxml/source/rdf/unordf))
$(eval $(call gb_Library_set_include,unordf,\
$$(INCLUDE) \
- -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Library_add_api,unordf,\
+ udkapi \
+ offapi \
))
$(eval $(call gb_Library_add_linked_libs,unordf,\
@@ -54,5 +58,7 @@ $(eval $(call gb_Library_add_exception_objects,unordf,\
unoxml/source/rdf/librdf_services \
))
+ $$(REDLAND_CFLAGS) \
+ $$(LIBXML_CFLAGS) \
# vim: set noet sw=4 ts=4:
diff --git a/unoxml/Library_unoxml.mk b/unoxml/Library_unoxml.mk
index 3303e5df6cf7..b51253a44036 100644
--- a/unoxml/Library_unoxml.mk
+++ b/unoxml/Library_unoxml.mk
@@ -31,9 +31,13 @@ $(eval $(call gb_Library_set_componentfile,unoxml,unoxml/source/service/unoxml))
$(eval $(call gb_Library_set_include,unoxml,\
$$(INCLUDE) \
- -I$(OUTDIR)/inc/offuh \
))
+))
+
+$(eval $(call gb_Library_add_api,unoxml,\
+ udkapi \
+ offapi \
$(eval $(call gb_Library_add_linked_libs,unoxml,\
ucbhelper \
sax \
diff --git a/unoxml/prj/build.lst b/unoxml/prj/build.lst
index 02f0482d76f8..97aed0f47b94 100644
--- a/unoxml/prj/build.lst
+++ b/unoxml/prj/build.lst
@@ -1,2 +1,2 @@
-ux unoxml : offuh cppuhelper LIBXML2:libxml2 LIBXSLT:libxslt REDLAND:redland sax comphelper ucbhelper NULL
+ux unoxml : offapi cppuhelper LIBXML2:libxml2 LIBXSLT:libxslt REDLAND:redland sax comphelper ucbhelper NULL
ux unoxml\prj nmake - all ux_prj NULL
diff --git a/unoxml/source/rdf/librdf_services.cxx b/unoxml/source/rdf/librdf_services.cxx
index 03b2b1e39eec..d1ff568a2369 100644
--- a/unoxml/source/rdf/librdf_services.cxx
+++ b/unoxml/source/rdf/librdf_services.cxx
@@ -39,12 +39,6 @@ using namespace ::com::sun::star;
extern "C"
{
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char **o_ppEnvironmentTypeName,
- uno_Environment ** /* ppEnvironment */)
-{
- *o_ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
static ::cppu::ImplementationEntry const entries[] = {
{ &comp_CBlankNode::_create,
&comp_CBlankNode::_getImplementationName,
@@ -65,7 +59,7 @@ static ::cppu::ImplementationEntry const entries[] = {
{ 0, 0, 0, 0, 0, 0 }
};
-SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL unordf_component_getFactory(
const char * implName, void * serviceManager, void * registryKey)
{
return ::cppu::component_getFactoryHelper(
diff --git a/unoxml/source/rdf/unordf.component b/unoxml/source/rdf/unordf.component
index a828e7b05d47..12a01ca6cf8c 100644
--- a/unoxml/source/rdf/unordf.component
+++ b/unoxml/source/rdf/unordf.component
@@ -26,7 +26,7 @@
*
**********************************************************************-->
-<component loader="com.sun.star.loader.SharedLibrary"
+<component loader="com.sun.star.loader.SharedLibrary" prefix="unordf"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="CBlankNode">
<service name="com.sun.star.rdf.BlankNode"/>
diff --git a/unoxml/source/service/services.cxx b/unoxml/source/service/services.cxx
index b81c363931fa..f9c024f7392a 100644
--- a/unoxml/source/service/services.cxx
+++ b/unoxml/source/service/services.cxx
@@ -55,12 +55,7 @@ using namespace ::com::sun::star::registry;
extern "C"
{
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char **ppEnvironmentTypeName, uno_Environment ** /*ppEnvironment */)
-{
- *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void * /*pRegistryKey*/)
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL unoxml_component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void * /*pRegistryKey*/)
{
void* pReturn = NULL ;
if ( pImplementationName && pServiceManager )
diff --git a/unoxml/source/service/unoxml.component b/unoxml/source/service/unoxml.component
index d8c907e6475b..889a755e22c5 100644
--- a/unoxml/source/service/unoxml.component
+++ b/unoxml/source/service/unoxml.component
@@ -26,7 +26,7 @@
*
**********************************************************************-->
-<component loader="com.sun.star.loader.SharedLibrary"
+<component loader="com.sun.star.loader.SharedLibrary" prefix="unoxml"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.xml.dom.DocumentBuilder">
<service name="com.sun.star.xml.dom.DocumentBuilder"/>
diff --git a/writerfilter/Library_writerfilter.mk b/writerfilter/Library_writerfilter.mk
index 1de3e786fd0e..6e3f6d8e18d0 100644
--- a/writerfilter/Library_writerfilter.mk
+++ b/writerfilter/Library_writerfilter.mk
@@ -37,7 +37,7 @@ $(eval $(call gb_Library_set_componentfile,writerfilter,writerfilter/util/writer
$(eval $(call gb_Library_set_include,writerfilter,\
$$(INCLUDE) \
- -I$(OUTDIR)/inc/offuh \
+))
-I$(realpath $(SRCDIR)/writerfilter/inc) \
-I$(WORKDIR)/CustomTarget/writerfilter/source \
-I$(WORKDIR)/CustomTarget/writerfilter/source/ooxml \
@@ -47,6 +47,11 @@ $(eval $(call gb_Library_set_include,writerfilter,\
-I$(realpath $(SRCDIR)/writerfilter/source/dmapper) \
))
+$(eval $(call gb_Library_add_api,writerfilter,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_Library_set_componentfile,writerfilter,writerfilter/util/writerfilter))
$(eval $(call gb_Library_add_defs,writerfilter,\
@@ -62,8 +67,10 @@ $(eval $(call gb_Library_add_linked_libs,writerfilter,\
i18nisolang1 \
i18npaper \
oox \
+ rtftok \
sal \
sot \
+ svt \
tl \
utl \
$(gb_STDLIBS) \
diff --git a/writerfilter/Module_writerfilter.mk b/writerfilter/Module_writerfilter.mk
index d51031d8b881..01f149b8cac8 100644
--- a/writerfilter/Module_writerfilter.mk
+++ b/writerfilter/Module_writerfilter.mk
@@ -28,6 +28,7 @@
$(eval $(call gb_Module_Module,writerfilter))
$(eval $(call gb_Module_add_targets,writerfilter,\
+ Library_rtftok \
Library_writerfilter \
Package_inc \
Package_writerfilter_generated \
@@ -37,7 +38,4 @@ $(eval $(call gb_Module_add_targets,writerfilter,\
# Library_resourcemodel \
# Library_writerfilter_uno \
- # not used
- # Library_rtftok
-
# vim: set noet ts=4 sw=4:
diff --git a/writerfilter/inc/WriterFilterDllApi.hxx b/writerfilter/inc/WriterFilterDllApi.hxx
index dff806017c8a..358e5cd624bc 100644
--- a/writerfilter/inc/WriterFilterDllApi.hxx
+++ b/writerfilter/inc/WriterFilterDllApi.hxx
@@ -35,6 +35,12 @@
#else
#define WRITERFILTER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
#endif
+#if defined(WRITERFILTER_RTFTOK_DLLIMPLEMENTATION)
+#define WRITERFILTER_RTFTOK_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define WRITERFILTER_RTFTOK_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
#define WRITERFILTER_DLLPRIVATE SAL_DLLPRIVATE
#endif /* INCLUDED_WRITERFILTERDLLAPI_H */
diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx
index d9d40aa32ad9..71190a158e1e 100644
--- a/writerfilter/inc/dmapper/DomainMapper.hxx
+++ b/writerfilter/inc/dmapper/DomainMapper.hxx
@@ -106,6 +106,7 @@ public:
void PopListProperties();
bool IsOOXMLImport() const;
+ bool IsRTFImport() const;
::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > GetTextFactory() const;
void AddListIDToLFOTable( sal_Int32 nAbstractNumId );
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > GetCurrentTextRange();
diff --git a/writerfilter/inc/rtftok/RTFDocument.hxx b/writerfilter/inc/rtftok/RTFDocument.hxx
new file mode 100644
index 000000000000..72fe6bd2d952
--- /dev/null
+++ b/writerfilter/inc/rtftok/RTFDocument.hxx
@@ -0,0 +1,72 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Miklos Vajna <vmiklos@frugalware.org>
+ * Portions created by the Initial Developer are Copyright (C) 2011 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _RTFDOCUMENT_HXX_
+#define _RTFDOCUMENT_HXX_
+
+#include <resourcemodel/WW8ResourceModel.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+
+namespace writerfilter {
+ namespace rtftok {
+ /// The RTFDocument opens and resolves the RTF document.
+ class WRITERFILTER_RTFTOK_DLLPUBLIC RTFDocument
+ : public writerfilter::Reference<Stream>
+ {
+ public:
+ /// Pointer to this stream.
+ typedef ::boost::shared_ptr<RTFDocument> Pointer_t;
+
+ virtual ~RTFDocument() { }
+
+ /// Resolves this document to a stream handler.
+ virtual void resolve(Stream & rHandler) = 0;
+
+ /// Returns string representation of the type of this reference. (Debugging purpose only.)
+ virtual ::std::string getType() const = 0;
+ };
+
+ /// Interface to create an RTFDocument instance.
+ class WRITERFILTER_RTFTOK_DLLPUBLIC RTFDocumentFactory
+ {
+ public:
+ static RTFDocument::Pointer_t
+ createDocument(
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext,
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > const & xInputStream,
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > const & xDstDoc,
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & xFrame);
+ };
+ } // namespace rtftok
+} // namespace writerfilter
+
+#endif // _RTFDOCUMENT_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/inc/rtftok/RTFInputSource.hxx b/writerfilter/inc/rtftok/RTFInputSource.hxx
deleted file mode 100644
index 5a0ca071ab1a..000000000000
--- a/writerfilter/inc/rtftok/RTFInputSource.hxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_RTFINPUTSOURCE_HXX
-#define INCLUDED_RTFINPUTSOURCE_HXX
-
-namespace writerfilter { namespace rtftok {
-
-class RTFInputSource
-{
-public:
- virtual int read(void *buffer, int maxLen) = 0;
-};
-
-} } /* end namespace writerfilter::rtftok */
-
-
-#endif /* INCLUDED_RTFINPUTSOURCE_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/inc/rtftok/RTFParseException.hxx b/writerfilter/inc/rtftok/RTFParseException.hxx
deleted file mode 100644
index 338711e57cb7..000000000000
--- a/writerfilter/inc/rtftok/RTFParseException.hxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_RTFPARSEEXCEPTION_HXX
-#define INCLUDED_RTFPARSEEXCEPTION_HXX
-
-namespace writerfilter { namespace rtftok {
-
-class RTFParseException
-{
-public:
- RTFParseException(char *message);
-};
-
-} } /* end namespace writerfilter::rtftok */
-
-
-#endif /* INCLUDED_RTFPARSEEXCEPTION_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/inc/rtftok/RTFScanner.hxx b/writerfilter/inc/rtftok/RTFScanner.hxx
deleted file mode 100644
index 9f1e2c655402..000000000000
--- a/writerfilter/inc/rtftok/RTFScanner.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_RTFSCANNER_HXX
-#define INCLUDED_RTFSCANNER_HXX
-
-#include <WriterFilterDllApi.hxx>
-#include <vector>
-#include <rtftok/RTFInputSource.hxx>
-#include <rtftok/RTFScannerHandler.hxx>
-
-namespace writerfilter { namespace rtftok {
-
-class WRITERFILTER_DLLPUBLIC RTFScanner {
-public:
- RTFScanner(RTFScannerHandler &eventHandler_) : eventHandler(eventHandler_) {};
- virtual ~RTFScanner() { }
-
- const char* YYText() { return yytext; }
- int YYLeng() { return yyleng; }
-
- virtual int yylex() = 0;
-
- int lineno() const { return yylineno; }
-
-protected:
- char* yytext;
- int yyleng;
- int yylineno; // only maintained if you use %option yylineno
- int yy_flex_debug; // only has effect with -d or "%option debug"
- RTFScannerHandler &eventHandler;
-
-
-public:
- static writerfilter::rtftok::RTFScanner* createRTFScanner(writerfilter::rtftok::RTFInputSource& inputSource, writerfilter::rtftok::RTFScannerHandler &eventHandler);
-};
-
-} } /* end namespace writerfilter::rtftok */
-
-
-#endif /* INCLUDED_RTFSCANNER_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/inc/rtftok/RTFScannerHandler.hxx b/writerfilter/inc/rtftok/RTFScannerHandler.hxx
deleted file mode 100644
index aa423439fa53..000000000000
--- a/writerfilter/inc/rtftok/RTFScannerHandler.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_RTFSCANNERHANDLER_HXX
-#define INCLUDED_RTFSCANNERHANDLER_HXX
-
-namespace writerfilter { namespace rtftok {
-
-class RTFScannerHandler
-{
-public:
- virtual void dest(char*token, char*value)=0;
- virtual void ctrl(char*token, char*value)=0;
- virtual void lbrace(void)=0;
- virtual void rbrace(void)=0;
- virtual void addSpaces(int count)=0;
- virtual void addBinData(unsigned char data)=0;
- virtual void addChar(char ch) =0;
- virtual void addCharU(sal_Unicode ch) =0;
- virtual void addHexChar(char* hexch) =0;
-
-};
-
-} } /* end namespace writerfilter::rtftok */
-
-#endif /* INCLUDED_RTFSCANNERHANDLER_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 4e3624405b9a..231b1aba3953 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1634,7 +1634,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
case NS_sprm::LN_PBrcBetween: // sprmPBrcBetween
{
//in binary format the borders are directly provided in OOXML they are inside of properties
- if( IsOOXMLImport() )
+ if( IsOOXMLImport() || IsRTFImport() )
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
if( pProperties.get())
@@ -1968,7 +1968,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
break;
case NS_sprm::LN_CFDStrike : /*sprmCFDStrike double strike through*/
rContext->Insert(ePropertyId, true,
- uno::makeAny( awt::FontStrikeout::DOUBLE ) );
+ uno::makeAny( nIntValue ? awt::FontStrikeout::DOUBLE : awt::FontStrikeout::NONE ) );
break;
case NS_sprm::LN_CFOutline: /*sprmCFOutline*/
case NS_sprm::LN_CFShadow: /*sprmCFShadow*/
@@ -2085,7 +2085,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
rContext->Insert(PROP_CHAR_CHAR_KERNING, true, uno::makeAny( sal_Int16(ConversionHelper::convertTwipToMM100(sal_Int16(nIntValue))) ) );
break;
case NS_sprm::LN_CHpsKern: // sprmCHpsKern auto kerning is bound to a minimum font size in Word - but not in Writer :-(
- rContext->Insert(PROP_CHAR_AUTO_KERNING, true, uno::makeAny( true ) );
+ rContext->Insert(PROP_CHAR_AUTO_KERNING, true, uno::makeAny( sal_Bool(nIntValue) ) );
break;
case NS_sprm::LN_CMajority50:
break; // sprmCMajority50
@@ -2684,9 +2684,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
break;
case 0x6877: //underlining color
{
- sal_Int32 nColor = ConversionHelper::ConvertColor(nIntValue);
rContext->Insert(PROP_CHAR_UNDERLINE_HAS_COLOR, true, uno::makeAny( true ) );
- rContext->Insert(PROP_CHAR_UNDERLINE_COLOR, true, uno::makeAny( nColor ) );
+ rContext->Insert(PROP_CHAR_UNDERLINE_COLOR, true, uno::makeAny( nIntValue ) );
}
break;
case 0x6815:
@@ -3677,6 +3676,11 @@ bool DomainMapper::IsOOXMLImport() const
return m_pImpl->IsOOXMLImport();
}
+bool DomainMapper::IsRTFImport() const
+{
+ return m_pImpl->IsRTFImport();
+}
+
uno::Reference < lang::XMultiServiceFactory > DomainMapper::GetTextFactory() const
{
return m_pImpl->GetTextFactory();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index bdaf3eb2d1fc..3b698970ed98 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -937,13 +937,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
uno::Reference< text::XTextRange > xParaEnd( xCur, uno::UNO_QUERY );
CheckParaRedline( xParaEnd );
- // Remove the last empty section paragraph if needed
- if ( m_bIsLastParaInSection && !m_bParaChanged )
- {
- RemoveLastParagraph( );
- m_bIsLastParaInSection = false;
- }
-
+ m_bIsLastParaInSection = false;
m_bParaChanged = false;
}
if( !bKeepLastParagraphProperties )
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 60ccc230b43d..d4147b1cb782 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -545,7 +545,7 @@ public:
void appendTableManager( )
{
boost::shared_ptr< DomainMapperTableManager > pMngr(
- new DomainMapperTableManager( m_eDocumentType == DOCUMENT_OOXML ) );
+ new DomainMapperTableManager( m_eDocumentType == DOCUMENT_OOXML || m_eDocumentType == DOCUMENT_RTF ) );
m_aTableManagers.push( pMngr );
}
@@ -562,6 +562,8 @@ public:
bool IsOOXMLImport() const { return m_eDocumentType == DOCUMENT_OOXML; }
+ bool IsRTFImport() const { return m_eDocumentType == DOCUMENT_RTF; }
+
void InitPageMargins() { m_aPageMargins = _PageMar(); }
void SetPageMarginTwip( PageMarElement eElement, sal_Int32 nValue );
const _PageMar& GetPageMargins() const {return m_aPageMargins;}
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index fb2cd53f0190..049f5b941af9 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -916,7 +916,7 @@ void ListsManager::lcl_sprm( Sprm& rSprm )
void ListsManager::lcl_entry( int /* pos */,
writerfilter::Reference<Properties>::Pointer_t ref )
{
- if( m_rDMapper.IsOOXMLImport() )
+ if( m_rDMapper.IsOOXMLImport() || m_rDMapper.IsRTFImport() )
{
ref->resolve(*this);
}
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 9ae05891e072..18b0ef39c981 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -837,130 +837,130 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
if( m_nColumnCount > 0 && xSection.is())
ApplyColumnProperties( xSection );
}
- else
+ //get the properties and create appropriate page styles
+ uno::Reference< beans::XPropertySet > xFollowPageStyle = GetPageStyle( rDM_Impl.GetPageStyles(), rDM_Impl.GetTextFactory(), false );
+
+ if( m_nDzaGutter > 0 )
{
- //get the properties and create appropriate page styles
- uno::Reference< beans::XPropertySet > xFollowPageStyle = GetPageStyle( rDM_Impl.GetPageStyles(), rDM_Impl.GetTextFactory(), false );
+ //todo: iGutterPos from DocProperties are missing
+ if( m_bGutterRTL )
+ m_nRightMargin += m_nDzaGutter;
+ else
+ m_nLeftMargin += m_nDzaGutter;
+ }
+ operator[]( PropertyDefinition( PROP_LEFT_MARGIN, false )) = uno::makeAny( m_nLeftMargin );
+ operator[]( PropertyDefinition( PROP_RIGHT_MARGIN, false )) = uno::makeAny( m_nRightMargin );
+
+ /*** if headers/footers are available then the top/bottom margins of the
+ header/footer are copied to the top/bottom margin of the page
+ */
+ CopyLastHeaderFooter( false, rDM_Impl );
+ PrepareHeaderFooterProperties( false );
+
+ const ::rtl::OUString sTrayIndex = rPropNameSupplier.GetName( PROP_PRINTER_PAPER_TRAY_INDEX );
+ if( m_nPaperBin >= 0 )
+ xFollowPageStyle->setPropertyValue( sTrayIndex, uno::makeAny( m_nPaperBin ) );
+ uno::Reference< text::XTextColumns > xColumns;
+ if( m_nColumnCount > 0 )
+ xColumns = ApplyColumnProperties( xFollowPageStyle );
- if( m_nDzaGutter > 0 )
- {
- //todo: iGutterPos from DocProperties are missing
- if( m_bGutterRTL )
- m_nRightMargin += m_nDzaGutter;
- else
- m_nLeftMargin += m_nDzaGutter;
- }
- operator[]( PropertyDefinition( PROP_LEFT_MARGIN, false )) = uno::makeAny( m_nLeftMargin );
- operator[]( PropertyDefinition( PROP_RIGHT_MARGIN, false )) = uno::makeAny( m_nRightMargin );
-
- /*** if headers/footers are available then the top/bottom margins of the
- header/footer are copied to the top/bottom margin of the page
- */
- CopyLastHeaderFooter( false, rDM_Impl );
- PrepareHeaderFooterProperties( false );
-
- const ::rtl::OUString sTrayIndex = rPropNameSupplier.GetName( PROP_PRINTER_PAPER_TRAY_INDEX );
- if( m_nPaperBin >= 0 )
- xFollowPageStyle->setPropertyValue( sTrayIndex, uno::makeAny( m_nPaperBin ) );
- uno::Reference< text::XTextColumns > xColumns;
- if( m_nColumnCount > 0 )
- xColumns = ApplyColumnProperties( xFollowPageStyle );
-
- //prepare text grid properties
- sal_Int32 nHeight = 1;
- PropertyMap::iterator aElement = find(PropertyDefinition( PROP_HEIGHT, false ));
- if( aElement != end())
- aElement->second >>= nHeight;
-
- sal_Int32 nWidth = 1;
- aElement = find(PropertyDefinition( PROP_WIDTH, false ));
- if( aElement != end())
- aElement->second >>= nWidth;
-
- text::WritingMode eWritingMode = text::WritingMode_LR_TB;
- aElement = find(PropertyDefinition( PROP_WRITING_MODE, false ));
- if( aElement != end())
- aElement->second >>= eWritingMode;
-
-
-
- sal_Int32 nTextAreaHeight = eWritingMode == text::WritingMode_LR_TB ?
- nHeight - m_nTopMargin - m_nBottomMargin :
- nWidth - m_nLeftMargin - m_nRightMargin;
-
- operator[]( PropertyDefinition( PROP_GRID_LINES, false )) =
- uno::makeAny( static_cast<sal_Int16>(nTextAreaHeight/m_nGridLinePitch));
-
- sal_Int32 nCharWidth = 423; //240 twip/ 12 pt
- //todo: is '0' the right index here?
- const StyleSheetEntryPtr pEntry = rDM_Impl.GetStyleSheetTable()->FindStyleSheetByISTD(::rtl::OUString::valueOf(static_cast<sal_Int32>(0), 16));
- if( pEntry.get( ) )
- {
- PropertyMap::iterator aElement_ = pEntry->pProperties->find(PropertyDefinition( PROP_CHAR_HEIGHT_ASIAN, false ));
- if( aElement_ != pEntry->pProperties->end())
- {
- double fHeight = 0;
- if( aElement_->second >>= fHeight )
- nCharWidth = ConversionHelper::convertTwipToMM100( (long)( fHeight * 20.0 + 0.5 ));
- }
- }
+ //prepare text grid properties
+ sal_Int32 nHeight = 1;
+ PropertyMap::iterator aElement = find(PropertyDefinition( PROP_HEIGHT, false ));
+ if( aElement != end())
+ aElement->second >>= nHeight;
- //dxtCharSpace
- if(m_nDxtCharSpace)
- {
- sal_Int32 nCharSpace = m_nDxtCharSpace;
- //main lives in top 20 bits, and is signed.
- sal_Int32 nMain = (nCharSpace & 0xFFFFF000);
- nMain /= 0x1000;
- nCharWidth += ConversionHelper::convertTwipToMM100( nMain * 20 );
-
- sal_Int32 nFraction = (nCharSpace & 0x00000FFF);
- nFraction = (nFraction * 20)/0xFFF;
- nCharWidth += ConversionHelper::convertTwipToMM100( nFraction );
- }
- operator[]( PropertyDefinition( PROP_GRID_BASE_HEIGHT, false )) = uno::makeAny( nCharWidth );
- sal_Int32 nRubyHeight = m_nGridLinePitch - nCharWidth;
- if(nRubyHeight < 0 )
- nRubyHeight = 0;
- operator[]( PropertyDefinition( PROP_GRID_RUBY_HEIGHT, false )) = uno::makeAny( nRubyHeight );
+ sal_Int32 nWidth = 1;
+ aElement = find(PropertyDefinition( PROP_WIDTH, false ));
+ if( aElement != end())
+ aElement->second >>= nWidth;
+
+ text::WritingMode eWritingMode = text::WritingMode_LR_TB;
+ aElement = find(PropertyDefinition( PROP_WRITING_MODE, false ));
+ if( aElement != end())
+ aElement->second >>= eWritingMode;
- sal_Int16 nGridMode = text::TextGridMode::NONE;
- switch (m_nGridType)
- {
- case NS_ooxml::LN_Value_wordprocessingml_ST_DocGrid_lines:
- nGridMode = text::TextGridMode::LINES;
- break;
- case NS_ooxml::LN_Value_wordprocessingml_ST_DocGrid_linesAndChars:
- nGridMode = text::TextGridMode::LINES_AND_CHARS;
- break;
- default:
- break;
- }
- operator[](PropertyDefinition(PROP_GRID_MODE, false)) = uno::makeAny(nGridMode);
+ sal_Int32 nTextAreaHeight = eWritingMode == text::WritingMode_LR_TB ?
+ nHeight - m_nTopMargin - m_nBottomMargin :
+ nWidth - m_nLeftMargin - m_nRightMargin;
- _ApplyProperties( xFollowPageStyle );
+ operator[]( PropertyDefinition( PROP_GRID_LINES, false )) =
+ uno::makeAny( static_cast<sal_Int16>(nTextAreaHeight/m_nGridLinePitch));
- //todo: creating a "First Page" style depends on HasTitlePage und _fFacingPage_
- if( m_bTitlePage )
+ sal_Int32 nCharWidth = 423; //240 twip/ 12 pt
+ //todo: is '0' the right index here?
+ const StyleSheetEntryPtr pEntry = rDM_Impl.GetStyleSheetTable()->FindStyleSheetByISTD(::rtl::OUS