LibreOffice Module filter (master) 1
cgm.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <o3tl/safeint.hxx>
21#include <osl/endian.h>
22#include <filter/importcgm.hxx>
23#include <tools/stream.hxx>
24#include "bitmap.hxx"
25#include "chart.hxx"
26#include "elements.hxx"
27#include "outact.hxx"
28#include <memory>
29#include <sal/log.hxx>
31
32using namespace ::com::sun::star;
33
34constexpr double gnOutdx = 28000; // Output size in 1/100TH mm
35constexpr double gnOutdy = 21000; // on which is mapped
36
37CGM::CGM(uno::Reference< frame::XModel > const & rModel)
38 : mnVDCXadd(0)
39 , mnVDCYadd(0)
40 , mnVDCXmul(0)
41 , mnVDCYmul(0)
42 , mnVDCdx(0)
43 , mnVDCdy(0)
44 , mnXFraction(0)
45 , mnYFraction(0)
46 , mbAngReverse(false)
47 , mbStatus(true)
48 , mbMetaFile(false)
49 , mbIsFinished(false)
50 , mbPicture(false)
51 , mbPictureBody(false)
52 , mbFigure(false)
53 , mbFirstOutPut(false)
54 , mbInDefaultReplacement(false)
55 , mnAct4PostReset(0)
56 , mnBitmapInserts(0)
57 , mpOutAct(new CGMImpressOutAct(*this, rModel))
58 , mpSource(nullptr)
59 , mpEndValidSource(nullptr)
60 , mnParaSize(0)
61 , mnActCount(0)
62 , mnEscape(0)
63 , mnElementClass(0)
64 , mnElementID(0)
65 , mnElementSize(0)
66{
67 pElement.reset( new CGMElements );
68 pCopyOfE.reset( new CGMElements );
69}
70
72{
73 maDefRepList.clear();
74 maDefRepSizeList.clear();
75};
76
77sal_uInt32 CGM::GetBackGroundColor() const
78{
79 return pElement ? pElement->aColorTable[ 0 ] : 0;
80}
81
82sal_uInt32 CGM::ImplGetUI16()
83{
84 sal_uInt8* pSource = mpSource + mnParaSize;
85 if (mpEndValidSource - pSource < 2)
86 throw css::uno::Exception("attempt to read past end of input", nullptr);
87 mnParaSize += 2;
88 return ( pSource[ 0 ] << 8 ) + pSource[ 1 ];
89};
90
91sal_uInt8 CGM::ImplGetByte( sal_uInt32 nSource, sal_uInt32 nPrecision )
92{
93 return static_cast<sal_uInt8>( nSource >> ( ( nPrecision - 1 ) << 3 ) );
94};
95
96sal_Int32 CGM::ImplGetI( sal_uInt32 nPrecision )
97{
98 sal_uInt8* pSource = mpSource + mnParaSize;
99 if (pSource > mpEndValidSource || o3tl::make_unsigned(mpEndValidSource - pSource) < nPrecision)
100 throw css::uno::Exception("attempt to read past end of input", nullptr);
101 mnParaSize += nPrecision;
102 switch( nPrecision )
103 {
104 case 1 :
105 {
106 return static_cast<char>(*pSource);
107 }
108
109 case 2 :
110 {
111 return static_cast<sal_Int16>( ( pSource[ 0 ] << 8 ) | pSource[ 1 ] );
112 }
113
114 case 3 :
115 {
116 return ( ( pSource[ 0 ] << 24 ) | ( pSource[ 1 ] << 16 ) | pSource[ 2 ] << 8 ) >> 8;
117 }
118 case 4:
119 {
120 return static_cast<sal_Int32>( ( pSource[ 0 ] << 24 ) | ( pSource[ 1 ] << 16 ) | ( pSource[ 2 ] << 8 ) | ( pSource[ 3 ] ) );
121 }
122 default:
123 mbStatus = false;
124 return 0;
125 }
126}
127
128sal_uInt32 CGM::ImplGetUI( sal_uInt32 nPrecision )
129{
130 sal_uInt8* pSource = mpSource + mnParaSize;
131 if (pSource > mpEndValidSource || o3tl::make_unsigned(mpEndValidSource - pSource) < nPrecision)
132 throw css::uno::Exception("attempt to read past end of input", nullptr);
133 mnParaSize += nPrecision;
134 switch( nPrecision )
135 {
136 case 1 :
137 return static_cast<sal_Int8>(*pSource);
138 case 2 :
139 {
140 return static_cast<sal_uInt16>( ( pSource[ 0 ] << 8 ) | pSource[ 1 ] );
141 }
142 case 3 :
143 {
144 return ( pSource[ 0 ] << 16 ) | ( pSource[ 1 ] << 8 ) | pSource[ 2 ];
145 }
146 case 4:
147 {
148 return static_cast<sal_uInt32>( ( pSource[ 0 ] << 24 ) | ( pSource[ 1 ] << 16 ) | ( pSource[ 2 ] << 8 ) | ( pSource[ 3 ] ) );
149 }
150 default:
151 mbStatus = false;
152 return 0;
153 }
154}
155
156void CGM::ImplGetSwitch4( const sal_uInt8* pSource, sal_uInt8* pDest )
157{
158 for ( int i = 0; i < 4; i++ )
159 {
160 pDest[ i ] = pSource[ i ^ 3 ]; // Little Endian <-> Big Endian switch
161 }
162}
163
164void CGM::ImplGetSwitch8( const sal_uInt8* pSource, sal_uInt8* pDest )
165{
166 for ( int i = 0; i < 8; i++ )
167 {
168 pDest[ i ] = pSource[ i ^ 7 ]; // Little Endian <-> Big Endian switch
169 }
170}
171
172double CGM::ImplGetFloat( RealPrecision eRealPrecision, sal_uInt32 nRealSize )
173{
174 void* pPtr;
175 sal_uInt8 aBuf[8];
176 double nRetValue;
177 double fDoubleBuf;
178 float fFloatBuf;
179
180#ifdef OSL_BIGENDIAN
181 const bool bCompatible = true;
182#else
183 const bool bCompatible = false;
184#endif
185
187 throw css::uno::Exception("attempt to read past end of input", nullptr);
188
189 if ( bCompatible )
190 {
191 pPtr = mpSource + mnParaSize;
192 }
193 else
194 {
195 if ( nRealSize == 4 )
197 else
199 pPtr = &aBuf;
200 }
201 if ( eRealPrecision == RP_FLOAT )
202 {
203 if ( nRealSize == 4 )
204 {
205 memcpy( static_cast<void*>(&fFloatBuf), pPtr, 4 );
206 nRetValue = static_cast<double>(fFloatBuf);
207 }
208 else
209 {
210 memcpy( static_cast<void*>(&fDoubleBuf), pPtr, 8 );
211 nRetValue = fDoubleBuf;
212 }
213 }
214 else // ->RP_FIXED
215 {
216 tools::Long nVal;
217 const int nSwitch = bCompatible ? 0 : 1 ;
218 if ( nRealSize == 4 )
219 {
220 sal_uInt16* pShort = static_cast<sal_uInt16*>(pPtr);
221 nVal = pShort[ nSwitch ];
222 nVal <<= 16;
223 nVal |= pShort[ nSwitch ^ 1 ];
224 nRetValue = static_cast<double>(nVal);
225 nRetValue /= 65536;
226 }
227 else
228 {
229 sal_Int32* pLong = static_cast<sal_Int32*>(pPtr);
230 nRetValue = static_cast<double>(abs( pLong[ nSwitch ] ));
231 nRetValue *= 65536;
232 nVal = static_cast<sal_uInt32>( pLong[ nSwitch ^ 1 ] );
233 nVal >>= 16;
234 nRetValue += static_cast<double>(nVal);
235 if ( pLong[ nSwitch ] < 0 )
236 {
237 nRetValue = -nRetValue;
238 }
239 nRetValue /= 65536;
240 }
241 }
242 mnParaSize += nRealSize;
243 return nRetValue;
244}
245
247{
248 if ( pElement->eVDCType == VDC_INTEGER )
249 return pElement->nVDCIntegerPrecision << 1;
250 else
251 return pElement->nVDCRealSize << 1;
252}
253
254inline double CGM::ImplGetIX()
255{
256 return ( ( ImplGetI( pElement->nVDCIntegerPrecision ) + mnVDCXadd ) * mnVDCXmul );
257}
258
259inline double CGM::ImplGetFX()
260{
261 return ( ( ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize ) + mnVDCXadd ) * mnVDCXmul );
262}
263
264inline double CGM::ImplGetIY()
265{
266 return ( ( ImplGetI( pElement->nVDCIntegerPrecision ) + mnVDCYadd ) * mnVDCYmul );
267}
268
269inline double CGM::ImplGetFY()
270{
271 return ( ( ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize ) + mnVDCYadd ) * mnVDCYmul );
272}
273
274void CGM::ImplGetPoint( FloatPoint& rFloatPoint, bool bMap )
275{
276 if ( pElement->eVDCType == VDC_INTEGER )
277 {
278 rFloatPoint.X = ImplGetIX();
279 rFloatPoint.Y = ImplGetIY();
280 }
281 else // ->floating points
282 {
283 rFloatPoint.X = ImplGetFX();
284 rFloatPoint.Y = ImplGetFY();
285 }
286 if ( bMap )
287 ImplMapPoint( rFloatPoint );
288}
289
290void CGM::ImplGetRectangle( FloatRect& rFloatRect, bool bMap )
291{
292 if ( pElement->eVDCType == VDC_INTEGER )
293 {
294 rFloatRect.Left = ImplGetIX();
295 rFloatRect.Bottom = ImplGetIY();
296 rFloatRect.Right = ImplGetIX();
297 rFloatRect.Top = ImplGetIY();
298 }
299 else // ->floating points
300 {
301 rFloatRect.Left = ImplGetFX();
302 rFloatRect.Bottom = ImplGetFY();
303 rFloatRect.Right = ImplGetFX();
304 rFloatRect.Top = ImplGetFY();
305 }
306 if ( bMap )
307 {
308 ImplMapX( rFloatRect.Left );
309 ImplMapX( rFloatRect.Right );
310 ImplMapY( rFloatRect.Top );
311 ImplMapY( rFloatRect.Bottom );
312 rFloatRect.Justify();
313 }
314}
315
317{
318 if ( pElement->eVDCType == VDC_INTEGER )
319 {
320 rFloatRect.Left = ImplGetI( pElement->nVDCIntegerPrecision );
321 rFloatRect.Bottom = ImplGetI( pElement->nVDCIntegerPrecision );
322 rFloatRect.Right = ImplGetI( pElement->nVDCIntegerPrecision );
323 rFloatRect.Top = ImplGetI( pElement->nVDCIntegerPrecision );
324 }
325 else // ->floating points
326 {
327 rFloatRect.Left = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
328 rFloatRect.Bottom = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
329 rFloatRect.Right = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
330 rFloatRect.Top = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
331 }
332}
333
334sal_uInt32 CGM::ImplGetBitmapColor( bool bDirect )
335{
336 // the background color is always a direct color
337
338 sal_uInt32 nTmp;
339 if ( ( pElement->eColorSelectionMode == CSM_DIRECT ) || bDirect )
340 {
341 sal_uInt32 nColor = ImplGetByte( ImplGetUI( pElement->nColorPrecision ), 1 );
342 sal_uInt32 nDiff = pElement->nColorValueExtent[ 3 ] - pElement->nColorValueExtent[ 0 ] + 1;
343
344 if ( !nDiff )
345 nDiff++;
346 nColor = ( ( nColor - pElement->nColorValueExtent[ 0 ] ) << 8 ) / nDiff;
347 nTmp = nColor << 16 & 0xff0000;
348
349 nColor = ImplGetByte( ImplGetUI( pElement->nColorPrecision ), 1 );
350 nDiff = pElement->nColorValueExtent[ 4 ] - pElement->nColorValueExtent[ 1 ] + 1;
351 if ( !nDiff )
352 nDiff++;
353 nColor = ( ( nColor - pElement->nColorValueExtent[ 1 ] ) << 8 ) / nDiff;
354 nTmp |= nColor << 8 & 0xff00;
355
356 nColor = ImplGetByte( ImplGetUI( pElement->nColorPrecision ), 1 );
357 nDiff = pElement->nColorValueExtent[ 5 ] - pElement->nColorValueExtent[ 2 ] + 1;
358 if ( !nDiff )
359 nDiff++;
360 nColor = ( ( nColor - pElement->nColorValueExtent[ 2 ] ) << 8 ) / nDiff;
361 nTmp |= static_cast<sal_uInt8>(nColor);
362 }
363 else
364 {
365 sal_uInt32 nIndex = ImplGetUI( pElement->nColorIndexPrecision );
366 nTmp = pElement->aColorTable[ static_cast<sal_uInt8>(nIndex) ] ;
367 }
368 return nTmp;
369}
370
371// call this function each time after the mapmode settings has been changed
373{
374 int nAngReverse = 1;
375 mnVDCdx = pElement->aVDCExtent.Right - pElement->aVDCExtent.Left;
376
377 mnVDCXadd = -pElement->aVDCExtent.Left;
378 mnVDCXmul = 1;
379 if ( mnVDCdx < 0 )
380 {
381 nAngReverse ^= 1;
382 mnVDCdx = -mnVDCdx;
383 mnVDCXmul = -1;
384 }
385
386 mnVDCdy = pElement->aVDCExtent.Bottom - pElement->aVDCExtent.Top;
387 mnVDCYadd = -pElement->aVDCExtent.Top;
388 mnVDCYmul = 1;
389 if ( mnVDCdy < 0 )
390 {
391 nAngReverse ^= 1;
392 mnVDCdy = -mnVDCdy;
393 mnVDCYmul = -1;
394 }
395 if ( nAngReverse )
396 mbAngReverse = true;
397 else
398 mbAngReverse = false;
399
400 if (mnVDCdy == 0.0 || mnVDCdx == 0.0 || gnOutdy == 0.0)
401 {
402 mbStatus = false;
403 return;
404 }
405
406 double fQuo1 = mnVDCdx / mnVDCdy;
407 double fQuo2 = gnOutdx / gnOutdy;
408 if ( fQuo2 < fQuo1 )
409 {
411 mnYFraction = gnOutdy * ( fQuo2 / fQuo1 ) / mnVDCdy;
412 }
413 else
414 {
415 mnXFraction = gnOutdx * ( fQuo1 / fQuo2 ) / mnVDCdx;
417 }
418}
419
420void CGM::ImplMapDouble( double& nNumb )
421{
422 if ( pElement->eDeviceViewPortMap != DVPM_FORCED )
423 return;
424
425 // point is 1mm * ScalingFactor
426 switch ( pElement->eDeviceViewPortMode )
427 {
428 case DVPM_FRACTION :
429 {
430 nNumb *= ( mnXFraction + mnYFraction ) / 2;
431 }
432 break;
433
434 case DVPM_METRIC :
435 {
436 // nNumb *= ( 100 * pElement->nDeviceViewPortScale );
437 nNumb *= ( mnXFraction + mnYFraction ) / 2;
438 if ( pElement->nDeviceViewPortScale < 0 )
439 nNumb = -nNumb;
440 }
441 break;
442
443 case DVPM_DEVICE :
444 {
445
446 }
447 break;
448
449 default:
450
451 break;
452 }
453}
454
455void CGM::ImplMapX( double& nNumb )
456{
457 if ( pElement->eDeviceViewPortMap != DVPM_FORCED )
458 return;
459
460 // point is 1mm * ScalingFactor
461 switch ( pElement->eDeviceViewPortMode )
462 {
463 case DVPM_FRACTION :
464 {
465 nNumb *= mnXFraction;
466 }
467 break;
468
469 case DVPM_METRIC :
470 {
471 // nNumb *= ( 100 * pElement->nDeviceViewPortScale );
472 nNumb *= mnXFraction;
473 if ( pElement->nDeviceViewPortScale < 0 )
474 nNumb = -nNumb;
475 }
476 break;
477
478 case DVPM_DEVICE :
479 {
480
481 }
482 break;
483
484 default:
485
486 break;
487 }
488}
489
490void CGM::ImplMapY( double& nNumb )
491{
492 if ( pElement->eDeviceViewPortMap != DVPM_FORCED )
493 return;
494
495 // point is 1mm * ScalingFactor
496 switch ( pElement->eDeviceViewPortMode )
497 {
498 case DVPM_FRACTION :
499 {
500 nNumb *= mnYFraction;
501 }
502 break;
503
504 case DVPM_METRIC :
505 {
506 // nNumb *= ( 100 * pElement->nDeviceViewPortScale );
507 nNumb *= mnYFraction;
508 if ( pElement->nDeviceViewPortScale < 0 )
509 nNumb = -nNumb;
510 }
511 break;
512
513 case DVPM_DEVICE :
514 {
515
516 }
517 break;
518
519 default:
520
521 break;
522 }
523}
524
525// convert a point to the current VC mapmode (1/100TH mm)
526void CGM::ImplMapPoint( FloatPoint& rFloatPoint )
527{
528 if ( pElement->eDeviceViewPortMap != DVPM_FORCED )
529 return;
530
531 // point is 1mm * ScalingFactor
532 switch ( pElement->eDeviceViewPortMode )
533 {
534 case DVPM_FRACTION :
535 {
536 rFloatPoint.X *= mnXFraction;
537 rFloatPoint.Y *= mnYFraction;
538 }
539 break;
540
541 case DVPM_METRIC :
542 {
543 rFloatPoint.X *= mnXFraction;
544 rFloatPoint.Y *= mnYFraction;
545 if ( pElement->nDeviceViewPortScale < 0 )
546 {
547 rFloatPoint.X = -rFloatPoint.X;
548 rFloatPoint.Y = -rFloatPoint.Y;
549 }
550 }
551 break;
552
553 case DVPM_DEVICE :
554 {
555
556 }
557 break;
558
559 default:
560
561 break;
562 }
563}
564
566{
567 switch ( mnElementClass )
568 {
569 case 0 : ImplDoClass0(); break;
570 case 1 : ImplDoClass1(); break;
571 case 2 : ImplDoClass2(); break;
572 case 3 : ImplDoClass3(); break;
573 case 4 :
574 {
575 ImplDoClass4();
576 mnAct4PostReset = 0;
577 }
578 break;
579 case 5 : ImplDoClass5(); break;
580 case 6 : ImplDoClass6(); break;
581 case 7 : ImplDoClass7(); break;
582 case 8 : ImplDoClass8(); break;
583 case 9 : ImplDoClass9(); break;
584 case 15 :ImplDoClass15(); break;
585 default: break;
586 }
587 mnActCount++;
588};
589
591{
592 if (maDefRepList.empty())
593 return;
594
596 {
597 SAL_WARN("filter.icgm", "recursion in ImplDefaultReplacement");
598 return;
599 }
600
602
603 sal_uInt32 nOldEscape = mnEscape;
604 sal_uInt32 nOldElementClass = mnElementClass;
605 sal_uInt32 nOldElementID = mnElementID;
606 sal_uInt32 nOldElementSize = mnElementSize;
607 sal_uInt8* pOldBuf = mpSource;
608 sal_uInt8* pOldEndValidSource = mpEndValidSource;
609
610 for ( size_t i = 0, n = maDefRepList.size(); i < n; ++i )
611 {
612 sal_uInt8* pBuf = maDefRepList[ i ].get();
613 sal_uInt32 nElementSize = maDefRepSizeList[ i ];
614 mpEndValidSource = pBuf + nElementSize;
615 sal_uInt32 nCount = 0;
616 while ( mbStatus && ( nCount < nElementSize ) )
617 {
618 mpSource = pBuf + nCount;
619 mnParaSize = 0;
621 mnElementClass = mnEscape >> 12;
622 mnElementID = ( mnEscape & 0x0fe0 ) >> 5;
623 mnElementSize = mnEscape & 0x1f;
624 if ( mnElementSize == 31 )
625 {
627 }
629 mnParaSize = 0;
630 mpSource = pBuf + nCount;
631 if ( mnElementSize & 1 )
632 nCount++;
634 if ( ( mnElementClass != 1 ) || ( mnElementID != 0xc ) ) // recursion is not possible here!!
635 ImplDoClass();
636 }
637 }
638 mnEscape = nOldEscape;
639 mnElementClass = nOldElementClass;
640 mnElementID = nOldElementID;
641 mnParaSize = mnElementSize = nOldElementSize;
642 mpSource = pOldBuf;
643 mpEndValidSource = pOldEndValidSource;
644
646}
647
648bool CGM::Write( SvStream& rIStm )
649{
650 if ( !mpBuf )
651 mpBuf.reset( new sal_uInt8[ 0xffff ] );
652
653 mnParaSize = 0;
654 mpSource = mpBuf.get();
655 if (rIStm.ReadBytes(mpSource, 2) != 2)
656 return false;
659 mnElementClass = mnEscape >> 12;
660 mnElementID = ( mnEscape & 0x0fe0 ) >> 5;
661 mnElementSize = mnEscape & 0x1f;
662
663 if ( mnElementSize == 31 )
664 {
665 if (rIStm.ReadBytes(mpSource + mnParaSize, 2) != 2)
666 return false;
669 }
670 mnParaSize = 0;
671 if (mnElementSize)
672 {
674 return false;
676 }
677
678 if ( mnElementSize & 1 )
679 rIStm.SeekRel( 1 );
680 ImplDoClass();
681
682 return mbStatus;
683};
684
685// GraphicImport - the exported function
686FILTER_DLLPUBLIC sal_uInt32
687ImportCGM(SvStream& rIn, uno::Reference< frame::XModel > const & rXModel, css::uno::Reference<css::task::XStatusIndicator> const & aXStatInd)
688{
689
690 sal_uInt32 nStatus = 0; // retvalue == 0 -> ERROR
691 // == 0xffrrggbb -> background color in the lower 24 bits
692
693 if( rXModel.is() )
694 {
695 try
696 {
697 CGM aCGM(rXModel);
698 if (aCGM.IsValid())
699 {
700 rIn.SetEndian(SvStreamEndian::BIG);
701 sal_uInt64 const nInSize = rIn.remainingSize();
702 rIn.Seek(0);
703
704 sal_uInt32 nNext = 0;
705 sal_uInt32 nAdd = nInSize / 20;
706 bool bProgressBar = aXStatInd.is();
707 if ( bProgressBar )
708 aXStatInd->start( "CGM Import" , nInSize );
709
710 while (aCGM.IsValid() && (rIn.Tell() < nInSize) && !aCGM.IsFinished())
711 {
712 if ( bProgressBar )
713 {
714 sal_uInt32 nCurrentPos = rIn.Tell();
715 if ( nCurrentPos >= nNext )
716 {
717 aXStatInd->setValue( nCurrentPos );
718 nNext = nCurrentPos + nAdd;
719 }
720 }
721
722 if (!aCGM.Write(rIn))
723 break;
724 }
725 if ( aCGM.IsValid() )
726 {
727 nStatus = aCGM.GetBackGroundColor() | 0xff000000;
728 }
729 if ( bProgressBar )
730 aXStatInd->end();
731 }
732 }
733 catch (const css::uno::Exception&)
734 {
735 TOOLS_WARN_EXCEPTION("filter.icgm", "");
736 nStatus = 0;
737 }
738 }
739 return nStatus;
740}
741
742/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool mbIsFinished
constexpr double gnOutdx
Definition: cgm.cxx:34
constexpr double gnOutdy
Definition: cgm.cxx:35
FILTER_DLLPUBLIC sal_uInt32 ImportCGM(SvStream &rIn, uno::Reference< frame::XModel > const &rXModel, css::uno::Reference< css::task::XStatusIndicator > const &aXStatInd)
Definition: cgm.cxx:687
@ DVPM_DEVICE
Definition: cgmtypes.hxx:90
@ DVPM_FRACTION
Definition: cgmtypes.hxx:90
@ DVPM_METRIC
Definition: cgmtypes.hxx:90
@ DVPM_FORCED
Definition: cgmtypes.hxx:91
@ CSM_DIRECT
Definition: cgmtypes.hxx:97
@ VDC_INTEGER
Definition: cgmtypes.hxx:89
RealPrecision
Definition: cgmtypes.hxx:85
@ RP_FLOAT
Definition: cgmtypes.hxx:85
Definition: cgm.hxx:39
void ImplDoClass6()
Definition: classx.cxx:40
~CGM()
Definition: cgm.cxx:71
void ImplSetMapMode()
Definition: cgm.cxx:372
sal_uInt32 mnActCount
Definition: cgm.hxx:79
double mnVDCdy
Definition: cgm.hxx:50
void ImplDoClass4()
Definition: class4.cxx:110
void ImplGetRectangleNS(FloatRect &)
Definition: cgm.cxx:316
void ImplMapX(double &)
Definition: cgm.cxx:455
sal_uInt32 mnElementClass
Definition: cgm.hxx:85
double mnXFraction
Definition: cgm.hxx:51
void ImplDoClass5()
Definition: class5.cxx:27
void ImplMapPoint(FloatPoint &)
Definition: cgm.cxx:526
double ImplGetFloat(RealPrecision, sal_uInt32 nRealSize)
Definition: cgm.cxx:172
bool IsValid() const
Definition: cgm.hxx:136
bool IsFinished() const
Definition: cgm.hxx:137
double mnVDCXmul
Definition: cgm.hxx:47
double ImplGetIY()
Definition: cgm.cxx:264
double mnVDCYadd
Definition: cgm.hxx:46
static void ImplGetSwitch4(const sal_uInt8 *pSource, sal_uInt8 *pDest)
Definition: cgm.cxx:156
static sal_uInt8 ImplGetByte(sal_uInt32 nSource, sal_uInt32 nPrecision)
Definition: cgm.cxx:91
void ImplDoClass7()
Definition: class7.cxx:29
void ImplDoClass()
Definition: cgm.cxx:565
double mnVDCXadd
Definition: cgm.hxx:45
bool mbStatus
Definition: cgm.hxx:55
bool mbAngReverse
Definition: cgm.hxx:53
sal_Int32 ImplGetI(sal_uInt32 nPrecision)
Definition: cgm.cxx:96
void ImplMapDouble(double &)
Definition: cgm.cxx:420
double mnYFraction
Definition: cgm.hxx:52
CGM(css::uno::Reference< css::frame::XModel > const &rModel)
Definition: cgm.cxx:37
sal_uInt32 mnElementID
Definition: cgm.hxx:86
sal_uInt32 ImplGetBitmapColor(bool bDirectColor=false)
Definition: cgm.cxx:334
sal_uInt32 ImplGetUI16()
Definition: cgm.cxx:82
void ImplDoClass15()
Definition: classx.cxx:237
void ImplDoClass3()
Definition: class3.cxx:26
sal_uInt8 * mpSource
Definition: cgm.hxx:75
void ImplGetPoint(FloatPoint &rFloatPoint, bool bMap=false)
Definition: cgm.cxx:274
void ImplDoClass1()
Definition: class1.cxx:30
void ImplGetRectangle(FloatRect &, bool bMap=false)
Definition: cgm.cxx:290
double ImplGetFY()
Definition: cgm.cxx:269
sal_uInt32 mnEscape
Definition: cgm.hxx:84
bool mbInDefaultReplacement
Definition: cgm.hxx:62
void ImplDoClass0()
Definition: class0.cxx:26
sal_uInt8 * mpEndValidSource
Definition: cgm.hxx:77
double ImplGetFX()
Definition: cgm.cxx:259
void ImplDefaultReplacement()
Definition: cgm.cxx:590
static void ImplGetSwitch8(const sal_uInt8 *pSource, sal_uInt8 *pDest)
Definition: cgm.cxx:164
::std::vector< std::unique_ptr< sal_uInt8[]> > maDefRepList
Definition: cgm.hxx:72
::std::vector< sal_uInt32 > maDefRepSizeList
Definition: cgm.hxx:73
std::unique_ptr< sal_uInt8[]> mpBuf
Definition: cgm.hxx:81
bool Write(SvStream &rIStm)
Definition: cgm.cxx:648
double ImplGetIX()
Definition: cgm.cxx:254
sal_uInt32 ImplGetUI(sal_uInt32 nPrecision)
Definition: cgm.cxx:128
sal_uInt32 mnElementSize
Definition: cgm.hxx:87
std::unique_ptr< CGMElements > pCopyOfE
Definition: cgm.hxx:70
void ImplMapY(double &)
Definition: cgm.cxx:490
double mnVDCdx
Definition: cgm.hxx:49
std::unique_ptr< CGMElements > pElement
Definition: cgm.hxx:69
void ImplDoClass9()
Definition: classx.cxx:218
sal_uInt32 ImplGetPointSize()
Definition: cgm.cxx:246
sal_uInt32 mnAct4PostReset
Definition: cgm.hxx:63
void ImplDoClass2()
Definition: class2.cxx:25
double mnVDCYmul
Definition: cgm.hxx:48
void ImplDoClass8()
Definition: classx.cxx:200
sal_uInt32 mnParaSize
Definition: cgm.hxx:78
sal_uInt32 GetBackGroundColor() const
Definition: cgm.cxx:77
sal_uInt64 Tell() const
void SetEndian(SvStreamEndian SvStreamEndian)
sal_uInt64 Seek(sal_uInt64 nPos)
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 SeekRel(sal_Int64 nPos)
sal_uInt64 remainingSize()
int nCount
#define TOOLS_WARN_EXCEPTION(area, stream)
#define FILTER_DLLPUBLIC
Definition: dllapi.h:29
sal_Int32 nIndex
sal_Int64 n
#define SAL_WARN(area, stream)
aBuf
Shape IDs per cluster in DGG atom.
int i
Definition: gentoken.py:48
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
long Long
SwNodeOffset abs(const SwNodeOffset &a)
double Y
Definition: cgmtypes.hxx:27
double X
Definition: cgmtypes.hxx:26
double Left
Definition: cgmtypes.hxx:33
double Right
Definition: cgmtypes.hxx:35
void Justify()
Definition: cgmtypes.hxx:38
double Bottom
Definition: cgmtypes.hxx:36
double Top
Definition: cgmtypes.hxx:34
unsigned char sal_uInt8
signed char sal_Int8