View | Details | Raw Unified | Return to issue 124277
Collapse All | Expand All

(-)filter/inc/filter/msfilter/escherex.hxx (-1 / +1 lines)
Lines 1255-1261 Link Here
1255
	static sal_Bool GetLineArrow( const sal_Bool bLineStart,
1255
	static sal_Bool GetLineArrow( const sal_Bool bLineStart,
1256
				      const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
1256
				      const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
1257
				      ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth );
1257
				      ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth );
1258
	static sal_Bool IsDefaultObject( SdrObjCustomShape* pCustoShape, const MSO_SPT eShapeType );
1258
	static sal_Bool IsDefaultObject( SdrObjCustomShape* pCustoShape );
1259
	static void LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted );
1259
	static void LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted );
1260
	static sal_Bool GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue );
1260
	static sal_Bool GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue );
1261
};
1261
};
(-)filter/source/msfilter/escherex.cxx (-12 / +3 lines)
Lines 2613-2631 Link Here
2613
		}
2613
		}
2614
	}
2614
	}
2615
}
2615
}
2616
2616
//zhaosz_xml
2617
sal_Bool EscherPropertyContainer::IsDefaultObject( SdrObjCustomShape* pCustoShape , const MSO_SPT eShapeType )
2617
sal_Bool EscherPropertyContainer::IsDefaultObject( SdrObjCustomShape* pCustoShape )
2618
{
2618
{
2619
    sal_Bool bIsDefaultObject = sal_False;
2619
    sal_Bool bIsDefaultObject = sal_False;
2620
	switch(eShapeType)
2621
	{
2622
		//if the custom shape is not default shape of ppt, return sal_Fasle;
2623
		case mso_sptTearDrop:
2624
			return bIsDefaultObject;
2625
			
2626
		default:
2627
			break;
2628
	}
2629
	
2620
	
2630
    if ( pCustoShape )
2621
    if ( pCustoShape )
2631
    {
2622
    {
Lines 2714-2720 Link Here
2714
			sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0;
2705
			sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0;
2715
			uno::Sequence< beans::PropertyValues > aHandlesPropSeq;
2706
			uno::Sequence< beans::PropertyValues > aHandlesPropSeq;
2716
			sal_Bool bPredefinedHandlesUsed = sal_True;
2707
			sal_Bool bPredefinedHandlesUsed = sal_True;
2717
			sal_Bool bIsDefaultObject = IsDefaultObject( pCustoShape , eShapeType);
2708
			sal_Bool bIsDefaultObject = IsDefaultObject( pCustoShape);
2718
2709
2719
			// convert property "Equations" into std::vector< EnhancedCustomShapeEquationEquation >
2710
			// convert property "Equations" into std::vector< EnhancedCustomShapeEquationEquation >
2720
			std::vector< EnhancedCustomShapeEquation >	aEquations;
2711
			std::vector< EnhancedCustomShapeEquation >	aEquations;
(-)oox/inc/oox/export/drawingml.hxx (-1 / +3 lines)
Lines 28-34 Link Here
28
#include <com/sun/star/awt/FontDescriptor.hpp>
28
#include <com/sun/star/awt/FontDescriptor.hpp>
29
#include <com/sun/star/uno/XReference.hpp>
29
#include <com/sun/star/uno/XReference.hpp>
30
#include <tools/poly.hxx>
30
#include <tools/poly.hxx>
31
#include <svx/escherex.hxx>
31
//zhaosz_xml
32
//#include <svx/escherex.hxx>
33
#include <filter/msfilter/escherex.hxx>
32
34
33
class Graphic;
35
class Graphic;
34
class String;
36
class String;
(-)oox/inc/oox/export/shapes.hxx (-5 / +12 lines)
Lines 69-77 Link Here
69
69
70
    typedef std::hash_map< const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>, sal_Int32, ShapeHash, ShapeCheck> ShapeHashMap;
70
    typedef std::hash_map< const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>, sal_Int32, ShapeHash, ShapeCheck> ShapeHashMap;
71
    ShapeHashMap maShapeMap;
71
    ShapeHashMap maShapeMap;
72
72
	ShapeHashMap* mpShapeMap;
73
public:
73
public:
74
    ShapeExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX );
74
    //ShapeExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX );
75
	
76
    ShapeExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, 
77
    	ShapeHashMap* pShapeMap = NULL, ::oox::core::XmlFilterBase* pFB = NULL, 
78
    	DocumentType eDocumentType = DOCUMENT_PPTX );
75
    virtual ~ShapeExport() {}
79
    virtual ~ShapeExport() {}
76
80
77
    sal_Int32           GetXmlNamespace() const;
81
    sal_Int32           GetXmlNamespace() const;
Lines 149-157 Link Here
149
    virtual ShapeExport&
153
    virtual ShapeExport&
150
                        WriteUnknownShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
154
                        WriteUnknownShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
151
155
152
    sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
156
  //zhaosz_xml
153
    sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
157
	sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
154
};
158
	sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape, ::oox::core::XmlFilterBase* pFB );
159
	sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
160
	static sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape, ShapeHashMap* pShapeMap );
161
  };
