diff options
Diffstat (limited to 'oox/inc')
-rw-r--r-- | oox/inc/oox/core/filterbase.hxx | 12 | ||||
-rw-r--r-- | oox/inc/oox/core/filterdetect.hxx | 1 | ||||
-rw-r--r-- | oox/inc/oox/dump/dumperbase.hxx | 2 | ||||
-rw-r--r-- | oox/inc/oox/helper/attributelist.hxx | 91 | ||||
-rw-r--r-- | oox/inc/oox/helper/graphichelper.hxx | 22 | ||||
-rwxr-xr-x | oox/inc/oox/ole/axbinaryreader.hxx | 20 | ||||
-rw-r--r-- | oox/inc/oox/ole/axcontrol.hxx | 72 | ||||
-rwxr-xr-x | oox/inc/oox/ole/vbacontrol.hxx | 8 | ||||
-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 |
18 files changed, 231 insertions, 77 deletions
diff --git a/oox/inc/oox/core/filterbase.hxx b/oox/inc/oox/core/filterbase.hxx index 31e26d38f590..1757b2be4334 100644 --- a/oox/inc/oox/core/filterbase.hxx +++ b/oox/inc/oox/core/filterbase.hxx @@ -113,9 +113,6 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getGlobalFactory() const; - /** Returns the media descriptor. */ - ::comphelper::MediaDescriptor& getMediaDescriptor() const; - /** Returns the document model (always existing). */ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& getModel() const; @@ -136,6 +133,9 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& getInteractionHandler() const; + /** Returns the media descriptor. */ + ::comphelper::MediaDescriptor& getMediaDescriptor() const; + /** Returns the URL of the imported or exported file. */ const ::rtl::OUString& getFileUrl() const; @@ -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/core/filterdetect.hxx b/oox/inc/oox/core/filterdetect.hxx index e38008305d71..76e46050c24a 100644 --- a/oox/inc/oox/core/filterdetect.hxx +++ b/oox/inc/oox/core/filterdetect.hxx @@ -41,6 +41,7 @@ namespace com { namespace sun { namespace star { } } } namespace comphelper { class MediaDescriptor; } + namespace oox { class AttributeList; } namespace oox { diff --git a/oox/inc/oox/dump/dumperbase.hxx b/oox/inc/oox/dump/dumperbase.hxx index f65eeceebf27..ed1a3e1fc938 100644 --- a/oox/inc/oox/dump/dumperbase.hxx +++ b/oox/inc/oox/dump/dumperbase.hxx @@ -39,9 +39,9 @@ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/util/DateTime.hpp> #include <comphelper/mediadescriptor.hxx> +#include "oox/helper/binaryinputstream.hxx" #include "oox/helper/helper.hxx" #include "oox/helper/storagebase.hxx" -#include "oox/helper/binaryinputstream.hxx" #define OOX_INCLUDE_DUMPER (OSL_DEBUG_LEVEL > 0) 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/ole/axbinaryreader.hxx b/oox/inc/oox/ole/axbinaryreader.hxx index d036e958a446..e3f102716e17 100755 --- a/oox/inc/oox/ole/axbinaryreader.hxx +++ b/oox/inc/oox/ole/axbinaryreader.hxx @@ -87,6 +87,9 @@ private: /** A pair of integer values as a property. */ typedef ::std::pair< sal_Int32, sal_Int32 > AxPairData; +/** An array of string values as a property. */ +typedef ::std::vector< ::rtl::OUString > AxStringArray; + // ============================================================================ const sal_uInt32 AX_FONTDATA_BOLD = 0x00000001; @@ -149,6 +152,9 @@ public: /** Reads the next string property from the stream, if the respective flag in the property mask is set. */ void readStringProperty( ::rtl::OUString& orValue ); + /** Reads a string array property from the stream, if the respective flag + in the property mask is set. */ + void readStringArrayProperty( AxStringArray& orArray ); /** Reads the next GUID property from the stream, if the respective flag in the property mask is set. The GUID will be enclosed in braces. */ void readGuidProperty( ::rtl::OUString& orGuid ); @@ -172,6 +178,9 @@ public: /** Skips the next string property in the stream, if the respective flag in the property mask is set. */ inline void skipStringProperty() { readStringProperty( maDummyString ); } + /** Skips the next string array property in the stream, if the respective + flag in the property mask is set. */ + inline void skipStringArrayProperty() { readStringArrayProperty( maDummyStringArray ); } /** Skips the next GUID property in the stream, if the respective flag in the property mask is set. */ inline void skipGuidProperty() { readGuidProperty( maDummyString ); } @@ -221,6 +230,16 @@ private: virtual bool readProperty( AxAlignedInputStream& rInStrm ); }; + /** Complex property for an array of strings. */ + struct StringArrayProperty : public ComplexProperty + { + AxStringArray& mrArray; + sal_uInt32 mnSize; + inline explicit StringArrayProperty( AxStringArray& rArray, sal_uInt32 nSize ) : + mrArray( rArray ), mnSize( nSize ) {} + virtual bool readProperty( AxAlignedInputStream& rInStrm ); + }; + /** Complex property for a GUID value. */ struct GuidProperty : public ComplexProperty { @@ -261,6 +280,7 @@ private: AxFontData maDummyFontData; /// Dummy font for unsupported properties. StreamDataSequence maDummyPicData; /// Dummy picture for unsupported properties. ::rtl::OUString maDummyString; /// Dummy string for unsupported properties. + AxStringArray maDummyStringArray; /// Dummy string array for unsupported properties. sal_Int64 mnPropFlags; /// Flags specifying existing properties. sal_Int64 mnNextProp; /// Next property to read. sal_Int64 mnPropsEnd; /// End position of simple/large properties. diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx index 7c533334cc49..8df45ece6065 100644 --- a/oox/inc/oox/ole/axcontrol.hxx +++ b/oox/inc/oox/ole/axcontrol.hxx @@ -111,8 +111,12 @@ enum ApiControlType API_CONTROL_COMBOBOX, API_CONTROL_SPINBUTTON, API_CONTROL_SCROLLBAR, + API_CONTROL_TABSTRIP, API_CONTROL_PROGRESSBAR, API_CONTROL_GROUPBOX, + API_CONTROL_FRAME, + API_CONTROL_PAGE, + API_CONTROL_MULTIPAGE, API_CONTROL_DIALOG }; @@ -639,19 +643,50 @@ private: // ============================================================================ +/** Model for a Forms 2.0 tabstrip control. */ +class AxTabStripModel : public AxFontDataModel +{ +public: + explicit AxTabStripModel(); + + virtual bool importBinaryModel( BinaryInputStream& rInStrm ); + + virtual ApiControlType getControlType() const; + virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const; + + /** Returns the caption with the specified zero-based index. */ + ::rtl::OUString getCaption( sal_Int32 nIndex ) const; + +private: + AxStringArray maCaptions; /// Captions of all tabs. + sal_uInt32 mnBackColor; /// Fill color. + sal_uInt32 mnTextColor; /// Text color. + sal_uInt32 mnFlags; /// Various flags. + sal_Int32 mnSelectedTab; /// The index of the selected tab. + sal_uInt32 mnTabStyle; /// Visual style of the tabs. + sal_Int32 mnTabFlagCount; /// Number of entries in tab flag array. +}; + +typedef ::boost::shared_ptr< AxTabStripModel > AxTabStripModelRef; + +// ============================================================================ + typedef ::std::vector< ::rtl::OUString > AxClassTable; /** Base class for ActiveX container controls. */ class AxContainerModelBase : public AxFontDataModel { public: - explicit AxContainerModelBase(); + explicit AxContainerModelBase( bool bFontSupport = false ); /** Allows to set single properties specified by XML token identifier. */ virtual void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue ); /** Reads the leading structure in the 'f' stream containing the model for this control. */ virtual bool importBinaryModel( BinaryInputStream& rInStrm ); + /** Converts font settings if supported. */ + virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const; + /** Reads the class table structure for embedded controls following the own model from the 'f' stream. */ bool importClassTable( BinaryInputStream& rInStrm, AxClassTable& orClassTable ); @@ -672,13 +707,14 @@ protected: sal_Int32 mnPicAlign; /// Anchor position of the picture. sal_Int32 mnPicSizeMode; /// Clip, stretch, zoom. bool mbPicTiling; /// True = picture is repeated. + bool mbFontSupport; /// True = control supports the font property. }; typedef ::boost::shared_ptr< AxContainerModelBase > AxContainerModelRef; // ============================================================================ -/** Model for a Forms 2.0 frame (group box). */ +/** Model for a Forms 2.0 frame control. */ class AxFrameModel : public AxContainerModelBase { public: @@ -690,6 +726,38 @@ public: // ============================================================================ +/** Model for a Forms 2.0 formpage control (a single page in a multipage control). */ +class AxFormPageModel : public AxContainerModelBase +{ +public: + explicit AxFormPageModel(); + + virtual ApiControlType getControlType() const; + virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const; +}; + +// ============================================================================ + +/** Model for a Forms 2.0 multipage control. Contains the tabstrip control + (class AxTabStripModel) and the single pages (class AxFormPageModel). */ +class AxMultiPageModel : public AxContainerModelBase +{ +public: + explicit AxMultiPageModel(); + + virtual ApiControlType getControlType() const; + virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const; + + /** Sets the tabstrip control model related to this multipage control. + Contains all formatting attributes of the page tabs. */ + void setTabStripModel( const AxTabStripModelRef& rxTabStrip ); + +private: + AxTabStripModelRef mxTabStrip; +}; + +// ============================================================================ + /** Model for a Forms 2.0 user form. */ class AxUserFormModel : public AxContainerModelBase { diff --git a/oox/inc/oox/ole/vbacontrol.hxx b/oox/inc/oox/ole/vbacontrol.hxx index ec1c25be6952..c2490b3506bf 100755 --- a/oox/inc/oox/ole/vbacontrol.hxx +++ b/oox/inc/oox/ole/vbacontrol.hxx @@ -39,8 +39,6 @@ namespace oox { class StorageBase; } namespace oox { namespace ole { -class VbaFormControl; - // ============================================================================ /** Common properties for all controls that are part of a VBA user form or of @@ -62,6 +60,10 @@ public: inline const ::rtl::OUString& getName() const { return maName; } /** Returns the position of the control in its parent. */ inline const AxPairData& getPosition() const { return maPos; } + /** Returns the unique identifier of this control. */ + inline sal_Int32 getId() const { return mnId; } + /** Returns true, if the control is visible. */ + bool isVisible() const; /** Returns true, if this control is a container control. */ bool isContainer() const; /** Returns the length of the stream data for stream based controls. */ @@ -122,6 +124,8 @@ public: /** Returns the programmatical name of the control. */ ::rtl::OUString getControlName() const; + /** Returns the unique identifier of this control. */ + sal_Int32 getControlId() const; /** Creates the UNO control model, inserts it into the passed container, and converts all control properties. */ 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 ); |