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 |
|