155
162
156
}}
163
}}
157
164
(-)oox/inc/oox/export/utils.hxx (-3 / +3 lines)
Lines 43-50 Link Here
43
#endif
43
#endif
44
44
45
// ---------------------------------------------------------------------------------------------
45
// ---------------------------------------------------------------------------------------------
46
46
//zhaosz_xml, INT32 to sal_Int32
47
static inline sal_Int64 PPTtoEMU( INT32 nPPT )
47
static inline sal_Int64 PPTtoEMU( sal_Int32 nPPT )
48
{
48
{
49
    return (sal_Int64)( (double)nPPT * 1587.5 );
49
    return (sal_Int64)( (double)nPPT * 1587.5 );
50
}
50
}
Lines 51-57 Link Here
51
51
52
// ---------------------------------------------------------------------------------------------
52
// ---------------------------------------------------------------------------------------------
53
53
54
static inline sal_Int64 MM100toEMU( INT32 nMM100 )
54
static inline sal_Int64 MM100toEMU( sal_Int32 nMM100 )
55
{
55
{
56
    return (sal_Int64)nMM100 * 360;
56
    return (sal_Int64)nMM100 * 360;
57
}
57
}
(-)oox/inc/oox/export/vmlexport.hxx (-4 / +4 lines)
Lines 23-29 Link Here
23
23
24
#include <oox/dllapi.h>
24
#include <oox/dllapi.h>
25
#include <sax/fshelper.hxx>
25
#include <sax/fshelper.hxx>
26
#include <svx/escherex.hxx>
26
#include <filter/msfilter/escherex.hxx> //zhaosz_xml
27
27
28
namespace rtl {
28
namespace rtl {
29
    class OString;
29
    class OString;
Lines 87-99 Link Here
87
87
88
private:
88
private:
89
89
90
    virtual void OpenContainer( UINT16 nEscherContainer, int nRecInstance = 0 );
90
    virtual void OpenContainer( sal_Int16 nEscherContainer, int nRecInstance = 0 );
91
    virtual void CloseContainer();
91
    virtual void CloseContainer();
92
92
93
    virtual UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
93
    virtual sal_uInt32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
94
    virtual void LeaveGroup();
94
    virtual void LeaveGroup();
95
95
96
    virtual void AddShape( UINT32 nShapeType, UINT32 nShapeFlags, UINT32 nShapeId = 0 );
96
    virtual void AddShape( sal_Int32 nShapeType, sal_Int32 nShapeFlags, sal_Int32 nShapeId = 0 );
97
97
98
private:
98
private:
99
    /// Create an OString representing the id from a numerical id.
99
    /// Create an OString representing the id from a numerical id.
(-)oox/prj/build.lst (-2 / +3 lines)
Lines 1-4 Link Here
1
oox	oox : vos cppu cppuhelper comphelper sal offapi sax basegfx xmlscript tools vcl BOOST:boost OPENSSL:openssl LIBXSLT:libxslt NULL
1
oox	oox : vos cppu cppuhelper comphelper sal offapi sax basegfx xmlscript tools vcl BOOST:boost OPENSSL:openssl LIBXSLT:libxslt svx NULL
2
oox	oox				usr1	-   all	oox_mkout NULL
2
oox	oox				usr1	-   all	oox_mkout NULL
3
oox	oox\prj				get	-   all	oox_prj NULL
3
oox	oox\prj				get	-   all	oox_prj NULL
4
oox	oox\source\token		nmake	-   all	oox_token NULL
4
oox	oox\source\token		nmake	-   all	oox_token NULL
Lines 15-18 Link Here
15
oox	oox\source\xls			nmake	-   all	oox_xls oox_token NULL
15
oox	oox\source\xls			nmake	-   all	oox_xls oox_token NULL
16
oox	oox\source\dump			nmake	-   all	oox_dump oox_token NULL
16
oox	oox\source\dump			nmake	-   all	oox_dump oox_token NULL
17
oox	oox\source\shape		nmake   -   all oox_shape oox_token NULL
17
oox	oox\source\shape		nmake   -   all oox_shape oox_token NULL
18
oox	oox\util			nmake   -   all oox_util oox_token oox_helper oox_core oox_ole oox_vml oox_drawingml oox_diagram oox_chart oox_table oox_ppt oox_xls oox_dump oox_shape oox_docprop NULL
18
oox	oox\source\export		nmake   -   all oox_export oox_token NULL
19
oox	oox\util			nmake   -   all oox_util oox_token oox_helper oox_core oox_ole oox_vml oox_drawingml oox_diagram oox_chart oox_table oox_ppt oox_xls oox_dump oox_export oox_shape oox_docprop NULL
(-)oox/prj/d.lst (-1 / +3 lines)
Lines 8-13 Link Here
8
mkdir: %_DEST%\inc%_EXT%\oox\token
8
mkdir: %_DEST%\inc%_EXT%\oox\token
9
mkdir: %_DEST%\inc%_EXT%\oox\vml
9
mkdir: %_DEST%\inc%_EXT%\oox\vml
10
mkdir: %_DEST%\inc%_EXT%\oox\xls
10
mkdir: %_DEST%\inc%_EXT%\oox\xls
11
mkdir: %_DEST%\inc%_EXT%\oox\export
11
12
12
..\%__SRC%\misc\*.map %_DEST%\bin%_EXT%\*.map
13
..\%__SRC%\misc\*.map %_DEST%\bin%_EXT%\*.map
13
..\%__SRC%\lib\ixo.lib %_DEST%\lib%_EXT%\ixo.lib
14
..\%__SRC%\lib\ixo.lib %_DEST%\lib%_EXT%\ixo.lib
Lines 35-40 Link Here
35
..\inc\oox\core\filterdetect.hxx %_DEST%\inc%_EXT%\oox\core\filterdetect.hxx
36
..\inc\oox\core\filterdetect.hxx %_DEST%\inc%_EXT%\oox\core\filterdetect.hxx
36
..\inc\oox\core\relations.hxx %_DEST%\inc%_EXT%\oox\core\relations.hxx
37
..\inc\oox\core\relations.hxx %_DEST%\inc%_EXT%\oox\core\relations.hxx
37
..\inc\oox\core\xmlfilterbase.hxx %_DEST%\inc%_EXT%\oox\core\xmlfilterbase.hxx
38
..\inc\oox\core\xmlfilterbase.hxx %_DEST%\inc%_EXT%\oox\core\xmlfilterbase.hxx
39
..\inc\oox\drawingml\*.hxx %_DEST%\inc%_EXT%\oox\drawingml\*.hxx
38
..\inc\oox\drawingml\chart\chartconverter.hxx %_DEST%\inc%_EXT%\oox\drawingml\chart\chartconverter.hxx
40
..\inc\oox\drawingml\chart\chartconverter.hxx %_DEST%\inc%_EXT%\oox\drawingml\chart\chartconverter.hxx
39
..\inc\oox\drawingml\table\tablestylelist.hxx %_DEST%\inc%_EXT%\oox\drawingml\table\tablestylelist.hxx
41
..\inc\oox\drawingml\table\tablestylelist.hxx %_DEST%\inc%_EXT%\oox\drawingml\table\tablestylelist.hxx
40
..\inc\oox\ole\vbaproject.hxx %_DEST%\inc%_EXT%\oox\ole\vbaproject.hxx
42
..\inc\oox\ole\vbaproject.hxx %_DEST%\inc%_EXT%\oox\ole\vbaproject.hxx
Lines 41-47 Link Here
41
..\inc\oox\vml\vmldrawing.hxx %_DEST%\inc%_EXT%\oox\vml\vmldrawing.hxx
43
..\inc\oox\vml\vmldrawing.hxx %_DEST%\inc%_EXT%\oox\vml\vmldrawing.hxx
42
..\inc\oox\vml\vmlshape.hxx %_DEST%\inc%_EXT%\oox\vml\vmlshape.hxx
44
..\inc\oox\vml\vmlshape.hxx %_DEST%\inc%_EXT%\oox\vml\vmlshape.hxx
43
..\inc\oox\xls\excelvbaproject.hxx %_DEST%\inc%_EXT%\oox\xls\excelvbaproject.hxx
45
..\inc\oox\xls\excelvbaproject.hxx %_DEST%\inc%_EXT%\oox\xls\excelvbaproject.hxx
44
46
..\inc\oox\export\*.hxx %_DEST%\inc%_EXT%\oox\export\*.hxx
45
dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; fi"
47
dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; fi"
46
48
47
..\xml\components.xml %_DEST%\xml%_EXT%\components.xml
49
..\xml\components.xml %_DEST%\xml%_EXT%\components.xml
(-)oox/source/export/drawingml.cxx (-22 / +64 lines)
Lines 24-29 Link Here
24
#include "oox/core/xmlfilterbase.hxx"
24
#include "oox/core/xmlfilterbase.hxx"
25
#include "oox/export/drawingml.hxx"
25
#include "oox/export/drawingml.hxx"
26
#include "oox/export/utils.hxx"
26
#include "oox/export/utils.hxx"
27
//zhaosz_xml
28
#include "oox/token/tokens.hxx"
27
29
28
#include <cstdio>
30
#include <cstdio>
29
#include <com/sun/star/awt/CharSet.hpp>
31
#include <com/sun/star/awt/CharSet.hpp>
Lines 35-40 Link Here
35
#include <com/sun/star/beans/XPropertySet.hpp>
37
#include <com/sun/star/beans/XPropertySet.hpp>
36
#include <com/sun/star/beans/XPropertyState.hpp>
38
#include <com/sun/star/beans/XPropertyState.hpp>
37
#include <com/sun/star/container/XEnumerationAccess.hpp>
39
#include <com/sun/star/container/XEnumerationAccess.hpp>
40
//zhaosz_xml
41
#include <com/sun/star/container/XIndexAccess.hpp>
42
38
#include <com/sun/star/drawing/BitmapMode.hpp>
43
#include <com/sun/star/drawing/BitmapMode.hpp>
39
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
44
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
40
#include <com/sun/star/drawing/LineDash.hpp>
45
#include <com/sun/star/drawing/LineDash.hpp>
Lines 42-47 Link Here
42
#include <com/sun/star/drawing/LineStyle.hpp>
47
#include <com/sun/star/drawing/LineStyle.hpp>
43
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
48
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
44
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
49
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
50
51
//zhaosz_xml
52
#include <com/sun/star/drawing/XShape.hpp>
53
#include <com/sun/star/drawing/FillStyle.hpp>
54
55
45
#include <com/sun/star/i18n/ScriptType.hpp>
56
#include <com/sun/star/i18n/ScriptType.hpp>
46
#include <com/sun/star/io/XOutputStream.hpp>
57
#include <com/sun/star/io/XOutputStream.hpp>
47
#include <com/sun/star/style/ParagraphAdjust.hpp>
58
#include <com/sun/star/style/ParagraphAdjust.hpp>
Lines 58-70 Link Here
58
#include <rtl/strbuf.hxx>
69
#include <rtl/strbuf.hxx>
59
#include <sfx2/app.hxx>
70
#include <sfx2/app.hxx>
60
#include <svl/languageoptions.hxx>
71
#include <svl/languageoptions.hxx>
61
#include <svx/escherex.hxx>
72
//zhaosz_xml
62
#include <svx/svxenum.hxx>
73
//#include <svx/escherex.hxx>
74
#include <filter/msfilter/escherex.hxx>
75
#include <unotools/fontcvt.hxx>
76
#include <unotools/fontdefs.hxx>
77
#include <editeng/svxenum.hxx>
63
78
64
using namespace ::com::sun::star;
79
using namespace ::com::sun::star;
65
using namespace ::com::sun::star::uno;
80
using namespace ::com::sun::star::uno;
66
using namespace ::com::sun::star::drawing;
81
using namespace ::com::sun::star::drawing;
67
using namespace ::com::sun::star::i18n;
82
using namespace ::com::sun::star::i18n;
83
//zhaosz_xml
84
using namespace ::com::sun::star::beans;
85
using namespace ::com::sun::star::style;
86
using namespace ::com::sun::star::text;
87
using namespace ::com::sun::star::drawing;
88
68
using ::com::sun::star::beans::PropertyState;
89
using ::com::sun::star::beans::PropertyState;
69
using ::com::sun::star::beans::PropertyValue;
90
using ::com::sun::star::beans::PropertyValue;
70
using ::com::sun::star::beans::XPropertySet;
91
using ::com::sun::star::beans::XPropertySet;
Lines 313-322 Link Here
313
334
314
    sal_uInt32 nLineWidth = 0;
335
    sal_uInt32 nLineWidth = 0;
315
    sal_uInt32 nColor = 0;
336
    sal_uInt32 nColor = 0;
316
    sal_Bool bColorSet = FALSE;
337
    sal_Bool bColorSet = sal_False; //zhaosz_xml
317
    const char* cap = NULL;
338
    const char* cap = NULL;
318
    drawing::LineDash aLineDash;
339
    drawing::LineDash aLineDash;
319
    sal_Bool bDashSet = FALSE;
340
    sal_Bool bDashSet = sal_False;
320
341
321
    GET( nLineWidth, LineWidth );
342
    GET( nLineWidth, LineWidth );
322
343
Lines 324-330 Link Here
324
        case drawing::LineStyle_DASH:
345
        case drawing::LineStyle_DASH:
325
            if( GETA( LineDash ) ) {
346
            if( GETA( LineDash ) ) {
326
                aLineDash = *(drawing::LineDash*) mAny.getValue();
347
                aLineDash = *(drawing::LineDash*) mAny.getValue();
327
                bDashSet = TRUE;
348
                bDashSet = sal_True;
328
                if( aLineDash.Style == DashStyle_ROUND || aLineDash.Style == DashStyle_ROUNDRELATIVE )
349
                if( aLineDash.Style == DashStyle_ROUND || aLineDash.Style == DashStyle_ROUNDRELATIVE )
329
                    cap = "rnd";
350
                    cap = "rnd";
330
351
Lines 336-342 Link Here
336
        default:
357
        default:
337
            if ( GETA( LineColor ) ) {
358
            if ( GETA( LineColor ) ) {
338
                nColor = *((sal_uInt32*) mAny.getValue()) & 0xffffff;
359
                nColor = *((sal_uInt32*) mAny.getValue()) & 0xffffff;
339
                bColorSet = TRUE;
360
                bColorSet = sal_True;
340
            }
361
            }
341
            break;
362
            break;
342
    }
363
    }
Lines 466-472 Link Here
466
            }
487
            }
467
488
468
            aData = aStream.GetData();
489
            aData = aStream.GetData();
469
            nDataSize = aStream.GetSize();
490
            //nDataSize = aStream.GetSize();
491
			//zhaosz_xml
492
			nDataSize = aStream.GetEndOfData();//just function replacing
470
            break;
493
            break;
471
            }
494
            }
472
    }
495
    }
Lines 478-485 Link Here
478
        case DOCUMENT_PPTX: pComponent = "ppt"; break;
501
        case DOCUMENT_PPTX: pComponent = "ppt"; break;
479
        case DOCUMENT_XLSX: pComponent = "xl"; break;
502
        case DOCUMENT_XLSX: pComponent = "xl"; break;
480
    }
503
    }
481
504
//zhaosz_xml 
482
    Reference< XOutputStream > xOutStream = mpFB->openOutputStream( OUStringBuffer()
505
    /*Reference< XOutputStream > xOutStream = mpFB->openOutputStream( OUStringBuffer()
483
                                                                    .appendAscii( pComponent )
506
                                                                    .appendAscii( pComponent )
484
                                                                    .appendAscii( "/media/image" )
507
                                                                    .appendAscii( "/media/image" )
485
                                                                    .append( (sal_Int32) mnImageCounter )
508
                                                                    .append( (sal_Int32) mnImageCounter )
Lines 486-491 Link Here
486
                                                                    .appendAscii( sExtension )
509
                                                                    .appendAscii( sExtension )
487
                                                                    .makeStringAndClear(),
510
                                                                    .makeStringAndClear(),
488
                                                                    sMediaType );
511
                                                                    sMediaType );
512
                                                                    */
513
     /*
514
     
515
		Reference< XOutputStream > XmlFilterBase::openFragmentStream( const OUString& rStreamName, const OUString& rMediaType )
516
		{
517
			Reference< XOutputStream > xOutputStream = openOutputStream( rStreamName );
518
			PropertySet aPropSet( xOutputStream );
519
			aPropSet.setProperty( PROP_MediaType, rMediaType );
520
			return xOutputStream;
521
		}
522
                                                                    
523
        */
524
    Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer()
525
                                                                    .appendAscii( pComponent )
526
                                                                    .appendAscii( "/media/image" )
527
                                                                    .append( (sal_Int32) mnImageCounter )
528
                                                                    .appendAscii( sExtension )
529
                                                                    .makeStringAndClear(),
530
                                                                    sMediaType );
489
    xOutStream->writeBytes( Sequence< sal_Int8 >( (const sal_Int8*) aData, nDataSize ) );
531
    xOutStream->writeBytes( Sequence< sal_Int8 >( (const sal_Int8*) aData, nDataSize ) );
490
    xOutStream->closeOutput();
532
    xOutStream->closeOutput();
