From hg changeset c94984deded153e8720faf14d1fc5c3a5b866381 in ooxml11
ooxml11: intermediate commit, builds
This commit is contained in:
parent
e9e0a70c10
commit
c051ddbb5c
3 changed files with 24 additions and 13 deletions
|
@ -45,9 +45,6 @@ public:
|
|||
enum DocumentType { DOCUMENT_DOCX, DOCUMENT_PPTX, DOCUMENT_XLSX };
|
||||
|
||||
private:
|
||||
::sax_fastparser::FSHelperPtr mpFS;
|
||||
::oox::core::XmlFilterBase* mpFB;
|
||||
|
||||
static int mnImageCounter;
|
||||
|
||||
/// To specify where write eg. the images to (like 'ppt', or 'word' - according to the OPC).
|
||||
|
@ -55,6 +52,8 @@ private:
|
|||
|
||||
protected:
|
||||
::com::sun::star::uno::Any mAny;
|
||||
::sax_fastparser::FSHelperPtr mpFS;
|
||||
::oox::core::XmlFilterBase* mpFB;
|
||||
|
||||
bool GetProperty( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, String aName );
|
||||
bool GetPropertyAndState( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
|
||||
|
@ -65,7 +64,7 @@ protected:
|
|||
rtl::OUString WriteImage( const rtl::OUString& rURL );
|
||||
|
||||
public:
|
||||
DrawingML( ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX ) : mpFS( pFS ), mpFB( pFB ), meDocumentType( eDocumentType ) {}
|
||||
DrawingML( ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX ) : meDocumentType( eDocumentType ), mpFS( pFS ), mpFB( pFB ) {}
|
||||
void SetFS( ::sax_fastparser::FSHelperPtr pFS ) { mpFS = pFS; }
|
||||
::sax_fastparser::FSHelperPtr GetFS() { return mpFS; }
|
||||
::oox::core::XmlFilterBase* GetFB() { return mpFB; }
|
||||
|
|
|
@ -49,9 +49,12 @@ namespace drawing {
|
|||
namespace oox { namespace drawingml {
|
||||
|
||||
class OOX_DLLPUBLIC ShapeExport : public DrawingML {
|
||||
|
||||
protected:
|
||||
sal_Int32 mnShapeIdMax, mnPictureIdMax;
|
||||
|
||||
private:
|
||||
sal_Int32 mnXmlNamespace;
|
||||
sal_Int32 mnShapeIdMax, mnPictureIdMax;
|
||||
Fraction maFraction;
|
||||
MapMode maMapModeSrc, maMapModeDest;
|
||||
|
||||
|
@ -73,7 +76,7 @@ private:
|
|||
};
|
||||
|
||||
typedef std::hash_map< const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>, sal_Int32, ShapeHash, ShapeCheck> ShapeHashMap;
|
||||
ShapeHashMap maShapeMap;
|
||||
static ShapeHashMap saShapeMap;
|
||||
|
||||
public:
|
||||
ShapeExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX );
|
||||
|
@ -155,7 +158,8 @@ public:
|
|||
WriteUnknownShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
|
||||
|
||||
sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
|
||||
sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
|
||||
static sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape, ::oox::core::XmlFilterBase* pFB );
|
||||
static sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -93,6 +93,7 @@ using ::com::sun::star::text::XText;
|
|||
using ::com::sun::star::text::XTextContent;
|
||||
using ::com::sun::star::text::XTextField;
|
||||
using ::com::sun::star::text::XTextRange;
|
||||
using ::oox::core::XmlFilterBase;
|
||||
using ::com::sun::star::chart2::XChartDocument;
|
||||
using ::com::sun::star::frame::XModel;
|
||||
using ::oox::core::XmlFilterBase;
|
||||
|
@ -364,11 +365,11 @@ namespace oox { namespace drawingml {
|
|||
if ( GETA(propName) ) \
|
||||
mAny >>= variable;
|
||||
|
||||
ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB, DocumentType eDocumentType )
|
||||
ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, XmlFilterBase* pFB, DocumentType eDocumentType )
|
||||
: DrawingML( pFS, pFB, eDocumentType )
|
||||
, mnXmlNamespace( nXmlNamespace )
|
||||
, mnShapeIdMax( 1 )
|
||||
, mnPictureIdMax( 1 )
|
||||
, mnXmlNamespace( nXmlNamespace )
|
||||
, maFraction( 1, 576 )
|
||||
, maMapModeSrc( MAP_100TH_MM )
|
||||
, maMapModeDest( MAP_INCH, Point(), maFraction, maFraction )
|
||||
|
@ -969,23 +970,30 @@ size_t ShapeExport::ShapeHash::operator()( const ::com::sun::star::uno::Referenc
|
|||
|
||||
sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape > rXShape )
|
||||
{
|
||||
sal_Int32 nID = GetFB()->GetUniqueId();
|
||||
return GetNewShapeID( rXShape, GetFB() );
|
||||
}
|
||||
|
||||
maShapeMap[ rXShape ] = nID;
|
||||
sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape > rXShape, XmlFilterBase* pFB )
|
||||
{
|
||||
sal_Int32 nID = pFB->GetUniqueId();
|
||||
|
||||
saShapeMap[ rXShape ] = nID;
|
||||
|
||||
return nID;
|
||||
}
|
||||
|
||||
sal_Int32 ShapeExport::GetShapeID( const Reference< XShape > rXShape )
|
||||
{
|
||||
ShapeHashMap::const_iterator aIter = maShapeMap.find( rXShape );
|
||||
ShapeHashMap::const_iterator aIter = saShapeMap.find( rXShape );
|
||||
|
||||
if( aIter == maShapeMap.end() )
|
||||
if( aIter == saShapeMap.end() )
|
||||
return -1;
|
||||
|
||||
return aIter->second;
|
||||
}
|
||||
|
||||
ShapeExport::ShapeHashMap ShapeExport::saShapeMap;
|
||||
|
||||
} }
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
|
Loading…
Reference in a new issue