diff options
Diffstat (limited to 'oox/inc/oox')
-rw-r--r-- | oox/inc/oox/core/filterbase.hxx | 6 | ||||
-rw-r--r-- | oox/inc/oox/helper/attributelist.hxx | 91 | ||||
-rw-r--r-- | oox/inc/oox/helper/graphichelper.hxx | 22 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmldrawing.hxx | 10 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmlformatting.hxx | 1 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmlshape.hxx | 20 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmlshapecontainer.hxx | 4 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmlshapecontext.hxx | 3 | ||||
-rw-r--r-- | oox/inc/oox/xls/biffhelper.hxx | 2 | ||||
-rw-r--r-- | oox/inc/oox/xls/drawingfragment.hxx | 5 | ||||
-rw-r--r-- | oox/inc/oox/xls/viewsettings.hxx | 20 | ||||
-rw-r--r-- | oox/inc/oox/xls/workbooksettings.hxx | 4 | ||||
-rw-r--r-- | oox/inc/oox/xls/worksheethelper.hxx | 11 |
13 files changed, 130 insertions, 69 deletions
diff --git a/oox/inc/oox/core/filterbase.hxx b/oox/inc/oox/core/filterbase.hxx index 617559a9a90f..1757b2be4334 100644 --- a/oox/inc/oox/core/filterbase.hxx +++ b/oox/inc/oox/core/filterbase.hxx @@ -202,12 +202,6 @@ public: @return True, if the data could be imported from the stream. */ bool importBinaryData( StreamDataSequence& orDataSeq, const ::rtl::OUString& rStreamName ); - /** Imports a graphic from the storage stream with the passed path and name. */ - ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > - importEmbeddedGraphic( const ::rtl::OUString& rStreamName ) const; - /** Imports a graphic object from the storage stream with the passed path and name. */ - ::rtl::OUString importEmbeddedGraphicObject( const ::rtl::OUString& rStreamName ) const; - // com.sun.star.lang.XServiceInfo interface ------------------------------- virtual ::rtl::OUString SAL_CALL diff --git a/oox/inc/oox/helper/attributelist.hxx b/oox/inc/oox/helper/attributelist.hxx index 89981160b699..631d7ec4b66e 100644 --- a/oox/inc/oox/helper/attributelist.hxx +++ b/oox/inc/oox/helper/attributelist.hxx @@ -37,27 +37,12 @@ namespace oox { // ============================================================================ -/** Provides access to attribute values of an element. - - Wraps a com.sun.star.xml.sax.XFastAttributeList object. Provides - convenience functions that convert the string value of an attribute to - various other data types. +/** Static helpers for conversion of strings to attribute values of various + different data types. */ -class AttributeList +class AttributeConversion { public: - explicit AttributeList( - const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs ); - - /** Returns the wrapped com.sun.star.xml.sax.XFastAttributeList object. */ - inline ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList > - getFastAttributeList() const { return mxAttribs; } - - /** Returns true, if the specified attribute is present. */ - bool hasAttribute( sal_Int32 nElement ) const; - - // static string conversion ----------------------------------------------- - /** Returns the decoded string value. All characters in the format '_xHHHH_' (H being a hexadecimal digit), will be decoded. */ static ::rtl::OUString decodeXString( const ::rtl::OUString& rValue ); @@ -82,95 +67,117 @@ public: /** Returns the 64-bit signed integer value from the passed string (hexadecimal). */ static sal_Int64 decodeHyperHex( const ::rtl::OUString& rValue ); +}; + +// ============================================================================ + +/** Provides access to attribute values of an element. + + Wraps a com.sun.star.xml.sax.XFastAttributeList object. Provides + convenience functions that convert the string value of an attribute to + various other data types. + */ +class AttributeList +{ +public: + explicit AttributeList( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs ); + + /** Returns the wrapped com.sun.star.xml.sax.XFastAttributeList object. */ + inline ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList > + getFastAttributeList() const { return mxAttribs; } + + /** Returns true, if the specified attribute is present. */ + bool hasAttribute( sal_Int32 nAttrToken ) const; // optional return values ------------------------------------------------- /** Returns the token identifier of the value of the specified attribute. */ - OptValue< sal_Int32 > getToken( sal_Int32 nElement ) const; + OptValue< sal_Int32 > getToken( sal_Int32 nAttrToken ) const; /** Returns the string value of the specified attribute. */ - OptValue< ::rtl::OUString > getString( sal_Int32 nElement ) const; + OptValue< ::rtl::OUString > getString( sal_Int32 nAttrToken ) const; /** Returns the string value of the specified attribute. All characters in the format '_xHHHH_' (H being a hexadecimal digit), will be decoded. */ - OptValue< ::rtl::OUString > getXString( sal_Int32 nElement ) const; + OptValue< ::rtl::OUString > getXString( sal_Int32 nAttrToken ) const; /** Returns the double value of the specified attribute. */ - OptValue< double > getDouble( sal_Int32 nElement ) const; + OptValue< double > getDouble( sal_Int32 nAttrToken ) const; /** Returns the 32-bit signed integer value of the specified attribute (decimal). */ - OptValue< sal_Int32 > getInteger( sal_Int32 nElement ) const; + OptValue< sal_Int32 > getInteger( sal_Int32 nAttrToken ) const; /** Returns the 32-bit unsigned integer value of the specified attribute (decimal). */ - OptValue< sal_uInt32 > getUnsigned( sal_Int32 nElement ) const; + OptValue< sal_uInt32 > getUnsigned( sal_Int32 nAttrToken ) const; /** Returns the 64-bit signed integer value of the specified attribute (decimal). */ - OptValue< sal_Int64 > getHyper( sal_Int32 nElement ) const; + OptValue< sal_Int64 > getHyper( sal_Int32 nAttrToken ) const; /** Returns the 32-bit signed integer value of the specified attribute (hexadecimal). */ - OptValue< sal_Int32 > getIntegerHex( sal_Int32 nElement ) const; + OptValue< sal_Int32 > getIntegerHex( sal_Int32 nAttrToken ) const; /** Returns the 32-bit unsigned integer value of the specified attribute (hexadecimal). */ - OptValue< sal_uInt32 > getUnsignedHex( sal_Int32 nElement ) const; + OptValue< sal_uInt32 > getUnsignedHex( sal_Int32 nAttrToken ) const; /** Returns the 64-bit signed integer value of the specified attribute (hexadecimal). */ - OptValue< sal_Int64 > getHyperHex( sal_Int32 nElement ) const; + OptValue< sal_Int64 > getHyperHex( sal_Int32 nAttrToken ) const; /** Returns the boolean value of the specified attribute. */ - OptValue< bool > getBool( sal_Int32 nElement ) const; + OptValue< bool > getBool( sal_Int32 nAttrToken ) const; /** Returns the date/time value of the specified attribute. */ - OptValue< ::com::sun::star::util::DateTime > getDateTime( sal_Int32 nElement ) const; + OptValue< ::com::sun::star::util::DateTime > getDateTime( sal_Int32 nAttrToken ) const; // defaulted return values ------------------------------------------------ /** Returns the token identifier of the value of the specified attribute, or the passed default identifier if the attribute is missing. */ - sal_Int32 getToken( sal_Int32 nElement, sal_Int32 nDefault ) const; + sal_Int32 getToken( sal_Int32 nAttrToken, sal_Int32 nDefault ) const; /** Returns the string value of the specified attribute, or the passed default string if the attribute is missing. */ - ::rtl::OUString getString( sal_Int32 nElement, const ::rtl::OUString& rDefault ) const; + ::rtl::OUString getString( sal_Int32 nAttrToken, const ::rtl::OUString& rDefault ) const; /** Returns the decoded string value of the specified attribute, or the passed default string if the attribute is missing. */ - ::rtl::OUString getXString( sal_Int32 nElement, const ::rtl::OUString& rDefault ) const; + ::rtl::OUString getXString( sal_Int32 nAttrToken, const ::rtl::OUString& rDefault ) const; /** Returns the double value of the specified attribute, or the passed default value if the attribute is missing or not convertible to a double. */ - double getDouble( sal_Int32 nElement, double fDefault ) const; + double getDouble( sal_Int32 nAttrToken, double fDefault ) const; /** Returns the 32-bit signed integer value of the specified attribute, or the passed default value if the attribute is missing or not convertible to integer. */ - sal_Int32 getInteger( sal_Int32 nElement, sal_Int32 nDefault ) const; + sal_Int32 getInteger( sal_Int32 nAttrToken, sal_Int32 nDefault ) const; /** Returns the 32-bit unsigned integer value of the specified attribute, or the passed default value if the attribute is missing or not convertible to unsigned. */ - sal_uInt32 getUnsigned( sal_Int32 nElement, sal_uInt32 nDefault ) const; + sal_uInt32 getUnsigned( sal_Int32 nAttrToken, sal_uInt32 nDefault ) const; /** Returns the 64-bit signed integer value of the specified attribute, or the passed default value if the attribute is missing or not convertible to integer. */ - sal_Int64 getHyper( sal_Int32 nElement, sal_Int64 nDefault ) const; + sal_Int64 getHyper( sal_Int32 nAttrToken, sal_Int64 nDefault ) const; /** Returns the 32-bit signed integer value of the specified attribute (hexadecimal), or the passed default value if the attribute is missing or not convertible. */ - sal_Int32 getIntegerHex( sal_Int32 nElement, sal_Int32 nDefault ) const; + sal_Int32 getIntegerHex( sal_Int32 nAttrToken, sal_Int32 nDefault ) const; /** Returns the 32-bit unsigned integer value of the specified attribute (hexadecimal), or the passed default value if the attribute is missing or not convertible. */ - sal_uInt32 getUnsignedHex( sal_Int32 nElement, sal_uInt32 nDefault ) const; + sal_uInt32 getUnsignedHex( sal_Int32 nAttrToken, sal_uInt32 nDefault ) const; /** Returns the 64-bit signed integer value of the specified attribute (hexadecimal), or the passed default value if the attribute is missing or not convertible. */ - sal_Int64 getHyperHex( sal_Int32 nElement, sal_Int64 nDefault ) const; + sal_Int64 getHyperHex( sal_Int32 nAttrToken, sal_Int64 nDefault ) const; /** Returns the boolean value of the specified attribute, or the passed default value if the attribute is missing or not convertible to bool. */ - bool getBool( sal_Int32 nElement, bool bDefault ) const; + bool getBool( sal_Int32 nAttrToken, bool bDefault ) const; /** Returns the date/time value of the specified attribute, or the default value if the attribute is missing or not convertible to a date/time value. */ - ::com::sun::star::util::DateTime getDateTime( sal_Int32 nElement, const ::com::sun::star::util::DateTime& rDefault ) const; + ::com::sun::star::util::DateTime getDateTime( sal_Int32 nAttrToken, const ::com::sun::star::util::DateTime& rDefault ) const; private: ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList > diff --git a/oox/inc/oox/helper/graphichelper.hxx b/oox/inc/oox/helper/graphichelper.hxx index 2d0964b37715..37002940cb17 100644 --- a/oox/inc/oox/helper/graphichelper.hxx +++ b/oox/inc/oox/helper/graphichelper.hxx @@ -34,6 +34,7 @@ #include <com/sun/star/awt/DeviceInfo.hpp> #include <com/sun/star/uno/Reference.hxx> #include "oox/helper/binarystreambase.hxx" +#include "oox/helper/storagebase.hxx" namespace com { namespace sun { namespace star { namespace awt { struct Point; } @@ -68,9 +69,12 @@ class GraphicHelper public: explicit GraphicHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxTargetFrame ); + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxTargetFrame, + const StorageRef& rxStorage ); virtual ~GraphicHelper(); + // System colors and predefined colors ------------------------------------ + /** Returns a system color specified by the passed XML token identifier. */ sal_Int32 getSystemColor( sal_Int32 nToken, sal_Int32 nDefaultRgb = API_RGB_TRANSPARENT ) const; /** Derived classes may implement to resolve a scheme color from the passed XML token identifier. */ @@ -78,6 +82,8 @@ public: /** Derived classes may implement to resolve a palette index to an RGB color. */ virtual sal_Int32 getPaletteColor( sal_Int32 nPaletteIdx ) const; + // Device info and device dependent unit conversion ----------------------- + /** Returns information about the output device. */ const ::com::sun::star::awt::DeviceInfo& getDeviceInfo() const; @@ -109,6 +115,8 @@ public: /** Converts the passed size from 1/100 mm to AppFont units. */ ::com::sun::star::awt::Size convertHmmToAppFont( const ::com::sun::star::awt::Size& rHmm ) const; + // Graphics and graphic objects ------------------------------------------ + /** Imports a graphic from the passed input stream. */ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > importGraphic( @@ -118,6 +126,10 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > importGraphic( const StreamDataSequence& rGraphicData ) const; + /** Imports a graphic from the storage stream with the passed path and name. */ + ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > + importEmbeddedGraphic( const ::rtl::OUString& rStreamName ) const; + /** Creates a persistent graphic object from the passed graphic. @return The URL of the created and internally cached graphic object. */ ::rtl::OUString createGraphicObject( @@ -132,16 +144,24 @@ public: @return The URL of the created and internally cached graphic object. */ ::rtl::OUString importGraphicObject( const StreamDataSequence& rGraphicData ) const; + /** Imports a graphic object from the storage stream with the passed path and name. + @return The URL of the created and internally cached graphic object. */ + ::rtl::OUString importEmbeddedGraphicObject( const ::rtl::OUString& rStreamName ) const; + + // ------------------------------------------------------------------------ private: typedef ::std::map< sal_Int32, sal_Int32 > SystemPalette; typedef ::std::deque< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > > GraphicObjectDeque; + typedef ::std::map< ::rtl::OUString, ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > > EmbeddedGraphicMap; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxCompContext; ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicProvider > mxGraphicProvider; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XUnitConversion > mxUnitConversion; ::com::sun::star::awt::DeviceInfo maDeviceInfo; /// Current output device info. SystemPalette maSystemPalette; /// Maps system colors (XML tokens) to RGB color values. + StorageRef mxStorage; /// Storage containing embedded graphics. mutable GraphicObjectDeque maGraphicObjects; /// Caches all created graphic objects to keep them alive. + mutable EmbeddedGraphicMap maEmbeddedGraphics; /// Maps all embedded graphics by their storage path. const ::rtl::OUString maGraphicObjScheme; /// The URL scheme name for graphic objects. double mfPixelPerHmmX; /// Number of screen pixels per 1/100 mm in X direction. double mfPixelPerHmmY; /// Number of screen pixels per 1/100 mm in Y direction. diff --git a/oox/inc/oox/vml/vmldrawing.hxx b/oox/inc/oox/vml/vmldrawing.hxx index 2312514d7117..c2f8432dca6f 100644 --- a/oox/inc/oox/vml/vmldrawing.hxx +++ b/oox/inc/oox/vml/vmldrawing.hxx @@ -36,6 +36,7 @@ namespace com { namespace sun { namespace star { namespace awt { struct Rectangle; } namespace awt { class XControlModel; } namespace drawing { class XDrawPage; } + namespace drawing { class XShape; } } } } namespace oox { namespace core { class XmlFilterBase; } } @@ -123,7 +124,8 @@ public: /** Final processing after import of the fragment. */ void finalizeFragmentImport(); - /** Creates and inserts all UNO shapes into the passed container. */ + /** Creates and inserts all UNO shapes into the passed container. The virtual + function notifyShapeInserted() will be called for each new shape. */ void convertAndInsert() const; /** Returns the registered info structure for an OLE object, if extant. */ @@ -146,6 +148,12 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel, const ShapeClientData& rClientData ) const; + /** Derived classes may want to know that a shape has been inserted. Will + be called from the convertAndInsert() implementation. */ + virtual void notifyShapeInserted( + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape, + const ::com::sun::star::awt::Rectangle& rShapeRect ); + private: typedef ::std::auto_ptr< ::oox::ole::EmbeddedForm > EmbeddedFormPtr; typedef ::std::auto_ptr< ShapeContainer > ShapeContainerPtr; diff --git a/oox/inc/oox/vml/vmlformatting.hxx b/oox/inc/oox/vml/vmlformatting.hxx index 1a9c1811cf6b..db67d7a85af4 100644 --- a/oox/inc/oox/vml/vmlformatting.hxx +++ b/oox/inc/oox/vml/vmlformatting.hxx @@ -169,6 +169,7 @@ struct FillModel OptValue< double > moFocus; /// Linear gradient focus of second color. OptValue< DoublePair > moFocusPos; /// Rectanguar gradient focus position of second color. OptValue< DoublePair > moFocusSize; /// Rectanguar gradient focus size of second color. + OptValue< ::rtl::OUString > moBitmapPath; /// Path to fill bitmap fragment. OptValue< bool > moRotate; /// True = rotate gradient/bitmap with shape. void assignUsed( const FillModel& rSource ); diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx index 18eaa7513fc5..7c770df28477 100644 --- a/oox/inc/oox/vml/vmlshape.hxx +++ b/oox/inc/oox/vml/vmlshape.hxx @@ -83,7 +83,7 @@ struct ShapeTypeModel class ShapeType { public: - explicit ShapeType( const Drawing& rDrawing ); + explicit ShapeType( Drawing& rDrawing ); virtual ~ShapeType(); /** Returns read/write access to the shape template model structure. */ @@ -109,7 +109,7 @@ private: ::com::sun::star::awt::Rectangle getRelRectangle() const; protected: - const Drawing& mrDrawing; /// The VML drawing page that contains this shape. + Drawing& mrDrawing; /// The VML drawing page that contains this shape. ShapeTypeModel maTypeModel; /// The model structure containing shape type data. }; @@ -180,7 +180,7 @@ public: const ShapeParentAnchor* pParentAnchor = 0 ) const; protected: - explicit ShapeBase( const Drawing& rDrawing ); + explicit ShapeBase( Drawing& rDrawing ); /** Derived classes create the corresponding XShape and insert it into the passed container. */ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > @@ -207,7 +207,7 @@ protected: class SimpleShape : public ShapeBase { public: - explicit SimpleShape( const Drawing& rDrawing, const ::rtl::OUString& rService ); + explicit SimpleShape( Drawing& rDrawing, const ::rtl::OUString& rService ); protected: /** Creates the corresponding XShape and inserts it into the passed container. */ @@ -226,7 +226,7 @@ private: class RectangleShape : public SimpleShape { public: - explicit RectangleShape( const Drawing& rDrawing ); + explicit RectangleShape( Drawing& rDrawing ); }; // ============================================================================ @@ -235,7 +235,7 @@ public: class EllipseShape : public SimpleShape { public: - explicit EllipseShape( const Drawing& rDrawing ); + explicit EllipseShape( Drawing& rDrawing ); }; // ============================================================================ @@ -244,7 +244,7 @@ public: class PolyLineShape : public SimpleShape { public: - explicit PolyLineShape( const Drawing& rDrawing ); + explicit PolyLineShape( Drawing& rDrawing ); protected: /** Creates the corresponding XShape and inserts it into the passed container. */ @@ -260,7 +260,7 @@ protected: class CustomShape : public SimpleShape { public: - explicit CustomShape( const Drawing& rDrawing ); + explicit CustomShape( Drawing& rDrawing ); protected: /** Creates the corresponding XShape and inserts it into the passed container. */ @@ -277,7 +277,7 @@ protected: class ComplexShape : public CustomShape { public: - explicit ComplexShape( const Drawing& rDrawing ); + explicit ComplexShape( Drawing& rDrawing ); protected: /** Creates the corresponding XShape and inserts it into the passed container. */ @@ -293,7 +293,7 @@ protected: class GroupShape : public ShapeBase { public: - explicit GroupShape( const Drawing& rDrawing ); + explicit GroupShape( Drawing& rDrawing ); virtual ~GroupShape(); /** Returns read/write access to the container of child shapes and templates. */ diff --git a/oox/inc/oox/vml/vmlshapecontainer.hxx b/oox/inc/oox/vml/vmlshapecontainer.hxx index d2682c89fd6c..a878fda2b74c 100644 --- a/oox/inc/oox/vml/vmlshapecontainer.hxx +++ b/oox/inc/oox/vml/vmlshapecontainer.hxx @@ -56,7 +56,7 @@ struct ShapeParentAnchor class ShapeContainer { public: - explicit ShapeContainer( const Drawing& rDrawing ); + explicit ShapeContainer( Drawing& rDrawing ); ~ShapeContainer(); /** Creates and returns a new shape template object. */ @@ -101,7 +101,7 @@ private: typedef RefMap< ::rtl::OUString, ShapeType > ShapeTypeMap; typedef RefMap< ::rtl::OUString, ShapeBase > ShapeMap; - const Drawing& mrDrawing; /// The VML drawing page that contains this shape. + Drawing& mrDrawing; /// The VML drawing page that contains this shape. ShapeTypeVector maTypes; /// All shape templates. ShapeVector maShapes; /// All shape definitions. ShapeTypeMap maTypesById; /// All shape templates mapped by identifier. diff --git a/oox/inc/oox/vml/vmlshapecontext.hxx b/oox/inc/oox/vml/vmlshapecontext.hxx index a72d3fd09039..bda7d90f34e2 100644 --- a/oox/inc/oox/vml/vmlshapecontext.hxx +++ b/oox/inc/oox/vml/vmlshapecontext.hxx @@ -94,6 +94,9 @@ private: /** Processes the 'style' attribute. */ void setStyle( const ::rtl::OUString& rStyle ); + /** Resolve a relation identifier to a fragment path. */ + OptValue< ::rtl::OUString > decodeFragmentPath( const AttributeList& rAttribs, sal_Int32 nToken ) const; + private: ShapeTypeModel& mrTypeModel; }; diff --git a/oox/inc/oox/xls/biffhelper.hxx b/oox/inc/oox/xls/biffhelper.hxx index 10c62aa17513..ce43e44fb613 100644 --- a/oox/inc/oox/xls/biffhelper.hxx +++ b/oox/inc/oox/xls/biffhelper.hxx @@ -151,6 +151,7 @@ const sal_Int32 OOBIN_ID_NUMFMT = 0x002C; const sal_Int32 OOBIN_ID_NUMFMTS = 0x0267; const sal_Int32 OOBIN_ID_OLEOBJECT = 0x027F; const sal_Int32 OOBIN_ID_OLEOBJECTS = 0x027E; +const sal_Int32 OOBIN_ID_OLESIZE = 0x0225; const sal_Int32 OOBIN_ID_PAGEMARGINS = 0x01DC; const sal_Int32 OOBIN_ID_PAGESETUP = 0x01DE; const sal_Int32 OOBIN_ID_PANE = 0x0097; @@ -428,6 +429,7 @@ const sal_uInt16 BIFF2_ID_NUMBER = 0x0003; const sal_uInt16 BIFF3_ID_NUMBER = 0x0203; const sal_uInt16 BIFF_ID_OBJ = 0x005D; const sal_uInt16 BIFF_ID_OBJECTPROTECT = 0x0063; +const sal_uInt16 BIFF_ID_OLESIZE = 0x00DE; const sal_uInt16 BIFF_ID_PAGELAYOUTVIEW = 0x088B; const sal_uInt16 BIFF_ID_PAGESETUP = 0x00A1; const sal_uInt16 BIFF_ID_PALETTE = 0x0092; diff --git a/oox/inc/oox/xls/drawingfragment.hxx b/oox/inc/oox/xls/drawingfragment.hxx index 22fddd373a86..66d716220b8a 100644 --- a/oox/inc/oox/xls/drawingfragment.hxx +++ b/oox/inc/oox/xls/drawingfragment.hxx @@ -177,6 +177,11 @@ public: virtual void convertControlClientData( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel, const ::oox::vml::ShapeClientData& rClientData ) const; + + /** Updates the bounding box covering all shapes of this drawing. */ + virtual void notifyShapeInserted( + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape, + const ::com::sun::star::awt::Rectangle& rShapeRect ); }; // ============================================================================ diff --git a/oox/inc/oox/xls/viewsettings.hxx b/oox/inc/oox/xls/viewsettings.hxx index 9715644cd54c..1f82aedeef91 100644 --- a/oox/inc/oox/xls/viewsettings.hxx +++ b/oox/inc/oox/xls/viewsettings.hxx @@ -179,15 +179,24 @@ public: /** Imports the workbookView element containing workbook view settings. */ void importWorkbookView( const AttributeList& rAttribs ); + /** Imports the oleSize element containing the visible size of the workbook. */ + void importOleSize( const AttributeList& rAttribs ); /** Imports the WORKBOOKVIEW record containing workbook view settings. */ void importWorkbookView( RecordInputStream& rStrm ); + /** Imports the OLESIZE record containing the visible size of the workbook. */ + void importOleSize( RecordInputStream& rStrm ); /** Imports the WINDOW1 record containing workbook view settings. */ void importWindow1( BiffInputStream& rStrm ); + /** Imports the OLESIZE record containing the visible size of the workbook. */ + void importOleSize( BiffInputStream& rStrm ); /** Stores converted view settings for a specific worksheet. */ void setSheetViewSettings( sal_Int16 nSheet, const SheetViewModelRef& rxSheetView, const ::com::sun::star::uno::Any& rProperties ); + /** Stores the used area for a specific worksheet. */ + void setSheetUsedArea( + const ::com::sun::star::table::CellRangeAddress& rUsedArea ); /** Converts all imported document view settings. */ void finalizeImport(); @@ -199,13 +208,18 @@ private: WorkbookViewModel& createWorkbookView(); private: - typedef RefVector< WorkbookViewModel > WorkbookViewModelVec; - typedef RefMap< sal_Int16, SheetViewModel > SheetViewModelMap; - typedef ::std::map< sal_Int16, ::com::sun::star::uno::Any > SheetPropertiesMap; + typedef RefVector< WorkbookViewModel > WorkbookViewModelVec; + typedef RefMap< sal_Int16, SheetViewModel > SheetViewModelMap; + typedef ::std::map< sal_Int16, ::com::sun::star::uno::Any > SheetPropertiesMap; + typedef ::std::map< sal_Int16, ::com::sun::star::table::CellRangeAddress > SheetUsedAreaMap; WorkbookViewModelVec maBookViews; /// Workbook view models. SheetViewModelMap maSheetViews; /// Active view model for each sheet. SheetPropertiesMap maSheetProps; /// Converted property sequences for each sheet. + SheetUsedAreaMap maSheetUsedAreas; /// Used area (cell range) of every sheet. + ::com::sun::star::table::CellRangeAddress + maOleSize; /// Visible area if this is an embedded OLE object. + bool mbValidOleSize; /// True = imported OLE size is a valid cell range. }; // ============================================================================ diff --git a/oox/inc/oox/xls/workbooksettings.hxx b/oox/inc/oox/xls/workbooksettings.hxx index d0f4ca17e73e..8ba322103955 100644 --- a/oox/inc/oox/xls/workbooksettings.hxx +++ b/oox/inc/oox/xls/workbooksettings.hxx @@ -109,8 +109,6 @@ public: /** Sets the save external linked values flag, e.g. from the WSBOOL record. */ void setSaveExtLinkValues( bool bSaveExtLinks ); - /** Imports the FILESHARING record. */ - void importFileSharing( BiffInputStream& rStrm ); /** Imports the BOOKBOOL record. */ void importBookBool( BiffInputStream& rStrm ); /** Imports the CALCCOUNT record. */ @@ -123,6 +121,8 @@ public: void importDateMode( BiffInputStream& rStrm ); /** Imports the DELTA record. */ void importDelta( BiffInputStream& rStrm ); + /** Imports the FILESHARING record. */ + void importFileSharing( BiffInputStream& rStrm ); /** Imports the HIDEOBJ record. */ void importHideObj( BiffInputStream& rStrm ); /** Imports the ITERATION record. */ diff --git a/oox/inc/oox/xls/worksheethelper.hxx b/oox/inc/oox/xls/worksheethelper.hxx index 4fdd827ff648..632d7027403f 100644 --- a/oox/inc/oox/xls/worksheethelper.hxx +++ b/oox/inc/oox/xls/worksheethelper.hxx @@ -35,6 +35,7 @@ namespace com { namespace sun { namespace star { namespace awt { struct Point; } + namespace awt { struct Rectangle; } namespace awt { struct Size; } namespace util { struct DateTime; } namespace drawing { class XDrawPage; } @@ -355,8 +356,6 @@ public: /** Changes the current sheet type. */ void setSheetType( WorksheetType eSheetType ); - /** Sets the dimension (used area) of the sheet. */ - void setDimension( const ::com::sun::star::table::CellRangeAddress& rRange ); /** Stores the cell formatting data of the current cell. */ void setCellFormat( const CellModel& rModel ); /** Merges the cells in the passed cell range. */ @@ -380,6 +379,14 @@ public: /** Sets the path to the legacy VML drawing fragment of this sheet. */ void setVmlDrawingPath( const ::rtl::OUString& rVmlDrawingPath ); + /** Extends the used area of this sheet by the passed cell position. */ + void extendUsedArea( const ::com::sun::star::table::CellAddress& rAddress ); + /** Extends the used area of this sheet by the passed cell range. */ + void extendUsedArea( const ::com::sun::star::table::CellRangeAddress& rRange ); + /** Extends the shape bounding box by the position and size of the passed rectangle. */ + void extendShapeBoundingBox( + const ::com::sun::star::awt::Rectangle& rShapeRect ); + /** Sets base width for all columns (without padding pixels). This value is only used, if width has not been set with setDefaultColumnWidth(). */ void setBaseColumnWidth( sal_Int32 nWidth ); |