491
533
Lines 791-797 Link Here
791
        if( rXTextField.is() ) {
833
        if( rXTextField.is() ) {
792
            rXPropSet.set( rXTextField, UNO_QUERY );
834
            rXPropSet.set( rXTextField, UNO_QUERY );
793
            if( rXPropSet.is() ) {
835
            if( rXPropSet.is() ) {
794
                String aFieldKind( rXTextField->getPresentation( TRUE ) );
836
                String aFieldKind( rXTextField->getPresentation( sal_True ) );
795
                DBG(printf ("field kind: %s\n", ST(aFieldKind) ));
837
                DBG(printf ("field kind: %s\n", ST(aFieldKind) ));
796
                if( aFieldKind == S( "Page" ) ) {
838
                if( aFieldKind == S( "Page" ) ) {
797
                    return "slidenum";
839
                    return "slidenum";
Lines 1092-1098 Link Here
1092
1134
1093
    mpFS->startElementNS( XML_a, XML_p, FSEND );
1135
    mpFS->startElementNS( XML_a, XML_p, FSEND );
1094
1136
1095
    sal_Bool bPropertiesWritten = FALSE;
1137
    sal_Bool bPropertiesWritten = sal_False;
1096
    while( enumeration->hasMoreElements() ) {
1138
    while( enumeration->hasMoreElements() ) {
1097
        Reference< XTextRange > run;
1139
        Reference< XTextRange > run;
1098
        Any any ( enumeration->nextElement() );
1140
        Any any ( enumeration->nextElement() );
Lines 1100-1106 Link Here
1100
        if (any >>= run) {
1142
        if (any >>= run) {
1101
            if( !bPropertiesWritten && run->getString().getLength() ) {
1143
            if( !bPropertiesWritten && run->getString().getLength() ) {
1102
                WriteParagraphProperties( rParagraph );
1144
                WriteParagraphProperties( rParagraph );
1103
                bPropertiesWritten = TRUE;
1145
                bPropertiesWritten = sal_True;
1104
            }
1146
            }
1105
            WriteRun( run );
1147
            WriteRun( run );
1106
        }
1148
        }
Lines 1152-1162 Link Here
1152
    if( eHorizontalAlignment == TextHorizontalAdjust_CENTER )
1194
    if( eHorizontalAlignment == TextHorizontalAdjust_CENTER )
1153
        bHorizontalCenter = true;
1195
        bHorizontalCenter = true;
1154
1196
1155
    sal_Bool bHasWrap = FALSE;
1197
    sal_Bool bHasWrap = sal_False;
1156
    sal_Bool bWrap = FALSE;
1198
    sal_Bool bWrap = sal_False;
1157
    if( GETA( TextWordWrap ) ) {
1199
    if( GETA( TextWordWrap ) ) {
1158
        mAny >>= bWrap;
1200
        mAny >>= bWrap;
1159
        bHasWrap = TRUE;
1201
        bHasWrap = sal_True;
1160
        //DBG(printf("wrap: %d\n", bWrap));
1202
        //DBG(printf("wrap: %d\n", bWrap));
1161
    }
1203
    }
1162
1204
Lines 1241-1251 Link Here
1241
1283
1242
    mpFS->startElementNS( XML_a, XML_pathLst, FSEND );
1284
    mpFS->startElementNS( XML_a, XML_pathLst, FSEND );
1243
1285
1244
    for( USHORT i = 0; i < rPolyPolygon.Count(); i ++ ) {
1286
    for( sal_uInt16 i = 0; i < rPolyPolygon.Count(); i ++ ) {
1245
1287
1246
        const Polygon& rPoly = rPolyPolygon[ i ];
1288
        const Polygon& rPoly = rPolyPolygon[ i ];
1247
        Rectangle aRect( rPoly.GetBoundRect() );
1289
        Rectangle aRect( rPoly.GetBoundRect() );
1248
        sal_Bool bBezier = FALSE;
1290
        sal_Bool bBezier = sal_False;
1249
1291
1250
        mpFS->startElementNS( XML_a, XML_path,
1292
        mpFS->startElementNS( XML_a, XML_path,
1251
                              XML_w, I64S( aRect.GetWidth() ),
1293
                              XML_w, I64S( aRect.GetWidth() ),
Lines 1264-1276 Link Here
1264
            mpFS->endElementNS( XML_a, XML_moveTo );
1306
            mpFS->endElementNS( XML_a, XML_moveTo );
1265
        }
1307
        }
1266
1308
1267
        for( USHORT j = 1; j < rPoly.GetSize(); j ++ )
1309
        for( sal_uInt16 j = 1; j < rPoly.GetSize(); j ++ )
1268
        {
1310
        {
1269
            enum PolyFlags flags = rPoly.GetFlags(j);
1311
            enum PolyFlags flags = rPoly.GetFlags(j);
1270
            if( flags == POLY_CONTROL && !bBezier )
1312
            if( flags == POLY_CONTROL && !bBezier )
1271
            {
1313
            {
1272
                mpFS->startElementNS( XML_a, XML_cubicBezTo, FSEND );
1314
                mpFS->startElementNS( XML_a, XML_cubicBezTo, FSEND );
1273
                bBezier = TRUE;
1315
                bBezier = sal_True;
1274
            }
1316
            }
1275
            else if( flags == POLY_NORMAL && !bBezier )
1317
            else if( flags == POLY_NORMAL && !bBezier )
1276
                mpFS->startElementNS( XML_a, XML_lnTo, FSEND );
1318
                mpFS->startElementNS( XML_a, XML_lnTo, FSEND );
Lines 1283-1289 Link Here
1283
            if( ( flags == POLY_NORMAL || flags == POLY_SYMMTR ) && bBezier )
1325
            if( ( flags == POLY_NORMAL || flags == POLY_SYMMTR ) && bBezier )
1284
            {
1326
            {
1285
                mpFS->endElementNS( XML_a, XML_cubicBezTo );
1327
                mpFS->endElementNS( XML_a, XML_cubicBezTo );
1286
                bBezier = FALSE;
1328
                bBezier = sal_False;
1287
            }
1329
            }
1288
            else if( flags == POLY_NORMAL && !bBezier )
1330
            else if( flags == POLY_NORMAL && !bBezier )
1289
                mpFS->endElementNS( XML_a, XML_lnTo );
1331
                mpFS->endElementNS( XML_a, XML_lnTo );
Lines 1323-1333 Link Here
1323
{
1365
{
1324
    mpFS->singleElementNS( XML_a, XML_stCxn,
1366
    mpFS->singleElementNS( XML_a, XML_stCxn,
1325
                           XML_id, I32S( nStartID ),
1367
                           XML_id, I32S( nStartID ),
1326
                           XML_idx, I64S( rConnectorEntry.GetConnectorRule( TRUE ) ),
1368
                           XML_idx, I64S( rConnectorEntry.GetConnectorRule( sal_True ) ),
1327
                           FSEND );
1369
                           FSEND );
1328
    mpFS->singleElementNS( XML_a, XML_endCxn,
1370
    mpFS->singleElementNS( XML_a, XML_endCxn,
1329
                           XML_id, I32S( nEndID ),
1371
                           XML_id, I32S( nEndID ),
1330
                           XML_idx, I64S( rConnectorEntry.GetConnectorRule( FALSE ) ),
1372
                           XML_idx, I64S( rConnectorEntry.GetConnectorRule( sal_False ) ),
1331
                           FSEND );
1373
                           FSEND );
1332
}
1374
}
1333
1375
(-)oox/source/export/makefile.mk (-3 / +3 lines)
Lines 35-43 Link Here
35
35
36
SLOFILES =	\
36
SLOFILES =	\
37
		$(SLO)$/drawingml.obj \
37
		$(SLO)$/drawingml.obj \
38
		$(SLO)$/shapes.obj \
38
		$(SLO)$/shapes.obj 
39
		$(SLO)$/vmlexport.obj \
39
#		$(SLO)$/vmlexport.obj \
40
		$(SLO)$/vmlexport-shape-types.obj
40
#		$(SLO)$/vmlexport-shape-types.obj
41
41
42
# --- Targets -------------------------------------------------------
42
# --- Targets -------------------------------------------------------
43
43
(-)oox/source/export/shapes.cxx (-11 / +36 lines)
Lines 61-69 Link Here
61
#include <rtl/strbuf.hxx>
61
#include <rtl/strbuf.hxx>
62
#include <sfx2/app.hxx>
62
#include <sfx2/app.hxx>
63
#include <svl/languageoptions.hxx>
63
#include <svl/languageoptions.hxx>
64
#include <svx/escherex.hxx>
64
//#include <svx/escherex.hxx>
65
//zhaosz_xml
66
#include <filter/msfilter/escherex.hxx>
67
#include <editeng/svxenum.hxx>
68
#include "oox/token/tokens.hxx"
69
65
#include <svx/svdoashp.hxx>
70
#include <svx/svdoashp.hxx>
66
#include <svx/svxenum.hxx>
71
//#include <svx/svxenum.hxx>
67
#include <svx/unoapi.hxx>
72
#include <svx/unoapi.hxx>
68
73
69
using namespace ::com::sun::star;
74
using namespace ::com::sun::star;
Lines 89-95 Link Here
89
using ::rtl::OUString;
94
using ::rtl::OUString;
90
using ::rtl::OUStringBuffer;
95
using ::rtl::OUStringBuffer;
91
using ::sax_fastparser::FSHelperPtr;
96
using ::sax_fastparser::FSHelperPtr;
97
//zhaosz_xml
98
using ::oox::core::XmlFilterBase;
92
99
100
93
DBG(extern void dump_pset(Reference< XPropertySet > rXPropSet));
101
DBG(extern void dump_pset(Reference< XPropertySet > rXPropSet));
94
102
95
#define IDS(x) (OString(#x " ") + OString::valueOf( mnShapeIdMax++ )).getStr()
103
#define IDS(x) (OString(#x " ") + OString::valueOf( mnShapeIdMax++ )).getStr()
Lines 306-312 Link Here
306
    { "mso-spt201", "hostControl" },
314
    { "mso-spt201", "hostControl" },
307
    { "mso-spt202", "rect" }
315
    { "mso-spt202", "rect" }
308
};
316
};
317
//zhaosz_xml
318
struct ShapeHash
319
{
320
    size_t operator()( const char* s ) const
321
    {
322
        return rtl_str_hashCode(s);
323
    }
324
};
309
325
326
struct ShapeCheck
327
{
328
    bool operator()( const char* s1, const char* s2 ) const
329
    {
330
        return strcmp( s1, s2 ) == 0;
331
    }
332
};
310
typedef std::hash_map< const char*, const char*, CStringHash, CStringEqual> CustomShapeTypeTranslationHashMap;
333
typedef std::hash_map< const char*, const char*, CStringHash, CStringEqual> CustomShapeTypeTranslationHashMap;
311
static CustomShapeTypeTranslationHashMap* pCustomShapeTypeTranslationHashMap = NULL;
334
static CustomShapeTypeTranslationHashMap* pCustomShapeTypeTranslationHashMap = NULL;
312
335
Lines 344-357 Link Here
344
    if ( GETA(propName) ) \
367
    if ( GETA(propName) ) \
345
        mAny >>= variable;
368
        mAny >>= variable;
346
369
347
ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB, DocumentType eDocumentType )
370
ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS,
371
	ShapeHashMap* pShapeMap, XmlFilterBase* pFB, DocumentType eDocumentType )
348
    : DrawingML( pFS, pFB, eDocumentType )
372
    : DrawingML( pFS, pFB, eDocumentType )
349
    , mnXmlNamespace( nXmlNamespace )
350
    , mnShapeIdMax( 1 )
373
    , mnShapeIdMax( 1 )
351
    , mnPictureIdMax( 1 )
374
    , mnPictureIdMax( 1 )
375
    , mnXmlNamespace( nXmlNamespace )
352
    , maFraction( 1, 576 )
376
    , maFraction( 1, 576 )
353
    , maMapModeSrc( MAP_100TH_MM )
377
    , maMapModeSrc( MAP_100TH_MM )
354
    , maMapModeDest( MAP_INCH, Point(), maFraction, maFraction )
378
    , maMapModeDest( MAP_INCH, Point(), maFraction, maFraction )
379
    , mpShapeMap( pShapeMap ? pShapeMap : &maShapeMap )
355
{
380
{
356
}
381
}
357
382
Lines 430-441 Link Here
430
455
431
ShapeExport& ShapeExport::WriteClosedBezierShape( Reference< XShape > xShape )
456
ShapeExport& ShapeExport::WriteClosedBezierShape( Reference< XShape > xShape )
432
{
457
{
433
    return WriteBezierShape( xShape, TRUE );
458
    return WriteBezierShape( xShape, sal_True );
434
}
459
}
435
460
436
ShapeExport& ShapeExport::WriteOpenBezierShape( Reference< XShape > xShape )
461
ShapeExport& ShapeExport::WriteOpenBezierShape( Reference< XShape > xShape )
437
{
462
{
438
    return WriteBezierShape( xShape, FALSE );
463
    return WriteBezierShape( xShape, sal_False );
439
}
464
}
440
465
441
ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
466
ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
Lines 445-451 Link Here
445
    Reference< XPropertySet > rXPropSet( xShape, UNO_QUERY );
470
    Reference< XPropertySet > rXPropSet( xShape, UNO_QUERY );
446
    SdrObjCustomShape* pShape = (SdrObjCustomShape*) GetSdrObjectFromXShape( xShape );
471
    SdrObjCustomShape* pShape = (SdrObjCustomShape*) GetSdrObjectFromXShape( xShape );
447
    sal_Bool bIsDefaultObject = EscherPropertyContainer::IsDefaultObject( pShape );
472
    sal_Bool bIsDefaultObject = EscherPropertyContainer::IsDefaultObject( pShape );
448
    sal_Bool bPredefinedHandlesUsed = TRUE;
473
    sal_Bool bPredefinedHandlesUsed = sal_True;
449
    OUString sShapeType;
474
    OUString sShapeType;
450
    sal_uInt32 nMirrorFlags = 0;
475
    sal_uInt32 nMirrorFlags = 0;
451
    MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType( xShape, nMirrorFlags, sShapeType );
476
    MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType( xShape, nMirrorFlags, sShapeType );
Lines 468-474 Link Here
468
                    nAdjustmentValuesIndex = i;
493
                    nAdjustmentValuesIndex = i;
469
                else if( rProp.Name.equalsAscii( "Handles" )) {
494
                else if( rProp.Name.equalsAscii( "Handles" )) {
470
                    if( !bIsDefaultObject )
495
                    if( !bIsDefaultObject )
471
                        bPredefinedHandlesUsed = FALSE;
496
                        bPredefinedHandlesUsed = sal_False;
472
                    // TODO: update nAdjustmentsWhichNeedsToBeConverted here
497
                    // TODO: update nAdjustmentsWhichNeedsToBeConverted here
473
                }
498
                }
474
            }
499
            }
Lines 702-714 Link Here
702
727
703
    Rectangle aRect( Point( aStartPoint.X, aStartPoint.Y ), Point( aEndPoint.X, aEndPoint.Y ) );
728
    Rectangle aRect( Point( aStartPoint.X, aStartPoint.Y ), Point( aEndPoint.X, aEndPoint.Y ) );
704
    if( aRect.getWidth() < 0 ) {
729
    if( aRect.getWidth() < 0 ) {
705
        bFlipH = TRUE;
730
        bFlipH = sal_True;
706
        aRect.setX( aEndPoint.X );
731
        aRect.setX( aEndPoint.X );
707
        aRect.setWidth( aStartPoint.X - aEndPoint.X );
732
        aRect.setWidth( aStartPoint.X - aEndPoint.X );
708
    }
733
    }
709
734
710
    if( aRect.getHeight() < 0 ) {
735
    if( aRect.getHeight() < 0 ) {
711
        bFlipV = TRUE;
736
        bFlipV = sal_True;
712
        aRect.setY( aEndPoint.Y );
737
        aRect.setY( aEndPoint.Y );
713
        aRect.setHeight( aStartPoint.Y - aEndPoint.Y );
738
        aRect.setHeight( aStartPoint.Y - aEndPoint.Y );
714
    }
739
    }
Lines 861-867 Link Here
861
}
886
}
862
887
863
typedef ShapeExport& (ShapeExport::*ShapeConverter)( Reference< XShape > );
888
typedef ShapeExport& (ShapeExport::*ShapeConverter)( Reference< XShape > );
864
typedef std::hash_map< const char*, ShapeConverter, CStringHash, CStringEqual> NameToConvertMapType;
889
typedef std::hash_map< const char*, ShapeConverter, ShapeHash, ShapeCheck> NameToConvertMapType;
865
890
866
static const NameToConvertMapType& lcl_GetConverters()
891
static const NameToConvertMapType& lcl_GetConverters()
867
{
892
{
(-)oox/source/export/vmlexport.cxx (-6 / +10 lines)
Lines 23-29 Link Here
23
23
24
#include <oox/export/vmlexport.hxx>
24
#include <oox/export/vmlexport.hxx>
25
25
26
#include <tokens.hxx>
26
//#include <tokens.hxx>
27
//zhaosz_xml
28
#include "oox/token/tokens.hxx"
27
29
28
#include <rtl/strbuf.hxx>
30
#include <rtl/strbuf.hxx>
29
#include <rtl/ustring.hxx>
31
#include <rtl/ustring.hxx>
Lines 60-66 Link Here
60
};
62
};
61
63
62
VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr pSerializer )
64
VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr pSerializer )
63
    : EscherEx( *( new SvNullStream ), 0 ),
65
    //: EscherEx( *( new SvNullStream ), 0 ),
66
    //zhaosz_xml
67
    : EscherEx( EscherExGlobalRef(new EscherExGlobal(0)), *( new SvNullStream ) ),
64
      m_pSerializer( pSerializer ),
68
      m_pSerializer( pSerializer ),
65
      m_pShapeAttrList( NULL ),
69
      m_pShapeAttrList( NULL ),
66
      m_nShapeType( ESCHER_ShpInst_Nil ),
70
      m_nShapeType( ESCHER_ShpInst_Nil ),
Lines 78-84 Link Here
78
    delete[] m_pShapeTypeWritten, m_pShapeTypeWritten = NULL;
82
    delete[] m_pShapeTypeWritten, m_pShapeTypeWritten = NULL;
79
}
83
}
80
84
81
void VMLExport::OpenContainer( UINT16 nEscherContainer, int nRecInstance )
85
void VMLExport::OpenContainer( sal_Int16 nEscherContainer, int nRecInstance )
82
{
86
{
83
    EscherEx::OpenContainer( nEscherContainer, nRecInstance );
87
    EscherEx::OpenContainer( nEscherContainer, nRecInstance );
84
88
Lines 122-130 Link Here
122
    EscherEx::CloseContainer();
126
    EscherEx::CloseContainer();
123
}
127
}
124
128
125
UINT32 VMLExport::EnterGroup( const String& rShapeName, const Rectangle* pRect )
129
sal_uInt32 VMLExport::EnterGroup( const String& rShapeName, const Rectangle* pRect )
126
{
130
{
127
    UINT32 nShapeId = GetShapeID();
131
    sal_Int32 nShapeId = GenerateShapeId();//zhaosz_xml,just function replacing 
128
132
129
    OStringBuffer aStyle( 200 );
133
    OStringBuffer aStyle( 200 );
130
    FastAttributeList *pAttrList = m_pSerializer->createAttrList();
134
    FastAttributeList *pAttrList = m_pSerializer->createAttrList();
Lines 167-173 Link Here
167
    m_pSerializer->endElementNS( XML_v, XML_group );
171
    m_pSerializer->endElementNS( XML_v, XML_group );
168
}
172
}
169
173
170
void VMLExport::AddShape( UINT32 nShapeType, UINT32 nShapeFlags, UINT32 nShapeId )
174
void VMLExport::AddShape( sal_Int32 nShapeType, sal_Int32 nShapeFlags, sal_Int32 nShapeId )
171
{
175
{
172
    m_nShapeType = nShapeType;
176
    m_nShapeType = nShapeType;
173
    m_nShapeFlags = nShapeFlags;
177
    m_nShapeFlags = nShapeFlags;
(-)oox/util/makefile.mk (-1 / +10 lines)
Lines 49-55 Link Here
49
    $(SLB)$/table.lib\
49
    $(SLB)$/table.lib\
50
    $(SLB)$/shape.lib\
50
    $(SLB)$/shape.lib\
51
    $(SLB)$/dump.lib\
51
    $(SLB)$/dump.lib\
52
    $(SLB)$/docprop.lib
52
    $(SLB)$/docprop.lib\
53
    $(SLB)$/export.lib
53
54
54
# --- Shared-Library -----------------------------------------------
55
# --- Shared-Library -----------------------------------------------
55
56
Lines 62-70 Link Here
62
		$(CPPUHELPERLIB)\
63
		$(CPPUHELPERLIB)\
63
		$(COMPHELPERLIB)\
64
		$(COMPHELPERLIB)\
64
		$(RTLLIB)		\
65
		$(RTLLIB)		\
66
			$(TOOLSLIB) \
65
		$(SALLIB)		\
67
		$(SALLIB)		\
66
		$(BASEGFXLIB)	\
68
		$(BASEGFXLIB)	\
69
		$(VCLLIB) \
67
		$(SAXLIB)       \
70
		$(SAXLIB)       \
71
		$(MSFILTERLIB)	\
72
		$(SVTOOLLIB)	\
73
		$(SVXLIB)  \
74
		$(SVXCORELIB)  \
75
		$(UNOTOOLSLIB)	\
76
		$(SVLLIB) \
68
        $(XMLSCRIPTLIB)
77
        $(XMLSCRIPTLIB)
69
78
70
# link openssl, copied this bit from ucb/source/ucp/webdav/makefile.mk
79
# link openssl, copied this bit from ucb/source/ucp/webdav/makefile.mk
(-)sc/inc/drwlayer.hxx (+2 lines)
Lines 208-213 Link Here
208
	// Verankerung setzen und ermitteln
208
	// Verankerung setzen und ermitteln
209
	static void		SetAnchor( SdrObject*, ScAnchorType );
209
	static void		SetAnchor( SdrObject*, ScAnchorType );
210
	static ScAnchorType	GetAnchor( const SdrObject* );
210
	static ScAnchorType	GetAnchor( const SdrObject* );
211
//zhaosz_xml
212
	static ScAnchorType 	GetAnchorType( const SdrObject& );
211
213
212
	// Positionen fuer Detektivlinien
214
	// Positionen fuer Detektivlinien
213
	static ScDrawObjData* GetObjData( SdrObject* pObj, sal_Bool bCreate=sal_False );
215
	static ScDrawObjData* GetObjData( SdrObject* pObj, sal_Bool bCreate=sal_False );
(-)sc/source/core/data/drwlayer.cxx (+7 lines)
Lines 1891-1896 Link Here
1891
	Point aAnchor( pObj->GetAnchorPos() );
1891
	Point aAnchor( pObj->GetAnchorPos() );
1892
	return ( aAnchor.Y() != 0 ) ? SCA_PAGE : SCA_CELL;
1892
	return ( aAnchor.Y() != 0 ) ? SCA_PAGE : SCA_CELL;
1893
}
1893
}
1894
//zhaosz_xml
1895
ScAnchorType ScDrawLayer::GetAnchorType( const SdrObject &rObj )
1896
{
1897
    //If this object has a cell anchor associated with it
1898
    //then its cell-anchored, otherwise its page-anchored
1899
    return ScDrawLayer::GetObjData(const_cast<SdrObject*>(&rObj)) ? SCA_CELL : SCA_PAGE;
1900
}
1894
1901
1895
ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, sal_Bool bCreate )		// static
1902
ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, sal_Bool bCreate )		// static
1896
{
1903
{
(-)sc/source/filter/excel/excdoc.cxx (-40 / +45 lines)
Lines 80-85 Link Here
80
80
81
#include <math.h>
81
#include <math.h>
82
82
83
#include <com/sun/star/document/XDocumentProperties.hpp>
84
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
83
using namespace ::oox;
85
using namespace ::oox;
84
using ::rtl::OString;
86
using ::rtl::OString;
85
87
Lines 403-410 Link Here
403
405
404
        Add( new XclExpRecalcId );
406
        Add( new XclExpRecalcId );
405
407
406
		// MSODRAWINGGROUP per-document data
408
        // MSODRAWINGGROUP per-document data
407
        aRecList.AppendRecord( GetObjectManager().CreateDrawingGroup() );
409
       // if( GetOutput() == EXC_OUTPUT_BINARY )
410
            aRecList.AppendRecord( GetObjectManager().CreateDrawingGroup() );
408
        // Shared string table: SST, EXTSST
411
        // Shared string table: SST, EXTSST
409
        aRecList.AppendRecord( CreateRecord( EXC_ID_SST ) );
412
        aRecList.AppendRecord( CreateRecord( EXC_ID_SST ) );
410
413
Lines 422-434 Link Here
422
    RootData& rR = GetOldRoot();
425
    RootData& rR = GetOldRoot();
423
    XclBiff eBiff = GetBiff();
426
    XclBiff eBiff = GetBiff();
424
    ScDocument& rDoc = GetDoc();
427
    ScDocument& rDoc = GetDoc();
425
428
	XclOutput eOutput = GetOutput();//zhaosz_xml
426
    DBG_ASSERT( (mnScTab >= 0L) && (mnScTab <= MAXTAB), "-ExcTable::Table(): mnScTab - no ordinary table!" );
429
    DBG_ASSERT( (mnScTab >= 0L) && (mnScTab <= MAXTAB), "-ExcTable::Table(): mnScTab - no ordinary table!" );
427
    DBG_ASSERT( nExcTab <= static_cast<sal_uInt16>(MAXTAB), "-ExcTable::Table(): nExcTab - no ordinary table!" );
430
    DBG_ASSERT( nExcTab <= static_cast<sal_uInt16>(MAXTAB), "-ExcTable::Table(): nExcTab - no ordinary table!" );
428
431
429
    // create a new OBJ list for this sheet (may be used by notes, autofilter, data validation)
432
    // create a new OBJ list for this sheet (may be used by notes, autofilter, data validation)
430
    if( eBiff == EXC_BIFF8 )
433
    if( eBiff == EXC_BIFF8 /*&& GetOutput() == EXC_OUTPUT_BINARY */)//zhaosz_xml 
431
        GetObjectManager().StartSheet();
434
    {
435
 		GetObjectManager().StartSheet();//make the mxObjList
436
    }
432
437
433
    // cell table: DEFROWHEIGHT, DEFCOLWIDTH, COLINFO, DIMENSIONS, ROW, cell records
438
    // cell table: DEFROWHEIGHT, DEFCOLWIDTH, COLINFO, DIMENSIONS, ROW, cell records
434
    mxCellTable.reset( new XclExpCellTable( GetRoot() ) );
439
    mxCellTable.reset( new XclExpCellTable( GetRoot() ) );
Lines 629-634 Link Here
629
            Add( new XclExpUsersViewEnd );
634
            Add( new XclExpUsersViewEnd );
630
        }
635
        }
