summaryrefslogtreecommitdiff
path: root/oox/inc
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@novell.com>2011-04-27 01:31:35 +0200
committerThorsten Behrens <tbehrens@novell.com>2011-04-27 01:31:35 +0200
commit48c61f72dd9e205f3d44838ae21cde0419538f1c (patch)
tree22eb884e19dd4f7c5b7dfaa0ba10bb77e12e3f19 /oox/inc
parentf433a86839499662cfc1356882b0538f01d850b6 (diff)
parent275e5c6544ff2f90cf6bd57b6a8a6293fe10943c (diff)
Merge commit 'ooo/DEV300_m106' into integration/dev300_m106
Conflicts: binfilter/bf_svtools/source/filter.vcl/jpeg/svt_jpegc.c filter/source/config/fragments/filters/SVG___Scalable_Vector_Graphics.xcu filter/source/config/fragments/internalgraphicfilters/svg_Import.xcu filter/source/config/fragments/types/svg_Scalable_Vector_Graphics.xcu filter/source/graphicfilter/eos2met/eos2met.cxx filter/source/msfilter/msvbahelper.cxx filter/source/svg/makefile.mk filter/source/svg/svgexport.cxx filter/source/svg/svgfilter.cxx filter/source/svg/svgfilter.hxx filter/source/svg/svgfontexport.cxx filter/source/svg/svgfontexport.hxx filter/source/svg/svgwriter.cxx filter/source/svg/svgwriter.hxx oox/inc/oox/core/relations.hxx oox/inc/oox/core/relationshandler.hxx oox/inc/oox/dump/biffdumper.hxx oox/inc/oox/dump/dffdumper.hxx oox/inc/oox/dump/dumperbase.hxx oox/inc/oox/dump/oledumper.hxx oox/inc/oox/dump/pptxdumper.hxx oox/inc/oox/helper/containerhelper.hxx oox/inc/oox/helper/propertyset.hxx oox/inc/oox/xls/commentsbuffer.hxx oox/inc/oox/xls/sharedformulabuffer.hxx oox/source/drawingml/shape.cxx oox/source/dump/oledumper.cxx oox/source/helper/binaryinputstream.cxx oox/source/helper/binaryoutputstream.cxx oox/source/helper/binarystreambase.cxx oox/source/helper/propertyset.cxx oox/source/ole/vbacontrol.cxx oox/source/ole/vbaproject.cxx oox/source/token/namespaces.hxx.tail oox/source/vml/vmlshape.cxx oox/source/xls/commentsbuffer.cxx oox/source/xls/condformatbuffer.cxx oox/source/xls/drawingfragment.cxx oox/source/xls/formulaparser.cxx oox/source/xls/pivotcachebuffer.cxx oox/source/xls/richstring.cxx oox/source/xls/sharedformulabuffer.cxx oox/source/xls/sheetdatacontext.cxx oox/source/xls/worksheethelper.cxx writerfilter/source/dmapper/DomainMapper_Impl.cxx
Diffstat (limited to 'oox/inc')
-rw-r--r--oox/inc/oox/core/contexthandler.hxx6
-rw-r--r--oox/inc/oox/core/fasttokenhandler.hxx6
-rw-r--r--oox/inc/oox/core/filterbase.hxx6
-rw-r--r--oox/inc/oox/core/fragmenthandler.hxx6
-rw-r--r--oox/inc/oox/core/relations.hxx6
-rw-r--r--oox/inc/oox/core/relationshandler.hxx6
-rw-r--r--oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx7
-rw-r--r--oox/inc/oox/drawingml/chart/converterbase.hxx3
-rw-r--r--oox/inc/oox/drawingml/color.hxx8
-rw-r--r--oox/inc/oox/drawingml/drawingmltypes.hxx23
-rw-r--r--oox/inc/oox/drawingml/fillproperties.hxx55
-rw-r--r--oox/inc/oox/drawingml/lineproperties.hxx48
-rwxr-xr-xoox/inc/oox/drawingml/shapepropertymap.hxx148
-rw-r--r--oox/inc/oox/dump/biffdumper.hxx4
-rw-r--r--oox/inc/oox/dump/dumperbase.hxx134
-rw-r--r--oox/inc/oox/dump/oledumper.hxx10
-rw-r--r--oox/inc/oox/dump/pptxdumper.hxx4
-rw-r--r--oox/inc/oox/dump/xlsbdumper.hxx4
-rw-r--r--oox/inc/oox/helper/binaryinputstream.hxx325
-rw-r--r--oox/inc/oox/helper/binaryoutputstream.hxx88
-rw-r--r--oox/inc/oox/helper/binarystreambase.hxx132
-rw-r--r--oox/inc/oox/helper/containerhelper.hxx56
-rw-r--r--oox/inc/oox/helper/graphichelper.hxx2
-rw-r--r--oox/inc/oox/helper/helper.hxx32
-rw-r--r--oox/inc/oox/helper/modelobjecthelper.hxx24
-rw-r--r--oox/inc/oox/helper/propertymap.hxx16
-rw-r--r--oox/inc/oox/helper/propertyset.hxx43
-rwxr-xr-x[-rw-r--r--]oox/inc/oox/helper/textinputstream.hxx91
-rw-r--r--oox/inc/oox/helper/zipstorage.hxx11
-rw-r--r--oox/inc/oox/ole/axbinaryreader.hxx18
-rw-r--r--oox/inc/oox/ole/oleobjecthelper.hxx4
-rwxr-xr-x[-rw-r--r--]oox/inc/oox/ole/olestorage.hxx10
-rw-r--r--oox/inc/oox/ole/vbacontrol.hxx2
-rw-r--r--oox/inc/oox/ole/vbainputstream.hxx19
-rwxr-xr-x[-rw-r--r--]oox/inc/oox/ole/vbamodule.hxx4
-rw-r--r--oox/inc/oox/ole/vbaproject.hxx2
-rw-r--r--oox/inc/oox/ppt/slidepersist.hxx4
-rw-r--r--oox/inc/oox/vml/vmldrawing.hxx4
-rw-r--r--oox/inc/oox/vml/vmlformatting.hxx13
-rw-r--r--oox/inc/oox/vml/vmlinputstream.hxx68
-rw-r--r--oox/inc/oox/xls/biffhelper.hxx5
-rw-r--r--oox/inc/oox/xls/biffinputstream.hxx30
-rw-r--r--oox/inc/oox/xls/biffoutputstream.hxx34
-rw-r--r--oox/inc/oox/xls/chartsheetfragment.hxx13
-rw-r--r--oox/inc/oox/xls/commentsbuffer.hxx15
-rw-r--r--oox/inc/oox/xls/condformatbuffer.hxx6
-rw-r--r--oox/inc/oox/xls/defnamesbuffer.hxx25
-rwxr-xr-xoox/inc/oox/xls/drawingbase.hxx147
-rw-r--r--oox/inc/oox/xls/drawingfragment.hxx99
-rwxr-xr-xoox/inc/oox/xls/drawingmanager.hxx521
-rw-r--r--oox/inc/oox/xls/excelfilter.hxx12
-rw-r--r--oox/inc/oox/xls/excelhandlers.hxx84
-rw-r--r--oox/inc/oox/xls/formulabase.hxx138
-rw-r--r--oox/inc/oox/xls/formulaparser.hxx37
-rw-r--r--oox/inc/oox/xls/ooxformulaparser.hxx6
-rw-r--r--oox/inc/oox/xls/pivotcachebuffer.hxx13
-rw-r--r--oox/inc/oox/xls/pivotcachefragment.hxx12
-rw-r--r--oox/inc/oox/xls/richstring.hxx45
-rw-r--r--oox/inc/oox/xls/sharedstringsbuffer.hxx13
-rwxr-xr-xoox/inc/oox/xls/sheetdatabuffer.hxx354
-rw-r--r--oox/inc/oox/xls/sheetdatacontext.hxx91
-rw-r--r--oox/inc/oox/xls/stylesbuffer.hxx7
-rw-r--r--oox/inc/oox/xls/workbookhelper.hxx68
-rw-r--r--oox/inc/oox/xls/worksheetfragment.hxx17
-rw-r--r--oox/inc/oox/xls/worksheethelper.hxx243
65 files changed, 2355 insertions, 1132 deletions
diff --git a/oox/inc/oox/core/contexthandler.hxx b/oox/inc/oox/core/contexthandler.hxx
index 9bad2003c12c..118d9396e354 100644
--- a/oox/inc/oox/core/contexthandler.hxx
+++ b/oox/inc/oox/core/contexthandler.hxx
@@ -58,9 +58,9 @@ typedef ::rtl::Reference< ContextHandler > ContextHandlerRef;
struct FragmentBaseData;
typedef ::boost::shared_ptr< FragmentBaseData > FragmentBaseDataRef;
-typedef ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastContextHandler > ContextHandlerImplBase;
+typedef ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastContextHandler > ContextHandler_BASE;
-class ContextHandler : public ContextHandlerImplBase
+class ContextHandler : public ContextHandler_BASE
{
public:
explicit ContextHandler( ContextHandler& rParent );
@@ -118,4 +118,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/core/fasttokenhandler.hxx b/oox/inc/oox/core/fasttokenhandler.hxx
index e3bdee6b728d..0297200d72a0 100644
--- a/oox/inc/oox/core/fasttokenhandler.hxx
+++ b/oox/inc/oox/core/fasttokenhandler.hxx
@@ -40,12 +40,12 @@ namespace core {
// ============================================================================
-typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::xml::sax::XFastTokenHandler > FastTokenHandlerBase;
+typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::xml::sax::XFastTokenHandler > FastTokenHandler_BASE;
/** Wrapper implementing the com.sun.star.xml.sax.XFastTokenHandler API interface
that provides access to the tokens generated from the internal token name list.
*/
-class FastTokenHandler : public FastTokenHandlerBase
+class FastTokenHandler : public FastTokenHandler_BASE
{
public:
explicit FastTokenHandler();
@@ -73,4 +73,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/core/filterbase.hxx b/oox/inc/oox/core/filterbase.hxx
index e2eea2587391..5a106354c769 100644
--- a/oox/inc/oox/core/filterbase.hxx
+++ b/oox/inc/oox/core/filterbase.hxx
@@ -94,9 +94,9 @@ typedef ::cppu::WeakImplHelper5<
::com::sun::star::document::XImporter,
::com::sun::star::document::XExporter,
::com::sun::star::document::XFilter >
- FilterBaseBase;
+ FilterBase_BASE;
-class OOX_DLLPUBLIC FilterBase : public FilterBaseBase, public ::cppu::BaseMutex
+class OOX_DLLPUBLIC FilterBase : public FilterBase_BASE, public ::cppu::BaseMutex
{
public:
explicit FilterBase(
@@ -318,4 +318,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/core/fragmenthandler.hxx b/oox/inc/oox/core/fragmenthandler.hxx
index 4cadfce9c121..05c645396c84 100644
--- a/oox/inc/oox/core/fragmenthandler.hxx
+++ b/oox/inc/oox/core/fragmenthandler.hxx
@@ -82,9 +82,9 @@ struct RecordInfo
// ============================================================================
-typedef ::cppu::ImplInheritanceHelper1< ContextHandler, ::com::sun::star::xml::sax::XFastDocumentHandler > FragmentHandlerImplBase;
+typedef ::cppu::ImplInheritanceHelper1< ContextHandler, ::com::sun::star::xml::sax::XFastDocumentHandler > FragmentHandler_BASE;
-class FragmentHandler : public FragmentHandlerImplBase
+class FragmentHandler : public FragmentHandler_BASE
{
public:
explicit FragmentHandler( XmlFilterBase& rFilter, const ::rtl::OUString& rFragmentPath );
@@ -136,4 +136,4 @@ typedef ::rtl::Reference< FragmentHandler > FragmentHandlerRef;
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/core/relations.hxx b/oox/inc/oox/core/relations.hxx
index 1b5432426f5d..64027ef361a8 100644
--- a/oox/inc/oox/core/relations.hxx
+++ b/oox/inc/oox/core/relations.hxx
@@ -26,8 +26,8 @@
*
************************************************************************/
-#ifndef OOX_CORE_RELATIONS
-#define OOX_CORE_RELATIONS
+#ifndef OOX_CORE_RELATIONS_HXX
+#define OOX_CORE_RELATIONS_HXX
#include <map>
#include <boost/shared_ptr.hpp>
@@ -108,4 +108,4 @@ private:
#endif // OOX_CORE_RELATIONS
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/core/relationshandler.hxx b/oox/inc/oox/core/relationshandler.hxx
index 06e237460b43..0e7bcf134064 100644
--- a/oox/inc/oox/core/relationshandler.hxx
+++ b/oox/inc/oox/core/relationshandler.hxx
@@ -26,8 +26,8 @@
*
************************************************************************/
-#ifndef OOX_CORE_RELATIONSHANDLER
-#define OOX_CORE_RELATIONSHANDLER
+#ifndef OOX_CORE_RELATIONSHANDLER_HXX
+#define OOX_CORE_RELATIONSHANDLER_HXX
#include "oox/core/fragmenthandler.hxx"
@@ -60,4 +60,4 @@ private:
#endif // OOX_CORE_RELATIONSHANDLER
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
index 37a49835e92f..502563ed9ce1 100644
--- a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
+++ b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
@@ -73,8 +73,7 @@ public:
void setPos( sal_Int32 nElement, sal_Int32 nParentContext, const ::rtl::OUString& rValue );
/** Calculates the resulting shape anchor in EMUs. */
- ::com::sun::star::awt::Rectangle
- calcEmuLocation( const EmuRectangle& rEmuChartRect ) const;
+ EmuRectangle calcAnchorRectEmu( const EmuRectangle& rChartRect ) const;
private:
AnchorPosModel maFrom; /// Top-left position relative to chart object.
@@ -110,7 +109,7 @@ private:
mxDrawPage; /// Drawing page of this sheet.
::oox::drawingml::ShapePtr mxShape; /// Current top-level shape.
ShapeAnchorRef mxAnchor; /// Current anchor of top-level shape.
- EmuRectangle maEmuChartRect; /// Position and size of the chart object for embedded shapes (in EMUs).
+ EmuRectangle maChartRectEmu; /// Position and size of the chart object for embedded shapes (in EMUs).
bool mbOleSupport; /// True = allow to insert OLE objects into the drawing page.
};
@@ -122,4 +121,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/drawingml/chart/converterbase.hxx b/oox/inc/oox/drawingml/chart/converterbase.hxx
index 1d717e75da63..3c50680edbd9 100644
--- a/oox/inc/oox/drawingml/chart/converterbase.hxx
+++ b/oox/inc/oox/drawingml/chart/converterbase.hxx
@@ -35,7 +35,6 @@
namespace com { namespace sun { namespace star {
namespace awt { struct Rectangle; }
namespace awt { struct Size; }
- namespace lang { class XMultiServiceFactory; }
namespace chart2 { class XChartDocument; }
namespace chart2 { class XTitle; }
namespace drawing { class XShape; }
@@ -158,4 +157,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/drawingml/color.hxx b/oox/inc/oox/drawingml/color.hxx
index 03fb0b402c34..62767ad7f803 100644
--- a/oox/inc/oox/drawingml/color.hxx
+++ b/oox/inc/oox/drawingml/color.hxx
@@ -93,10 +93,10 @@ public:
@param nPhClr Actual color for the phClr placeholder color used in theme style lists. */
sal_Int32 getColor( const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
- /** Returns true, if the color has a transparence set. */
- bool hasTransparence() const;
- /** Returns the transparence of the color (0 = opaque, 100 = full transparent). */
- sal_Int16 getTransparence() const;
+ /** Returns true, if the color is transparent. */
+ bool hasTransparency() const;
+ /** Returns the transparency of the color (0 = opaque, 100 = full transparent). */
+ sal_Int16 getTransparency() const;
private:
/** Internal helper for getColor(). */
diff --git a/oox/inc/oox/drawingml/drawingmltypes.hxx b/oox/inc/oox/drawingml/drawingmltypes.hxx
index 2ab2df9a80f1..86a1ddb7bd23 100644
--- a/oox/inc/oox/drawingml/drawingmltypes.hxx
+++ b/oox/inc/oox/drawingml/drawingmltypes.hxx
@@ -36,6 +36,7 @@
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
+#include "oox/helper/helper.hxx"
namespace oox {
namespace drawingml {
@@ -151,6 +152,23 @@ IndexRange GetIndexRange( const ::com::sun::star::uno::Reference< ::com::sun::st
// ============================================================================
+const sal_Int32 EMU_PER_HMM = 360; /// 360 EMUs per 1/100 mm.
+
+/** Converts the passed 32-bit integer value from 1/100 mm to EMUs. */
+inline sal_Int64 convertHmmToEmu( sal_Int32 nValue )
+{
+ return static_cast< sal_Int64 >( nValue ) * EMU_PER_HMM;
+}
+
+/** Converts the passed 64-bit integer value from EMUs to 1/100 mm. */
+inline sal_Int32 convertEmuToHmm( sal_Int64 nValue )
+{
+ return getLimitedValue< sal_Int32, sal_Int64 >( (nValue + EMU_PER_HMM / 2) / EMU_PER_HMM, 0, SAL_MAX_INT32 );
+}
+
+// ============================================================================
+
+/** A structure for a point with 64-bit interger components. */
struct EmuPoint
{
sal_Int64 X;
@@ -162,6 +180,7 @@ struct EmuPoint
// ============================================================================
+/** A structure for a size with 64-bit interger components. */
struct EmuSize
{
sal_Int64 Width;
@@ -173,11 +192,15 @@ struct EmuSize
// ============================================================================
+/** A structure for a rectangle with 64-bit interger components. */
struct EmuRectangle : public EmuPoint, public EmuSize
{
inline explicit EmuRectangle() {}
inline explicit EmuRectangle( const EmuPoint& rPos, const EmuSize& rSize ) : EmuPoint( rPos ), EmuSize( rSize ) {}
inline explicit EmuRectangle( sal_Int64 nX, sal_Int64 nY, sal_Int64 nWidth, sal_Int64 nHeight ) : EmuPoint( nX, nY ), EmuSize( nWidth, nHeight ) {}
+
+ inline void setPos( const EmuPoint& rPos ) { static_cast< EmuPoint& >( *this ) = rPos; }
+ inline void setSize( const EmuSize& rSize ) { static_cast< EmuSize& >( *this ) = rSize; }
};
// ============================================================================
diff --git a/oox/inc/oox/drawingml/fillproperties.hxx b/oox/inc/oox/drawingml/fillproperties.hxx
index 7fcfa38bddbd..9f7c1541172f 100644
--- a/oox/inc/oox/drawingml/fillproperties.hxx
+++ b/oox/inc/oox/drawingml/fillproperties.hxx
@@ -37,7 +37,6 @@
namespace oox {
class GraphicHelper;
- class ModelObjectHelper;
class PropertyMap;
class PropertySet;
}
@@ -45,38 +44,7 @@ namespace oox {
namespace oox {
namespace drawingml {
-// ============================================================================
-
-enum FillPropertyId
-{
- FillStyleId,
- FillColorId,
- FillTransparenceId,
- FillGradientId,
- FillBitmapUrlId,
- FillBitmapModeId,
- FillBitmapSizeXId,
- FillBitmapSizeYId,
- FillBitmapOffsetXId,
- FillBitmapOffsetYId,
- FillBitmapRectanglePointId,
- FillId_END
-};
-
-struct FillPropertyIds
-{
- const sal_Int32* mpnPropertyIds;
- bool mbNamedFillGradient;
- bool mbNamedFillBitmap;
-
- explicit FillPropertyIds(
- const sal_Int32* pnPropertyIds,
- bool bNamedFillGradient,
- bool bNamedFillBitmap );
-
- inline bool has( FillPropertyId ePropId ) const { return mpnPropertyIds[ ePropId ] >= 0; }
- inline sal_Int32 operator[]( FillPropertyId ePropId ) const { return mpnPropertyIds[ ePropId ]; }
-};
+class ShapePropertyMap;
// ============================================================================
@@ -148,8 +116,6 @@ struct FillProperties
PatternFillProperties maPatternProps; /// Properties for pattern fills.
BlipFillProperties maBlipProps; /// Properties for bitmap fills.
- static FillPropertyIds DEFAULT_IDS; /// Default fill property identifiers for shape fill.
-
/** Overwrites all members that are explicitly set in rSourceProps. */
void assignUsed( const FillProperties& rSourceProps );
@@ -159,19 +125,8 @@ struct FillProperties
/** Writes the properties to the passed property map. */
void pushToPropMap(
- PropertyMap& rPropMap,
- ModelObjectHelper& rModelObjHelper,
+ ShapePropertyMap& rPropMap,
const GraphicHelper& rGraphicHelper,
- const FillPropertyIds& rPropIds = DEFAULT_IDS,
- sal_Int32 nShapeRotation = 0,
- sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
-
- /** Writes the properties to the passed property set. */
- void pushToPropSet(
- PropertySet& rPropSet,
- ModelObjectHelper& rModelObjHelper,
- const GraphicHelper& rGraphicHelper,
- const FillPropertyIds& rPropIds = DEFAULT_IDS,
sal_Int32 nShapeRotation = 0,
sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
};
@@ -190,12 +145,6 @@ struct GraphicProperties
PropertyMap& rPropMap,
const GraphicHelper& rGraphicHelper,
sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
-
- /** Writes the properties to the passed property set. */
- void pushToPropSet(
- PropertySet& rPropSet,
- const GraphicHelper& rGraphicHelper,
- sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
};
// ============================================================================
diff --git a/oox/inc/oox/drawingml/lineproperties.hxx b/oox/inc/oox/drawingml/lineproperties.hxx
index bd8ac48eff05..8de222d27b40 100644
--- a/oox/inc/oox/drawingml/lineproperties.hxx
+++ b/oox/inc/oox/drawingml/lineproperties.hxx
@@ -36,40 +36,6 @@ namespace drawingml {
// ============================================================================
-enum LinePropertyId
-{
- LineStyleId,
- LineWidthId,
- LineColorId,
- LineTransparenceId,
- LineDashId,
- LineJointId,
- LineStartId,
- LineStartWidthId,
- LineStartCenterId,
- LineEndId,
- LineEndWidthId,
- LineEndCenterId,
- LineId_END
-};
-
-struct LinePropertyIds
-{
- const sal_Int32* mpnPropertyIds;
- bool mbNamedLineDash;
- bool mbNamedLineMarker;
-
- explicit LinePropertyIds(
- const sal_Int32* pnPropertyIds,
- bool bNamedLineDash,
- bool bNamedLineMarker );
-
- inline bool has( LinePropertyId ePropId ) const { return mpnPropertyIds[ ePropId ] >= 0; }
- inline sal_Int32 operator[]( LinePropertyId ePropId ) const { return mpnPropertyIds[ ePropId ]; }
-};
-
-// ============================================================================
-
struct LineArrowProperties
{
OptValue< sal_Int32 > moArrowType;
@@ -97,25 +63,13 @@ struct LineProperties
OptValue< sal_Int32 > moLineCap; /// Line cap (OOXML token).
OptValue< sal_Int32 > moLineJoint; /// Line joint type (OOXML token).
- static LinePropertyIds DEFAULT_IDS; /// Default line property identifiers.
-
/** Overwrites all members that are explicitly set in rSourceProps. */
void assignUsed( const LineProperties& rSourceProps );
/** Writes the properties to the passed property map. */
void pushToPropMap(
- PropertyMap& rPropMap,
- ModelObjectHelper& rModelObjHelper,
- const GraphicHelper& rGraphicHelper,
- const LinePropertyIds& rPropIds = DEFAULT_IDS,
- sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
-
- /** Writes the properties to the passed property map. */
- void pushToPropSet(
- PropertySet& rPropSet,
- ModelObjectHelper& rModelObjHelper,
+ ShapePropertyMap& rPropMap,
const GraphicHelper& rGraphicHelper,
- const LinePropertyIds& rPropIds = DEFAULT_IDS,
sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
};
diff --git a/oox/inc/oox/drawingml/shapepropertymap.hxx b/oox/inc/oox/drawingml/shapepropertymap.hxx
new file mode 100755
index 000000000000..e012d4b2a9ac
--- /dev/null
+++ b/oox/inc/oox/drawingml/shapepropertymap.hxx
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * 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 OOX_DRAWINGML_SHAPEPROPERTYMAP_HXX
+#define OOX_DRAWINGML_SHAPEPROPERTYMAP_HXX
+
+#include "oox/helper/propertymap.hxx"
+
+namespace oox { class ModelObjectHelper; }
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+/** Enumeration for various properties related to drawing shape formatting.
+
+ This is an abstraction for shape formatting properties that have different
+ names in various implementations, e.g. drawing shapes vs. chart objects.
+ */
+enum ShapePropertyId
+{
+ SHAPEPROP_LineStyle,
+ SHAPEPROP_LineWidth,
+ SHAPEPROP_LineColor,
+ SHAPEPROP_LineTransparency,
+ SHAPEPROP_LineDash, /// Explicit line dash or name of a line dash stored in a global container.
+ SHAPEPROP_LineJoint,
+ SHAPEPROP_LineStart, /// Explicit line start marker or name of a line marker stored in a global container.
+ SHAPEPROP_LineStartWidth,
+ SHAPEPROP_LineStartCenter,
+ SHAPEPROP_LineEnd, /// Explicit line end marker or name of a line marker stored in a global container.
+ SHAPEPROP_LineEndWidth,
+ SHAPEPROP_LineEndCenter,
+ SHAPEPROP_FillStyle,
+ SHAPEPROP_FillColor,
+ SHAPEPROP_FillTransparency,
+ SHAPEPROP_FillGradient, /// Explicit fill gradient or name of a fill gradient stored in a global container.
+ SHAPEPROP_FillBitmapUrl, /// Explicit fill bitmap URL or name of a fill bitmap URL stored in a global container.
+ SHAPEPROP_FillBitmapMode,
+ SHAPEPROP_FillBitmapSizeX,
+ SHAPEPROP_FillBitmapSizeY,
+ SHAPEPROP_FillBitmapOffsetX,
+ SHAPEPROP_FillBitmapOffsetY,
+ SHAPEPROP_FillBitmapRectanglePoint,
+ SHAPEPROP_END
+};
+
+// ============================================================================
+
+struct ShapePropertyInfo
+{
+ const sal_Int32* mpnPropertyIds; /// Pointer to array of property identifiers for all SHAPEPROP properties.
+ bool mbNamedLineMarker; /// True = use named line marker instead of explicit line marker.
+ bool mbNamedLineDash; /// True = use named line dash instead of explicit line dash.
+ bool mbNamedFillGradient; /// True = use named fill gradient instead of explicit fill gradient.
+ bool mbNamedFillBitmapUrl; /// True = use named fill bitmap URL instead of explicit fill bitmap URL.
+
+ static ShapePropertyInfo DEFAULT; /// Default property info (used as default parameter of other methods).
+
+ explicit ShapePropertyInfo(
+ const sal_Int32* pnPropertyIds,
+ bool bNamedLineMarker,
+ bool bNamedLineDash,
+ bool bNamedFillGradient,
+ bool bNamedFillBitmapUrl );
+
+ inline bool has( ShapePropertyId ePropId ) const { return mpnPropertyIds[ ePropId ] >= 0; }
+ inline sal_Int32 operator[]( ShapePropertyId ePropId ) const { return mpnPropertyIds[ ePropId ]; }
+};
+
+// ============================================================================
+
+class ShapePropertyMap : public PropertyMap
+{
+public:
+ explicit ShapePropertyMap(
+ ModelObjectHelper& rModelObjHelper,
+ const ShapePropertyInfo& rShapePropInfo = ShapePropertyInfo::DEFAULT );
+
+ /** Returns true, if the specified property is supported. */
+ bool supportsProperty( ShapePropertyId ePropId ) const;
+
+ /** Returns true, if named line markers are supported, and the specified
+ line marker has already been inserted into the marker table. */
+ bool hasNamedLineMarkerInTable( const ::rtl::OUString& rMarkerName ) const;
+
+ /** Sets the specified shape property to the passed value. */
+ bool setAnyProperty( ShapePropertyId ePropId, const ::com::sun::star::uno::Any& rValue );
+
+ /** Sets the specified shape property to the passed value. */
+ template< typename Type >
+ inline bool setProperty( ShapePropertyId ePropId, const Type& rValue )
+ { return setAnyProperty( ePropId, ::com::sun::star::uno::Any( rValue ) ); }
+
+ using PropertyMap::setAnyProperty;
+ using PropertyMap::setProperty;
+ using PropertyMap::operator[];
+
+private:
+ /** Sets an explicit line marker, or creates a named line marker. */
+ bool setLineMarker( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+ /** Sets an explicit line dash, or creates a named line dash. */
+ bool setLineDash( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+ /** Sets an explicit fill gradient, or creates a named fill gradient. */
+ bool setFillGradient( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+ /** Sets an explicit fill bitmap URL, or creates a named fill bitmap URL. */
+ bool setFillBitmapUrl( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+
+ // not implemented, to prevent implicit conversion from enum to int
+ ::com::sun::star::uno::Any& operator[]( ShapePropertyId ePropId );
+ const ::com::sun::star::uno::Any& operator[]( ShapePropertyId ePropId ) const;
+
+private:
+ ModelObjectHelper& mrModelObjHelper;
+ ShapePropertyInfo maShapePropInfo;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/dump/biffdumper.hxx b/oox/inc/oox/dump/biffdumper.hxx
index c6eae2876621..8409a0bb39cf 100644
--- a/oox/inc/oox/dump/biffdumper.hxx
+++ b/oox/inc/oox/dump/biffdumper.hxx
@@ -531,7 +531,7 @@ public:
protected:
virtual void implDumpStream(
- const BinaryInputStreamRef& rxStrm,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rStrmName,
const ::rtl::OUString& rSysFileName );
@@ -555,7 +555,7 @@ public:
explicit Dumper( const ::oox::core::FilterBase& rFilter );
explicit Dumper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
const ::rtl::OUString& rSysFileName );
diff --git a/oox/inc/oox/dump/dumperbase.hxx b/oox/inc/oox/dump/dumperbase.hxx
index 98ecd090dd9d..18207cff4952 100644
--- a/oox/inc/oox/dump/dumperbase.hxx
+++ b/oox/inc/oox/dump/dumperbase.hxx
@@ -50,10 +50,9 @@
namespace com { namespace sun { namespace star {
namespace io { class XInputStream; }
- namespace io { class XTextInputStream; }
namespace io { class XOutputStream; }
namespace io { class XTextOutputStream; }
- namespace lang { class XMultiServiceFactory; }
+ namespace uno { class XComponentContext; }
} } }
namespace comphelper {
@@ -125,43 +124,46 @@ public:
// input streams ----------------------------------------------------------
static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
- getXInputStream( BinaryInputStream& rStrm );
-
- static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
openInputStream(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::rtl::OUString& rFileName );
- static ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream >
- openTextInputStream(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
- const ::rtl::OUString& rEncoding );
-
- static ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream >
- openTextInputStream(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
- const ::rtl::OUString& rFileName,
- const ::rtl::OUString& rEncoding );
-
// output streams ---------------------------------------------------------
static ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
openOutputStream(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::rtl::OUString& rFileName );
static ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextOutputStream >
openTextOutputStream(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rxOutStrm,
- const ::rtl::OUString& rEncoding );
+ rtl_TextEncoding eTextEnc );
static ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextOutputStream >
openTextOutputStream(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::rtl::OUString& rFileName,
- const ::rtl::OUString& rEncoding );
+ rtl_TextEncoding eTextEnc );
+};
+
+// ============================================================================
+
+class BinaryInputStreamRef : public ::oox::BinaryInputStreamRef
+{
+public:
+ inline BinaryInputStreamRef() {}
+
+ inline /*implicit*/ BinaryInputStreamRef( BinaryInputStream* pInStrm ) :
+ ::oox::BinaryInputStreamRef( pInStrm ) {}
+
+ inline /*implicit*/ BinaryInputStreamRef( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm ) :
+ ::oox::BinaryInputStreamRef( new BinaryXInputStream( rxInStrm, true ) ) {}
+
+ template< typename StreamType >
+ inline /*implicit*/ BinaryInputStreamRef( const ::boost::shared_ptr< StreamType >& rxInStrm ) :
+ ::oox::BinaryInputStreamRef( rxInStrm ) {}
};
// ============================================================================
@@ -551,7 +553,9 @@ typedef ::boost::shared_ptr< Base > BaseRef;
| |
| +----> BinaryStreamObject
| |
- | +----> TextStreamObject
+ | +----> TextStreamObjectBase
+ | | |
+ | | +----> TextStreamObject
| | |
| | +----> XmlStreamObject
| |
@@ -891,14 +895,14 @@ class SharedConfigData : public Base, public ConfigItemBase
public:
explicit SharedConfigData(
const ::rtl::OUString& rFileName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const StorageRef& rxRootStrg,
const ::rtl::OUString& rSysFileName,
::comphelper::MediaDescriptor& rMediaDesc );
virtual ~SharedConfigData();
- inline const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getFactory() const { return mxFactory; }
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getContext() const { return mxContext; }
inline const StorageRef& getRootStorage() const { return mxRootStrg; }
inline const ::rtl::OUString& getSysFileName() const { return maSysFileName; }
@@ -933,7 +937,7 @@ private:
typedef ::std::map< ::rtl::OUString, ::rtl::OUString > ConfigDataMap;
typedef ::std::map< ::rtl::OUString, NameListRef > NameListMap;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
StorageRef mxRootStrg;
::rtl::OUString maSysFileName;
::comphelper::MediaDescriptor& mrMediaDesc;
@@ -978,14 +982,14 @@ public:
const ::oox::core::FilterBase& rFilter );
explicit Config(
const sal_Char* pcEnvVar,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const StorageRef& rxRootStrg,
const ::rtl::OUString& rSysFileName,
::comphelper::MediaDescriptor& rMediaDesc );
virtual ~Config();
- inline const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getFactory() const { return mxCfgData->getFactory(); }
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getContext() const { return mxCfgData->getContext(); }
inline const StorageRef& getRootStorage() const { return mxCfgData->getRootStorage(); }
inline const ::rtl::OUString& getSysFileName() const { return mxCfgData->getSysFileName(); }
@@ -1023,7 +1027,7 @@ protected:
const ::oox::core::FilterBase& rFilter );
void construct(
const sal_Char* pcEnvVar,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const StorageRef& rxRootStrg,
const ::rtl::OUString& rSysFileName,
::comphelper::MediaDescriptor& rMediaDesc );
@@ -1077,10 +1081,7 @@ class Output : public Base
{
public:
explicit Output(
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextOutputStream >& rxStrm );
-
- explicit Output(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::rtl::OUString& rFileName );
// ------------------------------------------------------------------------
@@ -1153,8 +1154,6 @@ public:
// ------------------------------------------------------------------------
protected:
- void construct( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextOutputStream >& rxStrm );
-
virtual bool implIsValid() const;
private:
@@ -1280,8 +1279,8 @@ class ObjectBase : public Base
public:
virtual ~ObjectBase();
- inline const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
- getFactory() const { return mxConfig->getFactory(); }
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&
+ getContext() const { return mxConfig->getContext(); }
void dump();
@@ -1324,7 +1323,7 @@ protected:
virtual void implDump();
virtual void implDumpStream(
- const BinaryInputStreamRef& rxStrm,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rStrmName,
const ::rtl::OUString& rSysFileName );
@@ -1395,7 +1394,6 @@ protected:
using ObjectBase::construct;
void construct( const ObjectBase& rParent, const ::rtl::OUString& rSysFileName );
- void construct( const ObjectBase& rParent, const OutputRef& rxOut );
void construct( const OutputObjectBase& rParent );
virtual bool implIsValid() const;
@@ -1454,6 +1452,7 @@ protected:
protected:
OutputRef mxOut;
+ ::rtl::OUString maSysFileName;
};
typedef ::boost::shared_ptr< OutputObjectBase > OutputObjectRef;
@@ -1579,7 +1578,6 @@ protected:
using OutputObjectBase::construct;
void construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const ::rtl::OUString& rSysFileName );
- void construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OutputRef& rxOut );
void construct( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm );
void construct( const InputObjectBase& rParent );
@@ -1806,46 +1804,76 @@ protected:
};
// ============================================================================
+// ============================================================================
-class TextStreamObject : public InputObjectBase
+class TextStreamObjectBase : public InputObjectBase
{
-public:
- explicit TextStreamObject(
+protected:
+ inline TextStreamObjectBase() {}
+
+ using InputObjectBase::construct;
+ void construct(
const ObjectBase& rParent,
const BinaryInputStreamRef& rxStrm,
rtl_TextEncoding eTextEnc,
const ::rtl::OUString& rSysFileName );
-
- explicit TextStreamObject(
+ void construct(
const OutputObjectBase& rParent,
const BinaryInputStreamRef& rxStrm,
rtl_TextEncoding eTextEnc );
+ void construct(
+ const InputObjectBase& rParent,
+ rtl_TextEncoding eTextEnc );
-protected:
virtual bool implIsValid() const;
virtual void implDump();
- virtual void implDumpLine( const ::rtl::OUString& rLine, sal_uInt32 nLine );
+
+ virtual void implDumpText( TextInputStream& rTextStrm ) = 0;
private:
+ void constructTextStrmObj( rtl_TextEncoding eTextEnc );
+
+protected:
::boost::shared_ptr< TextInputStream > mxTextStrm;
};
// ============================================================================
-class XmlStreamObject : public TextStreamObject
+class TextLineStreamObject : public TextStreamObjectBase
{
public:
- explicit XmlStreamObject(
+ explicit TextLineStreamObject(
const ObjectBase& rParent,
const BinaryInputStreamRef& rxStrm,
+ rtl_TextEncoding eTextEnc,
const ::rtl::OUString& rSysFileName );
+ explicit TextLineStreamObject(
+ const OutputObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ rtl_TextEncoding eTextEnc );
+
protected:
- virtual void implDump();
+ virtual void implDumpText( TextInputStream& rTextStrm );
virtual void implDumpLine( const ::rtl::OUString& rLine, sal_uInt32 nLine );
+};
-private:
- ::rtl::OUString maIncompleteLine;
+// ============================================================================
+
+class XmlStreamObject : public TextStreamObjectBase
+{
+public:
+ explicit XmlStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const ::rtl::OUString& rSysFileName );
+
+ explicit XmlStreamObject(
+ const OutputObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm );
+
+protected:
+ virtual void implDumpText( TextInputStream& rTextStrm );
};
// ============================================================================
diff --git a/oox/inc/oox/dump/oledumper.hxx b/oox/inc/oox/dump/oledumper.hxx
index c02d07d79758..1a94e771036a 100644
--- a/oox/inc/oox/dump/oledumper.hxx
+++ b/oox/inc/oox/dump/oledumper.hxx
@@ -181,7 +181,7 @@ protected:
void construct( const ObjectBase& rParent );
virtual void implDumpStream(
- const BinaryInputStreamRef& rxStrm,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rStrmName,
const ::rtl::OUString& rSysFileName );
@@ -763,7 +763,7 @@ public:
protected:
virtual void implDumpStream(
- const BinaryInputStreamRef& rxStrm,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rStrmName,
const ::rtl::OUString& rSysFileName );
@@ -858,7 +858,7 @@ public:
protected:
virtual void implDumpStream(
- const BinaryInputStreamRef& rxStrm,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rStrmName,
const ::rtl::OUString& rSysFileName );
@@ -880,7 +880,7 @@ public:
protected:
virtual void implDumpStream(
- const BinaryInputStreamRef& rxStrm,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rStrmName,
const ::rtl::OUString& rSysFileName );
@@ -898,7 +898,7 @@ public:
protected:
virtual void implDumpStream(
- const BinaryInputStreamRef& rxStrm,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rStrmName,
const ::rtl::OUString& rSysFileName );
diff --git a/oox/inc/oox/dump/pptxdumper.hxx b/oox/inc/oox/dump/pptxdumper.hxx
index 2afa6b3857bc..a008145ea18b 100644
--- a/oox/inc/oox/dump/pptxdumper.hxx
+++ b/oox/inc/oox/dump/pptxdumper.hxx
@@ -46,7 +46,7 @@ public:
protected:
virtual void implDumpStream(
- const BinaryInputStreamRef& rxStrm,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rStrmName,
const ::rtl::OUString& rSysFileName );
@@ -60,7 +60,7 @@ public:
explicit Dumper( const ::oox::core::FilterBase& rFilter );
explicit Dumper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
const ::rtl::OUString& rSysFileName );
diff --git a/oox/inc/oox/dump/xlsbdumper.hxx b/oox/inc/oox/dump/xlsbdumper.hxx
index 197844387b03..3b3afb55933d 100644
--- a/oox/inc/oox/dump/xlsbdumper.hxx
+++ b/oox/inc/oox/dump/xlsbdumper.hxx
@@ -226,7 +226,7 @@ public:
protected:
virtual void implDumpStream(
- const BinaryInputStreamRef& rxStrm,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rStrmName,
const ::rtl::OUString& rSysFileName );
@@ -240,7 +240,7 @@ public:
explicit Dumper( const ::oox::core::FilterBase& rFilter );
explicit Dumper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
const ::rtl::OUString& rSysFileName );
diff --git a/oox/inc/oox/helper/binaryinputstream.hxx b/oox/inc/oox/helper/binaryinputstream.hxx
index 2c7d0bd18f5c..7c8783dbc379 100644
--- a/oox/inc/oox/helper/binaryinputstream.hxx
+++ b/oox/inc/oox/helper/binaryinputstream.hxx
@@ -29,10 +29,14 @@
#ifndef OOX_HELPER_BINARYINPUTSTREAM_HXX
#define OOX_HELPER_BINARYINPUTSTREAM_HXX
-#include <boost/shared_ptr.hpp>
+#include <vector>
#include <com/sun/star/io/XInputStream.hpp>
#include "oox/helper/binarystreambase.hxx"
+namespace com { namespace sun { namespace star {
+ namespace io { class XInputStream; }
+} } }
+
namespace oox {
class BinaryOutputStream;
@@ -47,24 +51,51 @@ class BinaryInputStream : public virtual BinaryStreamBase
{
public:
/** Derived classes implement reading nBytes bytes to the passed sequence.
- @return Number of bytes really read. */
- virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes ) = 0;
- /** Derived classes implement reading nBytes bytes to the (existing) buffer opMem.
- @return Number of bytes really read. */
- virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes ) = 0;
+ The sequence will be reallocated internally.
+
+ @param nAtomSize
+ The size of the elements in the memory block, if available. Derived
+ classes may be interested in this information.
+
+ @return
+ Number of bytes really read.
+ */
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 ) = 0;
+
+ /** Derived classes implement reading nBytes bytes to the (preallocated!)
+ memory buffer opMem.
+
+ @param nAtomSize
+ The size of the elements in the memory block, if available. Derived
+ classes may be interested in this information.
+
+ @return
+ Number of bytes really read.
+ */
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 ) = 0;
+
/** Derived classes implement seeking the stream forward by the passed
- number of bytes. This should work for non-seekable streams too. */
- virtual void skip( sal_Int32 nBytes ) = 0;
+ number of bytes. This should work for non-seekable streams too.
+
+ @param nAtomSize
+ The size of the elements in the memory block, if available. Derived
+ classes may be interested in this information.
+ */
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 ) = 0;
/** Reads a value from the stream and converts it to platform byte order.
- Supported types: SAL integers (8 to 64 bit), float, double. */
+ All data types supported by the ByteOrderConverter class can be used.
+ */
template< typename Type >
void readValue( Type& ornValue );
+
/** Reads a value from the stream and converts it to platform byte order.
- Supported types: SAL integers (8 to 64 bit), float, double. */
+ All data types supported by the ByteOrderConverter class can be used.
+ */
template< typename Type >
inline Type readValue() { Type nValue; readValue( nValue ); return nValue; }
- /** Stream operator for integral and floating-point types. */
+
+ /** Stream operator for all data types supported by the readValue() function. */
template< typename Type >
inline BinaryInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; }
@@ -79,46 +110,135 @@ public:
inline float readFloat() { return readValue< float >(); }
inline double readDouble() { return readValue< double >(); }
- /** Reads a NUL-terminated byte character array and returns the string. */
+ /** Reads a (preallocated!) C array of values from the stream.
+
+ Converts all values in the array to platform byte order. All data types
+ supported by the ByteOrderConverter class can be used.
+
+ @param nElemCount
+ Number of array elements to read (NOT byte count).
+
+ @return
+ Number of array elements really read (NOT byte count).
+ */
+ template< typename Type >
+ sal_Int32 readArray( Type* opnArray, sal_Int32 nElemCount );
+
+ /** Reads a sequence of values from the stream.
+
+ The sequence will be reallocated internally. Converts all values in the
+ array to platform byte order. All data types supported by the
+ ByteOrderConverter class can be used.
+
+ @param nElemCount
+ Number of elements to put into the sequence (NOT byte count).
+
+ @return
+ Number of sequence elements really read (NOT byte count).
+ */
+ template< typename Type >
+ sal_Int32 readArray( ::com::sun::star::uno::Sequence< Type >& orSequence, sal_Int32 nElemCount );
+
+ /** Reads a vector of values from the stream.
+
+ The vector will be resized internally. Converts all values in the
+ vector to platform byte order. All data types supported by the
+ ByteOrderConverter class can be used.
+
+ @param nElemCount
+ Number of elements to put into the vector (NOT byte count).
+
+ @return
+ Number of vector elements really read (NOT byte count).
+ */
+ template< typename Type >
+ sal_Int32 readArray( ::std::vector< Type >& orVector, sal_Int32 nElemCount );
+
+ /** Skips an array of values of a certain type in the stream.
+
+ All data types supported by the ByteOrderConverter class can be used.
+
+ @param nElemCount
+ Number of array elements to skip (NOT byte count).
+ */
+ template< typename Type >
+ void skipArray( sal_Int32 nElemCount );
+
+ /** Reads a NUL-terminated byte character array and returns the string.
+ */
::rtl::OString readNulCharArray();
/** Reads a NUL-terminated byte character array and returns a Unicode string.
- @param eTextEnc The text encoding used to create the Unicode string. */
+
+ @param eTextEnc
+ The text encoding used to create the Unicode string.
+ */
::rtl::OUString readNulCharArrayUC( rtl_TextEncoding eTextEnc );
- /** Reads a NUL-terminated Unicode character array and returns the string. */
+ /** Reads a NUL-terminated Unicode character array and returns the string.
+ */
::rtl::OUString readNulUnicodeArray();
- /** Reads nChar byte characters and returns the string.
- @param nChars Number of characters (bytes) to read from the stream.
+ /** Reads a byte character array and returns the string.
+
+ @param nChars
+ Number of characters (bytes) to read from the stream.
+
@param bAllowNulChars
True = NUL characters are inserted into the imported string.
- False = NUL characters are replaced by question marks (default). */
+ False = NUL characters are replaced by question marks (default).
+ */
::rtl::OString readCharArray( sal_Int32 nChars, bool bAllowNulChars = false );
- /** Reads nChar byte characters and returns a Unicode string.
- @param nChars Number of characters (bytes) to read from the stream.
- @param eTextEnc The text encoding used to create the Unicode string.
+ /** Reads a byte character array and returns a Unicode string.
+
+ @param nChars
+ Number of characters (bytes) to read from the stream.
+
+ @param eTextEnc
+ The text encoding used to create the Unicode string.
+
@param bAllowNulChars
True = NUL characters are inserted into the imported string.
- False = NUL characters are replaced by question marks (default). */
+ False = NUL characters are replaced by question marks (default).
+ */
::rtl::OUString readCharArrayUC( sal_Int32 nChars, rtl_TextEncoding eTextEnc, bool bAllowNulChars = false );
- /** Reads nChars Unicode characters and returns the string.
- @param nChars Number of 16-bit characters to read from the stream.
+ /** Reads a Unicode character array and returns the string.
+
+ @param nChars
+ Number of 16-bit characters to read from the stream.
+
@param bAllowNulChars
True = NUL characters are inserted into the imported string.
- False = NUL characters are replaced by question marks (default). */
+ False = NUL characters are replaced by question marks (default).
+ */
::rtl::OUString readUnicodeArray( sal_Int32 nChars, bool bAllowNulChars = false );
- /** Copies nBytes bytes from the current position to the passed output stream. */
- void copyToStream( BinaryOutputStream& rOutStrm, sal_Int64 nBytes = SAL_MAX_INT64 );
+ /** Reads a Unicode character array (may be compressed) and returns the
+ string.
-private:
- /** Used by the readValue() template functions to read built-in types.
- @descr Derived classes may overwrite this default implementation which
- simply calls readMemory() with something own. */
- virtual void readAtom( void* opMem, sal_uInt8 nSize );
+ @param nChars
+ Number of 8-bit or 16-bit characters to read from the stream.
+
+ @param bCompressed
+ True = Character array is compressed (stored as 8-bit characters).
+ False = Character array is not compressed (stored as 16-bit characters).
+
+ @param bAllowNulChars
+ True = NUL characters are inserted into the imported string.
+ False = NUL characters are replaced by question marks (default).
+ */
+ ::rtl::OUString readCompressedUnicodeArray( sal_Int32 nChars, bool bCompressed, bool bAllowNulChars = false );
+
+ /** Copies nBytes bytes from the current position to the passed output stream.
+ */
+ void copyToStream( BinaryOutputStream& rOutStrm, sal_Int64 nBytes = SAL_MAX_INT64, sal_Int32 nAtomSize = 1 );
+
+protected:
+ /** This dummy default c'tor will never call the c'tor of the virtual base
+ class BinaryStreamBase as this class cannot be instanciated directly. */
+ inline explicit BinaryInputStream() : BinaryStreamBase( false ) {}
};
typedef ::boost::shared_ptr< BinaryInputStream > BinaryInputStreamRef;
@@ -128,14 +248,47 @@ typedef ::boost::shared_ptr< BinaryInputStream > BinaryInputStreamRef;
template< typename Type >
void BinaryInputStream::readValue( Type& ornValue )
{
- // can be instanciated for all types supported in class ByteOrderConverter
- readAtom( &ornValue, static_cast< sal_Int32 >( sizeof( Type ) ) );
+ readMemory( &ornValue, static_cast< sal_Int32 >( sizeof( Type ) ), sizeof( Type ) );
ByteOrderConverter::convertLittleEndian( ornValue );
}
+template< typename Type >
+sal_Int32 BinaryInputStream::readArray( Type* opnArray, sal_Int32 nElemCount )
+{
+ sal_Int32 nRet = 0;
+ if( !mbEof )
+ {
+ sal_Int32 nReadSize = getLimitedValue< sal_Int32, sal_Int32 >( nElemCount, 0, SAL_MAX_INT32 / sizeof( Type ) ) * sizeof( Type );
+ nRet = readMemory( opnArray, nReadSize, sizeof( Type ) ) / sizeof( Type );
+ ByteOrderConverter::convertLittleEndianArray( opnArray, static_cast< size_t >( nRet ) );
+ }
+ return nRet;
+}
+
+template< typename Type >
+sal_Int32 BinaryInputStream::readArray( ::com::sun::star::uno::Sequence< Type >& orSequence, sal_Int32 nElemCount )
+{
+ orSequence.reallocate( nElemCount );
+ return orSequence.hasElements() ? readArray( orSequence.getArray(), nElemCount ) : 0;
+}
+
+template< typename Type >
+sal_Int32 BinaryInputStream::readArray( ::std::vector< Type >& orVector, sal_Int32 nElemCount )
+{
+ orVector.resize( static_cast< size_t >( nElemCount ) );
+ return orVector.empty() ? 0 : readArray( &orVector.front(), nElemCount );
+}
+
+template< typename Type >
+void BinaryInputStream::skipArray( sal_Int32 nElemCount )
+{
+ sal_Int32 nSkipSize = getLimitedValue< sal_Int32, sal_Int32 >( nElemCount, 0, SAL_MAX_INT32 / sizeof( Type ) ) * sizeof( Type );
+ skip( nSkipSize, sizeof( Type ) );
+}
+
// ============================================================================
-/** Wraps a com.sun.star.io.XInputStream and provides convenient access functions.
+/** Wraps a UNO input stream and provides convenient access functions.
The binary data in the stream is assumed to be in little-endian format.
*/
@@ -144,10 +297,13 @@ class BinaryXInputStream : public BinaryXSeekableStream, public BinaryInputStrea
public:
/** Constructs the wrapper object for the passed input stream.
- @param rxInStream The com.sun.star.io.XInputStream interface of the
- input stream to be wrapped.
- @param bAutoClose True = automatically close the wrapped input stream
- on destruction of this wrapper.
+ @param rxInStream
+ The com.sun.star.io.XInputStream interface of the UNO input stream
+ to be wrapped.
+
+ @param bAutoClose
+ True = automatically close the wrapped input stream on destruction
+ of this wrapper or when close() is called.
*/
explicit BinaryXInputStream(
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
@@ -155,26 +311,26 @@ public:
virtual ~BinaryXInputStream();
+ /** Closes the input stream. Does also close the wrapped UNO input stream
+ if bAutoClose has been set to true in the constructor. */
+ virtual void close();
+
/** Reads nBytes bytes to the passed sequence.
@return Number of bytes really read. */
- virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes );
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
/** Reads nBytes bytes to the (existing) buffer opMem.
@return Number of bytes really read. */
- virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes );
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
/** Seeks the stream forward by the passed number of bytes. This works for
non-seekable streams too. */
- virtual void skip( sal_Int32 nBytes );
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
- /** Stream operator for integral and floating-point types. */
+ /** Stream operator for all data types supported by the readValue() function. */
template< typename Type >
inline BinaryXInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; }
- /** Returns the XInputStream interface of the wrapped input stream. */
- inline ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
- getXInputStream() const { return mxInStrm; }
- /** Closes the wrapped XInputStream. */
- void close();
-
private:
StreamDataSequence maBuffer; /// Data buffer used in readMemory() function.
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
@@ -182,8 +338,6 @@ private:
bool mbAutoClose; /// True = automatically close stream on destruction.
};
-typedef ::boost::shared_ptr< BinaryXInputStream > BinaryXInputStreamRef;
-
// ============================================================================
/** Wraps a StreamDataSequence and provides convenient access functions.
@@ -204,90 +358,101 @@ public:
/** Reads nBytes bytes to the passed sequence.
@return Number of bytes really read. */
- virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes );
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
/** Reads nBytes bytes to the (existing) buffer opMem.
@return Number of bytes really read. */
- virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes );
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
/** Seeks the stream forward by the passed number of bytes. This works for
non-seekable streams too. */
- virtual void skip( sal_Int32 nBytes );
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
- /** Stream operator for integral and floating-point types. */
+ /** Stream operator for all data types supported by the readValue() function. */
template< typename Type >
inline SequenceInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; }
-};
-typedef ::boost::shared_ptr< SequenceInputStream > SequenceInputStreamRef;
+private:
+ /** Returns the number of bytes available in the sequence for the passed byte count. */
+ inline sal_Int32 getMaxBytes( sal_Int32 nBytes ) const
+ { return getLimitedValue< sal_Int32, sal_Int32 >( nBytes, 0, mpData->getLength() - mnPos ); }
+};
// ============================================================================
/** Wraps a BinaryInputStream and provides access to a specific part of the
stream data.
- @descr
- Provides access to the stream data block starting at the current
- position of the stream, and with a specific length. If the wrapped
- stream is seekable, this wrapper will treat the position the wrapped
- has at construction time as position "0" (therefore the class name).
+ Provides access to the stream data block starting at the current position
+ of the stream, and with a specific length. If the wrapped stream is
+ seekable, this wrapper will treat the position of the wrapped stream at
+ construction time as position "0" (therefore the class name).
+
+ The passed input stream MUST live at least as long as this stream wrapper.
+ The stream MUST NOT be changed from outside as long as this stream wrapper
+ is used to read from it.
*/
class RelativeInputStream : public BinaryInputStream
{
public:
/** Constructs the wrapper object for the passed stream.
- @attention
- The passed input stream MUST live at least as long as this stream
- wrapper. The stream MUST NOT be changed from outside as long as
- this stream wrapper is used to read from it.
-
- @param nLength
+ @param nSize
If specified, restricts the amount of data that can be read from
the passed input stream.
*/
explicit RelativeInputStream(
BinaryInputStream& rInStrm,
- sal_Int64 nLength = SAL_MAX_INT64 );
+ sal_Int64 nSize = SAL_MAX_INT64 );
- /** Returns whether the wrapped stream is seekable. */
- virtual bool isSeekable() const;
/** Returns the size of the data block in the wrapped stream offered by
this wrapper. */
- virtual sal_Int64 getLength() const;
+ virtual sal_Int64 size() const;
+
/** Returns the current relative stream position. */
virtual sal_Int64 tell() const;
+
/** Seeks the stream to the passed relative position, if the wrapped stream
is seekable. */
virtual void seek( sal_Int64 nPos );
+ /** Closes the input stream but not the wrapped stream. */
+ virtual void close();
+
/** Reads nBytes bytes to the passed sequence. Does not read out of the
data block whose size has been specified on construction.
@return Number of bytes really read. */
- virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes );
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
/** Reads nBytes bytes to the (existing) buffer opMem. Does not read out of
the data block whose size has been specified on construction.
@return Number of bytes really read. */
- virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes );
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
/** Seeks the stream forward by the passed number of bytes. This works for
non-seekable streams too. Does not seek out of the data block. */
- virtual void skip( sal_Int32 nBytes );
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
- /** Stream operator for integral and floating-point types. */
+ /** Stream operator for all data types supported by the readValue() function. */
template< typename Type >
inline RelativeInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; }
private:
- BinaryInputStream& mrInStrm;
+ /** Returns the number of bytes available in the sequence for the passed byte count. */
+ inline sal_Int32 getMaxBytes( sal_Int32 nBytes ) const
+ { return getLimitedValue< sal_Int32, sal_Int64 >( nBytes, 0, mnSize - mnRelPos ); }
+
+private:
+ BinaryInputStream* mpInStrm;
sal_Int64 mnStartPos;
sal_Int64 mnRelPos;
- sal_Int64 mnLength;
+ sal_Int64 mnSize;
};
-typedef ::boost::shared_ptr< RelativeInputStream > RelativeInputStreamRef;
-
// ============================================================================
} // namespace oox
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/helper/binaryoutputstream.hxx b/oox/inc/oox/helper/binaryoutputstream.hxx
index c9bab075ebf1..3441f9726fa9 100644
--- a/oox/inc/oox/helper/binaryoutputstream.hxx
+++ b/oox/inc/oox/helper/binaryoutputstream.hxx
@@ -29,10 +29,12 @@
#ifndef OOX_HELPER_BINARYOUTPUTSTREAM_HXX
#define OOX_HELPER_BINARYOUTPUTSTREAM_HXX
-#include <boost/shared_ptr.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
#include "oox/helper/binarystreambase.hxx"
+namespace com { namespace sun { namespace star {
+ namespace io { class XOutputStream; }
+} } }
+
namespace oox {
// ============================================================================
@@ -44,24 +46,38 @@ namespace oox {
class BinaryOutputStream : public virtual BinaryStreamBase
{
public:
- /** Derived classes implement writing the passed data sequence. */
- virtual void writeData( const StreamDataSequence& rData ) = 0;
- /** Derived classes implement writing from the (existing) buffer pMem. */
- virtual void writeMemory( const void* pMem, sal_Int32 nBytes ) = 0;
+ /** Derived classes implement writing the contents of the passed data
+ sequence.
+
+ @param nAtomSize
+ The size of the elements in the memory block, if available. Derived
+ classes may be interested in this information.
+ */
+ virtual void writeData( const StreamDataSequence& rData, size_t nAtomSize = 1 ) = 0;
+
+ /** Derived classes implement writing the contents of the (preallocated!)
+ memory buffer pMem.
+
+ @param nAtomSize
+ The size of the elements in the memory block, if available. Derived
+ classes may be interested in this information.
+ */
+ virtual void writeMemory( const void* pMem, sal_Int32 nBytes, size_t nAtomSize = 1 ) = 0;
/** Writes a value to the stream and converts it to platform byte order.
- Supported types: SAL integers (8 to 64 bit), float, double. */
+ All data types supported by the ByteOrderConverter class can be used.
+ */
template< typename Type >
void writeValue( Type nValue );
- /** Stream operator for integral and floating-point types. */
+
+ /** Stream operator for all data types supported by the writeValue() function. */
template< typename Type >
inline BinaryOutputStream& operator<<( Type nValue ) { writeValue( nValue ); return *this; }
-private:
- /** Used by the writeValue() template function to write built-in types.
- @descr Derived classes may overwrite this default implementation which
- simply calls writeMemory() with something own. */
- virtual void writeAtom( const void* pMem, sal_uInt8 nSize );
+protected:
+ /** This dummy default c'tor will never call the c'tor of the virtual base
+ class BinaryStreamBase as this class cannot be instanciated directly. */
+ inline explicit BinaryOutputStream() : BinaryStreamBase( false ) {}
};
typedef ::boost::shared_ptr< BinaryOutputStream > BinaryOutputStreamRef;
@@ -71,14 +87,13 @@ typedef ::boost::shared_ptr< BinaryOutputStream > BinaryOutputStreamRef;
template< typename Type >
void BinaryOutputStream::writeValue( Type nValue )
{
- // can be instanciated for all types supported in class ByteOrderConverter
ByteOrderConverter::convertLittleEndian( nValue );
- writeMemory( &nValue, static_cast< sal_Int32 >( sizeof( Type ) ) );
+ writeMemory( &nValue, static_cast< sal_Int32 >( sizeof( Type ) ), sizeof( Type ) );
}
// ============================================================================
-/** Wraps a com.sun.star.io.XOutputStream and provides convenient access functions.
+/** Wraps a UNO output stream and provides convenient access functions.
The binary data in the stream is written in little-endian format.
*/
@@ -87,10 +102,13 @@ class BinaryXOutputStream : public BinaryXSeekableStream, public BinaryOutputStr
public:
/** Constructs the wrapper object for the passed output stream.
- @param rxOutStream The com.sun.star.io.XOutputStream interface of the
- output stream to be wrapped.
- @param bAutoClose True = automatically close the wrapped output stream
- on destruction of this wrapper.
+ @param rxOutStream
+ The com.sun.star.io.XOutputStream interface of the output stream to
+ be wrapped.
+
+ @param bAutoClose
+ True = automatically close the wrapped output stream on destruction
+ of this wrapper or when close() is called.
*/
explicit BinaryXOutputStream(
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rxOutStrm,
@@ -98,20 +116,23 @@ public:
virtual ~BinaryXOutputStream();
+ /** Flushes and closes the output stream. Does also close the wrapped UNO
+ output stream if bAutoClose has been set to true in the constructor. */
+ void close();
+
/** Writes the passed data sequence. */
- virtual void writeData( const StreamDataSequence& rData );
- /** Write nBytes bytes from the (existing) buffer pMem. */
- virtual void writeMemory( const void* pMem, sal_Int32 nBytes );
+ virtual void writeData( const StreamDataSequence& rData, size_t nAtomSize = 1 );
+
+ /** Write nBytes bytes from the (preallocated!) buffer pMem. */
+ virtual void writeMemory( const void* pMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
- /** Stream operator for integral and floating-point types. */
+ /** Stream operator for all data types supported by the writeValue() function. */
template< typename Type >
inline BinaryXOutputStream& operator<<( Type nValue ) { writeValue( nValue ); return *this; }
/** Returns the XOutputStream interface of the wrapped output stream. */
inline ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
getXOutputStream() const { return mxOutStrm; }
- /** Flushes and closes the wrapped XOutputStream. */
- void close();
private:
StreamDataSequence maBuffer; /// Data buffer used in writeMemory() function.
@@ -120,8 +141,6 @@ private:
bool mbAutoClose; /// True = automatically close stream on destruction.
};
-typedef ::boost::shared_ptr< BinaryXOutputStream > BinaryXOutputStreamRef;
-
// ============================================================================
/** Wraps a StreamDataSequence and provides convenient access functions.
@@ -143,21 +162,20 @@ public:
explicit SequenceOutputStream( StreamDataSequence& rData );
/** Writes the passed data sequence. */
- virtual void writeData( const StreamDataSequence& rData );
- /** Write nBytes bytes from the (existing) buffer pMem. */
- virtual void writeMemory( const void* pMem, sal_Int32 nBytes );
+ virtual void writeData( const StreamDataSequence& rData, size_t nAtomSize = 1 );
- /** Stream operator for integral and floating-point types. */
+ /** Write nBytes bytes from the (preallocated!) buffer pMem. */
+ virtual void writeMemory( const void* pMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Stream operator for all data types supported by the writeValue() function. */
template< typename Type >
inline SequenceOutputStream& operator<<( Type nValue ) { writeValue( nValue ); return *this; }
};
-typedef ::boost::shared_ptr< SequenceOutputStream > SequenceOutputStreamRef;
-
// ============================================================================
} // namespace oox
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/helper/binarystreambase.hxx b/oox/inc/oox/helper/binarystreambase.hxx
index de0bedbb2b37..5d2d3caad6b4 100644
--- a/oox/inc/oox/helper/binarystreambase.hxx
+++ b/oox/inc/oox/helper/binarystreambase.hxx
@@ -30,75 +30,123 @@
#define OOX_HELPER_BINARYSTREAMBASE_HXX
#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/io/XSeekable.hpp>
+#include <boost/shared_ptr.hpp>
#include "oox/helper/helper.hxx"
+namespace com { namespace sun { namespace star {
+ namespace io { class XSeekable; }
+} } }
+
namespace oox {
typedef ::com::sun::star::uno::Sequence< sal_Int8 > StreamDataSequence;
// ============================================================================
-/** Base interface for binary stream classes. Implemenetations may or may not
- support seeking the stream. */
+/** Base class for binary stream classes.
+ */
class BinaryStreamBase
{
public:
virtual ~BinaryStreamBase();
- /** Derived classes return whether the stream is seekable. Default: false. */
- virtual bool isSeekable() const;
- /** Derived classes return the size of the stream, if possible,
- otherwise/default: -1. May return something for unseekable streams. */
- virtual sal_Int64 getLength() const;
- /** Derived classes return the current stream position, if possible,
- otherwise/default: -1. May return something for unseekable streams. */
- virtual sal_Int64 tell() const;
- /** Derived classes implement seeking the stream to the passed position, if
- the stream is seekable. */
- virtual void seek( sal_Int64 nPos );
+ /** Implementations return the size of the stream, if possible.
+
+ This function may be implemented for some types of unseekable streams,
+ and MUST be implemented for all seekable streams.
+
+ @return
+ The size of the stream in bytes, or -1, if not implemented.
+ */
+ virtual sal_Int64 size() const = 0;
+
+ /** Implementations return the current stream position, if possible.
+
+ This function may be implemented for some types of unseekable streams,
+ and MUST be implemented for all seekable streams.
+
+ @return
+ The current position in the stream, or -1, if not implemented.
+ */
+ virtual sal_Int64 tell() const = 0;
+
+ /** Implementations seek the stream to the passed position, if
+ the stream is seekable.
+ */
+ virtual void seek( sal_Int64 nPos ) = 0;
+
+ /** Implementations close the stream.
+ */
+ virtual void close() = 0;
+
+ /** Returns true, if the implementation supports the seek() operation.
+
+ Implementations may still implement size() and tell() even if the
+ stream is not seekable.
+ */
+ inline bool isSeekable() const { return mbSeekable; }
/** Returns true, if the stream position is invalid (EOF). This flag turns
- true *after* the first attempt to seek/read beyond the stream end. */
+ true *after* the first attempt to seek/read beyond the stream end.
+ */
inline bool isEof() const { return mbEof; }
- /** Returns the size of the remaining data, if stream is seekable, otherwise -1. */
+ /** Returns the size of the remaining data available in the stream, if
+ stream supports size() and tell(), otherwise -1.
+ */
sal_Int64 getRemaining() const;
- /** Seeks the stream to the beginning, if stream is seekable. */
+
+ /** Seeks the stream to the beginning, if stream is seekable.
+ */
inline void seekToStart() { seek( 0 ); }
- /** Seeks the stream to the end, if stream is seekable. */
- inline void seekToEnd() { seek( getLength() ); }
+
+ /** Seeks the stream to the end, if stream is seekable.
+ */
+ inline void seekToEnd() { seek( size() ); }
+
/** Seeks the stream forward to a position that is a multiple of the passed
- block size, relative to the passed stream position, if stream is seekable. */
+ block size, if stream is seekable.
+
+ @param nBlockSize
+ The size of the data blocks the streams needs to be aligned to.
+
+ @param nAnchorPos
+ Position in the stream the data blocks are aligned to.
+ */
void alignToBlock( sal_Int32 nBlockSize, sal_Int64 nAnchorPos = 0 );
protected:
- inline explicit BinaryStreamBase() : mbEof( false ) {}
+ inline explicit BinaryStreamBase( bool bSeekable ) : mbEof( false ), mbSeekable( bSeekable ) {}
private:
BinaryStreamBase( const BinaryStreamBase& );
BinaryStreamBase& operator=( const BinaryStreamBase& );
protected:
- bool mbEof;
+ bool mbEof; /// End of stream flag.
+
+private:
+ const bool mbSeekable; /// True = implementation supports seeking.
};
// ============================================================================
-/** Base class for binary input and output streams wrapping an API stream,
+/** Base class for binary input and output streams wrapping a UNO stream,
seekable via the com.sun.star.io.XSeekable interface.
*/
class BinaryXSeekableStream : public virtual BinaryStreamBase
{
public:
- /** Returns true, if the wrapped stream is seekable. */
- virtual bool isSeekable() const;
- /** Returns the size of the stream, if stream is seekable, otherwise -1. */
- virtual sal_Int64 getLength() const;
- /** Returns the current stream position, if stream is seekable, otherwise -1. */
+ virtual ~BinaryXSeekableStream();
+
+ /** Returns the size of the stream, if wrapped stream is seekable, otherwise -1. */
+ virtual sal_Int64 size() const;
+ /** Returns the current stream position, if wrapped stream is seekable, otherwise -1. */
virtual sal_Int64 tell() const;
- /** Seeks the stream to the passed position, if stream is seekable. */
+ /** Seeks the stream to the passed position, if wrapped stream is seekable. */
virtual void seek( sal_Int64 nPos );
+ /** Releases the reference to the UNO XSeekable interface. */
+ virtual void close();
protected:
explicit BinaryXSeekableStream(
@@ -112,31 +160,29 @@ private:
// ============================================================================
/** Base class for binary input and output streams wrapping a
- StreamDataSequence, which is always seekable. */
+ StreamDataSequence, which is always seekable.
+
+ The wrapped data sequence MUST live at least as long as this stream
+ wrapper. The data sequence MUST NOT be changed from outside as long as this
+ stream wrapper is used to modify it.
+ */
class SequenceSeekableStream : public virtual BinaryStreamBase
{
public:
- /** Returns true (data sequence streams are always seekable). */
- virtual bool isSeekable() const;
/** Returns the size of the wrapped data sequence. */
- virtual sal_Int64 getLength() const;
+ virtual sal_Int64 size() const;
/** Returns the current stream position. */
virtual sal_Int64 tell() const;
/** Seeks the stream to the passed position. */
virtual void seek( sal_Int64 nPos );
+ /** Releases the reference to the data sequence. */
+ virtual void close();
protected:
- /** Constructs the wrapper object for the passed data sequence.
-
- @attention
- The passed data sequence MUST live at least as long as this stream
- wrapper. The data sequence MUST NOT be changed from outside as long
- as this stream wrapper is used to modify it.
- */
- inline explicit SequenceSeekableStream( const StreamDataSequence& rData ) : mrData( rData ), mnPos( 0 ) {}
+ explicit SequenceSeekableStream( const StreamDataSequence& rData );
protected:
- const StreamDataSequence& mrData; /// Wrapped data sequence.
+ const StreamDataSequence* mpData; /// Wrapped data sequence.
sal_Int32 mnPos; /// Current position in the sequence.
};
@@ -146,4 +192,4 @@ protected:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/helper/containerhelper.hxx b/oox/inc/oox/helper/containerhelper.hxx
index d7402905c92e..5c9dc88be411 100644
--- a/oox/inc/oox/helper/containerhelper.hxx
+++ b/oox/inc/oox/helper/containerhelper.hxx
@@ -29,8 +29,8 @@
#ifndef OOX_HELPER_CONTAINERHELPER_HXX
#define OOX_HELPER_CONTAINERHELPER_HXX
-#include <vector>
#include <map>
+#include <vector>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
@@ -41,11 +41,59 @@ namespace com { namespace sun { namespace star {
namespace container { class XIndexContainer; }
namespace container { class XNameAccess; }
namespace container { class XNameContainer; }
- namespace lang { class XMultiServiceFactory; }
+ namespace uno { class XComponentContext; }
} } }
namespace oox {
+// ============================================================================
+
+/** A range of signed 32-bit integer values. */
+struct ValueRange
+{
+ sal_Int32 mnFirst;
+ sal_Int32 mnLast;
+
+ inline explicit ValueRange( sal_Int32 nValue = 0 ) : mnFirst( nValue ), mnLast( nValue ) {}
+ inline explicit ValueRange( sal_Int32 nFirst, sal_Int32 nLast ) : mnFirst( nFirst ), mnLast( nLast ) {}
+
+ inline bool operator==( const ValueRange& rRange ) const { return (mnFirst == rRange.mnFirst) && (mnLast == rRange.mnLast); }
+ inline bool operator!=( const ValueRange& rRange ) const { return !(*this == rRange); }
+ inline bool contains( sal_Int32 nValue ) const { return (mnFirst <= nValue) && (nValue <= mnLast); }
+ inline bool contains( const ValueRange& rRange ) const { return (mnFirst <= rRange.mnFirst) && (rRange.mnLast <= mnLast); }
+ inline bool intersects( const ValueRange& rRange ) const { return (mnFirst <= rRange.mnLast) && (rRange.mnFirst <= mnLast); }
+};
+
+// ----------------------------------------------------------------------------
+
+typedef ::std::vector< ValueRange > ValueRangeVector;
+
+// ----------------------------------------------------------------------------
+
+/** An ordered list of value ranges. The insertion operation will merge
+ consecutive value ranges.
+ */
+class ValueRangeSet
+{
+public:
+ inline explicit ValueRangeSet() {}
+
+ /** Inserts the passed value into the range list. */
+ inline void insert( sal_Int32 nValue ) { insert( ValueRange( nValue ) ); }
+ /** Inserts the passed value range into the range list. */
+ void insert( const ValueRange& rRange );
+
+ /** Returns the ordered list of all value ranges. */
+ inline const ValueRangeVector& getRanges() const { return maRanges; }
+ /** Returns an intersection of the range list and the passed range. */
+ ValueRangeVector getIntersection( const ValueRange& rRange ) const;
+
+private:
+ ValueRangeVector maRanges;
+};
+
+// ============================================================================
+
/** Template for a 2-dimensional array of objects.
This class template provides a similar interface to the ::std::vector
@@ -123,7 +171,7 @@ public:
/** Creates a new index container object from scratch. */
static ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >
- createIndexContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory );
+ createIndexContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/** Inserts an object into an indexed container.
@@ -145,7 +193,7 @@ public:
/** Creates a new name container object from scratch. */
static ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
- createNameContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory );
+ createNameContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/** Returns a name that is not used in the passed name container.
diff --git a/oox/inc/oox/helper/graphichelper.hxx b/oox/inc/oox/helper/graphichelper.hxx
index 94e4df6c3b5a..4c0d0976ca74 100644
--- a/oox/inc/oox/helper/graphichelper.hxx
+++ b/oox/inc/oox/helper/graphichelper.hxx
@@ -158,7 +158,7 @@ private:
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::uno::XComponentContext > mxContext;
::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.
diff --git a/oox/inc/oox/helper/helper.hxx b/oox/inc/oox/helper/helper.hxx
index 687891bd36c5..25d41312080c 100644
--- a/oox/inc/oox/helper/helper.hxx
+++ b/oox/inc/oox/helper/helper.hxx
@@ -241,9 +241,9 @@ private:
class ByteOrderConverter
{
public:
+#ifdef OSL_BIGENDIAN
inline static void convertLittleEndian( sal_Int8& ) {} // present for usage in templates
inline static void convertLittleEndian( sal_uInt8& ) {} // present for usage in templates
-#ifdef OSL_BIGENDIAN
inline static void convertLittleEndian( sal_Int16& rnValue ) { swap2( reinterpret_cast< sal_uInt8* >( &rnValue ) ); }
inline static void convertLittleEndian( sal_uInt16& rnValue ) { swap2( reinterpret_cast< sal_uInt8* >( &rnValue ) ); }
inline static void convertLittleEndian( sal_Int32& rnValue ) { swap4( reinterpret_cast< sal_uInt8* >( &rnValue ) ); }
@@ -252,15 +252,20 @@ public:
inline static void convertLittleEndian( sal_uInt64& rnValue ) { swap8( reinterpret_cast< sal_uInt8* >( &rnValue ) ); }
inline static void convertLittleEndian( float& rfValue ) { swap4( reinterpret_cast< sal_uInt8* >( &rfValue ) ); }
inline static void convertLittleEndian( double& rfValue ) { swap8( reinterpret_cast< sal_uInt8* >( &rfValue ) ); }
+
+ template< typename Type >
+ inline static void convertLittleEndianArray( Type* pnArray, size_t nElemCount );
+
+ inline static void convertLittleEndianArray( sal_Int8*, size_t ) {}
+ inline static void convertLittleEndianArray( sal_uInt8*, size_t ) {}
+
#else
- inline static void convertLittleEndian( sal_Int16& ) {}
- inline static void convertLittleEndian( sal_uInt16& ) {}
- inline static void convertLittleEndian( sal_Int32& ) {}
- inline static void convertLittleEndian( sal_uInt32& ) {}
- inline static void convertLittleEndian( sal_Int64& ) {}
- inline static void convertLittleEndian( sal_uInt64& ) {}
- inline static void convertLittleEndian( float& ) {}
- inline static void convertLittleEndian( double& ) {}
+ template< typename Type >
+ inline static void convertLittleEndian( Type& ) {}
+
+ template< typename Type >
+ inline static void convertLittleEndianArray( Type*, size_t ) {}
+
#endif
/** Reads a value from memory, assuming memory buffer in little-endian.
@@ -302,6 +307,13 @@ inline void ByteOrderConverter::writeLittleEndian( void* pDstBuffer, Type nValue
}
#ifdef OSL_BIGENDIAN
+template< typename Type >
+inline void ByteOrderConverter::convertLittleEndianArray( Type* pnArray, size_t nElemCount )
+{
+ for( Type* pnArrayEnd = pnArray + nElemCount; pnArray != pnArrayEnd; ++pnArray )
+ convertLittleEndian( *pnArray );
+}
+
inline void ByteOrderConverter::swap2( sal_uInt8* pnData )
{
::std::swap( pnData[ 0 ], pnData[ 1 ] );
@@ -328,4 +340,4 @@ inline void ByteOrderConverter::swap8( sal_uInt8* pnData )
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/helper/modelobjecthelper.hxx b/oox/inc/oox/helper/modelobjecthelper.hxx
index 9bac77718a58..e62c0ef66d1d 100644
--- a/oox/inc/oox/helper/modelobjecthelper.hxx
+++ b/oox/inc/oox/helper/modelobjecthelper.hxx
@@ -49,7 +49,7 @@ class ObjectContainer
{
public:
explicit ObjectContainer(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory,
const ::rtl::OUString& rServiceName );
~ObjectContainer();
@@ -69,8 +69,8 @@ private:
void createContainer() const;
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- mxFactory; /// Factory to create the container.
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
+ mxModelFactory; /// Factory to create the container.
mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
mxContainer; /// Container for the objects.
::rtl::OUString maServiceName; /// Service name to create the container.
@@ -82,9 +82,9 @@ private:
/** Contains tables for named drawing objects for a document model.
Contains tables for named line markers, line dashes, fill gradients, and
- fill bitmaps. The class is needed to handle different document models in
- the same filter (e.g. embedded charts) which carry their own drawing object
- tables.
+ fill bitmap URLs. The class is needed to handle different document models
+ in the same filter (e.g. embedded charts) which carry their own drawing
+ object tables.
*/
class ModelObjectHelper
{
@@ -109,18 +109,18 @@ public:
an internal constant name with a new unused index appended. */
::rtl::OUString insertFillGradient( const ::com::sun::star::awt::Gradient& rGradient );
- /** Inserts a new named fill bitmap, returns the bitmap name, based on an
- internal constant name with a new unused index appended. */
- ::rtl::OUString insertFillBitmap( const ::rtl::OUString& rGraphicUrl );
+ /** Inserts a new named fill bitmap URL, returns the bitmap name, based on
+ an internal constant name with a new unused index appended. */
+ ::rtl::OUString insertFillBitmapUrl( const ::rtl::OUString& rGraphicUrl );
private:
ObjectContainer maMarkerContainer; /// Contains all named line markers (line end polygons).
ObjectContainer maDashContainer; /// Contains all named line dsahes.
ObjectContainer maGradientContainer; /// Contains all named fill gradients.
- ObjectContainer maBitmapContainer; /// Contains all named fill bitmaps.
+ ObjectContainer maBitmapUrlContainer; /// Contains all named fill bitmap URLs.
const ::rtl::OUString maDashNameBase; /// Base name for all named line dashes.
const ::rtl::OUString maGradientNameBase; /// Base name for all named fill gradients.
- const ::rtl::OUString maBitmapNameBase; /// Base name for all named fill bitmaps.
+ const ::rtl::OUString maBitmapUrlNameBase; /// Base name for all named fill bitmap URLs.
};
// ============================================================================
@@ -129,4 +129,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/helper/propertymap.hxx b/oox/inc/oox/helper/propertymap.hxx
index 4d4e16cb15fd..e69c336ddec0 100644
--- a/oox/inc/oox/helper/propertymap.hxx
+++ b/oox/inc/oox/helper/propertymap.hxx
@@ -60,7 +60,6 @@ class PropertyMap : public PropertyMapBase
{
public:
explicit PropertyMap();
- ~PropertyMap();
/** Returns the name of the passed property identifier. */
static const ::rtl::OUString& getPropertyName( sal_Int32 nPropId );
@@ -74,9 +73,18 @@ public:
/** Sets the specified property to the passed value. Does nothing, if the
identifier is invalid. */
+ inline bool setAnyProperty( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue )
+ { if( nPropId < 0 ) return false; (*this)[ nPropId ] = rValue; return true; }
+
+ /** Sets the specified property to the passed value. Does nothing, if the
+ identifier is invalid. */
template< typename Type >
- inline void setProperty( sal_Int32 nPropId, const Type& rValue )
- { if( nPropId >= 0 ) (*this)[ nPropId ] <<= rValue; }
+ inline bool setProperty( sal_Int32 nPropId, const Type& rValue )
+ { if( nPropId < 0 ) return false; (*this)[ nPropId ] <<= rValue; return true; }
+
+ /** Inserts all properties contained in the passed property map. */
+ inline void assignUsed( const PropertyMap& rPropMap )
+ { insert( rPropMap.begin(), rPropMap.end() ); }
/** Returns a sequence of property values, filled with all contained properties. */
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
@@ -87,7 +95,7 @@ public:
::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames,
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rValues ) const;
- /** Creates and fills a new instance supporting the XPropertySet interface. */
+ /** Creates a property set supporting the XPropertySet interface and inserts all properties. */
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
makePropertySet() const;
diff --git a/oox/inc/oox/helper/propertyset.hxx b/oox/inc/oox/helper/propertyset.hxx
index e07709f0ef17..421908d0e790 100644
--- a/oox/inc/oox/helper/propertyset.hxx
+++ b/oox/inc/oox/helper/propertyset.hxx
@@ -29,8 +29,9 @@
#ifndef OOX_HELPER_PROPERTYSET_HXX
#define OOX_HELPER_PROPERTYSET_HXX
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include "oox/token/properties.hxx"
namespace oox {
@@ -83,20 +84,20 @@ public:
inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
getXPropertySet() const { return mxPropSet; }
+ /** Returns true, if the specified property is supported by the property set. */
+ bool hasProperty( sal_Int32 nPropId ) const;
+
// Get properties ---------------------------------------------------------
/** Gets the specified property from the property set.
- @return true, if the any could be filled with the property value. */
- bool getAnyProperty( ::com::sun::star::uno::Any& orValue, sal_Int32 nPropId ) const;
+ @return the property value, or an empty Any, if the property is missing. */
+ ::com::sun::star::uno::Any getAnyProperty( sal_Int32 nPropId ) const;
/** Gets the specified property from the property set.
@return true, if the passed variable could be filled with the property value. */
template< typename Type >
- inline bool getProperty( Type& orValue, sal_Int32 nPropId ) const;
-
- /** Gets the specified property from the property set.
- @return the property value, or an empty Any, if the property is missing. */
- ::com::sun::star::uno::Any getAnyProperty( sal_Int32 nPropId ) const;
+ inline bool getProperty( Type& orValue, sal_Int32 nPropId ) const
+ { return getAnyProperty( nPropId ) >>= orValue; }
/** Gets the specified boolean property from the property set.
@return true = property contains true; false = property contains false or error occurred. */
@@ -112,11 +113,12 @@ public:
// Set properties ---------------------------------------------------------
/** Puts the passed any into the property set. */
- void setAnyProperty( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+ bool setAnyProperty( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
/** Puts the passed value into the property set. */
template< typename Type >
- inline void setProperty( sal_Int32 nPropId, const Type& rValue );
+ inline bool setProperty( sal_Int32 nPropId, const Type& rValue )
+ { return setAnyProperty( nPropId, ::com::sun::star::uno::Any( rValue ) ); }
/** Puts the passed properties into the property set. Tries to use the XMultiPropertySet interface.
@param rPropNames The property names. MUST be ordered alphabetically.
@@ -137,33 +139,20 @@ public:
private:
/** Gets the specified property from the property set.
@return true, if the any could be filled with the property value. */
- bool getAnyProperty( ::com::sun::star::uno::Any& orValue, const ::rtl::OUString& rPropName ) const;
+ bool implGetPropertyValue( ::com::sun::star::uno::Any& orValue, const ::rtl::OUString& rPropName ) const;
/** Puts the passed any into the property set. */
- void setAnyProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rValue );
+ bool implSetPropertyValue( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rValue );
private:
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
mxPropSet; /// The mandatory property set interface.
::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet >
mxMultiPropSet; /// The optional multi property set interface.
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
+ mxPropSetInfo; /// Property information.
};
-// ----------------------------------------------------------------------------
-
-template< typename Type >
-inline bool PropertySet::getProperty( Type& orValue, sal_Int32 nPropId ) const
-{
- ::com::sun::star::uno::Any aAny;
- return getAnyProperty( aAny, nPropId ) && (aAny >>= orValue);
-}
-
-template< typename Type >
-inline void PropertySet::setProperty( sal_Int32 nPropId, const Type& rValue )
-{
- setAnyProperty( nPropId, ::com::sun::star::uno::Any( rValue ) );
-}
-
// ============================================================================
} // namespace oox
diff --git a/oox/inc/oox/helper/textinputstream.hxx b/oox/inc/oox/helper/textinputstream.hxx
index b3256bd33235..b95260714a97 100644..100755
--- a/oox/inc/oox/helper/textinputstream.hxx
+++ b/oox/inc/oox/helper/textinputstream.hxx
@@ -26,29 +26,100 @@
*
************************************************************************/
-#ifndef OOX_HELPER_RECORDINPUTSTREAM_HXX
-#define OOX_HELPER_RECORDINPUTSTREAM_HXX
+#ifndef OOX_HELPER_TEXTINPUTSTREAM_HXX
+#define OOX_HELPER_TEXTINPUTSTREAM_HXX
-#include "oox/helper/binaryinputstream.hxx"
+#include <com/sun/star/uno/Reference.hxx>
+#include <rtl/ustring.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace io { class XInputStream; }
+ namespace io { class XTextInputStream; }
+ namespace uno { class XComponentContext; }
+} } }
namespace oox {
+class BinaryInputStream;
+
// ============================================================================
class TextInputStream
{
public:
- explicit TextInputStream( BinaryInputStream& rInStrm, rtl_TextEncoding eTextEnc );
+ explicit TextInputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
+ rtl_TextEncoding eTextEnc );
+
+ explicit TextInputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ BinaryInputStream& rInStrm,
+ rtl_TextEncoding eTextEnc );
+
+ ~TextInputStream();
- /** Returns true, if the wrapped input stream is in EOF state. */
+ /** Returns true, if no more text is available in the stream.
+ */
bool isEof() const;
- /** Reads a text line from the stream. */
+
+ /** Reads a text line from the stream.
+
+ If the last line in the stream is not terminated with line-end
+ character(s), the stream will immediately go into EOF state and return
+ the text line. Otherwise, if the last character in the stream is a
+ line-end character, the next call to this function will turn the stream
+ into EOF state and return an empty string.
+ */
::rtl::OUString readLine();
+ /** Reads a text portion from the stream until the specified character is
+ found.
+
+ If the end of the stream is not terminated with the specified
+ character, the stream will immediately go into EOF state and return the
+ remaining text portion. Otherwise, if the last character in the stream
+ is the specified character (and caller specifies to read and return it,
+ see parameter bIncludeChar), the next call to this function will turn
+ the stream into EOF state and return an empty string.
+
+ @param cChar
+ The separator character to be read to.
+
+ @param bIncludeChar
+ True = if found, the specified character will be read from stream
+ and included in the returned string.
+ False = the specified character will neither be read from the
+ stream nor included in the returned string, but will be
+ returned as first character in the next call of this function
+ or readLine().
+ */
+ ::rtl::OUString readToChar( sal_Unicode cChar, bool bIncludeChar );
+
+ // ------------------------------------------------------------------------
+
+ /** Creates a UNO text input stream object from the passed UNO input stream.
+ */
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream >
+ createXTextInputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
+ rtl_TextEncoding eTextEnc );
+
+ // ------------------------------------------------------------------------
+private:
+ void init(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
+ rtl_TextEncoding eTextEnc );
+
+ /** Adds the pending character in front of the passed string, if existing. */
+ ::rtl::OUString createFinalString( const ::rtl::OUString& rString );
+
private:
- BinaryInputStream& mrInStrm;
- rtl_TextEncoding meTextEnc;
- sal_Unicode mcLastEolChar;
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream >
+ mxTextStrm;
+ sal_Unicode mcPendingChar;
};
// ============================================================================
@@ -57,4 +128,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/helper/zipstorage.hxx b/oox/inc/oox/helper/zipstorage.hxx
index 1eb84d941244..4c8e898b9703 100644
--- a/oox/inc/oox/helper/zipstorage.hxx
+++ b/oox/inc/oox/helper/zipstorage.hxx
@@ -32,7 +32,7 @@
#include "oox/helper/storagebase.hxx"
namespace com { namespace sun { namespace star {
- namespace lang { class XMultiServiceFactory; }
+ namespace uno { class XComponentContext; }
} } }
namespace oox {
@@ -44,11 +44,11 @@ class ZipStorage : public StorageBase
{
public:
explicit ZipStorage(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream );
explicit ZipStorage(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxStream );
virtual ~ZipStorage();
@@ -84,9 +84,8 @@ private:
virtual void implCommit() const;
private:
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > XStorageRef;
-
- XStorageRef mxStorage; /// Storage based on input or output stream.
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ mxStorage; /// Storage based on input or output stream.
};
// ============================================================================
diff --git a/oox/inc/oox/ole/axbinaryreader.hxx b/oox/inc/oox/ole/axbinaryreader.hxx
index 811e7937d236..5d7e9a6d4f25 100644
--- a/oox/inc/oox/ole/axbinaryreader.hxx
+++ b/oox/inc/oox/ole/axbinaryreader.hxx
@@ -41,7 +41,7 @@ namespace ole {
/** A wrapper for a binary input stream that supports aligned read operations.
The implementation does not support seeking back the wrapped stream. All
- seeking operations (tell, seek, align) are performed relative to the
+ seeking operations (tell, seekTo, align) are performed relative to the
position of the wrapped stream at construction time of this wrapper. It is
possible to construct this wrapper with an unseekable input stream without
loosing any functionality.
@@ -51,21 +51,26 @@ class AxAlignedInputStream : public BinaryInputStream
public:
explicit AxAlignedInputStream( BinaryInputStream& rInStrm );
+ /** Returns the size of the data this stream represents, if the wrapped
+ stream supports the size() operation. */
+ virtual sal_Int64 size() const;
/** Return the current relative stream position (relative to position of
the wrapped stream at construction time). */
virtual sal_Int64 tell() const;
/** Seeks the stream to the passed relative position, if it is behind the
current position. */
virtual void seek( sal_Int64 nPos );
+ /** Closes the input stream but not the wrapped stream. */
+ virtual void close();
/** Reads nBytes bytes to the passed sequence.
@return Number of bytes really read. */
- virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes );
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Reads nBytes bytes to the (existing) buffer opMem.
@return Number of bytes really read. */
- virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes );
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Seeks the stream forward by the passed number of bytes. */
- virtual void skip( sal_Int32 nBytes );
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Aligns the stream to a multiple of the passed size (relative to the
position of the wrapped stream at construction time). */
@@ -79,8 +84,9 @@ public:
inline void skipAligned() { align( sizeof( Type ) ); skip( sizeof( Type ) ); }
private:
- BinaryInputStream& mrInStrm; /// The wrapped input stream.
+ BinaryInputStream* mpInStrm; /// The wrapped input stream.
sal_Int64 mnStrmPos; /// Tracks relative position in the stream.
+ sal_Int64 mnStrmSize; /// Size of the wrapped stream data.
};
// ============================================================================
@@ -298,4 +304,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/ole/oleobjecthelper.hxx b/oox/inc/oox/ole/oleobjecthelper.hxx
index 659e927d203b..8ae387851a12 100644
--- a/oox/inc/oox/ole/oleobjecthelper.hxx
+++ b/oox/inc/oox/ole/oleobjecthelper.hxx
@@ -64,7 +64,7 @@ class OleObjectHelper
{
public:
explicit OleObjectHelper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory );
~OleObjectHelper();
bool importOleObject(
@@ -85,4 +85,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/ole/olestorage.hxx b/oox/inc/oox/ole/olestorage.hxx
index d2c22f5aa0f6..aad7a9bfc165 100644..100755
--- a/oox/inc/oox/ole/olestorage.hxx
+++ b/oox/inc/oox/ole/olestorage.hxx
@@ -33,7 +33,7 @@
namespace com { namespace sun { namespace star {
namespace container { class XNameContainer; }
- namespace lang { class XMultiServiceFactory; }
+ namespace uno { class XComponentContext; }
} } }
namespace oox {
@@ -46,12 +46,12 @@ class OOX_DLLPUBLIC OleStorage : public StorageBase
{
public:
explicit OleStorage(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream,
bool bBaseStreamAccess );
explicit OleStorage(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream,
bool bBaseStreamAccess );
@@ -102,8 +102,8 @@ private:
virtual void implCommit() const;
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- mxFactory; /// Factory for storage/stream creation.
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ mxContext; /// Component context with service manager.
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
mxStorage; /// Access to elements of this sub storage.
const OleStorage* mpParentStorage; /// Parent OLE storage that contains this storage.
diff --git a/oox/inc/oox/ole/vbacontrol.hxx b/oox/inc/oox/ole/vbacontrol.hxx
index 3c862a9b2046..46472454fd5b 100644
--- a/oox/inc/oox/ole/vbacontrol.hxx
+++ b/oox/inc/oox/ole/vbacontrol.hxx
@@ -204,7 +204,7 @@ public:
rtl_TextEncoding eTextEnc );
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxCompContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxDocModel;
ControlConverter maConverter;
};
diff --git a/oox/inc/oox/ole/vbainputstream.hxx b/oox/inc/oox/ole/vbainputstream.hxx
index 0dc644d3bc24..ea0e543823c5 100644
--- a/oox/inc/oox/ole/vbainputstream.hxx
+++ b/oox/inc/oox/ole/vbainputstream.hxx
@@ -43,14 +43,23 @@ class VbaInputStream : public BinaryInputStream
public:
explicit VbaInputStream( BinaryInputStream& rInStrm );
+ /** Returns -1, stream size is not determinable. */
+ virtual sal_Int64 size() const;
+ /** Returns -1, stream position is not tracked. */
+ virtual sal_Int64 tell() const;
+ /** Does nothing, stream is not seekable. */
+ virtual void seek( sal_Int64 nPos );
+ /** Closes the input stream but not the wrapped stream. */
+ virtual void close();
+
/** Reads nBytes bytes to the passed sequence.
@return Number of bytes really read. */
- virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes );
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Reads nBytes bytes to the (existing) buffer opMem.
@return Number of bytes really read. */
- virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes );
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Seeks the stream forward by the passed number of bytes. */
- virtual void skip( sal_Int32 nBytes );
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
private:
/** If no data left in chunk buffer, reads the next chunk from stream. */
@@ -59,7 +68,7 @@ private:
private:
typedef ::std::vector< sal_uInt8 > ChunkBuffer;
- BinaryInputStream& mrInStrm;
+ BinaryInputStream* mpInStrm;
ChunkBuffer maChunk;
size_t mnChunkPos;
};
@@ -71,4 +80,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/ole/vbamodule.hxx b/oox/inc/oox/ole/vbamodule.hxx
index a0fc68a6c3f5..2e83b3e06af6 100644..100755
--- a/oox/inc/oox/ole/vbamodule.hxx
+++ b/oox/inc/oox/ole/vbamodule.hxx
@@ -36,6 +36,7 @@ namespace com { namespace sun { namespace star {
namespace container { class XNameAccess; }
namespace container { class XNameContainer; }
namespace frame { class XModel; }
+ namespace uno { class XComponentContext; }
} } }
namespace oox {
@@ -52,6 +53,7 @@ class VbaModule
{
public:
explicit VbaModule(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
const ::rtl::OUString& rName,
rtl_TextEncoding eTextEnc,
@@ -97,6 +99,8 @@ private:
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxDocObjectNA ) const;
private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ mxContext; /// Component context with service manager.
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
mxDocModel; /// Document model used to import/export the VBA project.
::rtl::OUString maName;
diff --git a/oox/inc/oox/ole/vbaproject.hxx b/oox/inc/oox/ole/vbaproject.hxx
index 2d1b4fd60cf8..001188f8ffff 100644
--- a/oox/inc/oox/ole/vbaproject.hxx
+++ b/oox/inc/oox/ole/vbaproject.hxx
@@ -191,7 +191,7 @@ private:
typedef ::std::map< ::rtl::OUString, sal_Int32 > DummyModuleMap;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
- mxCompContext; /// Component context with service manager.
+ mxContext; /// Component context with service manager.
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
mxDocModel; /// Document model used to import/export the VBA project.
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
diff --git a/oox/inc/oox/ppt/slidepersist.hxx b/oox/inc/oox/ppt/slidepersist.hxx
index 0a197e1d4135..e4891864820c 100644
--- a/oox/inc/oox/ppt/slidepersist.hxx
+++ b/oox/inc/oox/ppt/slidepersist.hxx
@@ -95,7 +95,7 @@ public:
void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr pFillPropertiesPtr ){ mpBackgroundPropertiesPtr = pFillPropertiesPtr; }
oox::drawingml::FillPropertiesPtr getBackgroundProperties() const { return mpBackgroundPropertiesPtr; }
- oox::drawingml::Color& getBackgroundColorRef() { return maBackgroundColorRef; }
+ oox::drawingml::Color& getBackgroundColor() { return maBackgroundColor; }
sal_Bool isMasterPage() const { return mbMaster; }
sal_Bool isNotesPage() const { return mbNotes; }
@@ -135,7 +135,7 @@ private:
SlidePersistPtr mpMasterPagePtr;
oox::drawingml::ShapePtr maShapesPtr;
- oox::drawingml::Color maBackgroundColorRef;
+ oox::drawingml::Color maBackgroundColor;
oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr;
::std::list< boost::shared_ptr< TimeNode > > maTimeNodeList;
diff --git a/oox/inc/oox/vml/vmldrawing.hxx b/oox/inc/oox/vml/vmldrawing.hxx
index ed01461f4e51..91d9c1abdcfb 100644
--- a/oox/inc/oox/vml/vmldrawing.hxx
+++ b/oox/inc/oox/vml/vmldrawing.hxx
@@ -133,7 +133,7 @@ public:
/** Final processing after import of the fragment. */
void finalizeFragmentImport();
- /** Creates and inserts all UNO shapes into the passed container. The virtual
+ /** Creates and inserts all UNO shapes into the draw page. The virtual
function notifyXShapeInserted() will be called for each new shape. */
void convertAndInsert() const;
@@ -216,4 +216,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/vml/vmlformatting.hxx b/oox/inc/oox/vml/vmlformatting.hxx
index a71539a7793d..5135452583c3 100644
--- a/oox/inc/oox/vml/vmlformatting.hxx
+++ b/oox/inc/oox/vml/vmlformatting.hxx
@@ -33,9 +33,8 @@
namespace oox {
class GraphicHelper;
- class ModelObjectHelper;
- class PropertyMap;
namespace drawingml { class Color; }
+ namespace drawingml { class ShapePropertyMap; }
}
namespace oox {
@@ -92,7 +91,7 @@ public:
@param bDefaultAsPixel Set to true if omitted measure unit means
pixel. Set to false if omitted measure unit means EMU.
*/
- static sal_Int32 decodeMeasureToEmu(
+ static sal_Int64 decodeMeasureToEmu(
const GraphicHelper& rGraphicHelper,
const ::rtl::OUString& rValue,
sal_Int32 nRefValue,
@@ -180,8 +179,7 @@ struct StrokeModel
/** Writes the properties to the passed property map. */
void pushToPropMap(
- PropertyMap& rPropMap,
- ModelObjectHelper& rModelObjectHelper,
+ ::oox::drawingml::ShapePropertyMap& rPropMap,
const GraphicHelper& rGraphicHelper ) const;
};
@@ -207,8 +205,7 @@ struct FillModel
/** Writes the properties to the passed property map. */
void pushToPropMap(
- PropertyMap& rPropMap,
- ModelObjectHelper& rModelObjectHelper,
+ ::oox::drawingml::ShapePropertyMap& rPropMap,
const GraphicHelper& rGraphicHelper ) const;
};
@@ -219,4 +216,4 @@ struct FillModel
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/vml/vmlinputstream.hxx b/oox/inc/oox/vml/vmlinputstream.hxx
index ad46888c3856..da16ff14d9a6 100644
--- a/oox/inc/oox/vml/vmlinputstream.hxx
+++ b/oox/inc/oox/vml/vmlinputstream.hxx
@@ -29,36 +29,72 @@
#ifndef OOX_VML_VMLINPUTSTREAM_HXX
#define OOX_VML_VMLINPUTSTREAM_HXX
-#include <comphelper/seqstream.hxx>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <rtl/string.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace io { class XTextInputStream; }
+ namespace uno { class XComponentContext; }
+} } }
namespace oox {
namespace vml {
// ============================================================================
-struct StreamDataContainer
-{
- ::comphelper::ByteSequence maDataSeq;
+typedef ::cppu::WeakImplHelper1< ::com::sun::star::io::XInputStream > InputStream_BASE;
- explicit StreamDataContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm );
-};
+/** An input stream class for VML streams, implementing the UNO interface
+ com.sun.star.io.XInputStream needed by the Expat XML parsers.
-// ============================================================================
+ This stream reads the data from the input stream passed to the constructor,
+ and parses all XML elements for features unsupported by the current Expat
+ XML parser:
-/** An input stream class for VML streams.
+ 1) All elements that have the form '<![inst]>' where 'inst' is any string
+ not containing the characters '<' and '>' are stripped from the input
+ stream.
- This stream reads the entire data from the input stream passed to the
- constructor, and parses all XML elements for features unsupported by the
- current Expat parser.
+ 2) Multiple occurences of the same attribute in an element but the last
+ are removed.
- All elements that have the form '<![inst]>' where 'inst' is any string not
- containing the characters '<' and '>' are stripped from the input stream.
+ 3) Line breaks represented by a single <br> element (without matching
+ </br> element) are replaced by a literal LF character.
*/
-class InputStream : private StreamDataContainer, public ::comphelper::SequenceInputStream
+class InputStream : public InputStream_BASE
{
public:
- explicit InputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm );
+ explicit InputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm );
virtual ~InputStream();
+
+ virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& rData, sal_Int32 nBytesToRead )
+ throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& rData, sal_Int32 nMaxBytesToRead )
+ throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip )
+ throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL available()
+ throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL closeInput()
+ throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ void updateBuffer() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ ::rtl::OString readToElementBegin() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ ::rtl::OString readToElementEnd() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream >
+ mxTextStrm;
+ ::com::sun::star::uno::Sequence< sal_Unicode > maOpeningBracket;
+ ::com::sun::star::uno::Sequence< sal_Unicode > maClosingBracket;
+ const ::rtl::OString maOpeningCData;
+ const ::rtl::OString maClosingCData;
+ ::rtl::OString maBuffer;
+ sal_Int32 mnBufferPos;
};
// ============================================================================
@@ -68,4 +104,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/biffhelper.hxx b/oox/inc/oox/xls/biffhelper.hxx
index 328cde3f0c32..be8303feac54 100644
--- a/oox/inc/oox/xls/biffhelper.hxx
+++ b/oox/inc/oox/xls/biffhelper.hxx
@@ -443,6 +443,7 @@ const sal_uInt16 BIFF_ID_MTHREADSETTINGS = 0x089A;
const sal_uInt16 BIFF_ID_MULTBLANK = 0x00BE;
const sal_uInt16 BIFF_ID_MULTRK = 0x00BD;
const sal_uInt16 BIFF_ID_NOTE = 0x001C;
+const sal_uInt16 BIFF_ID_NOTESOUND = 0x0096;
const sal_uInt16 BIFF2_ID_NUMBER = 0x0003;
const sal_uInt16 BIFF3_ID_NUMBER = 0x0203;
const sal_uInt16 BIFF_ID_OBJ = 0x005D;
@@ -621,7 +622,7 @@ public:
// BIFF12 import ----------------------------------------------------------
/** Reads a BIFF12 string with leading 16-bit or 32-bit length field. */
- static ::rtl::OUString readString( SequenceInputStream& rStrm, bool b32BitLen = true );
+ static ::rtl::OUString readString( SequenceInputStream& rStrm, bool b32BitLen = true, bool bAllowNulChars = false );
// BIFF2-BIFF8 import -----------------------------------------------------
@@ -668,4 +669,4 @@ inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, ::rtl::OUStr
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/biffinputstream.hxx b/oox/inc/oox/xls/biffinputstream.hxx
index 3fd8d4d8fbdc..2f6f537faca6 100644
--- a/oox/inc/oox/xls/biffinputstream.hxx
+++ b/oox/inc/oox/xls/biffinputstream.hxx
@@ -243,30 +243,30 @@ public:
// BinaryStreamBase interface (seeking) -----------------------------------
- /** Returns true, as the BIFF input stream is required to be seekable. */
- virtual bool isSeekable() const;
+ /** Returns the data size of the whole record without record headers. */
+ virtual sal_Int64 size() const;
/** Returns the position inside of the whole record content. */
virtual sal_Int64 tell() const;
- /** Returns the data size of the whole record without record headers. */
- virtual sal_Int64 getLength() const;
/** Seeks in record content to the specified position. */
virtual void seek( sal_Int64 nRecPos );
+ /** Closes the input stream but not the wrapped stream. */
+ virtual void close();
/** Returns the absolute position in the wrapped binary stream. */
sal_Int64 tellBase() const;
/** Returns the total size of the wrapped binary stream. */
- sal_Int64 getBaseLength() const;
+ sal_Int64 sizeBase() const;
// BinaryInputStream interface (stream read access) -----------------------
/** Reads nBytes bytes to the passed sequence.
@return Number of bytes really read. */
- virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes );
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Reads nBytes bytes and copies them to the passed buffer opMem.
@return Number of bytes really read. */
- virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes );
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Seeks forward inside the current record. */
- virtual void skip( sal_Int32 nBytes );
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Stream operator for integral and floating-point types. */
template< typename Type >
@@ -353,9 +353,6 @@ public:
// ------------------------------------------------------------------------
private:
- /** Forwards calls of readValue() template functions to the record buffer. */
- virtual void readAtom( void* opMem, sal_uInt8 nSize );
-
/** Initializes all members after base stream has been seeked to new record. */
void setupRecord();
/** Restarts the current record from the beginning. */
@@ -384,16 +381,9 @@ private:
records, stores the length in mnComplRecSize. */
void calcRecordLength();
- /** Ensures that reading nBytes bytes is possible with next stream access.
- @descr Stream must be located at the end of a raw record, and handling
- of CONTINUE records must be enabled.
- @return True if nBytes can be read from stream. */
- bool ensureRawReadSize( sal_uInt16 nBytes );
/** Returns the maximum size of raw data possible to read in one block. */
- sal_uInt16 getMaxRawReadSize( sal_Int32 nBytes ) const;
+ sal_uInt16 getMaxRawReadSize( sal_Int32 nBytes, size_t nAtomSize ) const;
- /** Reads an array of Unicode characters and appends them to the passed buffer. */
- void appendUnicodeArray( ::rtl::OUStringBuffer& orBuffer, sal_uInt16 nChars, bool b16BitChars, bool bAllowNulChars );
/** Reads the BIFF8 Unicode string header fields. */
void readUniStringHeader( bool& orb16BitChars, sal_Int32& ornAddSize );
@@ -446,4 +436,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/biffoutputstream.hxx b/oox/inc/oox/xls/biffoutputstream.hxx
index 6f56bac31c8d..c58b86fa4496 100644
--- a/oox/inc/oox/xls/biffoutputstream.hxx
+++ b/oox/inc/oox/xls/biffoutputstream.hxx
@@ -95,9 +95,6 @@ private:
CONTINUE record, use setPortionSize(). Example: To write a sequence of
16-bit values where 4 values form a unit and cannot be split, call
setPortionSize(8) first (4*2 bytes == 8).
-
- To write unicode character arrays, call writeUnicodeBuffer(). It creates
- CONTINUE records and repeats the unicode string flag byte automatically.
*/
class BiffOutputStream : public BinaryOutputStream
{
@@ -114,47 +111,44 @@ public:
/** Finishes the current record. Must be called for every started record. */
void endRecord();
- /** Sets size of data portion in bytes. 0 means no portions are used. */
- void setPortionSize( sal_uInt16 nSize );
+ /** Sets size of data portion in bytes. 0 or 1 means no portions are used. */
+ void setPortionSize( sal_uInt8 nSize );
// BinaryStreamBase interface (seeking) -----------------------------------
/** Returns the absolute position in the wrapped binary stream. */
sal_Int64 tellBase() const;
/** Returns the total size of the wrapped binary stream. */
- sal_Int64 getBaseLength() const;
+ sal_Int64 sizeBase() const;
// BinaryOutputStream interface (stream write access) ---------------------
/** Writes the passed data sequence. */
- virtual void writeData( const StreamDataSequence& rData );
+ virtual void writeData( const StreamDataSequence& rData, size_t nAtomSize = 1 );
/** Writes nBytes bytes from the passed buffer pMem. */
- virtual void writeMemory( const void* pMem, sal_Int32 nBytes );
+ virtual void writeMemory( const void* pMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Writes a sequence of nBytes bytes with the passed value. */
- void fill( sal_uInt8 nValue, sal_Int32 nBytes );
- /** Writes a block of memory, ensures that it is not split to a CONTINUE record. */
- void writeBlock( const void* pMem, sal_uInt16 nBytes );
+ void fill( sal_uInt8 nValue, sal_Int32 nBytes, size_t nAtomSize = 1 );
- /** Stream operator for integral and floating-point types. */
+ /** Stream operator for all data types supported by the writeValue() function. */
template< typename Type >
inline BiffOutputStream& operator<<( Type nValue ) { writeValue( nValue ); return *this; }
// ------------------------------------------------------------------------
private:
- /** Forwards calls of writeValue() template functions to the record buffer. */
- virtual void writeAtom( const void* pMem, sal_uInt8 nSize );
-
/** Checks the remaining size in the current record, creates CONTINUE record if needed. */
void ensureRawBlock( sal_uInt16 nSize );
- /** Checks the remaining size in the current record and creates CONTINUE record if needed.
+
+ /** Checks the remaining size in the current record and creates a CONTINUE
+ record if needed.
@return Maximum size left for writing to current record. */
- sal_uInt16 prepareRawBlock( sal_Int32 nTotalSize );
+ sal_uInt16 prepareWriteBlock( sal_Int32 nTotalSize, size_t nAtomSize );
private:
prv::BiffOutputRecordBuffer maRecBuffer; /// Raw record data buffer.
- sal_uInt16 mnPortionSize; /// Size of data portions.
- sal_uInt16 mnPortionPos; /// Position in current portion.
+ sal_uInt8 mnPortionSize; /// Size of data portions.
+ sal_uInt8 mnPortionPos; /// Position in current portion.
};
// ============================================================================
@@ -164,4 +158,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/chartsheetfragment.hxx b/oox/inc/oox/xls/chartsheetfragment.hxx
index 3e2f3b4feb0f..2f2d44c23ffb 100644
--- a/oox/inc/oox/xls/chartsheetfragment.hxx
+++ b/oox/inc/oox/xls/chartsheetfragment.hxx
@@ -40,10 +40,8 @@ class ChartsheetFragment : public WorksheetFragmentBase
{
public:
explicit ChartsheetFragment(
- const WorkbookHelper& rHelper,
- const ::rtl::OUString& rFragmentPath,
- const ISegmentProgressBarRef& rxProgressBar,
- sal_Int16 nSheet );
+ const WorksheetHelper& rHelper,
+ const ::rtl::OUString& rFragmentPath );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -68,9 +66,8 @@ class BiffChartsheetFragment : public BiffWorksheetFragmentBase
{
public:
explicit BiffChartsheetFragment(
- const BiffWorkbookFragmentBase& rParent,
- const ISegmentProgressBarRef& rxProgressBar,
- sal_Int16 nSheet );
+ const WorksheetHelper& rHelper,
+ const BiffWorkbookFragmentBase& rParent );
/** Imports the entire sheet fragment, returns true, if EOF record has been reached. */
virtual bool importFragment();
@@ -83,4 +80,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/commentsbuffer.hxx b/oox/inc/oox/xls/commentsbuffer.hxx
index 85ae32ee9b1a..a0017ef70c0c 100644
--- a/oox/inc/oox/xls/commentsbuffer.hxx
+++ b/oox/inc/oox/xls/commentsbuffer.hxx
@@ -43,7 +43,9 @@ struct CommentModel
::com::sun::star::table::CellRangeAddress
maRange; /// Position of the comment in the worksheet.
RichStringRef mxText; /// Formatted text of the comment.
+ ::rtl::OUString maAuthor; /// Comment author (BIFF8 only).
sal_Int32 mnAuthorId; /// Identifier of the comment's author.
+ sal_uInt16 mnObjId; /// Drawing object identifier (BIFF8 only).
sal_Bool mbAutoFill; /// Auto Selection of comment object's fill style
sal_Bool mbAutoScale; /// Auto Scale comment text
sal_Bool mbColHidden; /// Comment cell's Column is Hidden
@@ -53,6 +55,7 @@ struct CommentModel
sal_Int32 mnTVA; /// Vertical Alignment
::com::sun::star::awt::Rectangle
maAnchor; /// Anchor parameters
+ bool mbVisible; /// True = comment is always shown (BIFF2-BIFF8 only).
explicit CommentModel();
};
@@ -72,6 +75,8 @@ public:
void importAnchor( bool bFrom, sal_Int32 nWhich, const ::rtl::OUString &rChars );
/** Imports a cell comment from the passed stream of a COMMENT record. */
void importComment( SequenceInputStream& rStrm );
+ /** Imports a cell comment from the passed stream of a NOTE record. */
+ void importNote( BiffInputStream& rStrm );
/** Creates and returns a new rich-string object for the comment text. */
RichStringRef createText();
@@ -80,6 +85,14 @@ public:
void finalizeImport();
private:
+ /** Reads a BIFF2-BIFF5 NOTE record. */
+ void importNoteBiff2( BiffInputStream& rStrm );
+ /** Reads a BIFF8 NOTE record. */
+ void importNoteBiff8( BiffInputStream& rStrm );
+ /** Reads a NOTESOUND record. */
+ void importNoteSound( BiffInputStream& rStrm );
+
+private:
CommentModel maModel;
};
@@ -115,4 +128,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/condformatbuffer.hxx b/oox/inc/oox/xls/condformatbuffer.hxx
index 08d318e0a3c3..3dba25beedb5 100644
--- a/oox/inc/oox/xls/condformatbuffer.hxx
+++ b/oox/inc/oox/xls/condformatbuffer.hxx
@@ -45,9 +45,9 @@ namespace xls {
/** Model for a single rule in a conditional formatting. */
struct CondFormatRuleModel
{
- typedef ::std::vector< TokensFormulaContext > ContextVector;
+ typedef ::std::vector< ApiTokenSequence > ApiTokenSequenceVector;
- ContextVector maFormulas; /// Formulas for rule conditions.
+ ApiTokenSequenceVector maFormulas; /// Formulas for rule conditions.
::rtl::OUString maText; /// Text for 'contains' rules.
sal_Int32 mnPriority; /// Priority of this rule.
sal_Int32 mnType; /// Type of the rule.
@@ -192,4 +192,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/defnamesbuffer.hxx b/oox/inc/oox/xls/defnamesbuffer.hxx
index e76c0ad6cf74..f7a6b0cdc53c 100644
--- a/oox/inc/oox/xls/defnamesbuffer.hxx
+++ b/oox/inc/oox/xls/defnamesbuffer.hxx
@@ -38,7 +38,6 @@ namespace com { namespace sun { namespace star {
namespace oox {
namespace xls {
-class FormulaContext;
class BiffInputStreamPos;
// ============================================================================
@@ -92,15 +91,15 @@ public:
/** Returns the original name as imported from or exported to the file. */
const ::rtl::OUString& getUpcaseModelName() const;
/** Returns an Any with a SingleReference or ComplexReference, or an empty Any. */
- ::com::sun::star::uno::Any getReference( const ::com::sun::star::table::CellAddress& rBaseAddress ) const;
+ ::com::sun::star::uno::Any getReference( const ::com::sun::star::table::CellAddress& rBaseAddr ) const;
protected:
- /** Imports the OOXML formula string, using the passed formula context. */
- void importOoxFormula( FormulaContext& rContext, sal_Int16 nBaseSheet );
- /** Imports the BIFF12 formula, using the passed formula context. */
- void importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, SequenceInputStream& rStrm );
- /** Imports the BIFF formula, using the passed formula context. */
- void importBiffFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize = 0 );
+ /** Converts the OOXML formula string stored in the own model. */
+ ApiTokenSequence importOoxFormula( sal_Int16 nBaseSheet );
+ /** Imports the BIFF12 formula from the passed stream. */
+ ApiTokenSequence importBiff12Formula( sal_Int16 nBaseSheet, SequenceInputStream& rStrm );
+ /** Imports the BIFF formula from the passed stream. */
+ ApiTokenSequence importBiffFormula( sal_Int16 nBaseSheet, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize = 0 );
/** Tries to convert the passed token sequence to a SingleReference or ComplexReference. */
void extractReference( const ApiTokenSequence& rTokens );
@@ -152,10 +151,10 @@ public:
bool getAbsoluteRange( ::com::sun::star::table::CellRangeAddress& orRange ) const;
private:
- /** Imports the OOXML or BIFF12 formula, using the passed formula context. */
- void implImportOoxFormula( FormulaContext& rContext );
- /** Imports the BIFF formula, using the passed formula context. */
- void implImportBiffFormula( FormulaContext& rContext );
+ /** Imports the OOXML or BIFF12 definition of the name. */
+ void implImportOoxFormula();
+ /** Imports the BIFF definition of the name. */
+ void implImportBiffFormula();
private:
typedef ::std::auto_ptr< StreamDataSequence > StreamDataSeqPtr;
@@ -233,4 +232,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/drawingbase.hxx b/oox/inc/oox/xls/drawingbase.hxx
new file mode 100755
index 000000000000..01bf43a6434f
--- /dev/null
+++ b/oox/inc/oox/xls/drawingbase.hxx
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * 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 OOX_XLS_DRAWINGBASE_HXX
+#define OOX_XLS_DRAWINGBASE_HXX
+
+#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/xls/worksheethelper.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+/** Absolute position in a spreadsheet (in EMUs) independent from cells. */
+struct AnchorPointModel : public ::oox::drawingml::EmuPoint
+{
+ inline explicit AnchorPointModel() : ::oox::drawingml::EmuPoint( -1, -1 ) {}
+ inline bool isValid() const { return (X >= 0) && (Y >= 0); }
+};
+
+// ----------------------------------------------------------------------------
+
+/** Absolute size in a spreadsheet (in EMUs). */
+struct AnchorSizeModel : public ::oox::drawingml::EmuSize
+{
+ inline explicit AnchorSizeModel() : ::oox::drawingml::EmuSize( -1, -1 ) {}
+ inline bool isValid() const { return (Width >= 0) && (Height >= 0); }
+};
+
+// ----------------------------------------------------------------------------
+
+/** Position in spreadsheet (cell position and offset inside cell). */
+struct CellAnchorModel
+{
+ sal_Int32 mnCol; /// Column index.
+ sal_Int32 mnRow; /// Row index.
+ sal_Int64 mnColOffset; /// X offset inside the column.
+ sal_Int64 mnRowOffset; /// Y offset inside the row.
+
+ explicit CellAnchorModel();
+ inline bool isValid() const { return (mnCol >= 0) && (mnRow >= 0); }
+};
+
+// ----------------------------------------------------------------------------
+
+/** Application-specific client data of a shape. */
+struct AnchorClientDataModel
+{
+ bool mbLocksWithSheet;
+ bool mbPrintsWithSheet;
+
+ explicit AnchorClientDataModel();
+};
+
+// ============================================================================
+
+/** Contains the position of a shape in the spreadsheet. Supports different
+ shape anchor modes (absolute, one-cell, two-cell). */
+class ShapeAnchor : public WorksheetHelper
+{
+public:
+ explicit ShapeAnchor( const WorksheetHelper& rHelper );
+
+ /** Imports the shape anchor (one of the elements xdr:absoluteAnchor, xdr:oneCellAnchor, xdr:twoCellAnchor). */
+ void importAnchor( sal_Int32 nElement, const AttributeList& rAttribs );
+ /** Imports the absolute anchor position from the xdr:pos element. */
+ void importPos( const AttributeList& rAttribs );
+ /** Imports the absolute anchor size from the xdr:ext element. */
+ void importExt( const AttributeList& rAttribs );
+ /** Imports the shape client data from the xdr:clientData element. */
+ void importClientData( const AttributeList& rAttribs );
+ /** Sets an attribute of the cell-dependent anchor position from xdr:from and xdr:to elements. */
+ void setCellPos( sal_Int32 nElement, sal_Int32 nParentContext, const ::rtl::OUString& rValue );
+ /** Imports the client anchor settings from a VML element. */
+ void importVmlAnchor( const ::rtl::OUString& rAnchor );
+ /** Imports the client anchor settings from a BIFF or DFF stream. */
+ void importBiffAnchor( BinaryInputStream& rStrm );
+
+ /** Calculates the resulting shape anchor in EMUs. */
+ ::oox::drawingml::EmuRectangle calcAnchorRectEmu(
+ const ::com::sun::star::awt::Size& rPageSizeHmm ) const;
+ /** Calculates the resulting shape anchor in 1/100 mm. */
+ ::com::sun::star::awt::Rectangle calcAnchorRectHmm(
+ const ::com::sun::star::awt::Size& rPageSizeHmm ) const;
+
+private:
+ /** Converts the passed anchor to an absolute position in EMUs. */
+ ::oox::drawingml::EmuPoint calcCellAnchorEmu( const CellAnchorModel& rModel ) const;
+
+private:
+ enum AnchorType
+ {
+ ANCHOR_INVALID, /// Anchor type is unknown.
+ ANCHOR_ABSOLUTE, /// Absolute anchor (top-left corner and size in absolute units).
+ ANCHOR_ONECELL, /// One-cell anchor (top-left corner at cell, size in absolute units).
+ ANCHOR_TWOCELL /// Two-cell anchor (top-left and bottom-right corner at cell).
+ };
+
+ /** Specifies how cell positions from CellAnchorModel have to be processed. */
+ enum CellAnchorType
+ {
+ CELLANCHOR_EMU, /// Offsets are given in EMUs.
+ CELLANCHOR_PIXEL, /// Offsets are given in screen pixels.
+ CELLANCHOR_COLROW /// Offsets are given in fractions of column width or row height.
+ };
+
+ AnchorType meAnchorType; /// Type of this shape anchor.
+ CellAnchorType meCellAnchorType; /// Type of the cell anchor models.
+ AnchorPointModel maPos; /// Top-left position, if anchor is of type absolute.
+ AnchorSizeModel maSize; /// Anchor size, if anchor is not of type two-cell.
+ CellAnchorModel maFrom; /// Top-left position, if anchor is not of type absolute.
+ CellAnchorModel maTo; /// Bottom-right position, if anchor is of type two-cell.
+ AnchorClientDataModel maClientData; /// Shape client data.
+ sal_Int32 mnEditAs; /// Anchor mode as shown in the UI.
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/drawingfragment.hxx b/oox/inc/oox/xls/drawingfragment.hxx
index d78b038cd3b4..1000845dcac7 100644
--- a/oox/inc/oox/xls/drawingfragment.hxx
+++ b/oox/inc/oox/xls/drawingfragment.hxx
@@ -38,6 +38,7 @@
#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmldrawingfragment.hxx"
#include "oox/vml/vmltextbox.hxx"
+#include "oox/xls/drawingbase.hxx"
#include "oox/xls/excelhandlers.hxx"
namespace oox { namespace ole {
@@ -52,98 +53,6 @@ namespace xls {
// DrawingML
// ============================================================================
-/** Absolute position in spreadsheet (in EMUs) independent from cells. */
-struct AnchorPosModel : public ::oox::drawingml::EmuPoint
-{
- inline explicit AnchorPosModel() : ::oox::drawingml::EmuPoint( -1, -1 ) {}
- inline bool isValid() const { return (X >= 0) && (Y >= 0); }
-};
-
-// ----------------------------------------------------------------------------
-
-/** Absolute size in spreadsheet (in EMUs). */
-struct AnchorSizeModel : public ::oox::drawingml::EmuSize
-{
- inline explicit AnchorSizeModel() : ::oox::drawingml::EmuSize( -1, -1 ) {}
- inline bool isValid() const { return (Width >= 0) && (Height >= 0); }
-};
-
-// ----------------------------------------------------------------------------
-
-/** Position in spreadsheet (cell position and offset inside cell in EMUs). */
-struct AnchorCellModel
-{
- sal_Int32 mnCol; /// Column index.
- sal_Int32 mnRow; /// Row index.
- sal_Int64 mnColOffset; /// X offset in column mnCol (EMUs).
- sal_Int64 mnRowOffset; /// Y offset in row mnRow (EMUs).
-
- explicit AnchorCellModel();
- inline bool isValid() const { return (mnCol >= 0) && (mnRow >= 0); }
-};
-
-// ----------------------------------------------------------------------------
-
-/** Application-specific client data of a shape. */
-struct AnchorClientDataModel
-{
- bool mbLocksWithSheet;
- bool mbPrintsWithSheet;
-
- explicit AnchorClientDataModel();
-};
-
-// ============================================================================
-
-/** Contains the position of a shape in the spreadsheet. Supports different
- shape anchor modes (absolute, one-cell, two-cell). */
-class ShapeAnchor : public WorksheetHelper
-{
-public:
- explicit ShapeAnchor( const WorksheetHelper& rHelper );
-
- /** Imports the shape anchor (one of the elements xdr:absoluteAnchor, xdr:oneCellAnchor, xdr:twoCellAnchor). */
- void importAnchor( sal_Int32 nElement, const AttributeList& rAttribs );
- /** Imports the absolute anchor position from the xdr:pos element. */
- void importPos( const AttributeList& rAttribs );
- /** Imports the absolute anchor size from the xdr:ext element. */
- void importExt( const AttributeList& rAttribs );
- /** Imports the shape client data from the xdr:clientData element. */
- void importClientData( const AttributeList& rAttribs );
- /** Sets an attribute of the cell-dependent anchor position from xdr:from and xdr:to elements. */
- void setCellPos( sal_Int32 nElement, sal_Int32 nParentContext, const ::rtl::OUString& rValue );
- /** Imports and converts the VML specific client anchor. */
- void importVmlAnchor( const ::rtl::OUString& rAnchor );
-
- /** Returns true, if the anchor contains valid position and size settings. */
- bool isValidAnchor() const;
-
- /** Calculates the resulting shape anchor in 1/100 mm. */
- ::com::sun::star::awt::Rectangle
- calcApiLocation(
- const ::com::sun::star::awt::Size& rApiSheetSize,
- const AnchorSizeModel& rEmuSheetSize ) const;
-
- /** Calculates the resulting shape anchor in EMUs. */
- ::com::sun::star::awt::Rectangle
- calcEmuLocation( const AnchorSizeModel& rEmuSheetSize ) const;
-
-private:
- enum AnchorType { ANCHOR_ABSOLUTE, ANCHOR_ONECELL, ANCHOR_TWOCELL, ANCHOR_VML, ANCHOR_INVALID };
-
- AnchorType meType; /// Type of this shape anchor.
- AnchorPosModel maPos; /// Top-left position, if anchor is of type absolute.
- AnchorSizeModel maSize; /// Anchor size, if anchor is not of type two-cell.
- AnchorCellModel maFrom; /// Top-left position, if anchor is not of type absolute.
- AnchorCellModel maTo; /// Bottom-right position, if anchor is of type two-cell.
- AnchorClientDataModel maClientData; /// Shape client data.
- sal_Int32 mnEditAs; /// Anchor mode as shown in the UI.
-};
-
-typedef ::boost::shared_ptr< ShapeAnchor > ShapeAnchorRef;
-
-// ============================================================================
-
class ShapeMacroAttacher : public ::oox::ole::VbaMacroAttacherBase
{
public:
@@ -221,10 +130,10 @@ protected:
virtual void onEndElement();
private:
+ typedef ::std::auto_ptr< ShapeAnchor > ShapeAnchorRef;
+
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
mxDrawPage; /// Drawing page of this sheet.
- ::com::sun::star::awt::Size maApiSheetSize; /// Sheet size in 1/100 mm.
- AnchorSizeModel maEmuSheetSize; /// Sheet size in EMU.
::oox::drawingml::ShapePtr mxShape; /// Current top-level shape.
ShapeAnchorRef mxAnchor; /// Current anchor of top-level shape.
};
@@ -326,4 +235,4 @@ protected:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/drawingmanager.hxx b/oox/inc/oox/xls/drawingmanager.hxx
new file mode 100755
index 000000000000..91fba91ee271
--- /dev/null
+++ b/oox/inc/oox/xls/drawingmanager.hxx
@@ -0,0 +1,521 @@
+/*************************************************************************
+ *
+ * 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 OOX_XLS_DRAWINGMANAGER_HXX
+#define OOX_XLS_DRAWINGMANAGER_HXX
+
+#include "oox/xls/drawingbase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace drawing { class XDrawPage; }
+ namespace drawing { class XShape; }
+ namespace drawing { class XShapes; }
+} } }
+
+namespace oox { namespace drawingml { class ShapePropertyMap; } }
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+const sal_uInt16 BIFF_OBJ_INVALID_ID = 0;
+
+// ============================================================================
+// Model structures for BIFF OBJ record data
+// ============================================================================
+
+/** This structure contains line formatting attributes from an OBJ record. */
+struct BiffObjLineModel
+{
+ sal_uInt8 mnColorIdx; /// Index into color palette.
+ sal_uInt8 mnStyle; /// Line dash style.
+ sal_uInt8 mnWidth; /// Line width.
+ bool mbAuto; /// True = automatic line format.
+
+ explicit BiffObjLineModel();
+
+ /** Returns true, if the line formatting is visible (automatic or explicit). */
+ bool isVisible() const;
+};
+
+// ============================================================================
+
+/** This structure contains fill formatting attributes from an OBJ record. */
+struct BiffObjFillModel
+{
+ sal_uInt8 mnBackColorIdx; /// Index to color palette for background color.
+ sal_uInt8 mnPattColorIdx; /// Index to color palette for pattern foreground color.
+ sal_uInt8 mnPattern; /// Fill pattern.
+ bool mbAuto; /// True = automatic fill format.
+
+ explicit BiffObjFillModel();
+
+ /** Returns true, if the fill formatting is visible (automatic or explicit). */
+ bool isFilled() const;
+};
+
+// ============================================================================
+
+/** This structure contains text formatting attributes from an OBJ record. */
+struct BiffObjTextModel
+{
+ sal_uInt16 mnTextLen; /// Length of the text (characters).
+ sal_uInt16 mnFormatSize; /// Size of the formatting array (bytes).
+ sal_uInt16 mnLinkSize; /// Size of the linked text formula (bytes).
+ sal_uInt16 mnDefFontId; /// Font index for default font formatting.
+ sal_uInt16 mnFlags; /// Additional flags.
+ sal_uInt16 mnOrientation; /// Text orientation.
+ sal_uInt16 mnButtonFlags; /// Additional flags for push buttons.
+ sal_uInt16 mnShortcut; /// Shortcut character.
+ sal_uInt16 mnShortcutEA; /// East-asian shortcut character.
+
+ explicit BiffObjTextModel();
+
+ /** Reads text data from a BIFF3/BIFF4 OBJ record. */
+ void readObj3( BiffInputStream& rStrm );
+ /** Reads text data from a BIFF5 OBJ record. */
+ void readObj5( BiffInputStream& rStrm );
+ /** Reads text data from a BIFF8 TXO record. */
+ void readTxo8( BiffInputStream& rStrm );
+
+ /** Returns the horizontal alignment of the text. */
+ sal_uInt8 getHorAlign() const;
+ /** Returns the vertical alignment of the text. */
+ sal_uInt8 getVerAlign() const;
+};
+
+// ============================================================================
+// BIFF drawing objects
+// ============================================================================
+
+class BiffDrawingBase;
+class BiffDrawingObjectBase;
+typedef ::boost::shared_ptr< BiffDrawingObjectBase > BiffDrawingObjectRef;
+
+// ----------------------------------------------------------------------------
+
+class BiffDrawingObjectContainer
+{
+public:
+ explicit BiffDrawingObjectContainer();
+
+ /** Returns true, if the object list is empty. */
+ inline bool empty() const { return maObjects.empty(); }
+
+ /** Appends the passed object to the list of objects. */
+ void append( const BiffDrawingObjectRef& rxDrawingObj );
+ /** Tries to insert the passed object into the last group or appends it. */
+ void insertGrouped( const BiffDrawingObjectRef& rxDrawingObj );
+
+ /** Creates and inserts all UNO shapes into the passed shape container. */
+ void convertAndInsert( BiffDrawingBase& rDrawing,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle* pParentRect = 0 ) const;
+
+private:
+ typedef RefVector< BiffDrawingObjectBase > BiffDrawingObjectVector;
+ BiffDrawingObjectVector maObjects;
+};
+
+// ============================================================================
+
+/** Base class for all BIFF drawing objects (OBJ records). */
+class BiffDrawingObjectBase : public WorksheetHelper
+{
+public:
+ explicit BiffDrawingObjectBase( const WorksheetHelper& rHelper );
+ virtual ~BiffDrawingObjectBase();
+
+ /** Reads the BIFF3 OBJ record, returns a new drawing object. */
+ static BiffDrawingObjectRef importObjBiff3( const WorksheetHelper& rHelper, BiffInputStream& rStrm );
+ /** Reads the BIFF4 OBJ record, returns a new drawing object. */
+ static BiffDrawingObjectRef importObjBiff4( const WorksheetHelper& rHelper, BiffInputStream& rStrm );
+ /** Reads the BIFF5 OBJ record, returns a new drawing object. */
+ static BiffDrawingObjectRef importObjBiff5( const WorksheetHelper& rHelper, BiffInputStream& rStrm );
+ /** Reads the BIFF8 OBJ record, returns a new drawing object. */
+ static BiffDrawingObjectRef importObjBiff8( const WorksheetHelper& rHelper, BiffInputStream& rStrm );
+
+ /** Sets whether this is an area object (then its width and height must be greater than 0). */
+ inline void setAreaObj( bool bAreaObj ) { mbAreaObj = bAreaObj; }
+ /** If set to true, the object supports a simple on-click macro and/or hyperlink. */
+ inline void setSimpleMacro( bool bMacro ) { mbSimpleMacro = bMacro; }
+
+ /** If set to false, the UNO shape will not be created, processed, or inserted into the draw page. */
+ inline void setProcessShape( bool bProcess ) { mbProcessShape = bProcess; }
+ /** If set to false, the UNO shape will be created or processed, but not be inserted into the draw page. */
+ inline void setInsertShape( bool bInsert ) { mbInsertShape = bInsert; }
+ /** If set to true, a new custom UNO shape will be created while in DFF import (BIFF8 only). */
+ inline void setCustomDffObj( bool bCustom ) { mbCustomDff = bCustom; }
+
+ /** Returns the object identifier from the OBJ record. */
+ inline sal_uInt16 getObjId() const { return mnObjId; }
+ /** Returns the object type from the OBJ record. */
+ inline sal_uInt16 getObjType() const { return mnObjType; }
+
+ /** Returns true, if the object is hidden. */
+ inline bool isHidden() const { return mbHidden; }
+ /** Returns true, if the object is visible. */
+ inline bool isVisible() const { return mbVisible; }
+ /** Returns true, if the object is printable. */
+ inline bool isPrintable() const { return mbPrintable; }
+
+ /** Creates the UNO shape and inserts it into the passed shape container. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ convertAndInsert( BiffDrawingBase& rDrawing,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle* pParentRect = 0 ) const;
+
+protected:
+ /** Reads the object name in a BIFF5 OBJ record. */
+ void readNameBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen );
+ /** Reads the macro link in a BIFF3 OBJ record. */
+ void readMacroBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the macro link in a BIFF4 OBJ record. */
+ void readMacroBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the macro link in a BIFF5 OBJ record. */
+ void readMacroBiff5( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the ftMacro sub structure in an OBJ record. */
+ void readMacroBiff8( BiffInputStream& rStrm );
+
+ /** Converts the passed line formatting to the passed property map. */
+ void convertLineProperties( ::oox::drawingml::ShapePropertyMap& rPropMap, const BiffObjLineModel& rLineModel, sal_uInt16 nArrows = 0 ) const;
+ /** Converts the passed fill formatting to the passed property map. */
+ void convertFillProperties( ::oox::drawingml::ShapePropertyMap& rPropMap, const BiffObjFillModel& rFillModel ) const;
+ /** Converts the passed frame flags to the passed property map. */
+ void convertFrameProperties( ::oox::drawingml::ShapePropertyMap& rPropMap, sal_uInt16 nFrameFlags ) const;
+
+ /** Derived classes read the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void implReadObjBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Derived classes read the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Derived classes read the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Derived classes read the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
+ virtual void implReadObjBiff8SubRec( BiffInputStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+
+ /** Derived classes create the corresponding XShape and insert it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert( BiffDrawingBase& rDrawing,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const = 0;
+
+private:
+ /** Reads the contents of a BIFF3 OBJ record. */
+ void importObjBiff3( BiffInputStream& rStrm );
+ /** Reads the contents of a BIFF4 OBJ record. */
+ void importObjBiff4( BiffInputStream& rStrm );
+ /** Reads the contents of a BIFF5 OBJ record. */
+ void importObjBiff5( BiffInputStream& rStrm );
+ /** Reads the contents of a BIFF8 OBJ record. */
+ void importObjBiff8( BiffInputStream& rStrm );
+
+private:
+ ShapeAnchor maAnchor; /// Position of the drawing object.
+ ::rtl::OUString maObjName; /// Name of the object.
+ ::rtl::OUString maMacroName; /// Name of an attached macro.
+ ::rtl::OUString maHyperlink; /// On-click hyperlink URL.
+ sal_uInt32 mnDffShapeId; /// Shape identifier from DFF stream (BIFF8 only).
+ sal_uInt32 mnDffFlags; /// Shape flags from DFF stream.
+ sal_uInt16 mnObjId; /// The object identifier (unique per drawing).
+ sal_uInt16 mnObjType; /// The object type from OBJ record.
+ bool mbHasAnchor; /// True = anchor has been initialized.
+ bool mbHidden; /// True = object is hidden.
+ bool mbVisible; /// True = object is visible (form controls).
+ bool mbPrintable; /// True = object is printable.
+ bool mbAreaObj; /// True = width and height must be greater than 0.
+ bool mbAutoMargin; /// True = set automatic text margin.
+ bool mbSimpleMacro; /// True = create simple macro link and hyperlink.
+ bool mbProcessShape; /// True = object is valid, do processing and insertion.
+ bool mbInsertShape; /// True = insert the UNO shape into the draw page.
+ bool mbCustomDff; /// True = recreate UNO shape in DFF import (BIFF8 only).
+};
+
+// ============================================================================
+
+/** A placeholder object for unknown/unsupported object types. */
+class BiffPlaceholderObject : public BiffDrawingObjectBase
+{
+public:
+ explicit BiffPlaceholderObject( const WorksheetHelper& rHelper );
+
+protected:
+ /** Creates the corresponding XShape and insert it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert( BiffDrawingBase& rDrawing,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+};
+
+// ============================================================================
+
+/** A group object that is able to contain other child objects. */
+class BiffGroupObject : public BiffDrawingObjectBase
+{
+public:
+ explicit BiffGroupObject( const WorksheetHelper& rHelper );
+
+ /** Tries to insert the passed drawing object into this or a nested group. */
+ bool tryInsert( const BiffDrawingObjectRef& rxDrawingObj );
+
+protected:
+ /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void implReadObjBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+
+ /** Creates the corresponding XShape and insert it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert( BiffDrawingBase& rDrawing,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+protected:
+ BiffDrawingObjectContainer maChildren; /// All child objects contained in this group object.
+ sal_uInt16 mnFirstUngrouped; /// Object identfier of first object not grouped into this group.
+};
+
+// ============================================================================
+
+/** A simple line object. */
+class BiffLineObject : public BiffDrawingObjectBase
+{
+public:
+ explicit BiffLineObject( const WorksheetHelper& rHelper );
+
+protected:
+ /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void implReadObjBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+
+ /** Creates the corresponding XShape and insert it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert( BiffDrawingBase& rDrawing,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+protected:
+ BiffObjLineModel maLineModel; /// Line formatting.
+ sal_uInt16 mnArrows; /// Line arrows.
+ sal_uInt8 mnStartPoint; /// Starting point.
+};
+
+// ============================================================================
+
+/** A simple rectangle object (used as base class for oval objects). */
+class BiffRectObject : public BiffDrawingObjectBase
+{
+public:
+ explicit BiffRectObject( const WorksheetHelper& rHelper );
+
+protected:
+ /** Reads the fill model, the line model, and frame flags. */
+ void readFrameData( BiffInputStream& rStrm );
+
+ /** Converts fill formatting, line formatting, and frame style. */
+ void convertRectProperties( ::oox::drawingml::ShapePropertyMap& rPropMap ) const;
+
+ /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void implReadObjBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+
+ /** Creates the corresponding XShape and insert it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert( BiffDrawingBase& rDrawing,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+protected:
+ BiffObjFillModel maFillModel; /// Fill formatting.
+ BiffObjLineModel maLineModel; /// Line formatting.
+ sal_uInt16 mnFrameFlags; /// Additional flags.
+};
+
+// ============================================================================
+
+/** A simple oval object. */
+class BiffOvalObject : public BiffRectObject
+{
+public:
+ explicit BiffOvalObject( const WorksheetHelper& rHelper );
+
+protected:
+ /** Creates the corresponding XShape and insert it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert( BiffDrawingBase& rDrawing,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+};
+
+// ============================================================================
+
+/** A simple arc object. */
+class BiffArcObject : public BiffDrawingObjectBase
+{
+public:
+ explicit BiffArcObject( const WorksheetHelper& rHelper );
+
+protected:
+ /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void implReadObjBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+
+ /** Creates the corresponding XShape and insert it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert( BiffDrawingBase& rDrawing,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+protected:
+ BiffObjFillModel maFillModel; /// Fill formatting.
+ BiffObjLineModel maLineModel; /// Line formatting.
+ sal_uInt8 mnQuadrant; /// Visible quadrant of the circle.
+};
+
+// ============================================================================
+
+/** A simple polygon object. */
+class BiffPolygonObject : public BiffRectObject
+{
+public:
+ explicit BiffPolygonObject( const WorksheetHelper& rHelper );
+
+protected:
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+
+ /** Creates the corresponding XShape and insert it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert( BiffDrawingBase& rDrawing,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+private:
+ /** Reads the COORDLIST record following the OBJ record. */
+ void importCoordList( BiffInputStream& rStrm );
+
+protected:
+ typedef ::std::vector< ::com::sun::star::awt::Point > PointVector;
+ PointVector maCoords; /// Coordinates relative to bounding rectangle.
+ sal_uInt16 mnPolyFlags; /// Additional flags.
+ sal_uInt16 mnPointCount; /// Polygon point count.
+};
+
+// ============================================================================
+// BIFF drawing page
+// ============================================================================
+
+/** Base class for a container for all objects on a drawing page (in a
+ spreadsheet or in an embedded chart object).
+
+ For BIFF import, it is needed to load all drawing objects before converting
+ them to UNO shapes. There might be some dummy drawing objects (e.g. the
+ dropdown buttons of autofilters) which have to be skipped. The information,
+ that a drawing object is a dummy object, may be located after the drawing
+ objects themselves.
+
+ The BIFF8 format stores drawing objects in the DFF stream (stored
+ fragmented in MSODRAWING records), and in the OBJ records. The DFF stream
+ fragments are collected in a single stream, and the complete stream will be
+ processed afterwards.
+ */
+class BiffDrawingBase : public WorksheetHelper
+{
+public:
+ explicit BiffDrawingBase( const WorksheetHelper& rHelper,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage );
+
+ /** Imports a plain OBJ record (without leading DFF data). */
+ void importObj( BiffInputStream& rStrm );
+ /** Sets the object with the passed identifier to be skipped on import. */
+ void setSkipObj( sal_uInt16 nObjId );
+
+ /** Final processing after import of the all drawing objects. */
+ void finalizeImport();
+
+ /** Creates a new UNO shape object, inserts it into the passed UNO shape
+ container, and sets the shape position and size. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertXShape(
+ const ::rtl::OUString& rService,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) 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 ) = 0;
+
+protected:
+ /** Appends a new drawing object to the list of raw objects (without DFF data). */
+ void appendRawObject( const BiffDrawingObjectRef& rxDrawingObj );
+
+private:
+ typedef RefMap< sal_uInt16, BiffDrawingObjectBase > BiffDrawingObjectMapById;
+ typedef ::std::vector< sal_uInt16 > BiffObjIdVector;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
+ mxDrawPage; /// UNO draw page used to insert the shapes.
+ BiffDrawingObjectContainer maRawObjs; /// Drawing objects without DFF data.
+ BiffDrawingObjectMapById maObjMapId; /// Maps drawing objects by their object identifiers.
+ BiffObjIdVector maSkipObjs; /// Identifiers of all objects to be skipped.
+};
+
+// ----------------------------------------------------------------------------
+
+/** Drawing manager of a single sheet. */
+class BiffSheetDrawing : public BiffDrawingBase
+{
+public:
+ explicit BiffSheetDrawing( const WorksheetHelper& rHelper );
+
+ /** Called when a new UNO shape has been inserted into the draw page. */
+ virtual void notifyShapeInserted(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
+ const ::com::sun::star::awt::Rectangle& rShapeRect );
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/excelfilter.hxx b/oox/inc/oox/xls/excelfilter.hxx
index aa4e1f7a449e..e4cc7679ca01 100644
--- a/oox/inc/oox/xls/excelfilter.hxx
+++ b/oox/inc/oox/xls/excelfilter.hxx
@@ -36,23 +36,23 @@
namespace oox {
namespace xls {
-class WorkbookData;
+class WorkbookGlobals;
// ============================================================================
class ExcelFilterBase
{
public:
- void registerWorkbookData( WorkbookData& rData );
- WorkbookData& getWorkbookData() const;
- void unregisterWorkbookData();
+ void registerWorkbookGlobals( WorkbookGlobals& rBookGlob );
+ WorkbookGlobals& getWorkbookGlobals() const;
+ void unregisterWorkbookGlobals();
protected:
explicit ExcelFilterBase();
virtual ~ExcelFilterBase();
private:
- WorkbookData* mpData;
+ WorkbookGlobals* mpBookGlob;
};
// ============================================================================
@@ -122,4 +122,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/excelhandlers.hxx b/oox/inc/oox/xls/excelhandlers.hxx
index 28d8c527c878..41bf788a1ef1 100644
--- a/oox/inc/oox/xls/excelhandlers.hxx
+++ b/oox/inc/oox/xls/excelhandlers.hxx
@@ -46,55 +46,24 @@ class WorkbookContextBase : public ::oox::core::ContextHandler2, public Workbook
{
public:
template< typename ParentType >
- explicit WorkbookContextBase( ParentType& rParent );
+ inline explicit WorkbookContextBase( ParentType& rParent ) :
+ ::oox::core::ContextHandler2( rParent ), WorkbookHelper( rParent ) {}
};
-// ----------------------------------------------------------------------------
-
-template< typename ParentType >
-WorkbookContextBase::WorkbookContextBase( ParentType& rParent ) :
- ::oox::core::ContextHandler2( rParent ),
- WorkbookHelper( rParent )
-{
-}
-
// ============================================================================
/** Context handler derived from the WorksheetHelper helper class.
Used to import contexts in sheet fragments.
*/
-class WorksheetContextBase : public ::oox::core::ContextHandler2, public WorksheetHelperRoot
+class WorksheetContextBase : public ::oox::core::ContextHandler2, public WorksheetHelper
{
public:
template< typename ParentType >
- explicit WorksheetContextBase(
- ParentType& rParent,
- const ISegmentProgressBarRef& rxProgressBar,
- WorksheetType eSheetType,
- sal_Int16 nSheet );
-
- template< typename ParentType >
- explicit WorksheetContextBase( ParentType& rParent );
+ inline explicit WorksheetContextBase( ParentType& rParent ) :
+ ::oox::core::ContextHandler2( rParent ), WorksheetHelper( rParent ) {}
};
-// ----------------------------------------------------------------------------
-
-template< typename ParentType >
-WorksheetContextBase::WorksheetContextBase( ParentType& rParent,
- const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
- ::oox::core::ContextHandler2( rParent ),
- WorksheetHelperRoot( rParent, rxProgressBar, eSheetType, nSheet )
-{
-}
-
-template< typename ParentType >
-WorksheetContextBase::WorksheetContextBase( ParentType& rParent ) :
- ::oox::core::ContextHandler2( rParent ),
- WorksheetHelperRoot( rParent )
-{
-}
-
// ============================================================================
/** Fragment handler derived from the WorkbookHelper helper class.
@@ -115,17 +84,10 @@ public:
Used to import sheet fragments.
*/
-class WorksheetFragmentBase : public ::oox::core::FragmentHandler2, public WorksheetHelperRoot
+class WorksheetFragmentBase : public ::oox::core::FragmentHandler2, public WorksheetHelper
{
public:
explicit WorksheetFragmentBase(
- const WorkbookHelper& rHelper,
- const ::rtl::OUString& rFragmentPath,
- const ISegmentProgressBarRef& rxProgressBar,
- WorksheetType eSheetType,
- sal_Int16 nSheet );
-
- explicit WorksheetFragmentBase(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
};
@@ -165,15 +127,9 @@ protected:
Used to import contexts in sheet fragments.
*/
-class BiffWorksheetContextBase : public BiffContextHandler, public WorksheetHelperRoot
+class BiffWorksheetContextBase : public BiffContextHandler, public WorksheetHelper
{
protected:
- explicit BiffWorksheetContextBase(
- const WorkbookHelper& rHelper,
- const ISegmentProgressBarRef& rxProgressBar,
- WorksheetType eSheetType,
- sal_Int16 nSheet );
-
explicit BiffWorksheetContextBase( const WorksheetHelper& rHelper );
};
@@ -221,17 +177,6 @@ protected:
*/
BiffFragmentType startFragment( BiffType eBiff );
- /** Starts a new fragment at a specific position in the workbbok stream and
- returns the fragment type.
-
- The passed record handle must specify the stream position of the BOF
- record of the fragment substream. The function will try to start the
- next record and read the contents of the BOF record, if extant.
-
- @return Fragment type according to the imported BOF record.
- */
- BiffFragmentType startFragment( BiffType eBiff, sal_Int64 nRecHandle );
-
/** Skips the current fragment up to its trailing EOF record.
Skips all records until next EOF record. When this function returns,
@@ -274,14 +219,12 @@ protected:
Used to import sheet fragments.
*/
-class BiffWorksheetFragmentBase : public BiffFragmentHandler, public WorksheetHelperRoot
+class BiffWorksheetFragmentBase : public BiffFragmentHandler, public WorksheetHelper
{
protected:
explicit BiffWorksheetFragmentBase(
- const BiffWorkbookFragmentBase& rParent,
- const ISegmentProgressBarRef& rxProgressBar,
- WorksheetType eSheetType,
- sal_Int16 nSheet );
+ const WorksheetHelper& rHelper,
+ const BiffWorkbookFragmentBase& rParent );
};
// ----------------------------------------------------------------------------
@@ -292,9 +235,8 @@ class BiffSkipWorksheetFragment : public BiffWorksheetFragmentBase
{
public:
explicit BiffSkipWorksheetFragment(
- const BiffWorkbookFragmentBase& rParent,
- const ISegmentProgressBarRef& rxProgressBar,
- sal_Int16 nSheet );
+ const WorksheetHelper& rHelper,
+ const BiffWorkbookFragmentBase& rParent );
virtual bool importFragment();
};
@@ -307,4 +249,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/formulabase.hxx b/oox/inc/oox/xls/formulabase.hxx
index 0baf98b372c7..b3e403ab5741 100644
--- a/oox/inc/oox/xls/formulabase.hxx
+++ b/oox/inc/oox/xls/formulabase.hxx
@@ -29,6 +29,7 @@
#ifndef OOX_XLS_FORMULABASE_HXX
#define OOX_XLS_FORMULABASE_HXX
+#include <com/sun/star/beans/Pair.hpp>
#include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
#include <com/sun/star/sheet/FormulaToken.hpp>
#include <com/sun/star/table/CellAddress.hpp>
@@ -41,7 +42,6 @@
namespace com { namespace sun { namespace star {
namespace sheet { class XFormulaOpCodeMapper; }
namespace sheet { class XFormulaParser; }
- namespace sheet { class XFormulaTokens; }
} } }
namespace oox { template< typename Type > class Matrix; }
@@ -217,7 +217,20 @@ const sal_uInt16 BIFF_FUNC_CEILING = 288; /// Function identif
const sal_uInt16 BIFF_FUNC_HYPERLINK = 359; /// Function identifier of the HYPERLINK function.
const sal_uInt16 BIFF_FUNC_WEEKNUM = 465; /// Function identifier of the WEEKNUM function.
-// reference helpers ==========================================================
+// Formula type ===============================================================
+
+/** Enumerates all possible types of a formula. */
+enum FormulaType
+{
+ FORMULATYPE_CELL, /// Simple cell formula, or reference to a shared formula name.
+ FORMULATYPE_ARRAY, /// Array (matrix) formula.
+ FORMULATYPE_SHAREDFORMULA, /// Shared formula definition.
+ FORMULATYPE_CONDFORMAT, /// Condition of a conditional format rule.
+ FORMULATYPE_VALIDATION, /// Condition of a data validation.
+ FORMULATYPE_DEFINEDNAME /// Definition of a defined name.
+};
+
+// Reference helpers ==========================================================
/** A 2D formula cell reference struct with relative flags. */
struct BinSingleRef2d
@@ -251,11 +264,15 @@ struct BinComplexRef2d
void readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
};
-// token vector, sequence =====================================================
+// Token vector, token sequence ===============================================
typedef ::com::sun::star::sheet::FormulaToken ApiToken;
typedef ::com::sun::star::uno::Sequence< ApiToken > ApiTokenSequence;
+/** Contains the base address and type of a special token representing an array
+ formula or a shared formula (sal_False), or a table operation (sal_True). */
+typedef ::com::sun::star::beans::Pair< ::com::sun::star::table::CellAddress, sal_Bool > ApiSpecialTokenInfo;
+
/** A vector of formula tokens with additional convenience functions. */
class ApiTokenVector : public ::std::vector< ApiToken >
{
@@ -271,7 +288,7 @@ public:
inline void append( sal_Int32 nOpCode, const Type& rData ) { append( nOpCode ) <<= rData; }
};
-// token sequence iterator ====================================================
+// Token sequence iterator ====================================================
/** Token sequence iterator that is able to skip space tokens. */
class ApiTokenIterator
@@ -298,7 +315,7 @@ private:
const bool mbSkipSpaces; /// true = Skip whitespace tokens.
};
-// list of API op-codes =======================================================
+// List of API op-codes =======================================================
/** Contains all API op-codes needed to build formulas with tokens. */
struct ApiOpCodes
@@ -457,23 +474,23 @@ struct FunctionParamInfo
bool mbValType; /// Data type (false = REFTYPE, true = VALTYPE).
};
-// function data ==============================================================
+// Function data ==============================================================
/** This enumeration contains constants for all known external libraries
containing supported sheet functions. */
enum FunctionLibraryType
{
- FUNCLIB_EUROTOOL, /// EuroTool add-in with EUROCONVERT function.
- FUNCLIB_UNKNOWN /// Unknown library.
+ FUNCLIB_UNKNOWN = 0, /// Unknown library (must be zero).
+ FUNCLIB_EUROTOOL /// EuroTool add-in with EUROCONVERT function.
};
// ----------------------------------------------------------------------------
/** Represents information for a spreadsheet function.
- The member mpParamInfos points to an array of type information structures
+ The member mpParamInfos points to a C-array of type information structures
for all parameters of the function. The last initialized structure
- describing a regular parameter (member meValid == EXC_PARAMVALID_ALWAYS) in
+ describing a regular parameter (member meValid == FUNC_PARAM_REGULAR) in
this array is used repeatedly for all following parameters supported by a
function.
*/
@@ -491,7 +508,7 @@ struct FunctionInfo
sal_uInt8 mnMaxParamCount; /// Maximum number of parameters.
sal_uInt8 mnRetClass; /// BIFF token class of the return value.
const FunctionParamInfo* mpParamInfos; /// Information about all parameters.
- bool mbParamPairs; /// true = optional parameters are expected to appear in pairs.
+ bool mbParamPairs; /// True = optional parameters are expected to appear in pairs.
bool mbVolatile; /// True = volatile function.
bool mbExternal; /// True = external function in Calc.
bool mbMacroFunc; /// True = macro sheet function or command.
@@ -500,7 +517,7 @@ struct FunctionInfo
typedef RefVector< FunctionInfo > FunctionInfoVector;
-// function info parameter class iterator =====================================
+// Function info parameter class iterator =====================================
/** Iterator working on the mpParamInfos member of the FunctionInfo struct.
@@ -526,7 +543,7 @@ private:
bool mbParamPairs;
};
-// base function provider =====================================================
+// Base function provider =====================================================
struct FunctionProviderImpl;
@@ -567,7 +584,7 @@ private:
FunctionProviderImplRef mxFuncImpl; /// Shared implementation between all copies of the provider.
};
-// op-code and function provider ==============================================
+// Op-code and function provider ==============================================
struct OpCodeProviderImpl;
@@ -578,7 +595,7 @@ class OpCodeProvider : public FunctionProvider // not derived from WorkbookHelpe
{
public:
explicit OpCodeProvider(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory,
FilterType eFilter, BiffType eBiff, bool bImportFilter );
virtual ~OpCodeProvider();
@@ -605,7 +622,7 @@ class ApiParserWrapper : public OpCodeProvider
{
public:
explicit ApiParserWrapper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory,
const OpCodeProvider& rOpCodeProv );
/** Returns read/write access to the formula parser property set. */
@@ -622,74 +639,7 @@ private:
PropertySet maParserProps;
};
-// formula contexts ===========================================================
-
-class FormulaContext
-{
-public:
- inline void setBaseAddress( const ::com::sun::star::table::CellAddress& rBaseAddress )
- { maBaseAddress = rBaseAddress; }
-
- inline const ::com::sun::star::table::CellAddress& getBaseAddress() const { return maBaseAddress; }
- inline bool isRelativeAsOffset() const { return mbRelativeAsOffset; }
- inline bool is2dRefsAs3dRefs() const { return mb2dRefsAs3dRefs; }
- inline bool isNulCharsAllowed() const { return mbAllowNulChars; }
-
- virtual void setTokens( const ApiTokenSequence& rTokens ) = 0;
- virtual void setSharedFormula( const ::com::sun::star::table::CellAddress& rBaseAddr );
-
-protected:
- explicit FormulaContext(
- bool bRelativeAsOffset,
- bool b2dRefsAs3dRefs,
- bool bAllowNulChars = false );
- virtual ~FormulaContext();
-
-private:
- ::com::sun::star::table::CellAddress maBaseAddress;
- bool mbRelativeAsOffset;
- bool mb2dRefsAs3dRefs;
- bool mbAllowNulChars;
-};
-
-// ----------------------------------------------------------------------------
-
-/** Stores the converted formula token sequence in a class member. */
-class TokensFormulaContext : public FormulaContext
-{
-public:
- explicit TokensFormulaContext(
- bool bRelativeAsOffset,
- bool b2dRefsAs3dRefs,
- bool bAllowNulChars = false );
-
- inline const ApiTokenSequence& getTokens() const { return maTokens; }
-
- virtual void setTokens( const ApiTokenSequence& rTokens );
-
-private:
- ApiTokenSequence maTokens;
-};
-
-// ----------------------------------------------------------------------------
-
-/** Uses the com.sun.star.sheet.XFormulaTokens interface to set a token sequence. */
-class SimpleFormulaContext : public FormulaContext
-{
-public:
- explicit SimpleFormulaContext(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaTokens >& rxTokens,
- bool bRelativeAsOffset,
- bool b2dRefsAs3dRefs,
- bool bAllowNulChars = false );
-
- virtual void setTokens( const ApiTokenSequence& rTokens );
-
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaTokens > mxTokens;
-};
-
-// formula parser/printer base class for filters ==============================
+// Formula parser/printer base class for filters ==============================
/** Base class for import formula parsers and export formula compilers. */
class FormulaProcessorBase : public OpCodeProvider, protected ApiOpCodes, public WorkbookHelper
@@ -897,6 +847,24 @@ public:
::rtl::OUString& orString,
const ApiTokenSequence& rTokens ) const;
+ /** Tries to extract information about a special token used for array
+ formulas, shared formulas, or table operations.
+
+ @param orTokenInfo (output parameter) The extracted information about
+ the token. Contains the base address and the token type (sal_False
+ for array or shared formulas, sal_True for table operations).
+
+ @param rTokens The token sequence to be parsed. If it contains exactly
+ one OPCODE_BAD token with special token information, this
+ information will be extracted.
+
+ @return True = token sequence is valid, output parameter orTokenInfo
+ contains the token information extracted from the token sequence.
+ */
+ bool extractSpecialTokenInfo(
+ ApiSpecialTokenInfo& orTokenInfo,
+ const ApiTokenSequence& rTokens ) const;
+
/** Converts a single string with separators in the passed formula token
sequence to a list of string tokens.
@@ -924,4 +892,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/formulaparser.hxx b/oox/inc/oox/xls/formulaparser.hxx
index 843a1c3ad3f5..e85ff19e69c1 100644
--- a/oox/inc/oox/xls/formulaparser.hxx
+++ b/oox/inc/oox/xls/formulaparser.hxx
@@ -88,6 +88,7 @@ private:
const ApiToken* getSingleToken( const ApiToken* pToken, const ApiToken* pTokenEnd ) const;
const ApiToken* skipParentheses( const ApiToken* pToken, const ApiToken* pTokenEnd ) const;
const ApiToken* findParameters( ParameterPosVector& rParams, const ApiToken* pToken, const ApiToken* pTokenEnd ) const;
+ void appendEmptyParameter( const FunctionInfo& rFuncInfo, size_t nParam );
void appendCalcOnlyParameter( const FunctionInfo& rFuncInfo, size_t nParam );
void appendRequiredParameters( const FunctionInfo& rFuncInfo, size_t nParamCount );
@@ -114,38 +115,36 @@ public:
virtual ~FormulaParser();
/** Converts an OOXML formula string. */
- void importFormula(
- FormulaContext& rContext,
+ ApiTokenSequence importFormula(
+ const ::com::sun::star::table::CellAddress& rBaseAddr,
const ::rtl::OUString& rFormulaString ) const;
/** Imports and converts a BIFF12 token array from the passed stream. */
- void importFormula(
- FormulaContext& rContext,
+ ApiTokenSequence importFormula(
+ const ::com::sun::star::table::CellAddress& rBaseAddr,
+ FormulaType eType,
SequenceInputStream& rStrm ) const;
/** Imports and converts a BIFF2-BIFF8 token array from the passed stream.
@param pnFmlaSize Size of the token array. If null is passed, reads
it from stream (1 byte in BIFF2, 2 bytes otherwise) first. */
- void importFormula(
- FormulaContext& rContext,
+ ApiTokenSequence importFormula(
+ const ::com::sun::star::table::CellAddress& rBaseAddr,
+ FormulaType eType,
BiffInputStream& rStrm,
const sal_uInt16* pnFmlaSize = 0 ) const;
+ /** Converts the passed Boolean value to a similar formula. */
+ ApiTokenSequence convertBoolToFormula( bool bValue ) const;
+
/** Converts the passed BIFF error code to a similar formula. */
- void convertErrorToFormula(
- FormulaContext& rContext,
- sal_uInt8 nErrorCode ) const;
+ ApiTokenSequence convertErrorToFormula( sal_uInt8 nErrorCode ) const;
/** Converts the passed token index of a defined name to a formula calling that name. */
- void convertNameToFormula(
- FormulaContext& rContext,
- sal_Int32 nTokenIndex ) const;
+ ApiTokenSequence convertNameToFormula( sal_Int32 nTokenIndex ) const;
/** Converts the passed number into a HYPERLINK formula with the passed URL. */
- void convertNumberToHyperlink(
- FormulaContext& rContext,
- const ::rtl::OUString& rUrl,
- double fValue ) const;
+ ApiTokenSequence convertNumberToHyperlink( const ::rtl::OUString& rUrl, double fValue ) const;
/** Converts the passed XML formula to an OLE link target. */
::rtl::OUString importOleTargetLink( const ::rtl::OUString& rFormulaString );
@@ -154,9 +153,7 @@ public:
::rtl::OUString importOleTargetLink( SequenceInputStream& rStrm );
/** Imports and converts an OLE link target from the passed stream. */
- ::rtl::OUString importOleTargetLink(
- BiffInputStream& rStrm,
- const sal_uInt16* pnFmlaSize = 0 ) const;
+ ::rtl::OUString importOleTargetLink( BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize = 0 ) const;
/** Converts the passed formula to a macro name for a drawing shape. */
::rtl::OUString importMacroName( const ::rtl::OUString& rFormulaString );
@@ -172,4 +169,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/ooxformulaparser.hxx b/oox/inc/oox/xls/ooxformulaparser.hxx
index 2eaf8cb09a33..52ee9b9c2cce 100644
--- a/oox/inc/oox/xls/ooxformulaparser.hxx
+++ b/oox/inc/oox/xls/ooxformulaparser.hxx
@@ -47,10 +47,10 @@ class OOXMLFormulaPrinterImpl;
typedef ::cppu::WeakImplHelper3<
::com::sun::star::lang::XServiceInfo,
::com::sun::star::lang::XInitialization,
- ::com::sun::star::sheet::XFilterFormulaParser > OOXMLFormulaParserBase;
+ ::com::sun::star::sheet::XFilterFormulaParser > OOXMLFormulaParser_BASE;
/** OOXML formula parser/compiler service for usage in ODF filters. */
-class OOXMLFormulaParser : public OOXMLFormulaParserBase
+class OOXMLFormulaParser : public OOXMLFormulaParser_BASE
{
public:
explicit OOXMLFormulaParser();
@@ -111,4 +111,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/pivotcachebuffer.hxx b/oox/inc/oox/xls/pivotcachebuffer.hxx
index 1b972c95fa3e..208fbd432a20 100644
--- a/oox/inc/oox/xls/pivotcachebuffer.hxx
+++ b/oox/inc/oox/xls/pivotcachebuffer.hxx
@@ -32,6 +32,7 @@
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/util/DateTime.hpp>
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/refvector.hxx"
#include "oox/xls/workbookhelper.hxx"
@@ -431,15 +432,15 @@ public:
void writeSourceHeaderCells( WorksheetHelper& rSheetHelper ) const;
/** Writes a source field item value into the passed sheet. */
void writeSourceDataCell( WorksheetHelper& rSheetHelper,
- sal_Int32 nCol, sal_Int32 nRow,
+ sal_Int32 nColIdx, sal_Int32 nRowIdx,
const PivotCacheItem& rItem ) const;
/** Reads a PCRECORD record and writes all item values to the passed sheet. */
void importPCRecord( SequenceInputStream& rStrm,
- WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const;
+ WorksheetHelper& rSheetHelper, sal_Int32 nRowIdx ) const;
/** Reads a PCITEM_INDEXLIST record and writes all item values to the passed sheet. */
void importPCItemIndexList( BiffInputStream& rStrm,
- WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const;
+ WorksheetHelper& rSheetHelper, sal_Int32 nRowIdx ) const;
private:
/** Reads the worksheet source range from the DCONREF record. */
@@ -457,6 +458,8 @@ private:
void finalizeExternalSheetSource();
/** Creates a dummy sheet that will be filled with the pivot cache data. */
void prepareSourceDataSheet();
+ /** Checks, if the row index has changed since last call, and initializes the sheet data buffer. */
+ void updateSourceDataRow( WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const;
private:
typedef RefVector< PivotCacheField > PivotCacheFieldVector;
@@ -468,7 +471,9 @@ private:
PCDefinitionModel maDefModel; /// Global pivot cache settings.
PCSourceModel maSourceModel; /// Pivot cache source settings.
PCWorksheetSourceModel maSheetSrcModel; /// Sheet source data if cache type is sheet.
+ ValueRangeSet maColSpans; /// Column spans used by SheetDataBuffer for optimized cell import.
::rtl::OUString maTargetUrl; /// URL of an external source document.
+ mutable sal_Int32 mnCurrRow; /// Current row index in dummy sheet.
bool mbValidSource; /// True = pivot cache is based on supported data source.
bool mbDummySheet; /// True = pivot cache is based on a dummy sheet.
};
@@ -510,4 +515,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/pivotcachefragment.hxx b/oox/inc/oox/xls/pivotcachefragment.hxx
index 21c625b1a3bc..66a583482cdf 100644
--- a/oox/inc/oox/xls/pivotcachefragment.hxx
+++ b/oox/inc/oox/xls/pivotcachefragment.hxx
@@ -82,7 +82,7 @@ class PivotCacheRecordsFragment : public WorksheetFragmentBase
{
public:
explicit PivotCacheRecordsFragment(
- const WorkbookHelper& rHelper,
+ const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
const PivotCache& rPivotCache );
@@ -98,8 +98,8 @@ private:
private:
const PivotCache& mrPivotCache;
- sal_Int32 mnCol;
- sal_Int32 mnRow;
+ sal_Int32 mnColIdx; /// Relative column index in source data.
+ sal_Int32 mnRowIdx; /// Relative row index in source data.
bool mbInRecord;
};
@@ -127,7 +127,7 @@ class BiffPivotCacheRecordsContext : public BiffWorksheetContextBase
{
public:
explicit BiffPivotCacheRecordsContext(
- const WorkbookHelper& rHelper,
+ const WorksheetHelper& rHelper,
const PivotCache& rPivotCache );
/** Reads the current record from stream and tries to insert a cell into
@@ -143,7 +143,7 @@ private:
const PivotCache& mrPivotCache;
ColumnIndexVector maUnsharedCols; /// Column indexes of all unshared cache fields.
size_t mnColIdx; /// Current index into maUnsharedCols.
- sal_Int32 mnRow; /// Current row in source data (0-based).
+ sal_Int32 mnRowIdx; /// Current row in source data (0-based).
bool mbHasShared; /// True = pivot cache contains fields with shared items.
bool mbInRow; /// True = a data row has been started.
};
@@ -155,4 +155,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/richstring.hxx b/oox/inc/oox/xls/richstring.hxx
index 7d4122aa4eed..fcddfd2ab688 100644
--- a/oox/inc/oox/xls/richstring.hxx
+++ b/oox/inc/oox/xls/richstring.hxx
@@ -71,11 +71,13 @@ public:
/** Returns the text data of this portion. */
inline const ::rtl::OUString& getText() const { return maText; }
+ /** Returns true, if the portion fontains font formatting. */
+ inline bool hasFont() const { return mxFont.get() != 0; }
- /** Converts the portion and appends it to the passed XText. */
+ /** Converts the portion and replaces or appends to the passed XText. */
void convert(
const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >& rxText,
- sal_Int32 nXfId );
+ const Font* pFont, bool bReplace );
void writeFontProperties(
const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >& rxText,
@@ -251,21 +253,30 @@ public:
/** Imports a Unicode rich-string from the passed record stream. */
void importString( SequenceInputStream& rStrm, bool bRich );
- /** Imports a byte string from the passed BIFF stream. */
- void importByteString( BiffInputStream& rStrm, rtl_TextEncoding eDefaultTextEnc, BiffStringFlags nFlags = BIFF_STR_DEFAULT );
- /** Imports a Unicode rich-string from the passed BIFF stream. */
+ /** Imports nChars byte characters from the passed BIFF stream and appends a new text portion. */
+ void importCharArray( BiffInputStream& rStrm, sal_uInt16 nChars, rtl_TextEncoding eTextEnc );
+ /** Imports a byte string from the passed BIFF stream and appends new text portions. */
+ void importByteString( BiffInputStream& rStrm, rtl_TextEncoding eTextEnc, BiffStringFlags nFlags = BIFF_STR_DEFAULT );
+ /** Imports a Unicode rich-string from the passed BIFF stream and appends new text portions. */
void importUniString( BiffInputStream& rStrm, BiffStringFlags nFlags = BIFF_STR_DEFAULT );
/** Final processing after import of all strings. */
void finalizeImport();
- /** Returns the plain text concatenated from all string portions. */
- ::rtl::OUString getPlainText() const;
-
- /** Converts the string and writes it into the passed XText. */
+ /** Tries to extract a plain string from this object. Returns the string,
+ if there is only one unformatted portion. */
+ bool extractPlainString(
+ ::rtl::OUString& orString,
+ const Font* pFirstPortionFont = 0 ) const;
+
+ /** Converts the string and writes it into the passed XText.
+ @param rxText The XText interface of the target object.
+ @param bReplaceOld True = replace old contents of the text object.
+ @param pFirstPortionFont Optional font providing additional rich-text
+ formatting for the first text portion, e.g. font escapement. */
void convert(
const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >& rxText,
- sal_Int32 nXfId ) const;
+ const Font* pFirstPortionFont = 0 ) const;
private:
/** Creates, appends, and returns a new empty string portion. */
@@ -274,19 +285,19 @@ private:
RichStringPhoneticRef createPhonetic();
/** Create base text portions from the passed string and character formatting. */
- void createFontPortions( const ::rtl::OString& rText, rtl_TextEncoding eDefaultTextEnc, FontPortionModelList& rPortions );
+ void createTextPortions( const ::rtl::OString& rText, rtl_TextEncoding eTextEnc, FontPortionModelList& rPortions );
/** Create base text portions from the passed string and character formatting. */
- void createFontPortions( const ::rtl::OUString& rText, FontPortionModelList& rPortions );
+ void createTextPortions( const ::rtl::OUString& rText, FontPortionModelList& rPortions );
/** Create phonetic text portions from the passed string and portion data. */
void createPhoneticPortions( const ::rtl::OUString& rText, PhoneticPortionModelList& rPortions, sal_Int32 nBaseLen );
private:
- typedef RefVector< RichStringPortion > PortionVec;
- typedef RefVector< RichStringPhonetic > PhoneticVec;
+ typedef RefVector< RichStringPortion > PortionVector;
+ typedef RefVector< RichStringPhonetic > PhoneticVector;
- PortionVec maFontPortions; /// String portions with font data.
+ PortionVector maTextPortions; /// String portions with font data.
PhoneticSettings maPhonSettings; /// Phonetic settings for this string.
- PhoneticVec maPhonPortions; /// Phonetic text portions.
+ PhoneticVector maPhonPortions; /// Phonetic text portions.
};
typedef ::boost::shared_ptr< RichString > RichStringRef;
@@ -298,4 +309,4 @@ typedef ::boost::shared_ptr< RichString > RichStringRef;
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/sharedstringsbuffer.hxx b/oox/inc/oox/xls/sharedstringsbuffer.hxx
index 3f62d75ea5e4..cf659aa3ed85 100644
--- a/oox/inc/oox/xls/sharedstringsbuffer.hxx
+++ b/oox/inc/oox/xls/sharedstringsbuffer.hxx
@@ -50,15 +50,12 @@ public:
/** Final processing after import of all strings. */
void finalizeImport();
- /** Converts the specified string table entry. */
- void convertString(
- const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >& rxText,
- sal_Int32 nStringId,
- sal_Int32 nXfId ) const;
+ /** Returns the specified string. */
+ RichStringRef getString( sal_Int32 nStringId ) const;
private:
- typedef RefVector< RichString > StringVec;
- StringVec maStrings;
+ typedef RefVector< RichString > StringVector;
+ StringVector maStrings;
};
// ============================================================================
@@ -68,4 +65,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/sheetdatabuffer.hxx b/oox/inc/oox/xls/sheetdatabuffer.hxx
new file mode 100755
index 000000000000..6f61c8432e15
--- /dev/null
+++ b/oox/inc/oox/xls/sheetdatabuffer.hxx
@@ -0,0 +1,354 @@
+/*************************************************************************
+ *
+ * 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 OOX_XLS_SHEETDATABUFFER_HXX
+#define OOX_XLS_SHEETDATABUFFER_HXX
+
+#include <list>
+#include <map>
+#include "oox/xls/richstring.hxx"
+#include "oox/xls/worksheethelper.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace sheet { class XNamedRange; }
+ namespace util { struct DateTime; }
+} } }
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+/** Stores basic data about cell values and formatting. */
+struct CellModel
+{
+ ::com::sun::star::table::CellAddress
+ maCellAddr; /// The address of the current cell.
+ sal_Int32 mnCellType; /// Data type of the cell value.
+ sal_Int32 mnXfId; /// XF (cell formatting) identifier.
+ bool mbShowPhonetic; /// True = show phonetic text.
+
+ explicit CellModel();
+};
+
+// ----------------------------------------------------------------------------
+
+/** Stores data about cell formulas. */
+struct CellFormulaModel
+{
+ ::com::sun::star::table::CellRangeAddress
+ maFormulaRef; /// Formula range for array/shared formulas and data tables.
+ sal_Int32 mnFormulaType; /// Type of the formula (regular, array, shared, table).
+ sal_Int32 mnSharedId; /// Identifier of a shared formula (OOXML only).
+
+ explicit CellFormulaModel();
+
+ /** Returns true, if the passed cell address is valid for an array formula. */
+ bool isValidArrayRef( const ::com::sun::star::table::CellAddress& rCellAddr );
+ /** Returns true, if the passed cell address is valid for a shared formula. */
+ bool isValidSharedRef( const ::com::sun::star::table::CellAddress& rCellAddr );
+};
+
+// ----------------------------------------------------------------------------
+
+/** Stores data about table operations. */
+struct DataTableModel
+{
+ ::rtl::OUString maRef1; /// First reference cell for table operations.
+ ::rtl::OUString maRef2; /// Second reference cell for table operations.
+ bool mb2dTable; /// True = 2-dimensional data table.
+ bool mbRowTable; /// True = row oriented data table.
+ bool mbRef1Deleted; /// True = first reference cell deleted.
+ bool mbRef2Deleted; /// True = second reference cell deleted.
+
+ explicit DataTableModel();
+};
+
+// ============================================================================
+
+/** Stores position and contents of a range of cells for optimized import. */
+class CellBlock : public WorksheetHelper
+{
+public:
+ explicit CellBlock( const WorksheetHelper& rHelper, const ValueRange& rColSpan, sal_Int32 nRow );
+
+ /** Returns true, if the end index of the passed colspan is greater than
+ the own column end index, or if the passed range has the same end index
+ but the start indexes do not match. */
+ bool isBefore( const ValueRange& rColSpan ) const;
+ /** Returns true, if the cell block can be expanded with the passed colspan. */
+ bool isExpandable( const ValueRange& rColSpan ) const;
+ /** Returns true, if the own colspan contains the passed column. */
+ bool contains( sal_Int32 nCol ) const;
+
+ /** Returns the specified cell from the last row in the cell buffer array. */
+ ::com::sun::star::uno::Any& getCellAny( sal_Int32 nCol );
+ /** Inserts a rich-string into the cell block. */
+ void insertRichString(
+ const ::com::sun::star::table::CellAddress& rAddress,
+ const RichStringRef& rxString,
+ const Font* pFirstPortionFont );
+
+ /** Appends a new row to the cell buffer array. */
+ void startNextRow();
+ /** Writes all buffered cells into the Calc sheet. */
+ void finalizeImport();
+
+private:
+ /** Fills unused cells before passed index with empty strings. */
+ void fillUnusedCells( sal_Int32 nIndex );
+
+private:
+ /** Stores position and string data of a rich-string cell. */
+ struct RichStringCell
+ {
+ ::com::sun::star::table::CellAddress
+ maCellAddr; /// The address of the rich-string cell.
+ RichStringRef mxString; /// The string with rich formatting.
+ const Font* mpFirstPortionFont; /// Font information from cell for first text portion.
+
+ explicit RichStringCell(
+ const ::com::sun::star::table::CellAddress& rCellAddr,
+ const RichStringRef& rxString,
+ const Font* pFirstPortionFont );
+ };
+ typedef ::std::list< RichStringCell > RichStringCellList;
+
+ ::com::sun::star::table::CellRangeAddress
+ maRange; /// Cell range covered by this cell block.
+ RichStringCellList maRichStrings; /// Cached rich-string cells.
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >
+ maCellArray; /// The array of cells of this cell block.
+ ::com::sun::star::uno::Any*
+ mpCurrCellRow; /// Pointer to first cell of current row (last row in maCellArray).
+ const sal_Int32 mnRowLength; /// Number of cells covered by row of this cell block.
+ sal_Int32 mnFirstFreeIndex; /// Relative index of first unused cell in current row.
+};
+
+// ============================================================================
+
+/** Manages all cell blocks currently in use. */
+class CellBlockBuffer : public WorksheetHelper
+{
+public:
+ explicit CellBlockBuffer( const WorksheetHelper& rHelper );
+
+ /** Sets column span information for a row. */
+ void setColSpans( sal_Int32 nRow, const ValueRangeSet& rColSpans );
+
+ /** Tries to find a cell block. Recalculates the map of cell blocks, if the
+ passed cell address is located in another row than the last cell. */
+ CellBlock* getCellBlock( const ::com::sun::star::table::CellAddress& rCellAddr );
+
+ /** Inserts all cells of all open cell blocks into the Calc document. */
+ void finalizeImport();
+
+private:
+ typedef ::std::map< sal_Int32, ValueRangeVector > ColSpanVectorMap;
+ typedef RefMap< sal_Int32, CellBlock > CellBlockMap;
+
+ ColSpanVectorMap maColSpans; /// Buffereed column spans, mapped by row index.
+ CellBlockMap maCellBlocks; /// All open cell blocks, mapped by last (!) column of the block span.
+ CellBlockMap::iterator maCellBlockIt; /// Pointer to cell block currently in use.
+ sal_Int32 mnCurrRow; /// Current row index used for buffered cell import.
+};
+
+// ============================================================================
+
+/** Manages the cell contents and cell formatting of a sheet.
+ */
+class SheetDataBuffer : public WorksheetHelper
+{
+public:
+ explicit SheetDataBuffer( const WorksheetHelper& rHelper );
+
+ /** Sets column span information for a row. */
+ void setColSpans( sal_Int32 nRow, const ValueRangeSet& rColSpans );
+
+ /** Inserts a blank cell (with formatting) into the sheet. */
+ void setBlankCell( const CellModel& rModel );
+ /** Inserts a value cell into the sheet. */
+ void setValueCell( const CellModel& rModel, double fValue );
+ /** Inserts a simple string cell into the sheet. */
+ void setStringCell( const CellModel& rModel, const ::rtl::OUString& rText );
+ /** Inserts a rich-string cell into the sheet. */
+ void setStringCell( const CellModel& rModel, const RichStringRef& rxString );
+ /** Inserts a shared string cell into the sheet. */
+ void setStringCell( const CellModel& rModel, sal_Int32 nStringId );
+ /** Inserts a date/time cell into the sheet and adjusts number format. */
+ void setDateTimeCell( const CellModel& rModel, const ::com::sun::star::util::DateTime& rDateTime );
+ /** Inserts a boolean cell into the sheet and adjusts number format. */
+ void setBooleanCell( const CellModel& rModel, bool bValue );
+ /** Inserts an error cell from the passed error code into the sheet. */
+ void setErrorCell( const CellModel& rModel, const ::rtl::OUString& rErrorCode );
+ /** Inserts an error cell from the passed BIFF error code into the sheet. */
+ void setErrorCell( const CellModel& rModel, sal_uInt8 nErrorCode );
+ /** Inserts a formula cell into the sheet. */
+ void setFormulaCell( const CellModel& rModel, const ApiTokenSequence& rTokens );
+ /** Inserts a shared formula cell into the sheet (OOXML only). */
+ void setFormulaCell( const CellModel& rModel, sal_Int32 nSharedId );
+
+ /** Inserts the passed token array as array formula. */
+ void createArrayFormula(
+ const ::com::sun::star::table::CellRangeAddress& rRange,
+ const ApiTokenSequence& rTokens );
+ /** Sets a multiple table operation to the passed range. */
+ void createTableOperation(
+ const ::com::sun::star::table::CellRangeAddress& rRange,
+ const DataTableModel& rModel );
+ /** Creates a named range with a special name for a shared formula with the
+ specified identifier and formula definition (OOXML only). */
+ void createSharedFormula(
+ sal_Int32 nSharedId,
+ const ApiTokenSequence& rTokens );
+ /** Creates a named range with a special name for a shared formula with the
+ specified base address and formula definition (BIFF only). */
+ void createSharedFormula(
+ const ::com::sun::star::table::CellAddress& rCellAddr,
+ const ApiTokenSequence& rTokens );
+
+ /** Sets default cell formatting for the specified range of rows. */
+ void setRowFormat( sal_Int32 nRow, sal_Int32 nXfId, bool bCustomFormat );
+ /** Merges the cells in the passed cell range. */
+ void setMergedRange( const ::com::sun::star::table::CellRangeAddress& rRange );
+ /** Sets a standard number format (constant from com.sun.star.util.NumberFormat) to the specified cell. */
+ void setStandardNumFmt(
+ const ::com::sun::star::table::CellAddress& rCellAddr,
+ sal_Int16 nStdNumFmt );
+
+ /** Final processing after the sheet has been imported. */
+ void finalizeImport();
+
+private:
+ struct XfIdRowRange;
+ struct XfIdRange;
+
+ /** Sets the passed formula token array into a cell. */
+ void setCellFormula(
+ const ::com::sun::star::table::CellAddress& rCellAddr,
+ const ApiTokenSequence& rTokens );
+
+ /** Creates a named range with a special name for a shared formula with the
+ specified base address and formula definition. */
+ void createSharedFormula( const BinAddress& rMapKey, const ApiTokenSequence& rTokens );
+ /** Creates a formula token array representing the shared formula with the
+ passed identifier. */
+ ApiTokenSequence resolveSharedFormula( const BinAddress& rMapKey ) const;
+
+ /** Inserts the passed array formula into the sheet. */
+ void finalizeArrayFormula(
+ const ::com::sun::star::table::CellRangeAddress& rRange,
+ const ApiTokenSequence& rTokens ) const;
+ /** Inserts the passed table operation into the sheet. */
+ void finalizeTableOperation(
+ const ::com::sun::star::table::CellRangeAddress& rRange,
+ const DataTableModel& rModel ) const;
+
+ /** Processes the cell formatting data of the passed cell.
+ @param nNumFmtId If set, overrides number format of the cell XF. */
+ void setCellFormat( const CellModel& rModel, sal_Int32 nNumFmtId = -1 );
+
+ /** Writes all cell formatting attributes to the passed row range. */
+ void writeXfIdRowRangeProperties( const XfIdRowRange& rXfIdRowRange ) const;
+ /** Writes all cell formatting attributes to the passed cell range. */
+ void writeXfIdRangeProperties( const XfIdRange& rXfIdRange ) const;
+ /** Tries to merge the ranges last inserted in maXfIdRanges with existing ranges. */
+ void mergeXfIdRanges();
+
+ /** Merges the passed merged range and updates right/bottom cell borders. */
+ void finalizeMergedRange( const ::com::sun::star::table::CellRangeAddress& rRange );
+
+private:
+ /** Stores cell range address and formula token array of an array formula. */
+ typedef ::std::pair< ::com::sun::star::table::CellRangeAddress, ApiTokenSequence > ArrayFormula;
+ typedef ::std::list< ArrayFormula > ArrayFormulaList;
+
+ /** Stores cell range address and settings of a table operation. */
+ typedef ::std::pair< ::com::sun::star::table::CellRangeAddress, DataTableModel > TableOperation;
+ typedef ::std::list< TableOperation > TableOperationList;
+
+ typedef ::std::map< BinAddress, sal_Int32 > SharedFormulaMap;
+
+ /** Stores information about a range of rows with equal cell formatting. */
+ struct XfIdRowRange
+ {
+ ValueRange maRowRange; /// Indexes of first and last row.
+ sal_Int32 mnXfId; /// XF identifier for the row range.
+
+ explicit XfIdRowRange();
+ bool intersects( const ::com::sun::star::table::CellRangeAddress& rRange ) const;
+ void set( sal_Int32 nRow, sal_Int32 nXfId );
+ bool tryExpand( sal_Int32 nRow, sal_Int32 nXfId );
+ };
+
+ /** Stores information about a range of cells with equal formatting. */
+ struct XfIdRange
+ {
+ ::com::sun::star::table::CellRangeAddress
+ maRange; /// The formatted cell range.
+ sal_Int32 mnXfId; /// XF identifier for the range.
+ sal_Int32 mnNumFmtId; /// Number format overriding the XF.
+
+ void set( const ::com::sun::star::table::CellAddress& rCellAddr, sal_Int32 nXfId, sal_Int32 nNumFmtId );
+ bool tryExpand( const ::com::sun::star::table::CellAddress& rCellAddr, sal_Int32 nXfId, sal_Int32 nNumFmtId );
+ bool tryMerge( const XfIdRange& rXfIdRange );
+ };
+ typedef ::std::map< BinAddress, XfIdRange > XfIdRangeMap;
+
+ /** Stores information about a merged cell range. */
+ struct MergedRange
+ {
+ ::com::sun::star::table::CellRangeAddress
+ maRange; /// The formatted cell range.
+ sal_Int32 mnHorAlign; /// Horizontal alignment in the range.
+
+ explicit MergedRange( const ::com::sun::star::table::CellRangeAddress& rRange );
+ explicit MergedRange( const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nHorAlign );
+ bool tryExpand( const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nHorAlign );
+ };
+ typedef ::std::list< MergedRange > MergedRangeList;
+
+ CellBlockBuffer maCellBlocks; /// Manages all open cell blocks.
+ ArrayFormulaList maArrayFormulas; /// All array formulas in the sheet.
+ TableOperationList maTableOperations; /// All table operations in the sheet.
+ SharedFormulaMap maSharedFormulas; /// Maps shared formula base address to defined name token index.
+ ::com::sun::star::table::CellAddress
+ maSharedFmlaAddr; /// Address of a cell containing a pending shared formula.
+ BinAddress maSharedBaseAddr; /// Base address of the pending shared formula.
+ XfIdRowRange maXfIdRowRange; /// Cached XF identifier for a range of rows.
+ XfIdRangeMap maXfIdRanges; /// Collected XF identifiers for cell ranges.
+ MergedRangeList maMergedRanges; /// Merged cell ranges.
+ MergedRangeList maCenterFillRanges; /// Merged cell ranges from 'center across' or 'fill' alignment.
+ bool mbPendingSharedFmla; /// True = maSharedFmlaAddr and maSharedBaseAddr are valid.
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/sheetdatacontext.hxx b/oox/inc/oox/xls/sheetdatacontext.hxx
index 1649ed3fd71c..12f542f49273 100644
--- a/oox/inc/oox/xls/sheetdatacontext.hxx
+++ b/oox/inc/oox/xls/sheetdatacontext.hxx
@@ -31,22 +31,37 @@
#include "oox/xls/excelhandlers.hxx"
#include "oox/xls/richstring.hxx"
-
-namespace com { namespace sun { namespace star {
- namespace table { class XCell; }
-} } }
+#include "oox/xls/sheetdatabuffer.hxx"
namespace oox {
namespace xls {
// ============================================================================
+/** Used as base for sheet data context classes. Provides fast access to often
+ used converter objects and sheet index, to improve performance.
+ */
+struct SheetDataContextBase
+{
+ AddressConverter& mrAddressConv; /// The address converter.
+ FormulaParser& mrFormulaParser; /// The formula parser.
+ SheetDataBuffer& mrSheetData; /// The sheet data buffer for cell content and formatting.
+ CellModel maCellData; /// Position, contents, formatting of current imported cell.
+ CellFormulaModel maFmlaData; /// Settings for a cell formula.
+ sal_Int16 mnSheet; /// Index of the current sheet.
+
+ explicit SheetDataContextBase( const WorksheetHelper& rHelper );
+ virtual ~SheetDataContextBase();
+};
+
+// ============================================================================
+
/** This class implements importing the sheetData element.
The sheetData element contains all row settings and all cells in a single
sheet of a spreadsheet document.
*/
-class SheetDataContext : public WorksheetContextBase
+class SheetDataContext : public WorksheetContextBase, private SheetDataContextBase
{
public:
explicit SheetDataContext( WorksheetFragmentBase& rFragment );
@@ -65,12 +80,20 @@ private:
/** Imports row settings from a row element. */
void importRow( const AttributeList& rAttribs );
/** Imports cell settings from a c element. */
- void importCell( const AttributeList& rAttribs );
+ bool importCell( const AttributeList& rAttribs );
/** Imports cell settings from an f element. */
void importFormula( const AttributeList& rAttribs );
- /** Imports a cell address and the following XF identifier. */
- void importCellHeader( SequenceInputStream& rStrm, CellType eCellType );
+ /** Imports row settings from a ROW record. */
+ void importRow( SequenceInputStream& rStrm );
+
+ /** Reads a cell address and the following XF identifier. */
+ bool readCellHeader( SequenceInputStream& rStrm, CellType eCellType );
+ /** Reads a cell formula for the current cell. */
+ ApiTokenSequence readCellFormula( SequenceInputStream& rStrm );
+ /** Reads the formula range used by shared formulas, arrays, and data tables. */
+ bool readFormulaRef( SequenceInputStream& rStrm );
+
/** Imports an empty cell from a CELL_BLANK or MULTCELL_BLANK record. */
void importCellBlank( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a boolean cell from a CELL_BOOL, MULTCELL_BOOL, or FORMULA_BOOL record. */
@@ -88,30 +111,28 @@ private:
/** Imports a string cell from a CELL_STRING, MULTCELL_STRING, or FORMULA_STRING record. */
void importCellString( SequenceInputStream& rStrm, CellType eCellType );
- /** Imports a cell formula for the current cell. */
- void importCellFormula( SequenceInputStream& rStrm );
-
- /** Imports row settings from a ROW record. */
- void importRow( SequenceInputStream& rStrm );
/** Imports an array formula from an ARRAY record. */
void importArray( SequenceInputStream& rStrm );
- /** Imports a shared formula from a SHAREDFORMULA record. */
- void importSharedFmla( SequenceInputStream& rStrm );
/** Imports table operation from a DATATABLE record. */
void importDataTable( SequenceInputStream& rStrm );
+ /** Imports a shared formula from a SHAREDFORMULA record. */
+ void importSharedFmla( SequenceInputStream& rStrm );
private:
- CellModel maCurrCell; /// Position and formatting of current imported cell.
- DataTableModel maTableData; /// Additional data for table operation ranges.
- BinAddress maCurrPos; /// Current position for binary import.
- RichStringRef mxInlineStr; /// Inline rich string from 'is' element.
+ ::rtl::OUString maCellValue; /// Cell value string (OOXML only).
+ RichStringRef mxInlineStr; /// Inline rich string (OOXML only).
+ ApiTokenSequence maTokens; /// Formula token array (OOXML only).
+ DataTableModel maTableData; /// Settings for table operations.
+ BinAddress maCurrPos; /// Current cell position (BIFF12 only).
+ bool mbHasFormula; /// True = current cell has formula data (OOXML only).
+ bool mbValidRange; /// True = maFmlaData.maFormulaRef is valid (OOXML only).
};
// ============================================================================
/** This class implements importing row settings and all cells of a sheet.
*/
-class BiffSheetDataContext : public BiffWorksheetContextBase
+class BiffSheetDataContext : public BiffWorksheetContextBase, private SheetDataContextBase
{
public:
explicit BiffSheetDataContext( const WorksheetHelper& rHelper );
@@ -120,13 +141,15 @@ public:
virtual void importRecord( BiffInputStream& rStrm );
private:
- /** Sets current cell according to the passed address. */
- void setCurrCell( const BinAddress& rAddr );
+ /** Imports row settings from a ROW record. */
+ void importRow( BiffInputStream& rStrm );
- /** Imports an XF identifier and sets the mnXfId member. */
- void importXfId( BiffInputStream& rStrm, bool bBiff2 );
- /** Imports a BIFF cell address and the following XF identifier. */
- void importCellHeader( BiffInputStream& rStrm, bool bBiff2 );
+ /** Reads an XF identifier and initializes a new cell. */
+ bool readCellXfId( BiffInputStream& rStrm, const BinAddress& rAddr, bool bBiff2 );
+ /** Reads a BIFF cell address and the following XF identifier. */
+ bool readCellHeader( BiffInputStream& rStrm, bool bBiff2 );
+ /** Reads the formula range used by shared formulas, arrays, and data tables. */
+ bool readFormulaRef( BiffInputStream& rStrm );
/** Imports a BLANK record describing a blank but formatted cell. */
void importBlank( BiffInputStream& rStrm );
@@ -149,20 +172,18 @@ private:
/** Imports an RK record describing a numeric cell. */
void importRk( BiffInputStream& rStrm );
- /** Imports row settings from a ROW record. */
- void importRow( BiffInputStream& rStrm );
/** Imports an ARRAY record describing an array formula of a cell range. */
void importArray( BiffInputStream& rStrm );
- /** Imports a SHAREDFMLA record describing a shared formula in a cell range. */
- void importSharedFmla( BiffInputStream& rStrm );
/** Imports table operation from a DATATABLE or DATATABLE2 record. */
void importDataTable( BiffInputStream& rStrm );
+ /** Imports a SHAREDFMLA record describing a shared formula in a cell range. */
+ void importSharedFmla( BiffInputStream& rStrm );
private:
- CellModel maCurrCell; /// Position and formatting of current imported cell.
- sal_uInt32 mnFormulaIgnoreSize; /// Number of bytes to be ignored in FORMULA record.
- sal_uInt32 mnArrayIgnoreSize; /// Number of bytes to be ignored in ARRAY record.
- sal_uInt16 mnBiff2XfId; /// Current XF identifier from IXFE record.
+ sal_uInt32 mnFormulaSkipSize; /// Number of bytes to be ignored in FORMULA record.
+ sal_uInt32 mnArraySkipSize; /// Number of bytes to be ignored in ARRAY record.
+ sal_uInt16 mnBiff2XfId; /// Current XF identifier from IXFE record.
+ OptValue< bool > mobBiff2HasXfs; /// Select XF formatting or direct formatting in BIFF2.
};
// ============================================================================
@@ -172,4 +193,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/stylesbuffer.hxx b/oox/inc/oox/xls/stylesbuffer.hxx
index 86a1552664f7..0d960e7fe9a5 100644
--- a/oox/inc/oox/xls/stylesbuffer.hxx
+++ b/oox/inc/oox/xls/stylesbuffer.hxx
@@ -796,6 +796,11 @@ public:
/** Writes all formatting attributes to the passed property set. */
void writeToPropertySet( PropertySet& rPropSet ) const;
+ /** Converts formatting information from BIFF2 cell record data directly. */
+ static void writeBiff2CellFormatToPropertySet(
+ const WorkbookHelper& rHelper, PropertySet& rPropSet,
+ sal_uInt8 nFlags1, sal_uInt8 nFlags2, sal_uInt8 nFlags3 );
+
private:
/** Sets 'attribute used' flags from the passed BIFF bit field. */
void setBiffUsedFlags( sal_uInt8 nUsedFlags );
@@ -1104,4 +1109,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx
index fa32ea026fca..b48c55222644 100644
--- a/oox/inc/oox/xls/workbookhelper.hxx
+++ b/oox/inc/oox/xls/workbookhelper.hxx
@@ -109,47 +109,49 @@ class TableBuffer;
class ThemeBuffer;
class UnitConverter;
class ViewSettings;
-class WorkbookData;
class WorkbookSettings;
class WorksheetBuffer;
+class WorkbookGlobals;
+typedef ::boost::shared_ptr< WorkbookGlobals > WorkbookGlobalsRef;
+
/** Helper class to provice access to global workbook data.
All classes derived from this helper class will have access to a singleton
- object of type WorkbookData containing global workbook settings, buffers,
- converters, etc. Nearly all classes in this filter implementation are
- derived directly or indirectly from this class.
+ object of type WorkbookGlobals containing global workbook settings,
+ buffers, converters, etc. Nearly all classes in this filter implementation
+ are derived directly or indirectly from this class.
- This class contains just a simple reference to the WorkbookData object to
- prevent circular references, as the WorkbookData object contains a lot of
- objects derived from this class.
+ This class contains just a simple reference to the WorkbookGlobals object
+ to prevent circular references, as the WorkbookGlobals object contains a
+ lot of objects derived from this class.
*/
class WorkbookHelper
{
public:
- inline /*implicit*/ WorkbookHelper( WorkbookData& rBookData ) : mrBookData( rBookData ) {}
+ inline /*implicit*/ WorkbookHelper( WorkbookGlobals& rBookGlob ) : mrBookGlob( rBookGlob ) {}
virtual ~WorkbookHelper();
+ static WorkbookGlobalsRef constructGlobals( ExcelFilter& rFilter );
+ static WorkbookGlobalsRef constructGlobals( ExcelBiffFilter& rFilter, BiffType eBiff );
+
// filter -----------------------------------------------------------------
/** Returns the base filter object (base class of all filters). */
::oox::core::FilterBase& getBaseFilter() const;
- /** Returns a reference to the global service factory. */
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- getGlobalFactory() const;
/** Returns the file type of the current filter. */
FilterType getFilterType() const;
/** Returns the filter progress bar. */
SegmentProgressBar& getProgressBar() const;
/** Returns true, if the file is a multi-sheet document, or false if single-sheet. */
bool isWorkbookFile() const;
- /** Returns the index of the current sheet in the Calc document. */
+ /** Returns the index of the current Calc sheet, if filter currently processes a sheet. */
sal_Int16 getCurrentSheetIndex() const;
- /** Sets the index of the current sheet in the Calc document. */
- void setCurrentSheetIndex( sal_Int16 nSheet );
- /** Sets the VBA project storage. */
+ /** Sets the VBA project storage used to import VBA source code and forms. */
void setVbaProjectStorage( const StorageRef& rxVbaPrjStrg );
+ /** Sets the index of the current Calc sheet, if filter currently processes a sheet. */
+ void setCurrentSheetIndex( sal_Int16 nSheet );
/** Final conversion after importing the workbook. */
void finalizeWorkbookImport();
@@ -158,9 +160,6 @@ public:
/** Returns a reference to the source/target spreadsheet document model. */
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument >
getDocument() const;
- /** Returns a reference to the service factory of the spreadsheet document model. */
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- getDocumentFactory() const;
/** Returns a reference to the specified spreadsheet in the document model. */
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet >
@@ -284,38 +283,7 @@ public:
BiffCodecHelper& getCodecHelper() const;
private:
- WorkbookData& mrBookData;
-};
-
-// ============================================================================
-
-namespace prv {
-
-typedef ::boost::shared_ptr< WorkbookData > WorkbookDataRef;
-
-struct WorkbookDataOwner
-{
- explicit WorkbookDataOwner( WorkbookDataRef xBookData );
- virtual ~WorkbookDataOwner();
- WorkbookDataRef mxBookData;
-};
-
-} // namespace prv
-
-// ----------------------------------------------------------------------------
-
-class WorkbookHelperRoot : private prv::WorkbookDataOwner, public WorkbookHelper
-{
-public:
- explicit WorkbookHelperRoot( ExcelFilter& rFilter );
- explicit WorkbookHelperRoot( ExcelBiffFilter& rFilter, BiffType eBiff );
-
- /** Returns true, if this helper refers to a valid document. */
- bool isValid() const;
-
-private:
- WorkbookHelperRoot( const WorkbookHelperRoot& );
- WorkbookHelperRoot& operator=( const WorkbookHelperRoot& );
+ WorkbookGlobals& mrBookGlob;
};
// ============================================================================
diff --git a/oox/inc/oox/xls/worksheetfragment.hxx b/oox/inc/oox/xls/worksheetfragment.hxx
index 32970c8c8956..73d8fd8df987 100644
--- a/oox/inc/oox/xls/worksheetfragment.hxx
+++ b/oox/inc/oox/xls/worksheetfragment.hxx
@@ -64,11 +64,8 @@ class WorksheetFragment : public WorksheetFragmentBase
{
public:
explicit WorksheetFragment(
- const WorkbookHelper& rHelper,
- const ::rtl::OUString& rFragmentPath,
- const ISegmentProgressBarRef& rxProgressBar,
- WorksheetType eSheetType,
- sal_Int16 nSheet );
+ const WorksheetHelper& rHelper,
+ const ::rtl::OUString& rFragmentPath );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -135,10 +132,8 @@ class BiffWorksheetFragment : public BiffWorksheetFragmentBase
{
public:
explicit BiffWorksheetFragment(
- const BiffWorkbookFragmentBase& rParent,
- const ISegmentProgressBarRef& rxProgressBar,
- WorksheetType eSheetType,
- sal_Int16 nSheet );
+ const WorksheetHelper& rHelper,
+ const BiffWorkbookFragmentBase& rParent );
virtual ~BiffWorksheetFragment();
/** Imports the entire worksheet fragment, returns true, if EOF record has been reached. */
@@ -169,6 +164,8 @@ private:
void importLabelRanges( BiffInputStream& rStrm );
/** Imports the MEREDCELLS record and merges all cells in the document. */
void importMergedCells( BiffInputStream& rStrm );
+ /** Imports the NOTE record containing a cell note. */
+ void importNote( BiffInputStream& rStrm );
/** Imports the HORPAGEBREAKS or VERPAGEBREAKS record and inserts page breaks. */
void importPageBreaks( BiffInputStream& rStrm, bool bRowBreak );
/** Imports a pivot table. */
@@ -193,4 +190,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/worksheethelper.hxx b/oox/inc/oox/xls/worksheethelper.hxx
index 18800091f531..e31c8f69711b 100644
--- a/oox/inc/oox/xls/worksheethelper.hxx
+++ b/oox/inc/oox/xls/worksheethelper.hxx
@@ -29,6 +29,7 @@
#ifndef OOX_XLS_WORKSHEETHELPER_HXX
#define OOX_XLS_WORKSHEETHELPER_HXX
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/progressbar.hxx"
#include "oox/ole/olehelper.hxx"
#include "oox/xls/addressconverter.hxx"
@@ -45,7 +46,6 @@ namespace com { namespace sun { namespace star {
namespace table { class XCellRange; }
namespace table { class XTableColumns; }
namespace table { class XTableRows; }
- namespace util { struct DateTime; }
} } }
namespace oox {
@@ -54,12 +54,15 @@ namespace xls {
class AutoFilterBuffer;
struct BinAddress;
struct BinRange;
+class BiffSheetDrawing;
class BinRangeList;
class CommentsBuffer;
class CondFormatBuffer;
+class Font;
class PageSettings;
class QueryTableBuffer;
-class SharedFormulaBuffer;
+class RichString;
+class SheetDataBuffer;
class SheetViewSettings;
class VmlDrawing;
class WorksheetSettings;
@@ -80,47 +83,10 @@ enum WorksheetType
// ============================================================================
-/** Stores some data about a cell. */
-struct CellModel
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > mxCell;
- ::com::sun::star::table::CellAddress maAddress;
- ::rtl::OUString maValueStr; /// String containing cell value data.
- ::rtl::OUString maFormulaRef; /// String containing formula range for array/shared formulas.
- sal_Int32 mnCellType; /// Data type of the cell.
- sal_Int32 mnFormulaType; /// Type of the imported formula.
- sal_Int32 mnSharedId; /// Shared formula identifier for current cell.
- sal_Int32 mnXfId; /// XF identifier for the cell.
- sal_Int32 mnNumFmtId; /// Forced number format for the cell.
- bool mbHasValueStr; /// True = contents of maValueStr are valid.
- bool mbShowPhonetic; /// True = show phonetic text.
-
- inline explicit CellModel() { reset(); }
- void reset();
-};
-
-// ----------------------------------------------------------------------------
-
-/** Stores data about a data table a.k.a. multiple operation range. */
-struct DataTableModel
-{
- ::rtl::OUString maRef1; /// String containing first reference cell for data table formulas.
- ::rtl::OUString maRef2; /// String containing second reference cell for data table formulas.
- bool mb2dTable; /// True = 2-dimensional data table.
- bool mbRowTable; /// True = row oriented data table.
- bool mbRef1Deleted; /// True = first reference cell deleted.
- bool mbRef2Deleted; /// True = second reference cell deleted.
-
- explicit DataTableModel();
-};
-
-// ----------------------------------------------------------------------------
-
-/** Stores formatting data about a range of columns. */
+/** Stores settings and formatting data about a range of sheet columns. */
struct ColumnModel
{
- sal_Int32 mnFirstCol; /// 1-based (!) index of first column.
- sal_Int32 mnLastCol; /// 1-based (!) index of last column.
+ ValueRange maRange; /// 1-based (!) range of the described columns.
double mfWidth; /// Column width in number of characters.
sal_Int32 mnXfId; /// Column default formatting.
sal_Int32 mnLevel; /// Column outline level.
@@ -130,17 +96,17 @@ struct ColumnModel
explicit ColumnModel();
- /** Expands this entry with the passed column range, if column settings are equal. */
- bool tryExpand( const ColumnModel& rModel );
+ /** Returns true, if this entry can be merged with the passed column range (column settings are equal). */
+ bool isMergeable( const ColumnModel& rModel ) const;
};
// ----------------------------------------------------------------------------
-/** Stores formatting data about a range of rows. */
+/** Stores settings and formatting data about a sheet row. */
struct RowModel
{
- sal_Int32 mnFirstRow; /// 1-based (!) index of first row.
- sal_Int32 mnLastRow; /// 1-based (!) index of last row.
+ sal_Int32 mnRow; /// 1-based (!) index of the described row.
+ ValueRangeSet maColSpans; /// 0-based (!) column ranges of used cells.
double mfHeight; /// Row height in points.
sal_Int32 mnXfId; /// Row default formatting (see mbIsFormatted).
sal_Int32 mnLevel; /// Row outline level.
@@ -154,8 +120,10 @@ struct RowModel
explicit RowModel();
- /** Expands this entry with the passed row range, if row settings are equal. */
- bool tryExpand( const RowModel& rModel );
+ /** Inserts the passed column span into the row model. */
+ void insertColSpan( const ValueRange& rColSpan );
+ /** Returns true, if this entry can be merged with the passed row range (row settings are equal). */
+ bool isMergeable( const RowModel& rModel ) const;
};
// ----------------------------------------------------------------------------
@@ -216,12 +184,21 @@ struct ValidationModel
// ============================================================================
// ============================================================================
-class WorksheetData;
+class WorksheetGlobals;
+typedef ::boost::shared_ptr< WorksheetGlobals > WorksheetGlobalsRef;
class WorksheetHelper : public WorkbookHelper
{
public:
- /*implicit*/ WorksheetHelper( WorksheetData& rSheetData );
+ /*implicit*/ WorksheetHelper( WorksheetGlobals& rSheetGlob );
+
+ static WorksheetGlobalsRef constructGlobals(
+ const WorkbookHelper& rHelper,
+ const ISegmentProgressBarRef& rxProgressBar,
+ WorksheetType eSheetType,
+ sal_Int16 nSheet );
+
+ // ------------------------------------------------------------------------
/** Returns the type of this sheet. */
WorksheetType getSheetType() const;
@@ -233,47 +210,13 @@ public:
/** Returns the XCell interface for the passed cell address. */
::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >
- getCell(
- const ::com::sun::star::table::CellAddress& rAddress ) const;
- /** Returns the XCell interface for the passed cell address string. */
- ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >
- getCell(
- const ::rtl::OUString& rAddressStr,
- ::com::sun::star::table::CellAddress* opAddress = 0 ) const;
- /** Returns the XCell interface for the passed cell address. */
- ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >
- getCell(
- const BinAddress& rBinAddress,
- ::com::sun::star::table::CellAddress* opAddress = 0 ) const;
-
+ getCell( const ::com::sun::star::table::CellAddress& rAddress ) const;
/** Returns the XCellRange interface for the passed cell range address. */
::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange >
- getCellRange(
- const ::com::sun::star::table::CellRangeAddress& rRange ) const;
- /** Returns the XCellRange interface for the passed range address string. */
- ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange >
- getCellRange(
- const ::rtl::OUString& rRangeStr,
- ::com::sun::star::table::CellRangeAddress* opRange = 0 ) const;
- /** Returns the XCellRange interface for the passed range address. */
- ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange >
- getCellRange(
- const BinRange& rBinRange,
- ::com::sun::star::table::CellRangeAddress* opRange = 0 ) const;
-
+ getCellRange( const ::com::sun::star::table::CellRangeAddress& rRange ) const;
/** Returns the XSheetCellRanges interface for the passed cell range addresses. */
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges >
getCellRangeList( const ApiCellRangeList& rRanges ) const;
- /** Returns the XSheetCellRanges interface for the passed space-separated range list. */
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges >
- getCellRangeList(
- const ::rtl::OUString& rRangesStr,
- ApiCellRangeList* opRanges = 0 ) const;
- /** Returns the XSheetCellRanges interface for the passed range list. */
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges >
- getCellRangeList(
- const BinRangeList& rBinRanges,
- ApiCellRangeList* opRanges = 0 ) const;
/** Returns the address of the passed cell. The cell reference must be valid. */
static ::com::sun::star::table::CellAddress
@@ -293,10 +236,10 @@ public:
/** Returns the XTableColumns interface for a range of columns. */
::com::sun::star::uno::Reference< ::com::sun::star::table::XTableColumns >
- getColumns( sal_Int32 nFirstCol, sal_Int32 nLastCol ) const;
+ getColumns( const ValueRange& rColRange ) const;
/** Returns the XTableRows interface for a range of rows. */
::com::sun::star::uno::Reference< ::com::sun::star::table::XTableRows >
- getRows( sal_Int32 nFirstRow, sal_Int32 nLastRow ) const;
+ getRows( const ValueRange& rRowRange ) const;
/** Returns the XDrawPage interface of the draw page of the current sheet. */
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
@@ -309,10 +252,8 @@ public:
/** Returns the size of the entire drawing page in 1/100 mm. */
::com::sun::star::awt::Size getDrawPageSize() const;
- /** Returns the worksheet settings object. */
- WorksheetSettings& getWorksheetSettings() const;
- /** Returns the buffer containing all shared formulas in this sheet. */
- SharedFormulaBuffer& getSharedFormulas() const;
+ /** Returns the buffer for cell contents and cell formatting. */
+ SheetDataBuffer& getSheetData() const;
/** Returns the conditional formattings in this sheet. */
CondFormatBuffer& getCondFormats() const;
/** Returns the buffer for all cell comments in this sheet. */
@@ -321,66 +262,27 @@ public:
AutoFilterBuffer& getAutoFilters() const;
/** Returns the buffer for all web query tables in this sheet. */
QueryTableBuffer& getQueryTables() const;
+ /** Returns the worksheet settings object. */
+ WorksheetSettings& getWorksheetSettings() const;
/** Returns the page/print settings for this sheet. */
PageSettings& getPageSettings() const;
/** Returns the view settings for this sheet. */
SheetViewSettings& getSheetViewSettings() const;
- /** Returns the VML drawing page for this sheet. */
+ /** Returns the VML drawing page for this sheet (OOXML/BIFF12 only). */
VmlDrawing& getVmlDrawing() const;
-
- /** Sets the passed string to the cell. */
- void setStringCell(
- const ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >& rxCell,
- const ::rtl::OUString& rText ) const;
- /** Sets the shared string with the passed identifier to the cell. */
- void setSharedStringCell(
- const ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >& rxCell,
- sal_Int32 nStringId,
- sal_Int32 nXfId ) const;
- /** Sets the passed date/time value to the cell and adjusts number format. */
- void setDateTimeCell(
- const ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >& rxCell,
- const ::com::sun::star::util::DateTime& rDateTime ) const;
- /** Sets the passed boolean value to the cell and adjusts number format. */
- void setBooleanCell(
- const ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >& rxCell,
- bool bValue ) const;
- /** Sets the passed BIFF error code to the cell (by converting it to a formula). */
- void setErrorCell(
- const ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >& rxCell,
- const ::rtl::OUString& rErrorCode ) const;
- /** Sets the passed BIFF error code to the cell (by converting it to a formula). */
- void setErrorCell(
- const ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >& rxCell,
- sal_uInt8 nErrorCode ) const;
- /** Sets cell contents to the cell specified in the passed cell model. */
- void setCell( CellModel& orModel ) const;
-
- /** Sets a standard number format (constant from com.sun.star.util.NumberFormat) to the passed cell. */
- void setStandardNumFmt(
- const ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >& rxCell,
- sal_Int16 nStdNumFmt ) const;
+ /** Returns the BIFF drawing page for this sheet (BIFF2-BIFF8 only). */
+ BiffSheetDrawing& getBiffDrawing() const;
/** Changes the current sheet type. */
void setSheetType( WorksheetType eSheetType );
- /** Stores the cell formatting data of the current cell. */
- void setCellFormat( const CellModel& rModel );
- /** Merges the cells in the passed cell range. */
- void setMergedRange( const ::com::sun::star::table::CellRangeAddress& rRange );
/** Sets a column or row page break described in the passed struct. */
void setPageBreak( const PageBreakModel& rModel, bool bRowBreak );
/** Inserts the hyperlink URL into the spreadsheet. */
void setHyperlink( const HyperlinkModel& rModel );
/** Inserts the data validation settings into the spreadsheet. */
void setValidation( const ValidationModel& rModel );
- /** Sets a multiple table operation to the passed range. */
- void setTableOperation(
- const ::com::sun::star::table::CellRangeAddress& rRange,
- const DataTableModel& rModel ) const;
/** Sets the passed label ranges to the current sheet. */
- void setLabelRanges(
- const ApiCellRangeList& rColRanges,
- const ApiCellRangeList& rRowRanges );
+ void setLabelRanges( const ApiCellRangeList& rColRanges, const ApiCellRangeList& rRowRanges );
/** Sets the path to the DrawingML fragment of this sheet. */
void setDrawingPath( const ::rtl::OUString& rDrawingPath );
/** Sets the path to the legacy VML drawing fragment of this sheet. */
@@ -414,6 +316,26 @@ public:
@descr Row default formatting is converted directly, other settings
are cached and converted in the finalizeWorksheetImport() call. */
void setRowModel( const RowModel& rModel );
+ /** Specifies that the passed row needs to set its height manually. */
+ void setManualRowHeight( sal_Int32 nRow );
+
+ /** Inserts a value cell directly into the Calc sheet. */
+ void putValue(
+ const ::com::sun::star::table::CellAddress& rAddress,
+ double fValue ) const;
+ /** Inserts a string cell directly into the Calc sheet. */
+ void putString(
+ const ::com::sun::star::table::CellAddress& rAddress,
+ const ::rtl::OUString& rText ) const;
+ /** Inserts a rich-string cell directly into the Calc sheet. */
+ void putRichString(
+ const ::com::sun::star::table::CellAddress& rAddress,
+ const RichString& rString,
+ const Font* pFirstPortionFont ) const;
+ /** Inserts a formula cell directly into the Calc sheet. */
+ void putFormulaTokens(
+ const ::com::sun::star::table::CellAddress& rAddress,
+ const ApiTokenSequence& rTokens ) const;
/** Initial conversion before importing the worksheet. */
void initializeWorksheetImport();
@@ -421,50 +343,7 @@ public:
void finalizeWorksheetImport();
private:
- WorksheetData& mrSheetData;
-};
-
-// ============================================================================
-
-namespace prv {
-
-typedef ::boost::shared_ptr< WorksheetData > WorksheetDataRef;
-
-struct WorksheetDataOwner
-{
- explicit WorksheetDataOwner( WorksheetDataRef xSheetData );
- virtual ~WorksheetDataOwner();
- WorksheetDataRef mxSheetData;
-};
-
-} // namespace prv
-
-// ----------------------------------------------------------------------------
-
-class WorksheetHelperRoot : private prv::WorksheetDataOwner, public WorksheetHelper
-{
-public:
- /** Returns true, if this helper refers to an existing Calc sheet. */
- bool isValidSheet() const;
-
-protected:
- /** Constructs from the passed data, creates and owns a new data object. */
- explicit WorksheetHelperRoot(
- const WorkbookHelper& rHelper,
- const ISegmentProgressBarRef& rxProgressBar,
- WorksheetType eSheetType,
- sal_Int16 nSheet );
-
- /** Constructs from another sheet helper, does not create a data object. */
- explicit WorksheetHelperRoot(
- const WorksheetHelper& rHelper );
-
- /** Constructs from another sheet helper, shares ownership of the passed helper. */
- explicit WorksheetHelperRoot(
- const WorksheetHelperRoot& rHelper );
-
-private:
- WorksheetHelperRoot& operator=( const WorksheetHelperRoot& );
+ WorksheetGlobals& mrSheetGlob;
};
// ============================================================================
@@ -475,4 +354,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */