merge the formfield patch from ooo-build
[ooovba.git] / writerfilter / source / dmapper / GraphicImport.cxx
blob31519f8de89f45009ac443557864ac44ba50af41
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: GraphicImport.cxx,v $
11 * $Revision: 1.14 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #include "GraphicImport.hxx"
33 #include "GraphicHelpers.hxx"
35 #include <dmapper/DomainMapper.hxx>
36 #include <PropertyMap.hxx>
37 #include <doctok/resourceids.hxx>
38 #include <ooxml/resourceids.hxx>
39 #include <ConversionHelper.hxx>
40 #include <com/sun/star/uno/XComponentContext.hpp>
41 #include <com/sun/star/io/XInputStream.hpp>
42 #include <cppuhelper/implbase1.hxx>
43 #include <com/sun/star/awt/Size.hpp>
44 #include <com/sun/star/container/XNamed.hpp>
45 #include <com/sun/star/drawing/ColorMode.hpp>
47 #include <com/sun/star/graphic/XGraphicProvider.hpp>
48 #include <com/sun/star/graphic/XGraphic.hpp>
49 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
50 #include <com/sun/star/table/BorderLine.hpp>
51 #include <com/sun/star/text/GraphicCrop.hpp>
52 #include <com/sun/star/text/XTextContent.hpp>
53 #include <com/sun/star/text/TextContentAnchorType.hpp>
54 #include <com/sun/star/text/HoriOrientation.hpp>
55 #include <com/sun/star/text/RelOrientation.hpp>
56 #include <com/sun/star/text/VertOrientation.hpp>
57 #include <com/sun/star/text/WrapTextMode.hpp>
58 #include <com/sun/star/drawing/XShape.hpp>
59 #include <rtl/ustrbuf.hxx>
62 #include <iostream>
63 #include <resourcemodel/QNameToString.hxx>
64 #include <string.h>
66 #ifdef DEBUG_DOMAINMAPPER
67 #include <resourcemodel/TagLogger.hxx>
68 #endif
70 namespace writerfilter {
71 namespace dmapper
73 using namespace ::std;
74 using namespace ::com::sun::star;
76 #ifdef DEBUG_DOMAINMAPPER
77 extern TagLogger::Pointer_t dmapper_logger;
78 #endif
80 class XInputStreamHelper : public cppu::WeakImplHelper1
81 < io::XInputStream >
83 const sal_uInt8* m_pBuffer;
84 const sal_Int32 m_nLength;
85 sal_Int32 m_nPosition;
86 bool m_bBmp;
88 const sal_uInt8* m_pBMPHeader; //default BMP-header
89 sal_Int32 m_nHeaderLength;
90 public:
91 XInputStreamHelper(const sal_uInt8* buf, size_t len, bool bBmp);
92 ~XInputStreamHelper();
94 virtual ::sal_Int32 SAL_CALL readBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead ) throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException);
95 virtual ::sal_Int32 SAL_CALL readSomeBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead ) throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException);
96 virtual void SAL_CALL skipBytes( ::sal_Int32 nBytesToSkip ) throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException);
97 virtual ::sal_Int32 SAL_CALL available( ) throw (io::NotConnectedException, io::IOException, uno::RuntimeException);
98 virtual void SAL_CALL closeInput( ) throw (io::NotConnectedException, io::IOException, uno::RuntimeException);
100 /*-- 01.11.2006 13:56:20---------------------------------------------------
102 -----------------------------------------------------------------------*/
103 XInputStreamHelper::XInputStreamHelper(const sal_uInt8* buf, size_t len, bool bBmp) :
104 m_pBuffer( buf ),
105 m_nLength( len ),
106 m_nPosition( 0 ),
107 m_bBmp( bBmp )
109 static const sal_uInt8 aHeader[] =
110 {0x42, 0x4d, 0xe6, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 };
111 m_pBMPHeader = aHeader;
112 m_nHeaderLength = m_bBmp ? sizeof( aHeader ) / sizeof(sal_uInt8) : 0;
115 /*-- 01.11.2006 13:56:20---------------------------------------------------
117 -----------------------------------------------------------------------*/
118 XInputStreamHelper::~XInputStreamHelper()
121 /*-- 01.11.2006 13:56:21---------------------------------------------------
123 -----------------------------------------------------------------------*/
124 ::sal_Int32 XInputStreamHelper::readBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead )
125 throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
127 return readSomeBytes( aData, nBytesToRead );
129 /*-- 01.11.2006 13:56:21---------------------------------------------------
131 -----------------------------------------------------------------------*/
132 ::sal_Int32 XInputStreamHelper::readSomeBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead )
133 throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
135 sal_Int32 nRet = 0;
136 if( nMaxBytesToRead > 0 )
138 if( nMaxBytesToRead > (m_nLength + m_nHeaderLength) - m_nPosition )
139 nRet = (m_nLength + m_nHeaderLength) - m_nPosition;
140 else
141 nRet = nMaxBytesToRead;
142 aData.realloc( nRet );
143 sal_Int8* pData = aData.getArray();
144 sal_Int32 nHeaderRead = 0;
145 if( m_nPosition < m_nHeaderLength)
147 //copy header content first
148 nHeaderRead = m_nHeaderLength - m_nPosition;
149 memcpy( pData, m_pBMPHeader + (m_nPosition ), nHeaderRead );
150 nRet -= nHeaderRead;
151 m_nPosition += nHeaderRead;
153 if( nRet )
155 memcpy( pData + nHeaderRead, m_pBuffer + (m_nPosition - m_nHeaderLength), nRet );
156 m_nPosition += nRet;
159 return nRet;
161 /*-- 01.11.2006 13:56:21---------------------------------------------------
163 -----------------------------------------------------------------------*/
164 void XInputStreamHelper::skipBytes( ::sal_Int32 nBytesToSkip ) throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
166 if( nBytesToSkip < 0 || m_nPosition + nBytesToSkip > (m_nLength + m_nHeaderLength))
167 throw io::BufferSizeExceededException();
168 m_nPosition += nBytesToSkip;
170 /*-- 01.11.2006 13:56:22---------------------------------------------------
172 -----------------------------------------------------------------------*/
173 ::sal_Int32 XInputStreamHelper::available( ) throw (io::NotConnectedException, io::IOException, uno::RuntimeException)
175 return ( m_nLength + m_nHeaderLength ) - m_nPosition;
177 /*-- 01.11.2006 13:56:22---------------------------------------------------
179 -----------------------------------------------------------------------*/
180 void XInputStreamHelper::closeInput( ) throw (io::NotConnectedException, io::IOException, uno::RuntimeException)
183 /*-- 02.11.2006 09:34:29---------------------------------------------------
185 -----------------------------------------------------------------------*/
186 struct GraphicBorderLine
188 sal_Int32 nLineWidth;
189 // sal_Int32 nLineType;
190 sal_Int32 nLineColor;
191 sal_Int32 nLineDistance;
192 bool bHasShadow;
194 GraphicBorderLine() :
195 nLineWidth(0)
196 // ,nLineType(0)
197 ,nLineColor(0)
198 ,nLineDistance(0)
199 ,bHasShadow(false)
204 class GraphicImport_Impl
206 private:
207 sal_Int32 nXSize;
208 bool bXSizeValid;
209 sal_Int32 nYSize;
210 bool bYSizeValid;
212 public:
213 GraphicImportType eGraphicImportType;
214 DomainMapper& rDomainMapper;
216 sal_Int32 nHoriScaling;
217 sal_Int32 nVertScaling;
218 sal_Int32 nLeftPosition;
219 sal_Int32 nTopPosition;
220 sal_Int32 nRightPosition;
221 sal_Int32 nBottomPosition;
222 sal_Int32 nLeftCrop;
223 sal_Int32 nTopCrop;
224 sal_Int32 nRightCrop;
225 sal_Int32 nBottomCrop;
227 bool bUseSimplePos;
229 sal_Int16 nHoriOrient;
230 sal_Int16 nHoriRelation;
231 bool bPageToggle;
232 sal_Int16 nVertOrient;
233 sal_Int16 nVertRelation;
234 sal_Int32 nWrap;
235 bool bOpaque;
236 bool bContour;
237 bool bIgnoreWRK;
239 sal_Int32 nLeftMargin;
240 sal_Int32 nRightMargin;
241 sal_Int32 nTopMargin;
242 sal_Int32 nBottomMargin;
244 sal_Int32 nContrast;
245 sal_Int32 nBrightness;
246 double fGamma;
248 sal_Int32 nFillColor;
250 drawing::ColorMode eColorMode;
252 GraphicBorderLine aBorders[4];
253 sal_Int32 nCurrentBorderLine;
255 sal_Int32 nDffType;
256 bool bIsGraphic;
257 bool bIsBitmap;
258 bool bIsTiff;
259 sal_Int32 nBitsPerPixel;
261 bool bHoriFlip;
262 bool bVertFlip;
264 bool bSizeProtected;
265 bool bPositionProtected;
267 bool bInShapeOptionMode;
268 sal_Int32 nShapeOptionType;
270 ::rtl::OUString sName;
271 ::rtl::OUString sAlternativeText;
273 GraphicImport_Impl(GraphicImportType eImportType, DomainMapper& rDMapper) :
274 nXSize(0)
275 ,bXSizeValid(false)
276 ,nYSize(0)
277 ,bYSizeValid(false)
278 ,eGraphicImportType( eImportType )
279 ,rDomainMapper( rDMapper )
280 ,nHoriScaling(0)
281 ,nVertScaling(0)
282 ,nLeftPosition(0)
283 ,nTopPosition(0)
284 ,nRightPosition(0)
285 ,nBottomPosition(0)
286 ,nLeftCrop(0)
287 ,nTopCrop (0)
288 ,nRightCrop (0)
289 ,nBottomCrop(0)
290 ,bUseSimplePos(false)
291 ,nHoriOrient( text::HoriOrientation::NONE )
292 ,nHoriRelation( text::RelOrientation::FRAME )
293 ,bPageToggle( false )
294 ,nVertOrient( text::VertOrientation::NONE )
295 ,nVertRelation( text::RelOrientation::FRAME )
296 ,nWrap(0)
297 ,bOpaque( true )
298 ,bContour(false)
299 ,bIgnoreWRK(true)
300 ,nLeftMargin(319)
301 ,nRightMargin(319)
302 ,nTopMargin(0)
303 ,nBottomMargin(0)
304 ,nContrast(0)
305 ,nBrightness(0)
306 ,fGamma( -1.0 )
307 ,nFillColor( 0xffffffff )
308 ,eColorMode( drawing::ColorMode_STANDARD )
309 ,nCurrentBorderLine(BORDER_TOP)
310 ,nDffType( 0 )
311 ,bIsGraphic(false)
312 ,bIsBitmap(false)
313 ,bIsTiff(false)
314 ,nBitsPerPixel(0)
315 ,bHoriFlip(false)
316 ,bVertFlip(false)
317 ,bSizeProtected(false)
318 ,bPositionProtected(false)
319 ,bInShapeOptionMode(false)
322 void setXSize(sal_Int32 _nXSize)
324 nXSize = _nXSize;
325 bXSizeValid = true;
328 sal_uInt32 getXSize() const
330 return nXSize;
333 bool isXSizeValid() const
335 return bXSizeValid;
338 void setYSize(sal_Int32 _nYSize)
340 nYSize = _nYSize;
341 bYSizeValid = true;
344 sal_uInt32 getYSize() const
346 return nYSize;
349 bool isYSizeValis () const
351 return bYSizeValid;
354 /*-- 01.11.2006 09:42:42---------------------------------------------------
356 -----------------------------------------------------------------------*/
357 GraphicImport::GraphicImport(uno::Reference < uno::XComponentContext > xComponentContext,
358 uno::Reference< lang::XMultiServiceFactory > xTextFactory,
359 DomainMapper& rDMapper,
360 GraphicImportType eImportType )
361 : m_pImpl( new GraphicImport_Impl( eImportType, rDMapper ))
362 ,m_xComponentContext( xComponentContext )
363 ,m_xTextFactory( xTextFactory)
366 /*-- 01.11.2006 09:42:42---------------------------------------------------
368 -----------------------------------------------------------------------*/
369 GraphicImport::~GraphicImport()
371 delete m_pImpl;
373 /*-- 01.11.2006 09:45:01---------------------------------------------------
375 -----------------------------------------------------------------------*/
376 void GraphicImport::attribute(Id nName, Value & val)
378 #ifdef DEBUG_DOMAINMAPPER
379 dmapper_logger->startElement("attribute");
380 dmapper_logger->attribute("name", (*QNameToString::Instance())(nName));
381 #endif
382 sal_Int32 nIntValue = val.getInt();
383 /* WRITERFILTERSTATUS: table: PICFattribute */
384 switch( nName )
386 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
387 case NS_rtf::LN_LCB: break;//byte count
388 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
389 case NS_rtf::LN_CBHEADER: break;//ignored
390 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
391 case NS_rtf::LN_MFP: //MetafilePict
392 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
393 case NS_rtf::LN_DffRecord: //dff record - expands to an sprm which expands to ...
394 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
395 case NS_rtf::LN_shpopt: //shape options
396 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
397 case NS_rtf::LN_shpfbse: //BLIP store entry
398 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
399 case NS_rtf::LN_BRCTOP: //top border
400 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
401 case NS_rtf::LN_BRCLEFT: //left border
402 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
403 case NS_rtf::LN_BRCBOTTOM: //bottom border
404 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
405 case NS_rtf::LN_BRCRIGHT: //right border
406 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
407 case NS_rtf::LN_shape: //shape
408 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
409 case NS_rtf::LN_blip: //the binary graphic data in a shape
411 switch(nName)
413 case NS_rtf::LN_BRCTOP: //top border
414 m_pImpl->nCurrentBorderLine = BORDER_TOP;
415 break;
416 case NS_rtf::LN_BRCLEFT: //left border
417 m_pImpl->nCurrentBorderLine = BORDER_LEFT;
418 break;
419 case NS_rtf::LN_BRCBOTTOM: //bottom border
420 m_pImpl->nCurrentBorderLine = BORDER_BOTTOM;
421 break;
422 case NS_rtf::LN_BRCRIGHT: //right border
423 m_pImpl->nCurrentBorderLine = BORDER_RIGHT;
424 break;
425 case NS_rtf::LN_shpopt:
426 m_pImpl->bInShapeOptionMode = true;
427 break;
428 default:;
430 writerfilter::Reference<Properties>::Pointer_t pProperties = val.getProperties();
431 if( pProperties.get())
433 pProperties->resolve(*this);
435 switch(nName)
437 case NS_rtf::LN_shpopt:
438 m_pImpl->bInShapeOptionMode = false;
439 break;
440 default:;
443 break;
444 case NS_rtf::LN_payload :
446 writerfilter::Reference<BinaryObj>::Pointer_t pPictureData = val.getBinary();
447 if( pPictureData.get())
448 pPictureData->resolve(*this);
450 break;
451 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
452 case NS_rtf::LN_BM_RCWINMF: //windows bitmap structure - if it's a bitmap
453 break;
454 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
455 case NS_rtf::LN_DXAGOAL: //x-size in twip
456 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
457 case NS_rtf::LN_DYAGOAL: //y-size in twip
458 break;
459 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
460 case NS_rtf::LN_MX: m_pImpl->nHoriScaling = nIntValue; break;// hori scaling in 0.001%
461 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
462 case NS_rtf::LN_MY: m_pImpl->nVertScaling = nIntValue; break;// vert scaling in 0.001%
463 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
464 case NS_rtf::LN_DXACROPLEFT: m_pImpl->nLeftCrop = ConversionHelper::convertTwipToMM100(nIntValue); break;// left crop in twips
465 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
466 case NS_rtf::LN_DYACROPTOP: m_pImpl->nTopCrop = ConversionHelper::convertTwipToMM100(nIntValue); break;// top crop in twips
467 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
468 case NS_rtf::LN_DXACROPRIGHT: m_pImpl->nRightCrop = ConversionHelper::convertTwipToMM100(nIntValue); break;// right crop in twips
469 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
470 case NS_rtf::LN_DYACROPBOTTOM: m_pImpl->nBottomCrop = ConversionHelper::convertTwipToMM100(nIntValue); break;// bottom crop in twips
471 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
472 case NS_rtf::LN_BRCL: break;//border type - legacy -
473 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
474 case NS_rtf::LN_FFRAMEEMPTY: break;// picture consists of a single frame
475 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
476 case NS_rtf::LN_FBITMAP:
477 m_pImpl->bIsBitmap = nIntValue > 0 ? true : false;
478 break;//1 if it's a bitmap ???
479 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
480 case NS_rtf::LN_FDRAWHATCH: break;//1 if it's an active OLE object
481 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
482 case NS_rtf::LN_FERROR: break;// 1 if picture is an error message
483 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
484 case NS_rtf::LN_BPP: m_pImpl->nBitsPerPixel = nIntValue; break;//bits per pixel 0 - unknown, 1- mono, 4 - VGA
486 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
487 case NS_rtf::LN_DXAORIGIN: //horizontal offset of hand annotation origin
488 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
489 case NS_rtf::LN_DYAORIGIN: //vertical offset of hand annotation origin
490 break;
491 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
492 case NS_rtf::LN_CPROPS:break;// unknown - ignored
493 //metafilepict
494 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
495 case NS_rtf::LN_MM:
496 // according to the documentation 99 or 98 are provided - but they are not!
497 // m_pImpl->bIsBitmap = 99 == nIntValue ? true : false;
498 // m_pImpl->bIsTiff = 98 == nIntValue ? true : false;
500 break; //mapmode
501 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
502 case NS_rtf::LN_XEXT:
503 m_pImpl->setXSize(nIntValue);
504 break; // x-size
505 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
506 case NS_rtf::LN_YEXT:
507 m_pImpl->setYSize(nIntValue);
508 break; // y-size
509 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
510 case NS_rtf::LN_HMF: break; //identifier - ignored
512 //sprm 0xf004 and 0xf008, 0xf00b
513 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
514 case NS_rtf::LN_dfftype://
515 m_pImpl->nDffType = nIntValue;
516 break;
517 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
518 case NS_rtf::LN_dffinstance:
519 //todo: does this still work for PICF?
520 //in case of LN_dfftype == 0xf01f the instance contains the bitmap type:
521 if(m_pImpl->nDffType == 0xf01f)
522 switch( nIntValue )
524 case 0x216 : // Metafile header then compressed WMF
526 case 0x3D4 : // Metafile header then compressed EMF
528 case 0x542 : // Metafile hd. then compressed PICT
532 // rBLIPStream.SeekRel( nSkip + 20 );
533 // // read in size of metafile in EMUS
534 // rBLIPStream >> aMtfSize100.Width() >> aMtfSize100.Height();
535 // // scale to 1/100mm
536 // aMtfSize100.Width() /= 360, aMtfSize100.Height() /= 360;
537 // if ( pVisArea ) // seem that we currently are skipping the visarea position
538 // *pVisArea = Rectangle( Point(), aMtfSize100 );
539 // // skip rest of header
540 // nSkip = 6;
541 // bMtfBLIP = bZCodecCompression = TRUE;
544 break;
546 case 0x46A : break;// One byte tag then JPEG (= JFIF) data
548 case 0x6E0 : break;// One byte tag then PNG data
550 case 0x7A8 : m_pImpl->bIsBitmap = true;
551 // nSkip += 1; // One byte tag then DIB data
552 break;
555 break;
556 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
557 case NS_rtf::LN_dffversion:// ignored
558 break;
560 //sprm 0xf008
561 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
562 case NS_rtf::LN_shptype: break;
563 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
564 case NS_rtf::LN_shpid: break;
565 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
566 case NS_rtf::LN_shpfGroup: break;// This shape is a group shape
567 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
568 case NS_rtf::LN_shpfChild: break;// Not a top-level shape
569 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
570 case NS_rtf::LN_shpfPatriarch: break;// This is the topmost group shape. Exactly one of these per drawing.
571 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
572 case NS_rtf::LN_shpfDeleted: break;// The shape has been deleted
573 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
574 case NS_rtf::LN_shpfOleShape: break;// The shape is an OLE object
575 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
576 case NS_rtf::LN_shpfHaveMaster: break;// Shape has a hspMaster property
577 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
578 case NS_rtf::LN_shpfFlipH: // Shape is flipped horizontally
579 m_pImpl->bHoriFlip = nIntValue ? true : false;
580 break;
581 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
582 case NS_rtf::LN_shpfFlipV: // Shape is flipped vertically
583 m_pImpl->bVertFlip = nIntValue ? true : false;
584 break;
585 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
586 case NS_rtf::LN_shpfConnector: break;// Connector type of shape
587 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
588 case NS_rtf::LN_shpfHaveAnchor: break;// Shape has an anchor of some kind
589 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
590 case NS_rtf::LN_shpfBackground: break;// Background shape
591 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
592 case NS_rtf::LN_shpfHaveSpt: break;// Shape has a shape type property
593 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
594 case NS_rtf::LN_shptypename: break;// shape type name
595 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
596 case NS_rtf::LN_shppid: m_pImpl->nShapeOptionType = nIntValue; break; //type of shape option
597 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
598 case NS_rtf::LN_shpfBid: break; //ignored
599 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
600 case NS_rtf::LN_shpfComplex:break;
601 /* WRITERFILTERSTATUS: done: 50, planned: 10, spent: 5 */
602 case NS_rtf::LN_shpop:
604 if(NS_dff::LN_shpwzDescription != sal::static_int_cast<Id>(m_pImpl->nShapeOptionType) )
605 ProcessShapeOptions( val );
607 break;
608 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
609 case NS_rtf::LN_shpname: break;
610 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
611 case NS_rtf::LN_shpvalue:
613 if( NS_dff::LN_shpwzDescription == sal::static_int_cast<Id>(m_pImpl->nShapeOptionType) )
614 ProcessShapeOptions( val );
616 break;
618 //BLIP store entry
619 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
620 case NS_rtf::LN_shpbtWin32: break;
621 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
622 case NS_rtf::LN_shpbtMacOS: break;
623 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
624 case NS_rtf::LN_shprgbUid: break;
625 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
626 case NS_rtf::LN_shptag: break;
627 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
628 case NS_rtf::LN_shpsize: break;
629 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
630 case NS_rtf::LN_shpcRef: break;
631 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
632 case NS_rtf::LN_shpfoDelay: break;
633 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
634 case NS_rtf::LN_shpusage: break;
635 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
636 case NS_rtf::LN_shpcbName: break;
637 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
638 case NS_rtf::LN_shpunused2: break;
639 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
640 case NS_rtf::LN_shpunused3: break;
642 //border properties
643 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
644 case NS_rtf::LN_shpblipbname : break;
646 /* WRITERFILTERSTATUS: done: 100, planned: 1, spent: 1 */
647 case NS_rtf::LN_DPTLINEWIDTH: // 0x1759
648 m_pImpl->aBorders[m_pImpl->nCurrentBorderLine].nLineWidth = nIntValue;
649 break;
650 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
651 case NS_rtf::LN_BRCTYPE: // 0x175a
652 //graphic borders don't support different line types
653 //m_pImpl->aBorders[m_pImpl->nCurrentBorderLine].nLineType = nIntValue;
654 break;
655 /* WRITERFILTERSTATUS: done: 100, planned: 1, spent: 1 */
656 case NS_rtf::LN_ICO: // 0x175b
657 m_pImpl->aBorders[m_pImpl->nCurrentBorderLine].nLineColor = ConversionHelper::ConvertColor( nIntValue );
658 break;
659 /* WRITERFILTERSTATUS: done: 100, planned: 1, spent: 1 */
660 case NS_rtf::LN_DPTSPACE: // 0x175c
661 m_pImpl->aBorders[m_pImpl->nCurrentBorderLine].nLineDistance = nIntValue;
662 break;
663 /* WRITERFILTERSTATUS: done: 0, planned: 1, spent: 0 */
664 case NS_rtf::LN_FSHADOW: // 0x175d
665 m_pImpl->aBorders[m_pImpl->nCurrentBorderLine].bHasShadow = nIntValue ? true : false;
666 break;
667 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
668 case NS_rtf::LN_FFRAME: // ignored
669 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
670 case NS_rtf::LN_UNUSED2_15: break;// ignored
672 // const QName_t LN_shpoptextraoffset = 20028;
673 // const QName_t LN_shptypename = 20029;
674 // const QName_t LN_shpblipbname = 20031;
675 // const QName_t LN_binary = 20032;
679 // case NS_rtf::LN_shpblipbname = 20031;
680 // case NS_rtf::LN_binary = 20032;
681 // case NS_rtf::LN_shpdgg = 10492;
682 // case NS_rtf::LN_shpfbse = 10493;
685 // case NS_rtf::LN_CPROPS: //unused
689 // case NS_rtf::LN_LINECOLOR = 10372;
690 // case NS_rtf::LN_LINEWIDTH = 10373;
691 // case NS_rtf::LN_LINETYPE = 10374;
693 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
694 case NS_rtf::LN_SPID: break;
695 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
696 case NS_rtf::LN_XALEFT: m_pImpl->nLeftPosition = ConversionHelper::convertTwipToMM100(nIntValue); break; //left position
697 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
698 case NS_rtf::LN_YATOP: m_pImpl->nTopPosition = ConversionHelper::convertTwipToMM100(nIntValue); break; //top position
699 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
700 case NS_rtf::LN_XARIGHT: m_pImpl->nRightPosition = ConversionHelper::convertTwipToMM100(nIntValue); break; //right position
701 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
702 case NS_rtf::LN_YABOTTOM: m_pImpl->nBottomPosition = ConversionHelper::convertTwipToMM100(nIntValue); break;//bottom position
703 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
704 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
705 case NS_rtf::LN_FHDR:
706 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
707 case NS_rtf::LN_XAlign:
709 static const SwHoriOrient aHoriOriTab[ nCntXAlign ] =
711 HORI_NONE, // From left position
712 HORI_LEFT, // left
713 HORI_CENTER, // centered
714 HORI_RIGHT, // right
715 // --> OD 2004-12-06 #i36649#
716 // - inside -> HORI_LEFT and outside -> HORI_RIGHT
717 HORI_LEFT, // inside
718 HORI_RIGHT // outside
720 if( nIntValue < 6 && nIntValue > 0 )
722 static const sal_Int16 aHoriOrientTab[ 6 ] =
724 text::HoriOrientation::NONE,
725 text::HoriOrientation::LEFT,
726 text::HoriOrientation::CENTER,
727 text::HoriOrientation::RIGHT,
728 text::HoriOrientation::INSIDE,
729 text::HoriOrientation::OUTSIDE
731 m_pImpl->nHoriOrient = aHoriOrientTab[nIntValue];
732 m_pImpl->bPageToggle = nIntValue > 3;
734 break;
735 case NS_rtf::LN_YAlign:
737 static const SwVertOrient aVertOriTab[ nCntYAlign ] =
739 VERT_NONE, // From Top position
740 VERT_TOP, // top
741 VERT_CENTER, // centered
742 VERT_BOTTOM, // bottom
743 VERT_LINE_TOP, // inside (obscure)
744 VERT_LINE_BOTTOM // outside (obscure)
746 // CMC,OD 24.11.2003 #i22673# - to-line vertical alignment
747 static const SwVertOrient aToLineVertOriTab[ nCntYAlign ] =
749 VERT_NONE, // below
750 VERT_LINE_BOTTOM, // top
751 VERT_LINE_CENTER, // centered
752 VERT_LINE_TOP, // bottom
753 VERT_LINE_BOTTOM, // inside (obscure)
754 VERT_LINE_TOP // outside (obscure)
756 if ( eVertRel == REL_VERT_LINE ) //m_pImpl->nVertRelation == text::RelOrientation::TEXT_LINE
758 eVertOri = aToLineVertOriTab[ nYAlign ];
760 else
762 eVertOri = aVertOriTab[ nYAlign ];
766 if( nIntValue < 6 && nIntValue > 0)
768 static const sal_Int16 aVertOrientTab[ 6 ] =
770 text::VertOrientation::NONE, // From Top position
771 text::VertOrientation::TOP, // top
772 text::VertOrientation::CENTER, // centered
773 text::VertOrientation::BOTTOM, // bottom
774 text::VertOrientation::LINE_TOP, // inside (obscure)
775 text::VertOrientation::LINE_BOTTOM // outside (obscure)
777 static const sal_Int16 aToLineVertOrientTab[ 6 ] =
779 text::VertOrientation::NONE, // below
780 text::VertOrientation::LINE_BOTTOM, // top
781 text::VertOrientation::LINE_CENTER, // centered
782 text::VertOrientation::LINE_TOP, // bottom
783 text::VertOrientation::LINE_BOTTOM, // inside (obscure)
784 text::VertOrientation::LINE_TOP // outside (obscure)
786 m_pImpl->nVertOrient = m_pImpl->nVertRelation == text::RelOrientation::TEXT_LINE ?
787 aToLineVertOrientTab[nIntValue] : aVertOrientTab[nIntValue];
789 break;
790 case NS_rtf::LN_LayoutInTableCell: break; //currently unknown
791 case NS_rtf::LN_XRelTo:
792 case NS_rtf::LN_BX: //hori orient relation
793 switch( nIntValue )
795 case 0: m_pImpl->nHoriRelation = text::RelOrientation::PAGE_PRINT_AREA; break;
796 case 1: m_pImpl->nHoriRelation = text::RelOrientation::PAGE_FRAME; break;
797 case 2: m_pImpl->nHoriRelation = text::RelOrientation::FRAME; break;
798 //case :
799 default:m_pImpl->nHoriRelation = text::RelOrientation::CHAR;
801 break;
802 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
803 case NS_rtf::LN_YRelTo:
804 case NS_rtf::LN_BY: //vert orient relation
805 switch( nIntValue )
807 case 0: m_pImpl->nVertRelation = text::RelOrientation::PAGE_PRINT_AREA; break;
808 case 1: m_pImpl->nVertRelation = text::RelOrientation::PAGE_FRAME; break;
809 case 2: m_pImpl->nVertRelation = text::RelOrientation::FRAME; break;
810 //case :
811 default:m_pImpl->nVertRelation = text::RelOrientation::TEXT_LINE;
814 break;
815 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
816 case NS_rtf::LN_WR: //wrapping
817 switch( nIntValue )
819 case 0: //0 like 2, but doesn't require absolute object
820 m_pImpl->bIgnoreWRK = false;
821 case 2: //2 wrap around absolute object
822 m_pImpl->nWrap = text::WrapTextMode_PARALLEL;
823 break;
824 case 1: //1 no text next to shape
825 m_pImpl->nWrap = text::WrapTextMode_NONE;
826 break;
827 case 3: //3 wrap as if no object present
828 m_pImpl->nWrap = text::WrapTextMode_THROUGHT;
829 break;
830 case 4: //4 wrap tightly around object
831 m_pImpl->bIgnoreWRK = false;
832 case 5: //5 wrap tightly, but allow holes
833 m_pImpl->nWrap = text::WrapTextMode_PARALLEL;
834 m_pImpl->bContour = true;
835 break;
836 default:;
838 break;
839 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
840 case NS_rtf::LN_WRK:
841 if( !m_pImpl->bIgnoreWRK )
842 switch( nIntValue )
844 case 0: //0 like 2, but doesn't require absolute object
845 case 2: //2 wrap around absolute object
846 m_pImpl->nWrap = text::WrapTextMode_PARALLEL;
847 break;
848 case 1: //1 no text next to shape
849 m_pImpl->nWrap = text::WrapTextMode_NONE;
850 break;
851 case 3: //3 wrap as if no object present
852 m_pImpl->nWrap = text::WrapTextMode_THROUGHT;
853 break;
854 case 4: //4 wrap tightly around object
855 case 5: //5 wrap tightly, but allow holes
856 m_pImpl->nWrap = text::WrapTextMode_PARALLEL;
857 m_pImpl->bContour = true;
858 break;
859 default:;
861 break;
862 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
863 case NS_rtf::LN_FRCASIMPLE:
864 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
865 case NS_rtf::LN_FBELOWTEXT:
866 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
867 case NS_rtf::LN_FANCHORLOCK:
868 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
869 case NS_rtf::LN_CTXBX:
870 // {
871 // sal_Int32 nValue1 = val.getInt();
872 // nValue1++;
873 // }
874 break;
875 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
876 case NS_rtf::LN_shptxt:
877 //todo: text content
878 break;
879 /* case NS_rtf::LN_CH = 10421;
880 case NS_rtf::LN_UNUSED0_5 = 10422;
881 case NS_rtf::LN_FLT = 10423;
882 case NS_rtf::LN_shpLeft = 10424;
883 case NS_rtf::LN_shpTop = 10425;
884 break;*/
885 case NS_rtf::LN_dffheader: break;
886 case NS_ooxml::LN_CT_PositiveSize2D_cx:// 90407;
887 case NS_ooxml::LN_CT_PositiveSize2D_cy:// 90408;
889 sal_Int32 nDim = ConversionHelper::convertEMUToMM100( nIntValue );
890 if( nName == NS_ooxml::LN_CT_PositiveSize2D_cx )
891 m_pImpl->setXSize(nDim);
892 else
893 m_pImpl->setYSize(nDim);
895 break;
896 case NS_ooxml::LN_CT_EffectExtent_l:// 90907;
897 case NS_ooxml::LN_CT_EffectExtent_t:// 90908;
898 case NS_ooxml::LN_CT_EffectExtent_r:// 90909;
899 case NS_ooxml::LN_CT_EffectExtent_b:// 90910;
900 //todo: extends the wrapping size of the object, e.g. if shadow is added
901 break;
902 case NS_ooxml::LN_CT_NonVisualDrawingProps_id:// 90650;
903 //id of the object - ignored
904 break;
905 case NS_ooxml::LN_CT_NonVisualDrawingProps_name:// 90651;
906 //name of the object
907 m_pImpl->sName = val.getString();
908 break;
909 case NS_ooxml::LN_CT_NonVisualDrawingProps_descr:// 90652;
910 //alternative text
911 m_pImpl->sAlternativeText = val.getString();
912 break;
913 case NS_ooxml::LN_CT_GraphicalObjectFrameLocking_noChangeAspect://90644;
914 //disallow aspect ratio change - ignored
915 break;
916 case NS_ooxml::LN_CT_GraphicalObjectFrameLocking_noMove:// 90645;
917 m_pImpl->bPositionProtected = true;
918 break;
919 case NS_ooxml::LN_CT_GraphicalObjectFrameLocking_noResize: // 90646;
920 m_pImpl->bSizeProtected = true;
921 break;
922 case NS_ooxml::LN_CT_Anchor_distT: // 90983;
923 case NS_ooxml::LN_CT_Anchor_distB: // 90984;
924 case NS_ooxml::LN_CT_Anchor_distL: // 90985;
925 case NS_ooxml::LN_CT_Anchor_distR: // 90986;
927 //redirect to shape option processing
928 switch( nName )
930 case NS_ooxml::LN_CT_Anchor_distT: // 90983;
931 m_pImpl->nShapeOptionType = NS_dff::LN_shpdyWrapDistTop;
932 break;
933 case NS_ooxml::LN_CT_Anchor_distB: // 90984;
934 m_pImpl->nShapeOptionType = NS_dff::LN_shpdyWrapDistBottom;
935 break;
936 case NS_ooxml::LN_CT_Anchor_distL: // 90985;
937 m_pImpl->nShapeOptionType = NS_dff::LN_shpdxWrapDistLeft;
938 break;
939 case NS_ooxml::LN_CT_Anchor_distR: // 90986;
940 m_pImpl->nShapeOptionType = NS_dff::LN_shpdxWrapDistRight;
941 break;
942 //m_pImpl->nShapeOptionType = NS_dff::LN_shpcropFromTop
943 default: ;
945 ProcessShapeOptions(val);
947 break;
948 case NS_ooxml::LN_CT_Anchor_simplePos_attr: // 90987;
949 m_pImpl->bUseSimplePos = nIntValue > 0;
950 break;
951 case NS_ooxml::LN_CT_Anchor_relativeHeight: // 90988;
952 //z-order
953 break;
954 case NS_ooxml::LN_CT_Anchor_behindDoc: // 90989; - in background
955 if( nIntValue > 0 )
956 m_pImpl->bOpaque = false;
957 break;
958 case NS_ooxml::LN_CT_Anchor_locked: // 90990; - ignored
959 case NS_ooxml::LN_CT_Anchor_layoutInCell: // 90991; - ignored
960 //true: inside cell, cell resizes, false: table is resized or relocated, object might be outside of the table
961 case NS_ooxml::LN_CT_Anchor_hidden: // 90992; - ignored
962 break;
963 case NS_ooxml::LN_CT_Anchor_allowOverlap: // 90993;
964 //enable overlapping - ignored
965 break;
966 case NS_ooxml::LN_CT_Point2D_x: // 90405;
967 case NS_ooxml::LN_CT_Point2D_y: // 90406;
968 if( m_pImpl->bUseSimplePos )
970 //todo: absolute positioning
971 NS_ooxml::LN_CT_Point2D_x == nName ? m_pImpl->nLeftPosition = ConversionHelper::convertTwipToMM100(nIntValue) :
972 m_pImpl->nTopPosition = ConversionHelper::convertTwipToMM100(nIntValue);
975 break;
976 case NS_ooxml::LN_CT_WrapTight_wrapText: // 90934;
977 m_pImpl->bContour = true;
978 //no break;
979 case NS_ooxml::LN_CT_WrapSquare_wrapText: //90928;
980 switch ( val.getInt() )
982 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_bothSides: // 90920;
983 m_pImpl->nWrap = text::WrapTextMode_PARALLEL;
984 break;
985 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_left: // 90921;
986 m_pImpl->nWrap = text::WrapTextMode_LEFT;
987 break;
988 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_right: // 90922;
989 m_pImpl->nWrap = text::WrapTextMode_RIGHT;
990 break;
991 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_largest: // 90923;
992 m_pImpl->nWrap = text::WrapTextMode_DYNAMIC;
993 break;
994 default:;
996 break;
997 case NS_ooxml::LN_shape:
998 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1000 uno::Reference< drawing::XShape> xShape;
1001 val.getAny( ) >>= xShape;
1003 if ( xShape.is( ) )
1005 // Is it a graphic image
1006 bool bUseShape = true;
1009 uno::Reference< beans::XPropertySet > xShapeProps
1010 ( xShape, uno::UNO_QUERY_THROW );
1012 rtl::OUString sUrl;
1013 xShapeProps->getPropertyValue( rtl::OUString::createFromAscii( "GraphicURL" ) ) >>= sUrl;
1015 ::com::sun::star::beans::PropertyValues aMediaProperties( 1 );
1016 aMediaProperties[0].Name = rtl::OUString::createFromAscii( "URL" );
1017 aMediaProperties[0].Value <<= sUrl;
1019 m_xGraphicObject = createGraphicObject( aMediaProperties );
1021 bUseShape = !m_xGraphicObject.is( );
1023 if ( !bUseShape )
1025 // Define the object size
1026 uno::Reference< beans::XPropertySet > xGraphProps( m_xGraphicObject,
1027 uno::UNO_QUERY );
1028 awt::Size aSize = xShape->getSize( );
1029 xGraphProps->setPropertyValue( rtl::OUString::createFromAscii( "Height" ),
1030 uno::makeAny( aSize.Height ) );
1031 xGraphProps->setPropertyValue( rtl::OUString::createFromAscii( "Width" ),
1032 uno::makeAny( aSize.Width ) );
1035 catch( const beans::UnknownPropertyException e )
1037 // It isn't a graphic image
1040 if ( bUseShape )
1041 m_xShape = xShape;
1044 if ( m_xShape.is( ) )
1046 uno::Reference< beans::XPropertySet > xShapeProps
1047 (m_xShape, uno::UNO_QUERY_THROW);
1050 PropertyNameSupplier& rPropNameSupplier =
1051 PropertyNameSupplier::GetPropertyNameSupplier();
1052 xShapeProps->setPropertyValue
1053 (rPropNameSupplier.GetName(PROP_ANCHOR_TYPE),
1054 uno::makeAny
1055 (text::TextContentAnchorType_AS_CHARACTER));
1056 xShapeProps->setPropertyValue
1057 (rPropNameSupplier.GetName(PROP_TEXT_RANGE),
1058 uno::makeAny
1059 (m_pImpl->rDomainMapper.GetCurrentTextRange()));
1061 awt::Point aPoint(m_xShape->getPosition());
1062 awt::Size aSize(m_xShape->getSize());
1064 if (m_pImpl->isXSizeValid())
1065 aSize.Width = m_pImpl->getXSize();
1066 if (m_pImpl->isYSizeValis())
1067 aSize.Height = m_pImpl->getYSize();
1069 m_xShape->setSize(aSize);
1071 m_pImpl->bIsGraphic = true;
1075 break;
1076 case NS_ooxml::LN_CT_Inline_distT:
1077 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1078 case NS_ooxml::LN_CT_Inline_distB:
1079 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1080 case NS_ooxml::LN_CT_Inline_distL:
1081 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1082 case NS_ooxml::LN_CT_Inline_distR:
1083 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1084 //TODO: need to be handled
1085 break;
1086 case NS_ooxml::LN_CT_GraphicalObjectData_uri:
1087 val.getString();
1088 //TODO: does it need to be handled?
1089 break;
1090 default:
1091 #if OSL_DEBUG_LEVEL > 0
1092 ::rtl::OString sMessage( "GraphicImport::attribute() - Id: ");
1093 sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 10 );
1094 sMessage += ::rtl::OString(" / 0x");
1095 sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 16 );
1096 OSL_ENSURE( false, sMessage.getStr())
1097 #endif
1100 #ifdef DEBUG_DOMAINMAPPER
1101 dmapper_logger->endElement("attribute");
1102 #endif
1105 uno::Reference<text::XTextContent> GraphicImport::GetGraphicObject()
1107 uno::Reference<text::XTextContent> xResult;
1109 if (m_xGraphicObject.is())
1110 xResult = m_xGraphicObject;
1111 else if (m_xShape.is())
1113 xResult.set(m_xShape, uno::UNO_QUERY_THROW);
1116 return xResult;
1119 /*-- 22.11.2006 09:46:48---------------------------------------------------
1121 -----------------------------------------------------------------------*/
1122 void GraphicImport::ProcessShapeOptions(Value& val)
1124 sal_Int32 nIntValue = val.getInt();
1125 sal_Int32 nTwipValue = ConversionHelper::convertTwipToMM100(nIntValue);
1126 /* WRITERFILTERSTATUS: table: ShapeOptionsAttribute */
1127 switch( m_pImpl->nShapeOptionType )
1129 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1130 // case NS_dff::LN_shprotation /*4*/: break;
1131 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1132 // case NS_dff::LN_shpfLockRotation /*119*/: break;
1133 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1134 // case NS_dff::LN_shpfLockAspectRatio /*120*/: break;
1135 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1136 // case NS_dff::LN_shpfLockPosition /*121*/: break;
1137 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1138 // case NS_dff::LN_shpfLockAgainstSelect /*122*/: break;
1139 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1140 // case NS_dff::LN_shpfLockCropping /*123*/: break;
1141 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1142 // case NS_dff::LN_shpfLockVertices /*124*/: break;
1143 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1144 // case NS_dff::LN_shpfLockText /*125*/: break;
1145 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1146 // case NS_dff::LN_shpfLockAdjustHandles /*126*/: break;
1147 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1148 // case NS_dff::LN_shpfLockAgainstGrouping /*127*/: break;
1149 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1150 // case NS_dff::LN_shpfLockAgainstGrouping /*127*/:
1151 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1152 // case NS_dff::LN_shplTxid /*128*/:
1153 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1154 // case NS_dff::LN_shpdxTextLeft /*129*/:
1155 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1156 // case NS_dff::LN_shpdyTextTop /*130*/:
1157 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1158 // case NS_dff::LN_shpdxTextRight /*131*/:
1159 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1160 // case NS_dff::LN_shpdyTextBottom /*132*/:
1161 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1162 // case NS_dff::LN_shpWrapText /*133*/:
1163 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1164 // case NS_dff::LN_shpscaleText /*134*/:
1165 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1166 // case NS_dff::LN_shpanchorText /*135*/:
1167 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1168 // case NS_dff::LN_shptxflTextFlow /*136*/:
1169 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1170 // case NS_dff::LN_shpcdirFont /*137*/:
1171 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1172 // case NS_dff::LN_shphspNext /*138*/:
1173 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1174 // case NS_dff::LN_shptxdir /*139*/:
1175 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1176 // case NS_dff::LN_shpfSelectText /*187*/:
1177 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1178 // case NS_dff::LN_shpfAutoTextMargin /*188*/:
1179 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1180 // case NS_dff::LN_shpfRotateText /*189*/:
1181 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1182 // case NS_dff::LN_shpfFitShapeToText /*190*/:
1183 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1184 // case NS_dff::LN_shpfFitTextToShape /*191*/:
1185 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1186 // case NS_dff::LN_shpgtextUNICODE /*192*/:
1187 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1188 // case NS_dff::LN_shpgtextRTF /*193*/:
1189 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1190 // case NS_dff::LN_shpgtextAlign /*194*/:
1191 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1192 // case NS_dff::LN_shpgtextSize /*195*/:
1193 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1194 // case NS_dff::LN_shpgtextSpacing /*196*/:
1195 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1196 // case NS_dff::LN_shpgtextFont /*197*/:
1197 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1198 // case NS_dff::LN_shpgtextFReverseRows /*240*/:
1199 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1200 // case NS_dff::LN_shpfGtext /*241*/:
1201 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1202 // case NS_dff::LN_shpgtextFVertical /*242*/:
1203 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1204 // case NS_dff::LN_shpgtextFKern /*243*/:
1205 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1206 // case NS_dff::LN_shpgtextFTight /*244*/:
1207 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1208 // case NS_dff::LN_shpgtextFStretch /*245*/:
1209 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1210 // case NS_dff::LN_shpgtextFShrinkFit /*246*/:
1211 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1212 // case NS_dff::LN_shpgtextFBestFit /*247*/:
1213 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1214 // case NS_dff::LN_shpgtextFNormalize /*248*/:
1215 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1216 // case NS_dff::LN_shpgtextFDxMeasure /*249*/:
1217 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1218 // case NS_dff::LN_shpgtextFBold /*250*/:
1219 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1220 // case NS_dff::LN_shpgtextFItalic /*251*/:
1221 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1222 // case NS_dff::LN_shpgtextFUnderline /*252*/:
1223 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1224 // case NS_dff::LN_shpgtextFShadow /*253*/:
1225 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1226 // case NS_dff::LN_shpgtextFSmallcaps /*254*/:
1227 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1228 // case NS_dff::LN_shpgtextFStrikethrough /*255*/:
1230 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
1231 case NS_dff::LN_shpcropFromTop /*256*/ : m_pImpl->nTopCrop = nTwipValue; break;// rtf:shpcropFromTop
1232 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
1233 case NS_dff::LN_shpcropFromBottom /*257*/ : m_pImpl->nBottomCrop= nTwipValue; break;// rtf:shpcropFromBottom
1234 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
1235 case NS_dff::LN_shpcropFromLeft /*258*/ : m_pImpl->nLeftCrop = nTwipValue; break;// rtf:shpcropFromLeft
1236 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
1237 case NS_dff::LN_shpcropFromRight/*259*/ : m_pImpl->nRightCrop = nTwipValue;break;// rtf:shpcropFromRight
1238 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1239 case NS_dff::LN_shppib/*260*/: break; // rtf:shppib
1240 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1241 case NS_dff::LN_shppibName/*261*/: break; // rtf:shppibName
1242 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1243 case NS_dff::LN_shppibFlags/*262*/: // rtf:shppibFlags
1245 * // MSOBLIPFLAGS ñ flags for pictures
1246 typedef enum
1248 msoblipflagDefault = 0,
1249 msoblipflagComment = 0, // Blip name is a comment
1250 msoblipflagFile, // Blip name is a file name
1251 msoblipflagURL, // Blip name is a full URL
1252 msoblipflagType = 3, // Mask to extract type
1253 // Or the following flags with any of the above.
1254 msoblipflagDontSave = 4, // A "dont" is the depression in the metal
1255 // body work of an automobile caused when a
1256 // cyclist violently thrusts his or her nose
1257 // at it, thus a DontSave is another name for
1258 // a cycle lane.
1259 msoblipflagDoNotSave = 4, // For those who prefer English
1260 msoblipflagLinkToFile = 8,
1263 * */
1264 break;
1265 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1266 // case NS_dff::LN_shppictureTransparent /*263*/:
1267 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
1268 case NS_dff::LN_shppictureContrast/*264*/: // rtf:shppictureContrast docu: "1<<16"
1270 0x10000 is msoffice 50%
1271 < 0x10000 is in units of 1/50th of 0x10000 per 1%
1272 > 0x10000 is in units where
1273 a msoffice x% is stored as 50/(100-x) * 0x10000
1275 plus, a (ui) microsoft % ranges from 0 to 100, OOO
1276 from -100 to 100, so also normalize into that range
1278 if ( nIntValue > 0x10000 )
1280 double fX = nIntValue;
1281 fX /= 0x10000;
1282 fX /= 51; // 50 + 1 to round
1283 fX = 1/fX;
1284 m_pImpl->nContrast = static_cast<sal_Int32>(fX);
1285 m_pImpl->nContrast -= 100;
1286 m_pImpl->nContrast = -m_pImpl->nContrast;
1287 m_pImpl->nContrast = (m_pImpl->nContrast-50)*2;
1289 else if ( nIntValue == 0x10000 )
1290 m_pImpl->nContrast = 0;
1291 else
1293 m_pImpl->nContrast = nIntValue * 101; //100 + 1 to round
1294 m_pImpl->nContrast /= 0x10000;
1295 m_pImpl->nContrast -= 100;
1297 break;
1298 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
1299 case NS_dff::LN_shppictureBrightness/*265*/: // rtf:shppictureBrightness
1300 m_pImpl->nBrightness = ( (sal_Int32) nIntValue / 327 );
1301 break;
1302 /* WRITERFILTERSTATUS: done: 50, planned: 0, spent: 0 */
1303 case NS_dff::LN_shppictureGamma/*266*/: // rtf:shppictureGamma
1304 //todo check gamma value with _real_ document
1305 m_pImpl->fGamma = double(nIntValue/655);
1306 break;
1307 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1308 case NS_dff::LN_shppictureId /*267*/: break; // rtf:shppictureId
1309 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1310 case NS_dff::LN_shppictureDblCrMod /*268*/: break; // rtf:shppictureDblCrMod
1311 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1312 case NS_dff::LN_shppictureFillCrMod /*269*/: break; // rtf:shppictureFillCrMod
1313 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1314 case NS_dff::LN_shppictureLineCrMod /*270*/: break; // rtf:shppictureLineCrMod
1315 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1316 // case NS_dff::LN_shppibPrint /*271*/:
1317 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1318 // case NS_dff::LN_shppibPrintName /*272*/:
1319 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1320 // case NS_dff::LN_shppibPrintFlags /*273*/:
1321 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1322 // case NS_dff::LN_shpfNoHitTestPicture /*316*/:
1323 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1324 // case NS_dff::LN_shppictureGray /*317*/:
1325 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1326 // case NS_dff::LN_shppictureBiLevel /*318*/:
1328 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
1329 case NS_dff::LN_shppictureActive/*319*/: // rtf:shppictureActive
1330 switch( nIntValue & 0x06 )
1332 case 0 : m_pImpl->eColorMode = drawing::ColorMode_STANDARD; break;
1333 case 4 : m_pImpl->eColorMode = drawing::ColorMode_GREYS; break;
1334 case 6 : m_pImpl->eColorMode = drawing::ColorMode_MONO; break;
1335 default:;
1337 break;
1338 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1339 // case NS_dff::LN_shpgeoLeft /*320*/:
1340 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1341 // case NS_dff::LN_shpgeoTop /*321*/:
1342 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1343 // case NS_dff::LN_shpgeoRight /*322*/:
1344 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1345 // case NS_dff::LN_shpgeoBottom /*323*/:
1346 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1347 // case NS_dff::LN_shpshapePath /*324*/:
1348 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1349 // case NS_dff::LN_shppVertices /*325*/:
1350 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1351 // case NS_dff::LN_shppSegmentInfo /*326*/:
1352 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1353 // case NS_dff::LN_shpadjustValue /*327*/:
1354 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1355 // case NS_dff::LN_shpadjust2Value /*328*/:
1356 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1357 // case NS_dff::LN_shpadjust3Value /*329*/:
1358 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1359 // case NS_dff::LN_shpadjust4Value /*330*/:
1360 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1361 // case NS_dff::LN_shpadjust5Value /*331*/:
1362 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1363 // case NS_dff::LN_shpadjust6Value /*332*/:
1364 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1365 // case NS_dff::LN_shpadjust7Value /*333*/:
1366 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1367 // case NS_dff::LN_shpadjust8Value /*334*/:
1368 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1369 // case NS_dff::LN_shpadjust9Value /*335*/:
1370 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1371 // case NS_dff::LN_shpadjust10Value /*336*/:
1372 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1373 // case NS_dff::LN_shpfShadowOK /*378*/:
1374 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1375 // case NS_dff::LN_shpf3DOK /*379*/:
1376 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1377 // case NS_dff::LN_shpfLineOK /*380*/:
1378 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1379 // case NS_dff::LN_shpfGtextOK /*381*/:
1380 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1381 // case NS_dff::LN_shpfFillShadeShapeOK /*382*/:
1382 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1383 // case NS_dff::LN_shpfFillOK /*383*/:
1384 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1385 // case NS_dff::LN_shpfillType /*384*/:
1386 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1387 case NS_dff::LN_shpfillColor /*385*/:
1388 m_pImpl->nFillColor = (m_pImpl->nFillColor & 0xff000000) + ConversionHelper::ConvertColor( nIntValue );
1389 break;
1390 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1391 case NS_dff::LN_shpfillOpacity /*386*/:
1393 sal_Int32 nTrans = 0xff - ( nIntValue * 0xff ) / 0xffff;
1394 m_pImpl->nFillColor = (nTrans << 0x18 ) + (m_pImpl->nFillColor & 0xffffff);
1396 break;
1397 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1398 // case NS_dff::LN_shpfillBackColor /*387*/:
1399 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1400 // case NS_dff::LN_shpfillBackOpacity /*388*/:
1401 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1402 // case NS_dff::LN_shpfillCrMod /*389*/:
1403 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1404 // case NS_dff::LN_shpfillBlip /*390*/:
1405 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1406 // case NS_dff::LN_shpfillBlipName /*391*/:
1407 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1408 // case NS_dff::LN_shpfillBlipFlags /*392*/:
1409 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1410 // case NS_dff::LN_shpfillWidth /*393*/:
1411 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1412 // case NS_dff::LN_shpfillHeight /*394*/:
1413 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1414 // case NS_dff::LN_shpfillAngle /*395*/:
1415 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1416 // case NS_dff::LN_shpfillFocus /*396*/:
1417 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1418 // case NS_dff::LN_shpfillToLeft /*397*/:
1419 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1420 // case NS_dff::LN_shpfillToTop /*398*/:
1421 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1422 // case NS_dff::LN_shpfillToRight /*399*/:
1423 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1424 // case NS_dff::LN_shpfillToBottom /*400*/:
1425 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1426 // case NS_dff::LN_shpfillRectLeft /*401*/:
1427 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1428 // case NS_dff::LN_shpfillRectTop /*402*/:
1429 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1430 // case NS_dff::LN_shpfillRectRight /*403*/:
1431 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1432 // case NS_dff::LN_shpfillRectBottom /*404*/:
1433 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1434 // case NS_dff::LN_shpfillDztype /*405*/:
1435 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1436 // case NS_dff::LN_shpfillShadePreset /*406*/:
1437 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1438 // case NS_dff::LN_shpfillShadeColors /*407*/:
1439 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1440 // case NS_dff::LN_shpfillOriginX /*408*/:
1441 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1442 // case NS_dff::LN_shpfillOriginY /*409*/:
1443 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1444 // case NS_dff::LN_shpfillShapeOriginX /*410*/:
1445 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1446 // case NS_dff::LN_shpfillShapeOriginY /*411*/:
1447 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1448 // case NS_dff::LN_shpfillShadeType /*412*/:
1449 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1450 // case NS_dff::LN_shpfFilled /*443*/:
1451 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1452 // case NS_dff::LN_shpfHitTestFill /*444*/:
1453 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1454 // case NS_dff::LN_shpfillShape /*445*/:
1455 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1456 // case NS_dff::LN_shpfillUseRect /*446*/:
1457 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1458 case NS_dff::LN_shpfNoFillHitTest /*447*/: break; // rtf:shpfNoFillHitTest
1459 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
1460 case NS_dff::LN_shplineColor /*448*/:
1461 m_pImpl->aBorders[m_pImpl->nCurrentBorderLine].nLineColor = ConversionHelper::ConvertColor( nIntValue );
1462 break;
1463 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1464 // case NS_dff::LN_shplineOpacity /*449*/:
1465 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1466 // case NS_dff::LN_shplineBackColor /*450*/:
1467 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1468 // case NS_dff::LN_shplineCrMod /*451*/:
1469 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1470 // case NS_dff::LN_shplineType /*452*/:
1471 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1472 // case NS_dff::LN_shplineFillBlip /*453*/:
1473 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1474 // case NS_dff::LN_shplineFillBlipName /*454*/:
1475 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1476 // case NS_dff::LN_shplineFillBlipFlags /*455*/:
1477 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1478 // case NS_dff::LN_shplineFillWidth /*456*/:
1479 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1480 // case NS_dff::LN_shplineFillHeight /*457*/:
1481 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1482 // case NS_dff::LN_shplineFillDztype /*458*/:
1483 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
1484 case NS_dff::LN_shplineWidth /*459*/:
1485 //1pt == 12700 units
1486 m_pImpl->aBorders[m_pImpl->nCurrentBorderLine].nLineWidth = ConversionHelper::convertTwipToMM100(nIntValue / 635);
1487 break;
1488 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1489 // case NS_dff::LN_shplineMiterLimit /*460*/:
1490 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1491 // case NS_dff::LN_shplineStyle /*461*/:
1492 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1493 case NS_dff::LN_shplineDashing /*462*/:
1494 //graphic borders don't support different dashing
1495 /*MSOLINEDASHING
1496 msolineSolid, // Solid (continuous) pen
1497 msolineDashSys, // PS_DASH system dash style
1498 msolineDotSys, // PS_DOT system dash style
1499 msolineDashDotSys, // PS_DASHDOT system dash style
1500 msolineDashDotDotSys, // PS_DASHDOTDOT system dash style
1501 msolineDotGEL, // square dot style
1502 msolineDashGEL, // dash style
1503 msolineLongDashGEL, // long dash style
1504 msolineDashDotGEL, // dash short dash
1505 msolineLongDashDotGEL, // long dash short dash
1506 msolineLongDashDotDotGEL // long dash short dash short dash*/
1507 //m_pImpl->aBorders[nCurrentBorderLine].nLineType = nIntValue;
1508 break;
1509 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1510 // case NS_dff::LN_shplineDashStyle /*463*/:
1511 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1512 // case NS_dff::LN_shplineStartArrowhead /*464*/:
1513 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1514 // case NS_dff::LN_shplineEndArrowhead /*465*/:
1515 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1516 // case NS_dff::LN_shplineStartArrowWidth /*466*/:
1517 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1518 // case NS_dff::LN_shplineStartArrowLength /*467*/:
1519 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1520 // case NS_dff::LN_shplineEndArrowWidth /*468*/:
1521 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1522 // case NS_dff::LN_shplineEndArrowLength /*469*/:
1523 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1524 // case NS_dff::LN_shplineJoinStyle /*470*/:
1525 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1526 // case NS_dff::LN_shplineEndCapStyle /*471*/:
1527 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1528 // case NS_dff::LN_shpfArrowheadsOK /*507*/:
1529 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1530 // case NS_dff::LN_shpfLine /*508*/:
1531 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1532 // case NS_dff::LN_shpfHitTestLine /*509*/:
1533 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1534 // case NS_dff::LN_shplineFillShape /*510*/:
1535 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1536 case NS_dff::LN_shpfNoLineDrawDash /*511*/: break; // rtf:shpfNoLineDrawDash
1537 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1538 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1539 // case NS_dff::LN_shpshadowType /*512*/:
1540 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1541 // case NS_dff::LN_shpshadowColor /*513*/:
1542 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1543 // case NS_dff::LN_shpshadowHighlight /*514*/:
1544 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1545 // case NS_dff::LN_shpshadowCrMod /*515*/:
1546 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1547 // case NS_dff::LN_shpshadowOpacity /*516*/:
1548 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1549 // case NS_dff::LN_shpshadowOffsetX /*517*/:
1550 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1551 // case NS_dff::LN_shpshadowOffsetY /*518*/:
1552 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1553 // case NS_dff::LN_shpshadowSecondOffsetX /*519*/:
1554 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1555 // case NS_dff::LN_shpshadowSecondOffsetY /*520*/:
1556 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1557 // case NS_dff::LN_shpshadowScaleXToX /*521*/:
1558 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1559 // case NS_dff::LN_shpshadowScaleYToX /*522*/:
1560 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1561 // case NS_dff::LN_shpshadowScaleXToY /*523*/:
1562 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1563 // case NS_dff::LN_shpshadowScaleYToY /*524*/:
1564 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1565 // case NS_dff::LN_shpshadowPerspectiveX /*525*/:
1566 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1567 // case NS_dff::LN_shpshadowPerspectiveY /*526*/:
1568 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1569 // case NS_dff::LN_shpshadowWeight /*527*/:
1570 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1571 // case NS_dff::LN_shpshadowOriginX /*528*/:
1572 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1573 // case NS_dff::LN_shpshadowOriginY /*529*/:
1574 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1575 // case NS_dff::LN_shpfShadow /*574*/:
1576 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1577 // case NS_dff::LN_shpfshadowObscured /*575*/:
1578 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1579 // case NS_dff::LN_shpperspectiveType /*576*/:
1580 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1581 // case NS_dff::LN_shpperspectiveOffsetX /*577*/:
1582 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1583 // case NS_dff::LN_shpperspectiveOffsetY /*578*/:
1584 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1585 // case NS_dff::LN_shpperspectiveScaleXToX /*579*/:
1586 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1587 // case NS_dff::LN_shpperspectiveScaleYToX /*580*/:
1588 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1589 // case NS_dff::LN_shpperspectiveScaleXToY /*581*/:
1590 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1591 // case NS_dff::LN_shpperspectiveScaleYToY /*582*/:
1592 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1593 // case NS_dff::LN_shpperspectivePerspectiveX /*583*/:
1594 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1595 // case NS_dff::LN_shpperspectivePerspectiveY /*584*/:
1596 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1597 // case NS_dff::LN_shpperspectiveWeight /*585*/:
1598 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1599 // case NS_dff::LN_shpperspectiveOriginX /*586*/:
1600 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1601 // case NS_dff::LN_shpperspectiveOriginY /*587*/:
1602 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1603 // case NS_dff::LN_shpfPerspective /*639*/:
1604 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1605 // case NS_dff::LN_shpc3DSpecularAmt /*640*/:
1606 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1607 // case NS_dff::LN_shpc3DDiffuseAmt /*641*/:
1608 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1609 // case NS_dff::LN_shpc3DShininess /*642*/:
1610 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1611 // case NS_dff::LN_shpc3DEdgeThickness /*643*/:
1612 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1613 // case NS_dff::LN_shpc3DExtrudeForward /*644*/:
1614 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1615 // case NS_dff::LN_shpc3DExtrudeBackward /*645*/:
1616 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1617 // case NS_dff::LN_shpc3DExtrudePlane /*646*/:
1618 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1619 // case NS_dff::LN_shpc3DExtrusionColor /*647*/:
1620 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1621 // case NS_dff::LN_shpc3DCrMod /*648*/:
1622 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1623 // case NS_dff::LN_shpf3D /*700*/:
1624 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1625 // case NS_dff::LN_shpfc3DMetallic /*701*/:
1626 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1627 // case NS_dff::LN_shpfc3DUseExtrusionColor /*702*/:
1628 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1629 // case NS_dff::LN_shpfc3DLightFace /*703*/:
1630 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1631 // case NS_dff::LN_shpc3DYRotationAngle /*704*/:
1632 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1633 // case NS_dff::LN_shpc3DXRotationAngle /*705*/:
1634 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1635 // case NS_dff::LN_shpc3DRotationAxisX /*706*/:
1636 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1637 // case NS_dff::LN_shpc3DRotationAxisY /*707*/:
1638 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1639 // case NS_dff::LN_shpc3DRotationAxisZ /*708*/:
1640 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1641 // case NS_dff::LN_shpc3DRotationAngle /*709*/:
1642 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1643 // case NS_dff::LN_shpc3DRotationCenterX /*710*/:
1644 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1645 // case NS_dff::LN_shpc3DRotationCenterY /*711*/:
1646 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1647 // case NS_dff::LN_shpc3DRotationCenterZ /*712*/:
1648 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1649 // case NS_dff::LN_shpc3DRenderMode /*713*/:
1650 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1651 // case NS_dff::LN_shpc3DTolerance /*714*/:
1652 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1653 // case NS_dff::LN_shpc3DXViewpoint /*715*/:
1654 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1655 // case NS_dff::LN_shpc3DYViewpoint /*716*/:
1656 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1657 // case NS_dff::LN_shpc3DZViewpoint /*717*/:
1658 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1659 // case NS_dff::LN_shpc3DOriginX /*718*/:
1660 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1661 // case NS_dff::LN_shpc3DOriginY /*719*/:
1662 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1663 // case NS_dff::LN_shpc3DSkewAngle /*720*/:
1664 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1665 // case NS_dff::LN_shpc3DSkewAmount /*721*/:
1666 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1667 // case NS_dff::LN_shpc3DAmbientIntensity /*722*/:
1668 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1669 // case NS_dff::LN_shpc3DKeyX /*723*/:
1670 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1671 // case NS_dff::LN_shpc3DKeyY /*724*/:
1672 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1673 // case NS_dff::LN_shpc3DKeyZ /*725*/:
1674 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1675 // case NS_dff::LN_shpc3DKeyIntensity /*726*/:
1676 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1677 // case NS_dff::LN_shpc3DFillX /*727*/:
1678 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1679 // case NS_dff::LN_shpc3DFillY /*728*/:
1680 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1681 // case NS_dff::LN_shpc3DFillZ /*729*/:
1682 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1683 // case NS_dff::LN_shpc3DFillIntensity /*730*/:
1684 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1685 // case NS_dff::LN_shpfc3DConstrainRotation /*763*/:
1686 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1687 // case NS_dff::LN_shpfc3DRotationCenterAuto /*764*/:
1688 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1689 // case NS_dff::LN_shpfc3DParallel /*765*/:
1690 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1691 // case NS_dff::LN_shpfc3DKeyHarsh /*766*/:
1692 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1693 // case NS_dff::LN_shpfc3DFillHarsh /*767*/:
1694 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1695 // case NS_dff::LN_shphspMaster /*769*/:
1696 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1697 // case NS_dff::LN_shpcxstyle /*771*/:
1698 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1699 // case NS_dff::LN_shpbWMode /*772*/:
1700 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1701 // case NS_dff::LN_shpbWModePureBW /*773*/:
1702 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1703 // case NS_dff::LN_shpbWModeBW /*774*/:
1704 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1705 // case NS_dff::LN_shpfOleIcon /*826*/:
1706 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1707 // case NS_dff::LN_shpfPreferRelativeResize /*827*/:
1708 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1709 // case NS_dff::LN_shpfLockShapeType /*828*/:
1710 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1711 // case NS_dff::LN_shpfDeleteAttachedObject /*830*/:
1712 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1713 // case NS_dff::LN_shpfBackground /*831*/:
1714 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1715 // case NS_dff::LN_shpspcot /*832*/:
1716 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1717 // case NS_dff::LN_shpdxyCalloutGap /*833*/:
1718 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1719 // case NS_dff::LN_shpspcoa /*834*/:
1720 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1721 // case NS_dff::LN_shpspcod /*835*/:
1722 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1723 // case NS_dff::LN_shpdxyCalloutDropSpecified /*836*/:
1724 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1725 // case NS_dff::LN_shpdxyCalloutLengthSpecified /*837*/:
1726 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1727 // case NS_dff::LN_shpfCallout /*889*/:
1728 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1729 // case NS_dff::LN_shpfCalloutAccentBar /*890*/:
1730 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1731 // case NS_dff::LN_shpfCalloutTextBorder /*891*/:
1732 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1733 // case NS_dff::LN_shpfCalloutMinusX /*892*/:
1734 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1735 // case NS_dff::LN_shpfCalloutMinusY /*893*/:
1736 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1737 // case NS_dff::LN_shpfCalloutDropAuto /*894*/:
1738 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1739 // case NS_dff::LN_shpfCalloutLengthSpecified /*895*/:
1740 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1741 // case NS_dff::LN_shpwzName /*896*/:
1742 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1743 case NS_dff::LN_shpwzDescription /*897*/: //alternative text
1744 m_pImpl->sAlternativeText = val.getString();
1745 break;
1746 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1747 // case NS_dff::LN_shppihlShape /*898*/:
1748 case NS_dff::LN_shppWrapPolygonVertices/*899*/: break; // rtf:shppWrapPolygonVertices
1749 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1750 case NS_dff::LN_shpdxWrapDistLeft /*900*/: // contains a twip/635 value
1751 //todo: changes have to be applied depending on the orientation, see SwWW8ImplReader::AdjustLRWrapForWordMargins()
1752 m_pImpl->nLeftMargin = nIntValue / 360;
1753 break;
1754 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1755 case NS_dff::LN_shpdyWrapDistTop /*901*/: // contains a twip/635 value
1756 //todo: changes have to be applied depending on the orientation, see SwWW8ImplReader::AdjustULWrapForWordMargins()
1757 m_pImpl->nTopMargin = nIntValue / 360;
1758 break;
1759 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1760 case NS_dff::LN_shpdxWrapDistRight /*902*/:// contains a twip/635 value
1761 //todo: changes have to be applied depending on the orientation, see SwWW8ImplReader::AdjustLRWrapForWordMargins()
1762 m_pImpl->nRightMargin = nIntValue / 360;
1763 break;
1764 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1765 case NS_dff::LN_shpdyWrapDistBottom /*903*/:// contains a twip/635 value
1766 //todo: changes have to be applied depending on the orientation, see SwWW8ImplReader::AdjustULWrapForWordMargins()
1767 m_pImpl->nBottomMargin = nIntValue / 360;
1768 break;
1769 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1770 // case NS_dff::LN_shplidRegroup /*904*/:
1771 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1772 // case NS_dff::LN_shpfEditedWrap /*953*/:
1773 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1774 // case NS_dff::LN_shpfBehindDocument /*954*/:
1775 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1776 // case NS_dff::LN_shpfOnDblClickNotify /*955*/:
1777 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1778 // case NS_dff::LN_shpfIsButton /*956*/:
1779 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1780 // case NS_dff::LN_shpfOneD /*957*/:
1781 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1782 // case NS_dff::LN_shpfHidden /*958*/:
1783 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1784 case NS_dff::LN_shpfPrint /*959*/: break; // rtf:shpfPrint
1786 default:
1787 OSL_ENSURE( false, "shape option unsupported?");
1790 /*-- 01.11.2006 09:45:02---------------------------------------------------
1792 -----------------------------------------------------------------------*/
1793 void GraphicImport::sprm(Sprm & rSprm)
1795 #ifdef DEBUG_DOMAINMAPPER
1796 dmapper_logger->startElement("sprm");
1797 dmapper_logger->chars(rSprm.toString());
1798 #endif
1800 sal_uInt32 nSprmId = rSprm.getId();
1801 Value::Pointer_t pValue = rSprm.getValue();
1803 /* WRITERFILTERSTATUS: table: PICFsprmdata */
1804 switch(nSprmId)
1806 case 0xf004: //dff record
1807 case 0xf00a: //part of 0xf004 - shape properties
1808 case 0xf00b: //part of 0xf004
1809 case 0xf007:
1810 case 0xf122: //udefprop
1811 case NS_ooxml::LN_CT_Inline_extent: // 90911;
1812 case NS_ooxml::LN_CT_Inline_effectExtent: // 90912;
1813 case NS_ooxml::LN_CT_Inline_docPr: // 90913;
1814 case NS_ooxml::LN_CT_Inline_cNvGraphicFramePr: // 90914;
1815 case NS_ooxml::LN_CT_NonVisualGraphicFrameProperties_graphicFrameLocks:// 90657
1816 case NS_ooxml::LN_CT_Inline_a_graphic:// 90915
1817 case NS_ooxml::LN_CT_Anchor_simplePos_elem: // 90975;
1818 case NS_ooxml::LN_CT_Anchor_extent: // 90978;
1819 case NS_ooxml::LN_CT_Anchor_effectExtent: // 90979;
1820 case NS_ooxml::LN_EG_WrapType_wrapSquare: // 90945;
1821 case NS_ooxml::LN_EG_WrapType_wrapTight: // 90946;
1822 case NS_ooxml::LN_CT_Anchor_docPr: // 90980;
1823 case NS_ooxml::LN_CT_Anchor_cNvGraphicFramePr: // 90981;
1824 case NS_ooxml::LN_CT_Anchor_a_graphic: // 90982;
1825 case NS_ooxml::LN_CT_WrapPath_start: // 90924;
1826 case NS_ooxml::LN_CT_WrapPath_lineTo: // 90925;
1827 case NS_ooxml::LN_CT_WrapTight_wrapPolygon: // 90933;
1828 case NS_ooxml::LN_graphic_graphic:
1829 case NS_ooxml::LN_pic_pic:
1831 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
1832 if( pProperties.get())
1834 pProperties->resolve(*this);
1837 break;
1838 case NS_ooxml::LN_CT_Anchor_positionH: // 90976;
1840 // Use a special handler for the positionning
1841 PositionHandlerPtr pHandler( new PositionHandler );
1842 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
1843 if( pProperties.get( ) )
1845 pProperties->resolve( *pHandler );
1847 m_pImpl->nHoriRelation = pHandler->m_nRelation;
1848 m_pImpl->nHoriOrient = pHandler->m_nOrient;
1849 m_pImpl->nLeftPosition = pHandler->m_nPosition;
1852 break;
1853 case NS_ooxml::LN_CT_Anchor_positionV: // 90977;
1855 // Use a special handler for the positionning
1856 PositionHandlerPtr pHandler( new PositionHandler );
1857 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
1858 if( pProperties.get( ) )
1860 pProperties->resolve( *pHandler );
1862 m_pImpl->nVertRelation = pHandler->m_nRelation;
1863 m_pImpl->nVertOrient = pHandler->m_nOrient;
1864 m_pImpl->nTopPosition = pHandler->m_nPosition;
1867 break;
1868 case 0x271b:
1869 case 0x271c:
1871 if( nSprmId != 0x271c || m_pImpl->nDffType == 0xf01f || m_pImpl->nDffType == 0xf01e )
1873 writerfilter::Reference<BinaryObj>::Pointer_t pPictureData = rSprm.getBinary();
1874 if( pPictureData.get())
1875 pPictureData->resolve(*this);
1878 break;
1879 case NS_ooxml::LN_EG_WrapType_wrapNone: // 90944; - doesn't contain attributes
1880 //depending on the behindDoc attribute text wraps through behind or in fron of the object
1881 m_pImpl->nWrap = text::WrapTextMode_THROUGHT;
1882 break;
1883 case NS_ooxml::LN_EG_WrapType_wrapTopAndBottom: // 90948;
1884 m_pImpl->nWrap = text::WrapTextMode_NONE;
1885 break;
1886 case NS_ooxml::LN_EG_WrapType_wrapThrough: // 90947;
1887 m_pImpl->nWrap = text::WrapTextMode_THROUGHT;
1888 break;
1889 case 0xf010:
1890 case 0xf011:
1891 //ignore - doesn't contain useful members
1892 break;
1893 case NS_ooxml::LN_CT_GraphicalObject_graphicData:// 90660;
1895 m_pImpl->bIsGraphic = true;
1897 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
1898 if( pProperties.get())
1899 pProperties->resolve(*this);
1901 break;
1902 default:
1903 #if OSL_DEBUG_LEVEL > 0
1904 ::rtl::OString sMessage( "GraphicImport::sprm() - Id: ");
1905 sMessage += ::rtl::OString::valueOf( sal_Int32( nSprmId ), 10 );
1906 sMessage += ::rtl::OString(" / 0x");
1907 sMessage += ::rtl::OString::valueOf( sal_Int32( nSprmId ), 16 );
1908 OSL_ENSURE( false, sMessage.getStr())
1909 #endif
1915 #ifdef DEBUG_DOMAINMAPPER
1916 dmapper_logger->endElement("sprm");
1917 #endif
1919 /*-- 01.11.2006 09:45:02---------------------------------------------------
1921 -----------------------------------------------------------------------*/
1922 void GraphicImport::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t /*ref*/)
1925 /*-- 16.11.2006 16:14:32---------------------------------------------------
1926 crop is stored as "fixed float" as 16.16 fraction value
1927 related to width/or height
1928 -----------------------------------------------------------------------*/
1929 void lcl_CalcCrop( sal_Int32& nCrop, sal_Int32 nRef )
1931 nCrop = ((nCrop >> 16 ) * nRef )
1932 + (((nCrop & 0xffff) * nRef ) >> 16);
1935 uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const beans::PropertyValues& aMediaProperties )
1937 uno::Reference< text::XTextContent > xGraphicObject;
1940 uno::Reference< graphic::XGraphicProvider > xGraphicProvider(
1941 m_xComponentContext->getServiceManager()->createInstanceWithContext(
1942 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.graphic.GraphicProvider")),
1943 m_xComponentContext),
1944 uno::UNO_QUERY_THROW );
1946 uno::Reference< graphic::XGraphic > xGraphic = xGraphicProvider->queryGraphic( aMediaProperties );
1948 if(xGraphic.is())
1950 PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
1952 uno::Reference< beans::XPropertySet > xGraphicObjectProperties(
1953 m_xTextFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextGraphicObject"))),
1954 uno::UNO_QUERY_THROW);
1955 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_GRAPHIC), uno::makeAny( xGraphic ));
1956 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_ANCHOR_TYPE),
1957 uno::makeAny( m_pImpl->eGraphicImportType == IMPORT_AS_SHAPE || m_pImpl->eGraphicImportType == IMPORT_AS_DETECTED_ANCHOR ?
1958 text::TextContentAnchorType_AT_CHARACTER :
1959 text::TextContentAnchorType_AS_CHARACTER ));
1960 xGraphicObject = uno::Reference< text::XTextContent >( xGraphicObjectProperties, uno::UNO_QUERY_THROW );
1962 //shapes have only one border, PICF might have four
1963 table::BorderLine aBorderLine;
1964 for( sal_Int32 nBorder = 0; nBorder < 4; ++nBorder )
1966 if( m_pImpl->eGraphicImportType == IMPORT_AS_GRAPHIC || !nBorder )
1968 aBorderLine.Color = m_pImpl->aBorders[m_pImpl->eGraphicImportType == IMPORT_AS_SHAPE ? BORDER_TOP : static_cast<BorderPosition>(nBorder) ].nLineColor;
1969 aBorderLine.InnerLineWidth = 0;
1970 aBorderLine.OuterLineWidth = (sal_Int16)m_pImpl->aBorders[m_pImpl->eGraphicImportType == IMPORT_AS_SHAPE ? BORDER_TOP : static_cast<BorderPosition>(nBorder) ].nLineWidth;
1971 aBorderLine.LineDistance = 0;
1973 PropertyIds aBorderProps[4] =
1975 PROP_LEFT_BORDER,
1976 PROP_RIGHT_BORDER,
1977 PROP_TOP_BORDER,
1978 PROP_BOTTOM_BORDER
1980 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( aBorderProps[nBorder]), uno::makeAny(aBorderLine));
1983 // setting properties for all types
1984 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_ALTERNATIVE_TEXT ),
1985 uno::makeAny( m_pImpl->sAlternativeText ));
1986 if( m_pImpl->bPositionProtected )
1987 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_POSITION_PROTECTED ),
1988 uno::makeAny(true));
1989 if( m_pImpl->bSizeProtected )
1990 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_SIZE_PROTECTED ),
1991 uno::makeAny(true));
1993 if( m_pImpl->eGraphicImportType == IMPORT_AS_SHAPE || m_pImpl->eGraphicImportType == IMPORT_AS_DETECTED_ANCHOR )
1995 sal_Int32 nWidth = m_pImpl->nRightPosition - m_pImpl->nLeftPosition;
1996 if( m_pImpl->eGraphicImportType == IMPORT_AS_SHAPE )
1998 sal_Int32 nHeight = m_pImpl->nBottomPosition - m_pImpl->nTopPosition;
1999 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_SIZE),
2000 uno::makeAny( awt::Size( nWidth, nHeight )));
2002 //adjust margins
2003 if( (m_pImpl->nHoriOrient == text::HoriOrientation::LEFT &&
2004 (m_pImpl->nHoriRelation == text::RelOrientation::PAGE_PRINT_AREA ||
2005 m_pImpl->nHoriRelation == text::RelOrientation::FRAME) ) ||
2006 (m_pImpl->nHoriOrient == text::HoriOrientation::INSIDE &&
2007 m_pImpl->nHoriRelation == text::RelOrientation::PAGE_PRINT_AREA ))
2008 m_pImpl->nLeftMargin = 0;
2009 if((m_pImpl->nHoriOrient == text::HoriOrientation::RIGHT &&
2010 (m_pImpl->nHoriRelation == text::RelOrientation::PAGE_PRINT_AREA ||
2011 m_pImpl->nHoriRelation == text::RelOrientation::FRAME) ) ||
2012 (m_pImpl->nHoriOrient == text::HoriOrientation::INSIDE &&
2013 m_pImpl->nHoriRelation == text::RelOrientation::PAGE_PRINT_AREA ))
2014 m_pImpl->nRightMargin = 0;
2015 // adjust top/bottom margins
2016 if( m_pImpl->nVertOrient == text::VertOrientation::TOP &&
2017 ( m_pImpl->nVertRelation == text::RelOrientation::PAGE_PRINT_AREA ||
2018 m_pImpl->nVertRelation == text::RelOrientation::PAGE_FRAME))
2019 m_pImpl->nTopMargin = 0;
2020 if( m_pImpl->nVertOrient == text::VertOrientation::BOTTOM &&
2021 ( m_pImpl->nVertRelation == text::RelOrientation::PAGE_PRINT_AREA ||
2022 m_pImpl->nVertRelation == text::RelOrientation::PAGE_FRAME))
2023 m_pImpl->nBottomMargin = 0;
2024 if( m_pImpl->nVertOrient == text::VertOrientation::BOTTOM &&
2025 m_pImpl->nVertRelation == text::RelOrientation::PAGE_PRINT_AREA )
2026 m_pImpl->nBottomMargin = 0;
2028 //adjust alignment
2029 if( m_pImpl->nHoriOrient == text::HoriOrientation::INSIDE &&
2030 m_pImpl->nHoriRelation == text::RelOrientation::PAGE_FRAME )
2032 // convert 'left to page' to 'from left -<width> to page text area'
2033 m_pImpl->nHoriOrient = text::HoriOrientation::NONE;
2034 m_pImpl->nHoriRelation = text::RelOrientation::PAGE_PRINT_AREA;
2035 m_pImpl->nLeftPosition = - nWidth;
2037 else if( m_pImpl->nHoriOrient == text::HoriOrientation::OUTSIDE &&
2038 m_pImpl->nHoriRelation == text::RelOrientation::PAGE_FRAME )
2040 // convert 'right to page' to 'from left 0 to right page border'
2041 m_pImpl->nHoriOrient = text::HoriOrientation::NONE;
2042 m_pImpl->nHoriRelation = text::RelOrientation::PAGE_RIGHT;
2043 m_pImpl->nLeftPosition = 0;
2046 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_ORIENT ),
2047 uno::makeAny(m_pImpl->nHoriOrient));
2048 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_ORIENT_POSITION),
2049 uno::makeAny(m_pImpl->nLeftPosition));
2050 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_ORIENT_RELATION ),
2051 uno::makeAny(m_pImpl->nHoriRelation));
2052 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_PAGE_TOGGLE ),
2053 uno::makeAny(m_pImpl->bPageToggle));
2054 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT ),
2055 uno::makeAny(m_pImpl->nVertOrient));
2056 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT_POSITION),
2057 uno::makeAny(m_pImpl->nTopPosition));
2058 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT_RELATION ),
2059 uno::makeAny(m_pImpl->nVertRelation));
2060 if( !m_pImpl->bOpaque )
2062 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_OPAQUE ),
2063 uno::makeAny(m_pImpl->bOpaque));
2065 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_SURROUND ),
2066 uno::makeAny(m_pImpl->nWrap));
2068 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_SURROUND_CONTOUR ),
2069 uno::makeAny(m_pImpl->bContour));
2070 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_CONTOUR_OUTSIDE ),
2071 uno::makeAny(true));
2072 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_LEFT_MARGIN ),
2073 uno::makeAny(m_pImpl->nLeftMargin));
2074 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_RIGHT_MARGIN ),
2075 uno::makeAny(m_pImpl->nRightMargin));
2076 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_TOP_MARGIN ),
2077 uno::makeAny(m_pImpl->nTopMargin));
2078 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_BOTTOM_MARGIN ),
2079 uno::makeAny(m_pImpl->nBottomMargin));
2081 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_CONTOUR_POLY_POLYGON),
2082 uno::Any());
2083 if( m_pImpl->eColorMode == drawing::ColorMode_STANDARD &&
2084 m_pImpl->nContrast == -70 &&
2085 m_pImpl->nBrightness == 70 )
2087 // strange definition of WATERMARK!
2088 m_pImpl->nContrast = 0;
2089 m_pImpl->nBrightness = 0;
2090 m_pImpl->eColorMode = drawing::ColorMode_WATERMARK;
2093 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_ADJUST_CONTRAST ),
2094 uno::makeAny((sal_Int16)m_pImpl->nContrast));
2095 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_ADJUST_LUMINANCE ),
2096 uno::makeAny((sal_Int16)m_pImpl->nBrightness));
2097 if(m_pImpl->eColorMode != drawing::ColorMode_STANDARD)
2098 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_GRAPHIC_COLOR_MODE ),
2099 uno::makeAny(m_pImpl->eColorMode));
2100 if(m_pImpl->fGamma > 0. )
2101 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_GAMMA ),
2102 uno::makeAny(m_pImpl->fGamma ));
2103 if(m_pImpl->bHoriFlip)
2105 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_MIRRORED_ON_EVEN_PAGES ),
2106 uno::makeAny( m_pImpl->bHoriFlip ));
2107 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_MIRRORED_ON_ODD_PAGES ),
2108 uno::makeAny( m_pImpl->bHoriFlip ));
2110 if( m_pImpl->bVertFlip )
2111 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_MIRRORED ),
2112 uno::makeAny( m_pImpl->bVertFlip ));
2113 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_BACK_COLOR ),
2114 uno::makeAny( m_pImpl->nFillColor ));
2115 //there seems to be no way to detect the original size via _real_ API
2116 uno::Reference< beans::XPropertySet > xGraphicProperties( xGraphic, uno::UNO_QUERY_THROW );
2117 awt::Size aGraphicSize, aGraphicSizePixel;
2118 xGraphicProperties->getPropertyValue(rPropNameSupplier.GetName( PROP_SIZE100th_M_M )) >>= aGraphicSize;
2119 xGraphicProperties->getPropertyValue(rPropNameSupplier.GetName( PROP_SIZE_PIXEL )) >>= aGraphicSizePixel;
2120 if( aGraphicSize.Width && aGraphicSize.Height )
2122 //todo: i71651 graphic size is not provided by the GraphicDescriptor
2123 lcl_CalcCrop( m_pImpl->nTopCrop, aGraphicSize.Height );
2124 lcl_CalcCrop( m_pImpl->nBottomCrop, aGraphicSize.Height );
2125 lcl_CalcCrop( m_pImpl->nLeftCrop, aGraphicSize.Width );
2126 lcl_CalcCrop( m_pImpl->nRightCrop, aGraphicSize.Width );
2128 xGraphicProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_GRAPHIC_CROP ),
2129 uno::makeAny(text::GraphicCrop(m_pImpl->nTopCrop, m_pImpl->nBottomCrop, m_pImpl->nLeftCrop, m_pImpl->nRightCrop)));
2133 if(m_pImpl->eGraphicImportType == IMPORT_AS_DETECTED_INLINE || m_pImpl->eGraphicImportType == IMPORT_AS_DETECTED_ANCHOR)
2135 if( m_pImpl->getXSize() && m_pImpl->getYSize() )
2136 xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_SIZE),
2137 uno::makeAny( awt::Size( m_pImpl->getXSize(), m_pImpl->getYSize() )));
2140 if( m_pImpl->sName.getLength() )
2142 uno::Reference< container::XNamed > xNamed( xGraphicObjectProperties, uno::UNO_QUERY_THROW );
2143 xNamed->setName( m_pImpl->sName );
2146 catch( const uno::Exception& )
2152 catch( const uno::Exception& e )
2154 clog << __FILE__ << ":" << __LINE__ << " failed. Message :" ;
2155 clog << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( ) << endl;
2157 return xGraphicObject;
2160 /*-- 01.11.2006 09:45:02---------------------------------------------------
2162 -----------------------------------------------------------------------*/
2163 void GraphicImport::data(const sal_uInt8* buf, size_t len, writerfilter::Reference<Properties>::Pointer_t /*ref*/)
2165 PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
2167 ::com::sun::star::beans::PropertyValues aMediaProperties( 1 );
2168 aMediaProperties[0].Name = rPropNameSupplier.GetName(PROP_INPUT_STREAM);
2170 uno::Reference< io::XInputStream > xIStream = new XInputStreamHelper( buf, len, m_pImpl->bIsBitmap );
2171 aMediaProperties[0].Value <<= xIStream;
2173 m_xGraphicObject = createGraphicObject( aMediaProperties );
2175 /*-- 01.11.2006 09:45:03---------------------------------------------------
2177 -----------------------------------------------------------------------*/
2178 void GraphicImport::startSectionGroup()
2181 /*-- 01.11.2006 09:45:03---------------------------------------------------
2183 -----------------------------------------------------------------------*/
2184 void GraphicImport::endSectionGroup()
2187 /*-- 01.11.2006 09:45:03---------------------------------------------------
2189 -----------------------------------------------------------------------*/
2190 void GraphicImport::startParagraphGroup()
2193 /*-- 01.11.2006 09:45:03---------------------------------------------------
2195 -----------------------------------------------------------------------*/
2196 void GraphicImport::endParagraphGroup()
2199 /*-- 01.11.2006 09:45:03---------------------------------------------------
2201 -----------------------------------------------------------------------*/
2202 void GraphicImport::startCharacterGroup()
2205 /*-- 01.11.2006 09:45:04---------------------------------------------------
2207 -----------------------------------------------------------------------*/
2208 void GraphicImport::endCharacterGroup()
2211 /*-- 01.11.2006 09:45:04---------------------------------------------------
2213 -----------------------------------------------------------------------*/
2214 void GraphicImport::text(const sal_uInt8 * /*_data*/, size_t /*len*/)
2217 /*-- 01.11.2006 09:45:05---------------------------------------------------
2219 -----------------------------------------------------------------------*/
2220 void GraphicImport::utext(const sal_uInt8 * /*_data*/, size_t /*len*/)
2223 /*-- 01.11.2006 09:45:05---------------------------------------------------
2225 -----------------------------------------------------------------------*/
2226 void GraphicImport::props(writerfilter::Reference<Properties>::Pointer_t /*ref*/)
2229 /*-- 01.11.2006 09:45:06---------------------------------------------------
2231 -----------------------------------------------------------------------*/
2232 void GraphicImport::table(Id /*name*/, writerfilter::Reference<Table>::Pointer_t /*ref*/)
2235 /*-- 01.11.2006 09:45:07---------------------------------------------------
2237 -----------------------------------------------------------------------*/
2238 void GraphicImport::substream(Id /*name*/, ::writerfilter::Reference<Stream>::Pointer_t /*ref*/)
2241 /*-- 01.11.2006 09:45:07---------------------------------------------------
2243 -----------------------------------------------------------------------*/
2244 void GraphicImport::info(const string & /*info*/)
2248 void GraphicImport::startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > /*xShape*/ )
2252 void GraphicImport::endShape( )
2256 /*-- 09.08.2007 10:17:00---------------------------------------------------
2258 -----------------------------------------------------------------------*/
2259 bool GraphicImport::IsGraphic() const
2261 return m_pImpl->bIsGraphic;