631
    }
636
    }
637
	//zhaosz_xml
638
	if (GetOutput() == EXC_OUTPUT_XML_2007 )//call mxObjList->EndSheet();
639
		   aRecList.AppendRecord( GetObjectManager().ProcessDrawing( GetSdrPage( mnScTab ) ) );
632
640
633
    // EOF
641
    // EOF
634
    Add( new ExcEof );
642
    Add( new ExcEof );
Lines 737-745 Link Here
737
        xTab->FillAsEmptyTable( nCodeNameIdx );
745
        xTab->FillAsEmptyTable( nCodeNameIdx );
738
    }
746
    }
739
747
740
    if ( GetBiff() == EXC_BIFF8 )
748
    if ( GetOutput() == EXC_OUTPUT_BINARY && GetBiff() == EXC_BIFF8 )
741
	{
749
    {
742
		// complete temporary Escher stream
750
        // complete temporary Escher stream
743
        GetObjectManager().EndDocument();
751
        GetObjectManager().EndDocument();
744
752
745
		// change tracking
753
		// change tracking
Lines 780-827 Link Here
780
		pExpChangeTrack->Write();
788
		pExpChangeTrack->Write();
781
}
789
}
782
790
783
void ExcDocument::WriteXml( SvStream& rStrm )
791
void ExcDocument::WriteXml( XclExpXmlStream& rStrm )
784
{
792
{
793
    SfxObjectShell* pDocShell = GetDocShell();
794
795
    using namespace ::com::sun::star;
796
    uno::Reference<document::XDocumentPropertiesSupplier> xDPS( pDocShell->GetModel(), uno::UNO_QUERY_THROW );
797
    uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties();
798
799
    rStrm.exportDocumentProperties( xDocProps );
800
801
    sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream();
802
    rWorkbook->startElement( XML_workbook,
803
            XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
804
            FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
805
            FSEND );
806
    rWorkbook->singleElement( XML_fileVersion,
807
            XML_appName, "Calc",
808
            // OOXTODO: XML_codeName
809
            // OOXTODO: XML_lastEdited
810
            // OOXTODO: XML_lowestEdited
811
            // OOXTODO: XML_rupBuild
812
            FSEND );
813
785
    if( !maTableList.IsEmpty() )
814
    if( !maTableList.IsEmpty() )
786
    {
815
    {
787
        InitializeSave();
816
        InitializeSave();
788
817
789
        XclExpXmlStream aStrm( ::comphelper::getProcessComponentContext(), rStrm, GetRoot() );
818
        aHeader.WriteXml( rStrm );
790
819
791
        sax_fastparser::FSHelperPtr& rWorkbook = aStrm.GetCurrentStream();
792
        rWorkbook->startElement( XML_workbook,
793
                XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
794
                FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
795
                FSEND );
796
        rWorkbook->singleElement( XML_fileVersion,
797
                XML_appName, "Calc",
798
                // OOXTODO: XML_codeName
799
                // OOXTODO: XML_lastEdited
800
                // OOXTODO: XML_lowestEdited
801
                // OOXTODO: XML_rupBuild
802
                FSEND );
803
804
        aHeader.WriteXml( aStrm );
805
806
        for( size_t nTab = 0, nTabCount = maTableList.GetSize(); nTab < nTabCount; ++nTab )
820
        for( size_t nTab = 0, nTabCount = maTableList.GetSize(); nTab < nTabCount; ++nTab )
807
        {
821
        {
808
            // set current stream position in BOUNDSHEET record
809
#if 0
810
            ExcBoundsheetRef xBoundsheet = maBoundsheetList.GetRecord( nTab );
811
            if( xBoundsheet.get() )
812
                xBoundsheet->SetStreamPos( aXclStrm.GetSvStreamPos() );
813
#endif
814
            // write the table
822
            // write the table
815
            maTableList.GetRecord( nTab )->WriteXml( aStrm );
823
            maTableList.GetRecord( nTab )->WriteXml( rStrm );
816
        }
824
        }
825
    }
817
826
818
        rWorkbook->endElement( XML_workbook );
827
    rWorkbook->endElement( XML_workbook );
819
        rWorkbook.reset();
828
    rWorkbook.reset();
820
        aStrm.commitStorage();
829
821
    }
830
    rStrm.commitStorage();
822
#if 0
823
    if( pExpChangeTrack )
824
        pExpChangeTrack->WriteXml();
825
#endif
826
}
831
}
827
832
(-)sc/source/filter/excel/expop2.cxx (-1 / +1 lines)
Lines 188-194 Link Here
188
    }
188
    }
189
189
190
    pExcDoc->ReadDoc();         // ScDoc -> ExcDoc
190
    pExcDoc->ReadDoc();         // ScDoc -> ExcDoc
191
    pExcDoc->WriteXml( aOut );  // wechstreamen
191
//    pExcDoc->WriteXml( aOut );  // wechstreamen
192
192
193
    if( pDocShell && xRootStrg.Is() )
193
    if( pDocShell && xRootStrg.Is() )
194
    {
194
    {
(-)sc/source/filter/excel/xestream.cxx (-19 / +31 lines)
Lines 40-45 Link Here
40
#include "xlstring.hxx"
40
#include "xlstring.hxx"
41
#include "xeroot.hxx"
41
#include "xeroot.hxx"
42
#include "xestyle.hxx"
42
#include "xestyle.hxx"
43
#include "xcl97rec.hxx"
43
#include "rangelst.hxx"
44
#include "rangelst.hxx"
44
#include "compiler.hxx"
45
#include "compiler.hxx"
45
46
Lines 814-844 Link Here
814
{
815
{
815
    return b ? "true" : "false";
816
    return b ? "true" : "false";
816
}
817
}
818
//zhaosz_xml
819
sax_fastparser::FSHelperPtr XclXmlUtils::WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int32 nValue )
820
{
821
    pStream->startElement( nElement, FSEND );
822
    pStream->write( nValue );
823
    pStream->endElement( nElement );
817
824
818
// ============================================================================
825
    return pStream;
826
}
819
827
820
XclExpXmlStream::XclExpXmlStream( const Reference< XComponentContext >& rxContext, SvStream& rStrm, const XclExpRoot& rRoot )
828
sax_fastparser::FSHelperPtr XclXmlUtils::WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int64 nValue )
821
    : XmlFilterBase( rxContext )
822
    , mrRoot( rRoot )
823
{
829
{
824
    Sequence< PropertyValue > aArgs( 1 );
830
    pStream->startElement( nElement, FSEND );
825
    const OUString sStream( RTL_CONSTASCII_USTRINGPARAM( "StreamForOutput" ) );
831
    pStream->write( nValue );
826
    aArgs[0].Name  = sStream;
832
    pStream->endElement( nElement );
827
    aArgs[0].Value <<= Reference< XStream > ( new OStreamWrapper( rStrm ) );
828
833
829
    XServiceInfo* pInfo = rRoot.GetDocModelObj();
834
    return pStream;
830
    Reference< XComponent > aComponent( pInfo, UNO_QUERY );
835
}
831
    setSourceDocument( aComponent );
832
    filter( aArgs );
833
836
834
    PushStream( CreateOutputStream(
837
sax_fastparser::FSHelperPtr XclXmlUtils::WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, const char* sValue )
835
                OUString::createFromAscii( "xl/workbook.xml" ),
838
{
836
                OUString::createFromAscii( "xl/workbook.xml" ),
839
    pStream->startElement( nElement, FSEND );
837
                Reference< XOutputStream >(),
840
    pStream->write( sValue );
838
                "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
841
    pStream->endElement( nElement );
839
                "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ) );
842
843
    return pStream;
840
}
844
}
845
// ============================================================================
841
846
847
XclExpXmlStream::XclExpXmlStream( const Reference< XComponentContext >& rxContext  )
848
    : XmlFilterBase( rxContext )
849
    , mpRoot( NULL )
850
{
851
}
852
842
XclExpXmlStream::~XclExpXmlStream()
853
XclExpXmlStream::~XclExpXmlStream()
843
{
854
{
844
}
855
}
Lines 961-967 Link Here
961
                // OOXTODO: XML_theme,      index into <clrScheme/>
972
                // OOXTODO: XML_theme,      index into <clrScheme/>
962
                // OOXTODO: XML_tint,       double
973
                // OOXTODO: XML_tint,       double
963
                FSEND );
974
                FSEND );
964
    lcl_WriteValue( rStream, XML_sz,         OString::valueOf( (double) (rFontData.mnHeight / 20.0) ).getStr() );  // Twips->Points
975
    //lcl_WriteValue( rStream, XML_sz,         OString::valueOf( ((double) (rFontData.mnHeight / 20.0)).getStr() ) );  // Twips->Pt
976
    lcl_WriteValue( rStream, XML_sz,         OString::valueOf( (double) (rFontData.mnHeight / 20.0) ).getStr() ); 
965
    lcl_WriteValue( rStream, XML_u,          bHaveUnderline ? pUnderline : NULL );
977
    lcl_WriteValue( rStream, XML_u,          bHaveUnderline ? pUnderline : NULL );
966
    lcl_WriteValue( rStream, XML_vertAlign,  bHaveVertAlign ? pVertAlign : NULL );
978
    lcl_WriteValue( rStream, XML_vertAlign,  bHaveVertAlign ? pVertAlign : NULL );
967
979
(-)sc/source/filter/excel/xestyle.cxx (+5 lines)
Lines 2271-2276 Link Here
2271
    else
2271
    else
2272
        sName = XclXmlUtils::ToOString( maName );
2272
        sName = XclXmlUtils::ToOString( maName );
2273
    sal_Int32 nXFId = rStrm.GetRoot().GetXFBuffer().GetXmlStyleIndex( maXFId.mnXFId );
2273
    sal_Int32 nXFId = rStrm.GetRoot().GetXFBuffer().GetXmlStyleIndex( maXFId.mnXFId );
2274
	//zhaosz_xml
2275
	const sal_Int32 maxId = 53;//this value gotten from ooxml validator
2276
	sal_uInt8 nSI = mnStyleId;
2277
	if(nSI > maxId)
2278
		nSI = maxId;
2274
    rStrm.GetCurrentStream()->singleElement( XML_cellStyle,
2279
    rStrm.GetCurrentStream()->singleElement( XML_cellStyle,
2275
            XML_name,           sName.getStr(),
2280
            XML_name,           sName.getStr(),
2276
            XML_xfId,           OString::valueOf( nXFId ).getStr(),
2281
            XML_xfId,           OString::valueOf( nXFId ).getStr(),
(-)sc/source/filter/inc/excdoc.hxx (-3 / +3 lines)
Lines 104-112 Link Here
104
    explicit                    ExcDocument( const XclExpRoot& rRoot );
104
    explicit                    ExcDocument( const XclExpRoot& rRoot );
105
    virtual                     ~ExcDocument();
105
    virtual                     ~ExcDocument();
106
106
107
	void				ReadDoc( void );
107
    void                ReadDoc( void );
108
	void				Write( SvStream& rSvStrm );
108
    void                Write( SvStream& rSvStrm );
109
	void				WriteXml( SvStream& rSvStrm );
109
    void                WriteXml( XclExpXmlStream& );
110
};
110
};
111
111
112
112
(-)sc/source/filter/inc/xcl97rec.hxx (+22 lines)
Lines 52-62 Link Here
52
    void                EndSheet();
52
    void                EndSheet();
53
53
54
    virtual void        Save( XclExpStream& rStrm );
54
    virtual void        Save( XclExpStream& rStrm );
55
	virtual void		SaveXml( XclExpXmlStream& rStrm );
56
	//zhaosz_xml
57
	static      void            ResetCounters();
55
58
56
private:
59
private:
57
    XclEscherEx&        mrEscherEx;
60
    XclEscherEx&        mrEscherEx;
58
    XclExpMsoDrawing*   pMsodrawingPerSheet;
61
    XclExpMsoDrawing*   pMsodrawingPerSheet;
59
    XclExpMsoDrawing*   pSolverContainer;
62
    XclExpMsoDrawing*   pSolverContainer;
63
	//zhaosz_xml
64
	static  int    mnDrawingMLCount, mnVmlCount;
65
	SCTAB               mnScTab;
60
};
66
};
61
67
62
68
Lines 78-83 Link Here
78
		sal_Bool				bFirstOnSheet;
84
		sal_Bool				bFirstOnSheet;
79
85
80
        bool                    mbOwnEscher;    /// true = Escher part created on the fly.
86
        bool                    mbOwnEscher;    /// true = Escher part created on the fly.
87
//zhaosz_xml
88
    SCTAB               mnScTab;
81
89
82
    /** @param bOwnEscher  If set to true, this object will create its escher data.
90
    /** @param bOwnEscher  If set to true, this object will create its escher data.
83
        See SetOwnEscher() for details. */
91
        See SetOwnEscher() for details. */
Lines 96-101 Link Here
96
    inline sal_uInt16           GetObjType() const { return mnObjType; }
104
    inline sal_uInt16           GetObjType() const { return mnObjType; }
97
105
98
	inline	void				SetId( sal_uInt16 nId )	{ nObjId = nId; }
106
	inline	void				SetId( sal_uInt16 nId )	{ nObjId = nId; }
107
	//zhaosz_xml
108
		inline	void				SetTab( SCTAB nScTab )	{ mnScTab = nScTab; }
109
	
110
		inline	SCTAB				GetTab() const			{ return mnScTab; }
99
111
100
	inline	void				SetLocked( sal_Bool b )
112
	inline	void				SetLocked( sal_Bool b )
101
									{ b ? nGrbit |= 0x0001 : nGrbit &= ~0x0001; }
113
									{ b ? nGrbit |= 0x0001 : nGrbit &= ~0x0001; }
Lines 217-229 Link Here
217
class XclObjAny : public XclObj
229
class XclObjAny : public XclObj
218
{
230
{
219
private:
231
private:
232
	//zhaosz_xml
233
 	 com::sun::star::uno::Reference< com::sun::star::drawing::XShape >  mxShape;
220
    virtual void                WriteSubRecs( XclExpStream& rStrm );
234
    virtual void                WriteSubRecs( XclExpStream& rStrm );
221
235
222
public:
236
public:
223
                                XclObjAny( XclExpObjectManager& rObjMgr );
237
                                XclObjAny( XclExpObjectManager& rObjMgr );
238
								XclObjAny( XclExpObjectManager& rObjMgr , 
239
									com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape);
224
	virtual						~XclObjAny();
240
	virtual						~XclObjAny();
225
241
226
	virtual	void				Save( XclExpStream& rStrm );
242
	virtual	void				Save( XclExpStream& rStrm );
243
	//zhaosz_xml
244
	
245
	void SaveXml( XclExpXmlStream& rStrm );
246
	com::sun::star::uno::Reference< com::sun::star::drawing::XShape >  GetShape() const { return mxShape; }
247
	static void                 WriteFromTo( XclExpXmlStream& rStrm, const XclObjAny& rObj );
248
       static void                 WriteFromTo( XclExpXmlStream& rStrm, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape, SCTAB nTab );
227
};
249
};
228
250
229
251
(-)sc/source/filter/inc/xestream.hxx (+6 lines)
Lines 264-269 Link Here
264
    (s.Len() && s.GetChar( 0 ) != 0 ? XclXmlUtils::ToOString( s ).getStr() : NULL)
264
    (s.Len() && s.GetChar( 0 ) != 0 ? XclXmlUtils::ToOString( s ).getStr() : NULL)
265
265
266
class ScAddress;
266
class ScAddress;
267
class ScDocShell;
267
class ScDocument;
268
class ScDocument;
268
class ScRange;
269
class ScRange;
269
class ScRangeList;
270
class ScRangeList;
Lines 298-303 Link Here
298
    static ::rtl::OUString ToOUString( ScDocument& rDocument, const ScAddress& rAddress, ScTokenArray* pTokenArray );
299
    static ::rtl::OUString ToOUString( ScDocument& rDocument, const ScAddress& rAddress, ScTokenArray* pTokenArray );
299
    static ::rtl::OUString ToOUString( const XclExpString& s );
300
    static ::rtl::OUString ToOUString( const XclExpString& s );
300
    static const char* ToPsz( bool b );
301
    static const char* ToPsz( bool b );
302
	//zhaosz_xml
303
	 static sax_fastparser::FSHelperPtr  WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int32 nValue );
304
    static sax_fastparser::FSHelperPtr  WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int64 nValue );
305
    static sax_fastparser::FSHelperPtr  WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, const char* sValue );
306
    
301
};
307
};
302
308
303
class XclExpXmlStream : public oox::core::XmlFilterBase
309
class XclExpXmlStream : public oox::core::XmlFilterBase
(-)sc/source/filter/xcl97/xcl97esc.cxx (-1 / +1 lines)
Lines 270-276 Link Here
270
        {
270
        {
271
            // #107540# ignore permanent note shapes
271
            // #107540# ignore permanent note shapes
272
            // #i12190# do not ignore callouts (do not filter by object type ID)
272
            // #i12190# do not ignore callouts (do not filter by object type ID)
273
            pCurrXclObj = new XclObjAny( mrObjMgr );   // just a metafile
273
            pCurrXclObj = new XclObjAny( mrObjMgr ,rxShape );   // just a metafile
274
        }
274
        }
275
	}
275
	}
276
	if ( pCurrXclObj )
276
	if ( pCurrXclObj )
(-)sc/source/filter/xcl97/xcl97rec.cxx (+171 lines)
Lines 72-77 Link Here
72
#include "docoptio.hxx"
72
#include "docoptio.hxx"
73
#include "patattr.hxx"
73
#include "patattr.hxx"
74
#include "tabprotection.hxx"
74
#include "tabprotection.hxx"
75
//zhaosz_xml
76
#include <oox/export/utils.hxx>
77
#include <oox/export/vmlexport.hxx>
78
#include <oox/export/shapes.hxx>
79
#include "oox/token/tokens.hxx"
75
80
76
using namespace ::oox;
81
using namespace ::oox;
77
82
Lines 82-92 Link Here
82
using ::com::sun::star::uno::UNO_QUERY;
87
using ::com::sun::star::uno::UNO_QUERY;
83
using ::com::sun::star::beans::XPropertySet;
88
using ::com::sun::star::beans::XPropertySet;
84
using ::com::sun::star::drawing::XShape;
89
using ::com::sun::star::drawing::XShape;
90
//zhaosz_xml
91
using ::oox::drawingml::ShapeExport;
92
using ::oox::drawingml::DrawingML;
85
93
94
//zhaosz_xml
95
 int XclExpObjList::mnDrawingMLCount=0;
96
 int XclExpObjList::mnVmlCount=0;
97
98
void XclExpObjList::ResetCounters()
99
{
100
    mnDrawingMLCount    = 0;
101
    mnVmlCount          = 0;
102
}
103
86
// ============================================================================
104
// ============================================================================
87
105
88
XclExpObjList::XclExpObjList( const XclExpRoot& rRoot, XclEscherEx& rEscherEx ) :
106
XclExpObjList::XclExpObjList( const XclExpRoot& rRoot, XclEscherEx& rEscherEx ) :
89
    XclExpRoot( rRoot ),
107
    XclExpRoot( rRoot ),
108
	mnScTab( rRoot.GetCurrScTab() ),//zhaosz_xml
90
    mrEscherEx( rEscherEx ),
109
    mrEscherEx( rEscherEx ),
91
    pSolverContainer( 0 )
110
    pSolverContainer( 0 )
92
{
111
{
Lines 114-119 Link Here
114
		Insert( pObj, LIST_APPEND );
133
		Insert( pObj, LIST_APPEND );
115
		sal_uInt16 nCnt = (sal_uInt16) Count();
134
		sal_uInt16 nCnt = (sal_uInt16) Count();
116
		pObj->SetId( nCnt );
135
		pObj->SetId( nCnt );
136
		//zhaosz_xml
137
		pObj->SetTab( mnScTab );
138
		
117
		return nCnt;
139
		return nCnt;
118
	}
140
	}
119
	else
141
	else
Lines 144-150 Link Here
144
    if( pSolverContainer )
166
    if( pSolverContainer )
145
        pSolverContainer->Save( rStrm );
167
        pSolverContainer->Save( rStrm );
146
}
168
}
169
//zhaosz_xml
170
static bool IsVmlObject( const XclObj& rObj )
171
{
172
    switch( rObj.GetObjType() )
173
    {
174
        case EXC_OBJTYPE_NOTE:
175
            return true;
176
        default:
177
            return false;
178
    }
179
}
147
180
181
static void SaveDrawingMLObjects( XclExpObjList& rList, XclExpXmlStream& rStrm, int& nDrawingMLCount )
182
{
183
  
184
185
    sal_Int32 nDrawing = ++nDrawingMLCount;
186
    OUString sId;
187
    sax_fastparser::FSHelperPtr pDrawing = rStrm.CreateOutputStream(
188
            XclXmlUtils::GetStreamName( "xl/", "drawings/drawing", nDrawing ),
189
            XclXmlUtils::GetStreamName( "../", "drawings/drawing", nDrawing ),
190
            rStrm.GetCurrentStream()->getOutputStream(),
191
            "application/vnd.openxmlformats-officedocument.drawing+xml",
192
            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
193
            &sId );
194
195
    rStrm.GetCurrentStream()->singleElement( XML_drawing,
196
            FSNS( XML_r, XML_id ),  XclXmlUtils::ToOString( sId ).getStr(),
197
            FSEND );
198
199
    rStrm.PushStream( pDrawing );
200
    pDrawing->startElement( FSNS( XML_xdr, XML_wsDr ),
201
            FSNS( XML_xmlns, XML_xdr ), "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
202
            FSNS( XML_xmlns, XML_a ),   "http://schemas.openxmlformats.org/drawingml/2006/main",
203
            FSNS( XML_xmlns, XML_r ),   "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
204
            FSEND );
205
206
    for ( XclObj* p = rList.First(); p; p = rList.Next() )
207
    {
208
      	// if( p->GetObjType() != 0 )//zhaosz_xml, obj is a group
209
        if( IsVmlObject( *p ) || p->GetObjType()==0)
210
            continue;
211
		p->SaveXml( rStrm );
212
    }
213
214
    pDrawing->endElement( FSNS( XML_xdr, XML_wsDr ) );
215
216
    rStrm.PopStream();
217
}
218
219
void XclExpObjList::SaveXml( XclExpXmlStream& rStrm )
220
{
221
    
222
    if( pSolverContainer )
223
         pSolverContainer->SaveXml( rStrm );
224
225
    if( Count() == 0 )
226
        return;
227
228
    SaveDrawingMLObjects( *this, rStrm, mnDrawingMLCount );
229
    //SaveVmlObjects( *this, rStrm, mnVmlCount );
230
    
231
}
232
148
// --- class XclObj --------------------------------------------------
233
// --- class XclObj --------------------------------------------------
149
234
150
XclObj::XclObj( XclExpObjectManager& rObjMgr, sal_uInt16 nObjType, bool bOwnEscher ) :
235
XclObj::XclObj( XclExpObjectManager& rObjMgr, sal_uInt16 nObjType, bool bOwnEscher ) :
Lines 672-677 Link Here
672
    XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN )
757
    XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN )
673
{
758
{
674
}
759
}
760
//zhaosz_xml
761
XclObjAny::XclObjAny( XclExpObjectManager& rObjMgr,Reference< XShape > xShape ) :
762
    XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN ),
763
	mxShape( xShape)
764
{
765
}
675
766
676
XclObjAny::~XclObjAny()
767
XclObjAny::~XclObjAny()
677
{
768
{
Lines 693-699 Link Here
693
	// content of this record
784
	// content of this record
694
	XclObj::Save( rStrm );
785
	XclObj::Save( rStrm );
695
}
786
}
787
//zhaosz_xml
788
static const char* GetEditAs( XclObjAny& rObj )
789
{
790
    if( const SdrObject* pShape = EscherEx::GetSdrObject( rObj.GetShape() ) )
791
    {
792
        // OOXTODO: returning "twoCell"
793
        switch( ScDrawLayer::GetAnchorType( *pShape ) )
794
        {
795
            case SCA_CELL:  return "oneCell";
796
            default:        break;
797
        }
798
    }
799
    return "absolute";
800
}
696
801
802
void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, const Reference< XShape >& rShape, SCTAB nTab )
803
{
804
    sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream();
805
806
    awt::Point  aTopLeft    = rShape->getPosition();
807
    awt::Size   aSize       = rShape->getSize();
808
    Rectangle   aLocation( aTopLeft.X, aTopLeft.Y, aTopLeft.X + aSize.Width, aTopLeft.Y + aSize.Height );
809
    ScRange     aRange      = rStrm.GetRoot().GetDoc().GetRange( nTab, aLocation );
810
    Rectangle   aRangeRect  = rStrm.GetRoot().GetDoc().GetMMRect( aRange.aStart.Col(), aRange.aStart.Row(),
811
            aRange.aEnd.Col()-1, aRange.aEnd.Row()-1,
812
            nTab );
813
814
815
    pDrawing->startElement( FSNS( XML_xdr, XML_from ),
816
            FSEND );
817
    XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_col ), (sal_Int32) aRange.aStart.Col() );
818
    XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_colOff ),
819
            MM100toEMU( aLocation.Left() - aRangeRect.Left() ) );
820
    XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_row ), (sal_Int32) aRange.aStart.Row() );
821
    XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_rowOff ),
822
            MM100toEMU( aLocation.Top() - aRangeRect.Top() ) );
823
    pDrawing->endElement( FSNS( XML_xdr, XML_from ) );
824
825
    pDrawing->startElement( FSNS( XML_xdr, XML_to ),
826
            FSEND );
827
    XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_col ), (sal_Int32) aRange.aEnd.Col() );
828
    XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_colOff ),
829
            MM100toEMU( aLocation.Right() - aRangeRect.Right() ) );
830
    XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_row ), (sal_Int32) aRange.aEnd.Row() );
831
    XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_rowOff ),
832
            MM100toEMU( aLocation.Bottom() - aRangeRect.Bottom() ) );
833
    pDrawing->endElement( FSNS( XML_xdr, XML_to ) );
834
}
835
836
void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, const XclObjAny& rObj )
837
{
838
    WriteFromTo( rStrm, rObj.GetShape(), rObj.GetTab() );
839
}
840
841
void XclObjAny::SaveXml( XclExpXmlStream& rStrm )
842
{
843
    if( !mxShape.is() )
844
        return;
845
846
    sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream();
847
848
    ShapeExport aDML( XML_xdr, pDrawing, NULL, &rStrm, DrawingML::DOCUMENT_XLSX );
849
	
850
    pDrawing->startElement( FSNS( XML_xdr, XML_twoCellAnchor ), // OOXTODO: oneCellAnchor, absoluteAnchor
851
            XML_editAs, GetEditAs( *this ),
852
            FSEND );
853
    Reference< XPropertySet > xPropSet( mxShape, UNO_QUERY );
854
    if (xPropSet.is())
855
    {
856
        WriteFromTo( rStrm, *this );
857
		//zhaosz_xml
858
        aDML.WriteShape( mxShape );
859
    }
860
861
    pDrawing->singleElement( FSNS( XML_xdr, XML_clientData),
862
            // OOXTODO: XML_fLocksWithSheet
863
            // OOXTODO: XML_fPrintsWithSheet
864
            FSEND );
865
    pDrawing->endElement( FSNS( XML_xdr, XML_twoCellAnchor ) );
866
}
867
697
// --- class ExcBof8_Base --------------------------------------------
868
// --- class ExcBof8_Base --------------------------------------------
698
869
699
ExcBof8_Base::ExcBof8_Base()
870
ExcBof8_Base::ExcBof8_Base()

Return to issue 124277