LibreOffice Module lotuswordpro (master) 1
lwpdrawobj.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*************************************************************************
3 *
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
6 *
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
9 *
10 * Sun Microsystems Inc., October, 2000
11 *
12 * GNU Lesser General Public License Version 2.1
13 * =============================================
14 * Copyright 2000 by Sun Microsystems, Inc.
15 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 *
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License version 2.1, as published by the Free Software Foundation.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 *
31 *
32 * Sun Industry Standards Source License Version 1.1
33 * =================================================
34 * The contents of this file are subject to the Sun Industry Standards
35 * Source License Version 1.1 (the "License"); You may not use this file
36 * except in compliance with the License. You may obtain a copy of the
37 * License at http://www.openoffice.org/license.html.
38 *
39 * Software provided under this License is provided on an "AS IS" basis,
40 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 * See the License for the specific provisions governing your rights and
44 * obligations concerning the Software.
45 *
46 * The Initial Developer of the Original Code is: IBM Corporation
47 *
48 * Copyright: 2008 by IBM Corporation
49 *
50 * All Rights Reserved.
51 *
52 * Contributor(s): _______________________________________
53 *
54 *
55 ************************************************************************/
61#include <osl/thread.h>
62#include <lwpglobalmgr.hxx>
63#include "lwpdrawobj.hxx"
64#include <lwptools.hxx>
65#include <tools/stream.hxx>
67
68#include <xfilter/xfframe.hxx>
69
70#include <xfilter/xfglobal.hxx>
77#include <xfilter/xffont.hxx>
78
83#include <xfilter/xfimage.hxx>
84
85#include "lwpcharsetmgr.hxx"
86#include "lwpsdwrect.hxx"
87
94 , m_pStream(pStream)
95 , m_pTransData(pTransData)
96{
98}
99
104{
105 //flags
106 m_pStream->SeekRel(1);
107
108 //record Length
110
111 //boundrect
116
117 //nextObj, prevObj
118 m_pStream->SeekRel(4);
119}
120
125{
126 if ((m_eType != OT_POLYGON) && (m_eType != OT_TEXTART))
127 {
128 m_pStream->SeekRel(8);
129 }
130
133
134 // pen color
139
140 // foreground color
145
146 // background color
151
152 // fill style
156}
157
163{
164 if (!pStyle)
165 {
166 assert(false);
167 return;
168 }
169
174
176 {
177 default: //fall through!
178 case FT_TRANSPARENT:
179 {
180 // set fill style : none
181 break;
182 }
183 case FT_SOLID:
184 {
185 pStyle->SetAreaColor(aForeColor);
186 break;
187 }
188 case FT_HORZHATCH:
189 {
190 pStyle->SetAreaColor(aBackColor);
191 pStyle->SetAreaLineStyle(enumXFAreaLineSingle, 0, 0.12, aForeColor);
192 break;
193 }
194 case FT_VERTHATCH:
195 {
196 pStyle->SetAreaColor(aBackColor);
197 pStyle->SetAreaLineStyle(enumXFAreaLineSingle, 90, 0.12, aForeColor);
198 break;
199 }
200 case FT_FDIAGHATCH:
201 {
202 pStyle->SetAreaColor(aBackColor);
203 pStyle->SetAreaLineStyle(enumXFAreaLineSingle, 135, 0.09, aForeColor);
204 break;
205 }
206 case FT_BDIAGHATCH:
207 {
208 pStyle->SetAreaColor(aBackColor);
209 pStyle->SetAreaLineStyle(enumXFAreaLineSingle, 45, 0.09, aForeColor);
210 break;
211 }
212 case FT_CROSSHATCH:
213 {
214 pStyle->SetAreaColor(aBackColor);
215 pStyle->SetAreaLineStyle(enumXFAreaLineCrossed, 0, 0.12, aForeColor);
216 break;
217 }
219 {
220 pStyle->SetAreaColor(aBackColor);
221 pStyle->SetAreaLineStyle(enumXFAreaLineCrossed, 45, 0.095, aForeColor);
222 break;
223 }
224 }
225}
226
235 const SdwColor& rColor)
236{
237 if (!pStyle)
238 {
239 assert(false);
240 return;
241 }
242 if (nWidth == 0)
243 {
244 nLineStyle = LS_NULL;
245 }
246
247 if (nLineStyle == LS_NULL)
248 {
249 // set stroke:none
250 return;
251 }
252
253 if (nLineStyle == LS_DOT)
254 {
255 pStyle->SetLineDashStyle(enumXFLineDash, 0.05, 0.05, 0.05);
256 }
257
258 // line width
259 double fWidth = static_cast<double>(nWidth)/TWIPS_PER_CM;
260
261 // line color
262 XFColor aXFColor(rColor.nR, rColor.nG, rColor.nB);
263
264 pStyle->SetLineStyle(fWidth, aXFColor);
265}
266
272{
273 double fOffsetX = 0.00, fOffsetY = 0.00;
274 double fScaleX = 1.00, fScaleY = 1.00;
275 if (m_pTransData)
276 {
277 fOffsetX = m_pTransData->fOffsetX;
278 fOffsetY = m_pTransData->fOffsetY;
279 fScaleX = m_pTransData->fScaleX;
280 fScaleY = m_pTransData->fScaleY;
281 }
282
283 pObj->SetPosition(static_cast<double>(m_aObjHeader.nLeft)/TWIPS_PER_CM * fScaleX+ fOffsetX,
284 static_cast<double>(m_aObjHeader.nTop)/TWIPS_PER_CM * fScaleY + fOffsetY,
285 static_cast<double>(m_aObjHeader.nRight-m_aObjHeader.nLeft)/TWIPS_PER_CM * fScaleX,
286 static_cast<double>(m_aObjHeader.nBottom-m_aObjHeader.nTop)/TWIPS_PER_CM * fScaleY);
287}
288
294void LwpDrawObj::SetArrowHead(XFDrawStyle* pOpenedObjStyle, sal_uInt8 nArrowFlag, sal_uInt8 nLineWidth)
295{
296 // no arrowhead
297 if (!nArrowFlag)
298 {
299 return;
300 }
301
302 if (!pOpenedObjStyle)
303 {
304 assert(false);
305 return;
306 }
307
308 // arrowhead flag of an object's start side
309 sal_uInt8 nLeftArrow = nArrowFlag & 0x0F;
310
311 // arrowhead flag of an object's end side
312 sal_uInt8 nRightArrow = (nArrowFlag & 0xF0) >> 4;
313
314 double fWidth_inch = static_cast<double>(nLineWidth)/TWIPS_PER_CM;
315 double fArrowSize_inch = fWidth_inch + 0.08;
316 double fArrowSize = fArrowSize_inch * CM_PER_INCH;
317
318 if (nLeftArrow)
319 {
320 pOpenedObjStyle->SetArrowStart( GetArrowName(nLeftArrow), fArrowSize);
321 }
322 if (nRightArrow)
323 {
324 pOpenedObjStyle->SetArrowEnd( GetArrowName(nRightArrow), fArrowSize);
325 }
326
327}
328
335{
336 // style name of arrowhead
337 OUString aArrowName;
338
339 switch(nArrowStyle)
340 {
341 default:
343 aArrowName = "Symmetric arrow";
344 break;
346 aArrowName = "Arrow concave";
347 break;
349 aArrowName = "arrow100";
350 break;
352 aArrowName = "reverse arrow";
353 break;
355 aArrowName = "reverse concave arrow";
356 break;
358 aArrowName = "reverse line arrow";
359 break;
360 case AH_ARROW_TEE:
361 aArrowName = "Dimension lines";
362 break;
363 case AH_ARROW_SQUARE:
364 aArrowName = "Square";
365 break;
366 case AH_ARROW_CIRCLE:
367 aArrowName = "Circle";
368 break;
369 }
370
371 return aArrowName;
372}
373
379{
380 // read records
381 Read();
382
383 // register style
384 OUString aStyleName = RegisterStyle();
385
386 // create XF-Objects
388 if (m_pTransData
392 && FABS(m_pTransData->fScaleY - 1.0) < THRESHOLD)
393 {
394 xXFObj = CreateStandardDrawObj(aStyleName);
395 }
396 else
397 {
398 xXFObj = CreateDrawObj(aStyleName);
399 }
400
401 // set anchor type
402 if (xXFObj)
403 {
404 xXFObj->SetAnchorType(enumXFAnchorFrame);
405 }
406
407 return xXFObj;
408}
409
415: LwpDrawObj(pStream, pTransData)
416{
417}
418
423{
431
436}
437
439{
440 std::unique_ptr<XFDrawStyle> pStyle( new XFDrawStyle() );
441
442 // set line style
444
445 // set arrow head
447
449 return pXFStyleManager->AddStyle(std::move(pStyle)).m_pStyle->GetStyleName();
450}
451
453{
455 xLine->MoveTo(XFPoint(static_cast<double>(m_aLineRec.nStartX)/TWIPS_PER_CM * m_pTransData->fScaleX,
456 static_cast<double>(m_aLineRec.nStartY)/TWIPS_PER_CM * m_pTransData->fScaleY));
457 xLine->LineTo(XFPoint(static_cast<double>(m_aLineRec.nEndX)/TWIPS_PER_CM * m_pTransData->fScaleX,
458 static_cast<double>(m_aLineRec.nEndY)/TWIPS_PER_CM * m_pTransData->fScaleY));
459 SetPosition(xLine.get());
460
461 xLine->SetStyleName(rStyleName);
462
463 return xLine;
464}
465
467{
469 xLine->SetStartPoint(static_cast<double>(m_aLineRec.nStartX)/TWIPS_PER_CM,static_cast<double>(m_aLineRec.nStartY)/TWIPS_PER_CM);
470 xLine->SetEndPoint(static_cast<double>(m_aLineRec.nEndX)/TWIPS_PER_CM,static_cast<double>(m_aLineRec.nEndY)/TWIPS_PER_CM);
471
472 xLine->SetStyleName(rStyleName);
473 return xLine;
474}
475
481: LwpDrawObj(pStream, pTransData)
482{
483}
485{
486}
487
492{
501
503 throw BadRead();
504
506
507 for (sal_uInt16 nC = 0; nC < m_aPolyLineRec.nNumPoints; nC++)
508 {
511 }
512}
513
515{
516 std::unique_ptr<XFDrawStyle> pStyle(new XFDrawStyle());
517
518 // set line style
521
522 // set arrow head
524
526 return pXFStyleManager->AddStyle(std::move(pStyle)).m_pStyle->GetStyleName();
527}
528
530{
531 rtl::Reference<XFDrawPath> xPolyline(new XFDrawPath());
532 xPolyline->MoveTo(XFPoint(static_cast<double>(m_pVector[0].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
533 static_cast<double>(m_pVector[0].y)/TWIPS_PER_CM * m_pTransData->fScaleY));
534 for (sal_uInt16 nC = 1; nC < m_aPolyLineRec.nNumPoints; nC++)
535 {
536 xPolyline->LineTo(XFPoint(static_cast<double>(m_pVector[nC].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
537 static_cast<double>(m_pVector[nC].y)/TWIPS_PER_CM * m_pTransData->fScaleY));
538 }
539 SetPosition(xPolyline.get());
540
541 xPolyline->SetStyleName(rStyleName);
542
543 return xPolyline;
544}
545
547{
549 for (sal_uInt16 nC = 0; nC < m_aPolyLineRec.nNumPoints; nC++)
550 {
551 xPolyline->AddPoint(static_cast<double>(m_pVector[nC].x)/TWIPS_PER_CM,
552 static_cast<double>(m_pVector[nC].y)/TWIPS_PER_CM);
553 }
554
555 xPolyline->SetStyleName(rStyleName);
556
557 return xPolyline;
558}
559
565 : LwpDrawObj(pStream, pTransData)
566 , m_nNumPoints(0)
567{
568}
569
571{
572}
573
578{
581
583 throw BadRead();
584
585 m_pVector.reset( new SdwPoint[m_nNumPoints] );
586
587 for (sal_uInt16 nC = 0; nC < m_nNumPoints; nC++)
588 {
591 }
592}
593
595{
596 std::unique_ptr<XFDrawStyle> pStyle(new XFDrawStyle());
597
598 // set line style
601
602 // set fill style
603 SetFillStyle(pStyle.get());
604
606 return pXFStyleManager->AddStyle(std::move(pStyle)).m_pStyle->GetStyleName();
607}
608
610{
612 xPolygon->MoveTo(XFPoint(static_cast<double>(m_pVector[0].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
613 static_cast<double>(m_pVector[0].y)/TWIPS_PER_CM * m_pTransData->fScaleY));
614 for (sal_uInt16 nC = 1; nC < m_nNumPoints; nC++)
615 {
616 xPolygon->LineTo(XFPoint(static_cast<double>(m_pVector[nC].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
617 static_cast<double>(m_pVector[nC].y)/TWIPS_PER_CM * m_pTransData->fScaleY));
618 }
619 xPolygon->ClosePath();
620 SetPosition(xPolygon.get());
621 xPolygon->SetStyleName(rStyleName);
622
623 return xPolygon;
624}
625
627{
629 for (sal_uInt16 nC = 0; nC < m_nNumPoints; nC++)
630 {
631 xPolygon->AddPoint(static_cast<double>(m_pVector[nC].x)/TWIPS_PER_CM,
632 static_cast<double>(m_pVector[nC].y)/TWIPS_PER_CM);
633 }
634
635 xPolygon->SetStyleName(rStyleName);
636
637 return xPolygon;
638}
639
645 : LwpDrawObj(pStream, pTransData)
646{
647}
648
653{
655
656 sal_uInt8 nPointsCount;
657 if (m_eType == OT_RNDRECT)
658 {
659 nPointsCount = 16;
660 m_pStream->SeekRel(4); // corner points
661 }
662 else
663 {
664 nPointsCount = 4;
665 }
666
667 for (sal_uInt8 nC = 0; nC < nPointsCount; nC++)
668 {
671 }
672}
673
675{
676 std::unique_ptr<XFDrawStyle> pStyle(new XFDrawStyle());
677
678 // set line style
681
682 // set fill style
683 SetFillStyle(pStyle.get());
684
686 return pXFStyleManager->AddStyle(std::move(pStyle)).m_pStyle->GetStyleName();
687}
688
690{
691 if (m_eType == OT_RNDRECT)
692 {
693 return CreateRoundedRect(rStyleName);
694 }
695 else
696 {
698 xRect->MoveTo(XFPoint(static_cast<double>(m_aVector[0].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
699 static_cast<double>(m_aVector[0].y)/TWIPS_PER_CM * m_pTransData->fScaleY));
700 for (sal_uInt8 nC = 1; nC < 4; nC++)
701 {
702 xRect->LineTo(XFPoint(static_cast<double>(m_aVector[nC].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
703 static_cast<double>(m_aVector[nC].y)/TWIPS_PER_CM * m_pTransData->fScaleY));
704 }
705 xRect->LineTo(XFPoint(static_cast<double>(m_aVector[0].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
706 static_cast<double>(m_aVector[0].y)/TWIPS_PER_CM * m_pTransData->fScaleY));
707 xRect->ClosePath();
708 SetPosition(xRect.get());
709
710 xRect->SetStyleName(rStyleName);
711
712 return xRect;
713 }
714}
715
717{
718 XFDrawPath* pRoundedRect = new XFDrawPath();
719 pRoundedRect->MoveTo(XFPoint(static_cast<double>(m_aVector[0].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
720 static_cast<double>(m_aVector[0].y)/TWIPS_PER_CM * m_pTransData->fScaleY));
721
722 sal_uInt8 nPtIndex = 1;
723 for (sal_uInt8 nC = 0; nC < 7; nC++)
724 {
725 if (nC%2 == 0)
726 {
727 XFPoint aCtrl1(static_cast<double>(m_aVector[nPtIndex].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
728 static_cast<double>(m_aVector[nPtIndex].y)/TWIPS_PER_CM * m_pTransData->fScaleY);
729 nPtIndex++;
730 XFPoint aCtrl2(static_cast<double>(m_aVector[nPtIndex].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
731 static_cast<double>(m_aVector[nPtIndex].y)/TWIPS_PER_CM * m_pTransData->fScaleY);
732 nPtIndex++;
733 XFPoint aDest(static_cast<double>(m_aVector[nPtIndex].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
734 static_cast<double>(m_aVector[nPtIndex].y)/TWIPS_PER_CM * m_pTransData->fScaleY);
735 nPtIndex++;
736
737 pRoundedRect->CurveTo(aDest, aCtrl1, aCtrl2);
738 }
739 else
740 {
741 XFPoint aDest(static_cast<double>(m_aVector[nPtIndex].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
742 static_cast<double>(m_aVector[nPtIndex].y)/TWIPS_PER_CM * m_pTransData->fScaleY);
743 nPtIndex++;
744
745 pRoundedRect->LineTo(aDest);
746 }
747 }
748
749 pRoundedRect->LineTo(XFPoint(static_cast<double>(m_aVector[0].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
750 static_cast<double>(m_aVector[0].y)/TWIPS_PER_CM * m_pTransData->fScaleY));
751 pRoundedRect->ClosePath();
752 SetPosition(pRoundedRect);
753
754 pRoundedRect->SetStyleName(rStyleName);
755
756 return pRoundedRect;
757}
758
760{
761 if (m_eType == OT_RNDRECT)
762 {
763 return CreateRoundedRect(rStyleName);
764 }
765 else
766 {
768 double fStartX, fStartY, fWidth, fHeight;
769 double fRotAngle = 0.0;
770 SdwRectangle aSdwRect;
771 tools::Rectangle aOriginalRect;
772 Point aPt0, aPt1, aPt2, aPt3;
773
774 aPt0.setX(m_aVector[0].x); aPt0.setY(m_aVector[0].y);
775 aPt1.setX(m_aVector[1].x); aPt1.setY(m_aVector[1].y);
776 aPt2.setX(m_aVector[2].x); aPt2.setY(m_aVector[2].y);
777 aPt3.setX(m_aVector[3].x); aPt3.setY(m_aVector[3].y);
778
779 aSdwRect = SdwRectangle(aPt0, aPt1, aPt2, aPt3);
780 if (aSdwRect.IsRectRotated())
781 {
782 aOriginalRect = aSdwRect.GetOriginalRect();
783 fRotAngle = aSdwRect.GetRotationAngle();
784 }
785 else
786 {
787 aOriginalRect = tools::Rectangle(aPt0, aPt2);
788 }
789
790 fStartX = aOriginalRect.Left();
791 fStartY = aOriginalRect.Top();
792 fWidth = aOriginalRect.GetWidth();
793 fHeight = aOriginalRect.GetHeight();
794
795 xRect->SetStartPoint(XFPoint(fStartX/TWIPS_PER_CM + m_pTransData->fOffsetX,
797 xRect->SetSize(fWidth/TWIPS_PER_CM, fHeight/TWIPS_PER_CM);
798
799 if (aSdwRect.IsRectRotated())
800 {
801 xRect->SetRotate( basegfx::rad2deg(fRotAngle) );// aXFCenter);
802 }
803
804 xRect->SetStyleName(rStyleName);
805
806 return xRect;
807 }
808}
809
815: LwpDrawObj(pStream, pTransData)
816{
817}
818
823{
825
826 for (SdwPoint & nC : m_aVector)
827 {
828 m_pStream->ReadInt16( nC.x );
829 m_pStream->ReadInt16( nC.y );
830 }
831}
832
834{
835 std::unique_ptr<XFDrawStyle> pStyle(new XFDrawStyle());
836
837 // set line style
840
841 // set fill style
842 SetFillStyle(pStyle.get());
843
845 return pXFStyleManager->AddStyle(std::move(pStyle)).m_pStyle->GetStyleName();
846}
847
849{
851 xEllipse->MoveTo(XFPoint(static_cast<double>(m_aVector[0].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
852 static_cast<double>(m_aVector[0].y)/TWIPS_PER_CM * m_pTransData->fScaleY));
853 sal_uInt8 nPtIndex = 1;
854 for (sal_uInt8 nC = 0; nC < 4; nC++)
855 {
856 XFPoint aCtrl1(static_cast<double>(m_aVector[nPtIndex].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
857 static_cast<double>(m_aVector[nPtIndex].y)/TWIPS_PER_CM * m_pTransData->fScaleY);
858 nPtIndex++;
859 XFPoint aCtrl2(static_cast<double>(m_aVector[nPtIndex].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
860 static_cast<double>(m_aVector[nPtIndex].y)/TWIPS_PER_CM * m_pTransData->fScaleY);
861 nPtIndex++;
862 XFPoint aDest(static_cast<double>(m_aVector[nPtIndex].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
863 static_cast<double>(m_aVector[nPtIndex].y)/TWIPS_PER_CM * m_pTransData->fScaleY);
864 nPtIndex++;
865
866 xEllipse->CurveTo(aDest, aCtrl1, aCtrl2);
867 }
868 xEllipse->ClosePath();
869 SetPosition(xEllipse.get());
870
871 xEllipse->SetStyleName(rStyleName);
872
873 return xEllipse;
874}
875
877{
878 return CreateDrawObj(rStyleName);
879}
880
886: LwpDrawObj(pStream, pTransData)
887{
888}
889
894{
895 m_pStream->SeekRel(16);// arcRect, startPt, endPt
896
904
905 for (SdwPoint & nC : m_aVector)
906 {
907 m_pStream->ReadInt16( nC.x );
908 m_pStream->ReadInt16( nC.y );
909 }
910}
911
913{
914 std::unique_ptr<XFDrawStyle> pStyle(new XFDrawStyle());
915
916 // set line style
919
920 // set arrow head
922
924 return pXFStyleManager->AddStyle(std::move(pStyle)).m_pStyle->GetStyleName();
925}
926
928{
930 xArc->MoveTo(XFPoint(static_cast<double>(m_aVector[0].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
931 static_cast<double>(m_aVector[0].y)/TWIPS_PER_CM * m_pTransData->fScaleY));
932 XFPoint aDest(static_cast<double>(m_aVector[3].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
933 static_cast<double>(m_aVector[3].y)/TWIPS_PER_CM * m_pTransData->fScaleY);
934 XFPoint aCtl1(static_cast<double>(m_aVector[1].x)/TWIPS_PER_CM * m_pTransData->fScaleX,
935 static_cast<double>(m_aVector[1].y)/TWIPS_PER_CM * m_pTransData->fScaleY);
936 XFPoint aCtl2(static_cast<double>(m_aVector[2].x)/TWIPS_PER_CM* m_pTransData->fScaleX,
937 static_cast<double>(m_aVector[2].y)/TWIPS_PER_CM * m_pTransData->fScaleY);
938 xArc->CurveTo(aDest, aCtl1, aCtl2);
939
940 SetPosition(xArc.get());
941
942 xArc->SetStyleName(rStyleName);
943
944 return xArc;
945}
946
948{
949 return CreateDrawObj(rStyleName);
950}
951
957{
958}
959
961{
963 {
964 delete [] m_aTextRec.pTextString;
965 m_aTextRec.pTextString = nullptr;
966 }
967}
968
970{
971 // color
972 XFColor aXFColor(pRec->aTextColor.nR, pRec->aTextColor.nG,
973 pRec->aTextColor.nB);
974 pFont->SetColor(aXFColor);
975 //size
976 pFont->SetFontSize(pRec->nTextSize/20);
977 // bold
978 pFont->SetBold((pRec->nTextAttrs & TA_BOLD) != 0);
979 // italic
980 pFont->SetItalic((pRec->nTextAttrs & TA_ITALIC) != 0);
981 // strike-through
982 if (pRec->nTextAttrs & TA_STRIKETHRU)
983 {
984 pFont->SetCrossout(enumXFCrossoutSignel);
985 }
986 else
987 {
988 pFont->SetCrossout(enumXFCrossoutNone);
989 }
990 // underline
991 if (pRec->nTextAttrs & TA_UNDERLINE)
992 {
993 pFont->SetUnderline(enumXFUnderlineSingle);
994 }
995 else if (pRec->nTextAttrs & TA_WORDUNDERLINE)
996 {
997 pFont->SetUnderline(enumXFUnderlineSingle, true);
998 }
999 else if (pRec->nTextAttrs & TA_DOUBLEUNDER)
1000 {
1001 pFont->SetUnderline(enumXFUnderlineDouble);
1002 }
1003 else
1004 {
1005 pFont->SetUnderline(enumXFUnderlineNone);
1006 }
1007 // small-caps
1008 if (pRec->nTextAttrs & TA_SMALLCAPS)
1009 {
1010 pFont->SetTransform(enumXFTransformSmallCaps);
1011 }
1012}
1013
1018{
1022
1023 if (m_aTextRec.nTextWidth == 0)
1025
1029 m_pStream->SeekRel(1);// PitchAndFamily
1030
1032
1033 if (m_aTextRec.nTextSize < 0)
1035
1036 //color
1041
1046
1047 if (!m_pStream->good())
1048 throw BadRead();
1049
1050 // some draw files in version 1.2 have an extra byte following '\0'.
1051 // can't rely on that, so read in the whole string into memory.
1052
1053 // the 71 is the fixed length before text content in textbox record
1054 sal_Int16 TextLength = m_aObjHeader.nRecLen - 71;
1055 if (TextLength < 0)
1056 throw BadRead();
1059 throw BadRead();
1060}
1061
1063{
1064 std::unique_ptr<XFParaStyle> pStyle(new XFParaStyle());
1065
1066 // font style
1067 // the pFont need to be deleted myself?
1068 rtl::Reference<XFFont> pFont = new XFFont();
1069
1070 OUString aFontName(reinterpret_cast<char*>(m_aTextRec.tmpTextFaceName),
1071 strlen(reinterpret_cast<char*>(m_aTextRec.tmpTextFaceName)), RTL_TEXTENCODING_MS_1252);
1072 pFont->SetFontName(aFontName);
1073
1074 SetFontStyle(pFont, &m_aTextRec);
1075
1076 pStyle->SetFont(pFont);
1077
1079 return pXFStyleManager->AddStyle(std::move(pStyle)).m_pStyle->GetStyleName();
1080}
1081
1083{
1084 rtl::Reference<XFFrame> xTextBox(new XFFrame(true));
1085
1086 sal_Int16 TextLength = m_aObjHeader.nRecLen - 71;
1087 rtl_TextEncoding aEncoding;
1089 {
1090 aEncoding = osl_getThreadTextEncoding();
1091 }
1092 else
1093 {
1094 // temporary code, need to create Encoding from the value of nTextCharacterSet
1096 }
1097
1098 if (TextLength < 2)
1099 throw BadRead();
1100
1101 XFParagraph* pXFPara = new XFParagraph();
1102 pXFPara->Add(OUString(reinterpret_cast<char*>(m_aTextRec.pTextString), (TextLength-2), aEncoding));
1103 pXFPara->SetStyleName(rStyleName);
1104
1105 xTextBox->Add(pXFPara);
1106 SetPosition(xTextBox.get());
1107
1108 std::unique_ptr<XFTextBoxStyle> pBoxStyle(new XFTextBoxStyle());
1109
1111 OUString sName = pXFStyleManager->AddStyle(std::move(pBoxStyle)).m_pStyle->GetStyleName();
1112 xTextBox->SetStyleName(sName);
1113
1114 return xTextBox;
1115}
1116
1118{
1119 return CreateDrawObj(rStyleName);
1120}
1121
1127: LwpDrawObj(pStream, pTransData)
1128{
1129}
1130
1132{
1133 m_aTextArtRec.aPath[0].aPts.clear();
1134 m_aTextArtRec.aPath[1].aPts.clear();
1136 {
1137 delete [] m_aTextArtRec.pTextString;
1138 m_aTextArtRec.pTextString = nullptr;
1139 }
1140
1141}
1142
1144{
1145 sal_Int16 nX, nY;
1146 nX = (m_aTextArtRec.aPath[0].aPts[0].x + m_aTextArtRec.aPath[1].aPts[0].x) / 2;
1147 nY = (m_aTextArtRec.aPath[0].aPts[0].y + m_aTextArtRec.aPath[1].aPts[0].y) / 2;
1148 XFPoint aStart(static_cast<double>(nX)/TWIPS_PER_CM * m_pTransData->fScaleX,
1149 static_cast<double>(nY)/TWIPS_PER_CM * m_pTransData->fScaleY);
1150 pPath->MoveTo(aStart);
1151
1152 sal_uInt8 nPtIndex = 1;
1153 for (sal_uInt16 nC = 1; nC <= m_aTextArtRec.aPath[0].n; nC++)
1154 {
1155 nX = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).x + m_aTextArtRec.aPath[1].aPts.at(nPtIndex).x) / 2;
1156 nY = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).y + m_aTextArtRec.aPath[1].aPts.at(nPtIndex).y) / 2;
1157 XFPoint aCtrl1(static_cast<double>(nX)/TWIPS_PER_CM * m_pTransData->fScaleX,
1158 static_cast<double>(nY)/TWIPS_PER_CM * m_pTransData->fScaleY);
1159
1160 nPtIndex++;
1161 nX = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).x + m_aTextArtRec.aPath[1].aPts.at(nPtIndex).x) / 2;
1162 nY = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).y + m_aTextArtRec.aPath[1].aPts.at(nPtIndex).y) / 2;
1163 XFPoint aCtrl2(static_cast<double>(nX)/TWIPS_PER_CM * m_pTransData->fScaleX,
1164 static_cast<double>(nY)/TWIPS_PER_CM * m_pTransData->fScaleY);
1165
1166 nPtIndex++;
1167 nX = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).x + m_aTextArtRec.aPath[1].aPts.at(nPtIndex).x) / 2;
1168 nY = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).y + m_aTextArtRec.aPath[1].aPts.at(nPtIndex).y) / 2;
1169 XFPoint aDest(static_cast<double>(nX)/TWIPS_PER_CM * m_pTransData->fScaleX,
1170 static_cast<double>(nY)/TWIPS_PER_CM * m_pTransData->fScaleY);
1171
1172 pPath->CurveTo(aDest, aCtrl1, aCtrl2);
1173 }
1174}
1175
1177{
1178 for (SdwPoint & nC : m_aVector)
1179 {
1180 m_pStream->ReadInt16( nC.x );
1181 m_pStream->ReadInt16( nC.y );
1182 }
1183
1186
1189
1190 sal_uInt16 nPointNumber;
1191 m_pStream->ReadUInt16( nPointNumber );
1192
1193 size_t nPoints = nPointNumber*3+1;
1194 if (!m_pStream->good() || nPoints > m_pStream->remainingSize() / 4)
1195 throw BadRead();
1196
1197 m_aTextArtRec.aPath[0].n = nPointNumber;
1198 m_aTextArtRec.aPath[0].aPts.resize(nPoints);
1199 for (size_t nPt = 0; nPt < nPoints; ++nPt)
1200 {
1201 sal_Int16 nX, nY;
1202 m_pStream->ReadInt16( nX );
1203 m_pStream->ReadInt16( nY );
1204 m_aTextArtRec.aPath[0].aPts[nPt].x = nX;
1205 m_aTextArtRec.aPath[0].aPts[nPt].y = nY;
1206 }
1207
1208 m_pStream->ReadUInt16( nPointNumber );
1209
1210 nPoints = nPointNumber*3+1;
1211 if (!m_pStream->good() || nPoints > m_pStream->remainingSize() / 4)
1212 throw BadRead();
1213
1214 m_aTextArtRec.aPath[1].n = nPointNumber;
1215 m_aTextArtRec.aPath[1].aPts.resize(nPoints);
1216 for (size_t nPt = 0; nPt < nPoints; ++nPt)
1217 {
1218 sal_Int16 nX, nY;
1219 m_pStream->ReadInt16( nX );
1220 m_pStream->ReadInt16( nY );
1221 m_aTextArtRec.aPath[1].aPts[nPt].x = nX;
1222 m_aTextArtRec.aPath[1].aPts[nPt].y = nY;
1223 }
1224
1225 m_pStream->SeekRel(1);
1226
1229 m_pStream->SeekRel(1);// PitchAndFamily
1230
1232
1233 if (m_aTextArtRec.nTextSize < 0)
1235
1240
1241 const sal_uInt16 nTextArtFixedLength = 105;
1242 m_aTextArtRec.nTextLen = m_aObjHeader.nRecLen - nTextArtFixedLength
1243 - (m_aTextArtRec.aPath[0].n*3 + 1)*4
1244 - (m_aTextArtRec.aPath[1].n*3 + 1)*4;
1245
1246
1247 if (!m_pStream->good())
1248 throw BadRead();
1250 throw BadRead();
1251 if (m_aTextArtRec.nTextLen < 1)
1252 throw BadRead();
1253
1257
1258}
1259
1261{
1262 std::unique_ptr<XFParaStyle> pStyle(new XFParaStyle());
1263
1264 // font style
1265 // the pFont need to be deleted myself?
1266 rtl::Reference<XFFont> pFont = new XFFont();
1267
1268 OUString aFontName(reinterpret_cast<char*>(m_aTextArtRec.tmpTextFaceName),
1269 strlen(reinterpret_cast<char*>(m_aTextArtRec.tmpTextFaceName)), RTL_TEXTENCODING_MS_1252);
1270 pFont->SetFontName(aFontName);
1271
1273
1274 pStyle->SetFont(pFont);
1275
1277 return pXFStyleManager->AddStyle(std::move(pStyle)).m_pStyle->GetStyleName();
1278}
1279
1281{
1282 std::unique_ptr<XFDrawStyle> pStyle(new XFDrawStyle());
1283
1284 rtl::Reference<XFFrame> xRetObj(new XFDrawPath());
1285 XFDrawPath* pFWPath = static_cast<XFDrawPath*>(xRetObj.get());
1286 CreateFWPath(pFWPath);
1287 pStyle->SetFontWorkStyle(enumXFFWSlantY, enumXFFWAdjustAutosize);
1288
1289 SetPosition(xRetObj.get());
1290
1291 rtl_TextEncoding aEncoding;
1293 {
1294 aEncoding = osl_getThreadTextEncoding();
1295 }
1296 else
1297 {
1298 // temporary code, need to create Encoding from the value of nTextCharacterSet
1300 }
1301
1302 XFParagraph* pXFPara = new XFParagraph();
1303 pXFPara->Add(OUString(reinterpret_cast<char*>(m_aTextArtRec.pTextString), (m_aTextArtRec.nTextLen-1), aEncoding));
1304 pXFPara->SetStyleName(rStyleName);
1305 xRetObj->Add(pXFPara);
1306
1308 xRetObj->SetStyleName(pXFStyleManager->AddStyle(std::move(pStyle)).m_pStyle->GetStyleName());
1309
1310 return xRetObj;
1311}
1312
1314{
1315 return CreateDrawObj(rStyleName);
1316}
1317
1323{
1324}
1325
1330{
1332}
1333
1339{
1340}
1341
1343{
1344}
1345
1346static bool IsValid(const BmpInfoHeader2& rHeader)
1347{
1348 if (rHeader.nPlanes != 1)
1349 return false;
1350
1351 if (rHeader.nBitCount != 0 && rHeader.nBitCount != 1 &&
1352 rHeader.nBitCount != 4 && rHeader.nBitCount != 8 &&
1353 rHeader.nBitCount != 16 && rHeader.nBitCount != 24 &&
1354 rHeader.nBitCount != 32)
1355 {
1356 return false;
1357 }
1358
1359 return true;
1360}
1361
1366{
1369
1370 // 20 == length of draw-specific fields.
1371 if (m_aObjHeader.nRecLen < 20)
1372 throw BadRead();
1373
1374 sal_uInt64 nBmpPos = m_pStream->Tell();
1375 sal_uInt64 nBmpLen =
1376 std::min<sal_uInt64>(m_aObjHeader.nRecLen - 20, m_pStream->remainingSize());
1377
1378 BmpInfoHeader2 aInfoHeader2;
1379 m_pStream->ReadUInt32( aInfoHeader2.nHeaderLen );
1380
1381 if (!m_pStream->good() || nBmpLen < aInfoHeader2.nHeaderLen)
1382 throw BadRead();
1383
1384 sal_uInt32 N;
1385 sal_uInt32 rgbTableSize;
1386
1387 if (aInfoHeader2.nHeaderLen == sizeof(BmpInfoHeader))
1388 {
1389 sal_uInt16 nTmp;
1390
1391 m_pStream->ReadUInt16( nTmp );
1392 aInfoHeader2.nWidth = nTmp;
1393 m_pStream->ReadUInt16( nTmp );
1394 aInfoHeader2.nHeight = nTmp;
1395 m_pStream->ReadUInt16( aInfoHeader2.nPlanes );
1396 m_pStream->ReadUInt16( aInfoHeader2.nBitCount );
1397
1398 if (!m_pStream->good() || !IsValid(aInfoHeader2))
1399 throw BadRead();
1400
1401 N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;
1402 if (N >= 16)
1403 {
1404 rgbTableSize = 0;
1405 }
1406 else
1407 {
1408 rgbTableSize = 3 * (1 << N);
1409 }
1410 }
1411 else if (aInfoHeader2.nHeaderLen >= sizeof(BmpInfoHeader2))
1412 {
1413 m_pStream->ReadUInt32( aInfoHeader2.nWidth );
1414 m_pStream->ReadUInt32( aInfoHeader2.nHeight );
1415 m_pStream->ReadUInt16( aInfoHeader2.nPlanes );
1416 m_pStream->ReadUInt16( aInfoHeader2.nBitCount );
1417
1418 if (!m_pStream->good() || !IsValid(aInfoHeader2))
1419 throw BadRead();
1420
1421 N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;
1422 if (N >= 16)
1423 {
1424 rgbTableSize = 0;
1425 }
1426 else
1427 {
1428 rgbTableSize = 4 * (1 << N);
1429 }
1430 }
1431 else
1432 {
1433 throw BadRead();
1434 }
1435
1436 m_aBmpRec.nFileSize = static_cast<sal_uInt32>(nBmpLen + 14);
1438
1439 sal_uInt32 nOffBits = 14 + aInfoHeader2.nHeaderLen + rgbTableSize;
1440 m_pImageData[0] = 'B';
1441 m_pImageData[1] = 'M';
1442 m_pImageData[2] = static_cast<sal_uInt8>(m_aBmpRec.nFileSize);
1443 m_pImageData[3] = static_cast<sal_uInt8>(m_aBmpRec.nFileSize >> 8);
1444 m_pImageData[4] = static_cast<sal_uInt8>(m_aBmpRec.nFileSize >> 16);
1445 m_pImageData[5] = static_cast<sal_uInt8>(m_aBmpRec.nFileSize >> 24);
1446 m_pImageData[6] = 0;
1447 m_pImageData[7] = 0;
1448 m_pImageData[8] = 0;
1449 m_pImageData[9] = 0;
1450 m_pImageData[10] = static_cast<sal_uInt8>(nOffBits);
1451 m_pImageData[11] = static_cast<sal_uInt8>(nOffBits >> 8);
1452 m_pImageData[12] = static_cast<sal_uInt8>(nOffBits >> 16);
1453 m_pImageData[13] = static_cast<sal_uInt8>(nOffBits >> 24);
1454
1455 sal_uInt8* pPicData = m_pImageData.get();
1456
1457 m_pStream->Seek(nBmpPos);
1458 if (nBmpLen != m_pStream->ReadBytes(pPicData + 14, nBmpLen))
1459 throw BadRead();
1460}
1461
1463{
1464 std::unique_ptr<XFImageStyle> pBmpStyle(new XFImageStyle());
1465 pBmpStyle->SetYPosType(enumXFFrameYPosFromTop, enumXFFrameYRelFrame);
1466 pBmpStyle->SetXPosType(enumXFFrameXPosFromLeft, enumXFFrameXRelFrame);
1467
1469 return pXFStyleManager->AddStyle(std::move(pBmpStyle)).m_pStyle->GetStyleName();
1470}
1471
1473{
1474 rtl::Reference<XFImage> xImage(new XFImage());
1475 xImage->SetImageData(m_pImageData.get(), m_aBmpRec.nFileSize);
1476 SetPosition(xImage.get());
1477
1478 xImage->SetStyleName(rStyleName);
1479
1480 return xImage;
1481}
1482
1484{
1485 return CreateDrawObj(rStyleName);
1486}
1487
1488/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 nLineWidth
virtual OUString GetStyleName()=0
@descr: return the style name.
static rtl_TextEncoding GetTextCharEncoding()
SdwPoint m_aVector[4]
Definition: lwpdrawobj.hxx:275
SdwArcRecord m_aArcRec
Definition: lwpdrawobj.hxx:274
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:927
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:912
virtual void Read() override
@descr reading function of class LwpDrawArc
Definition: lwpdrawobj.cxx:893
LwpDrawArc(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawArc
Definition: lwpdrawobj.cxx:885
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:947
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
virtual void Read() override
@descr reading function of class LwpDrawBitmap
LwpDrawBitmap(SvStream *pStream)
@descr Constructor of class LwpDrawBitmap
std::unique_ptr< sal_uInt8[]> m_pImageData
Definition: lwpdrawobj.hxx:362
SdwBmpRecord m_aBmpRec
Definition: lwpdrawobj.hxx:361
virtual ~LwpDrawBitmap() override
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
virtual void Read() override
@descr reading function of class LwpDrawEllipse
Definition: lwpdrawobj.cxx:822
SdwPoint m_aVector[13]
Definition: lwpdrawobj.hxx:255
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:833
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:848
LwpDrawEllipse(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawEllipse
Definition: lwpdrawobj.cxx:814
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:876
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:438
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:452
LwpDrawLine(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawLine
Definition: lwpdrawobj.cxx:414
virtual void Read() override
@descr reading function of class LwpDrawLine
Definition: lwpdrawobj.cxx:422
SdwLineRecord m_aLineRec
Definition: lwpdrawobj.hxx:172
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:466
virtual void Read() override
@descr reading function of class LwpDrawMetafile
LwpDrawMetafile(SvStream *pStream)
@descr Constructor of class LwpDrawMetafile
Lwp-base-draw object.
Definition: lwpdrawobj.hxx:82
virtual OUString RegisterStyle()=0
@descr register styles of a draw object according to the saved records data.
static void SetLineStyle(XFDrawStyle *pStyle, sal_uInt8 nWidth, sal_uInt8 nLineStyle, const SdwColor &rColor)
@descr set line/border style of drawing objects.
Definition: lwpdrawobj.cxx:234
void SetFillStyle(XFDrawStyle *pStyle)
@descr set fill style of drawing objects
Definition: lwpdrawobj.cxx:162
SdwDrawObjHeader m_aObjHeader
Definition: lwpdrawobj.hxx:86
rtl::Reference< XFFrame > CreateXFDrawObject()
@descr create a completed XF-draw object(read data, register styles and create XF-draw object)
Definition: lwpdrawobj.cxx:378
SdwClosedObjStyleRec m_aClosedObjStyleRec
Definition: lwpdrawobj.hxx:87
virtual void Read()=0
@descr read out the record of a draw object.
static OUString GetArrowName(sal_uInt8 nArrowStyle)
@descr get arrow style name according to the flag.
Definition: lwpdrawobj.cxx:334
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName)=0
@descr create XF-draw object and assign the style name to it.
void ReadClosedObjStyle()
@descr read the style of closed lwp-sdw-object like: rectangle, ellipse and so on.
Definition: lwpdrawobj.cxx:124
SvStream * m_pStream
Definition: lwpdrawobj.hxx:85
DrawObjectType m_eType
Definition: lwpdrawobj.hxx:84
static void SetArrowHead(XFDrawStyle *pOpenedObjStyle, sal_uInt8 nArrowFlag, sal_uInt8 nLineWidth)
@descr set arrowhead of a xf-drawing object.
Definition: lwpdrawobj.cxx:294
void ReadObjHeaderRecord()
@descr read the header record data of lwp-sdw-object
Definition: lwpdrawobj.cxx:103
void SetPosition(XFFrame *pObj)
@descr set position of a drawing object in the frame.
Definition: lwpdrawobj.cxx:271
DrawingOffsetAndScale * m_pTransData
Definition: lwpdrawobj.hxx:88
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName)=0
@descr create XF-draw object and assign the style name to it.
LwpDrawObj(SvStream *pStream, DrawingOffsetAndScale *pTransData=nullptr)
@descr Constructor of class LwpDrawObj
Definition: lwpdrawobj.cxx:92
virtual ~LwpDrawPolyLine() override
Definition: lwpdrawobj.cxx:484
SdwPolyLineRecord m_aPolyLineRec
Definition: lwpdrawobj.hxx:191
virtual void Read() override
@descr reading function of class LwpDrawPolyLine
Definition: lwpdrawobj.cxx:491
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:514
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:546
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:529
LwpDrawPolyLine(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawPolyLine
Definition: lwpdrawobj.cxx:480
std::unique_ptr< SdwPoint[]> m_pVector
Definition: lwpdrawobj.hxx:192
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:594
virtual void Read() override
@descr reading function of class LwpDrawPolygon
Definition: lwpdrawobj.cxx:577
virtual ~LwpDrawPolygon() override
Definition: lwpdrawobj.cxx:570
sal_uInt16 m_nNumPoints
Definition: lwpdrawobj.hxx:212
LwpDrawPolygon(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawPolygon
Definition: lwpdrawobj.cxx:564
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:609
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:626
std::unique_ptr< SdwPoint[]> m_pVector
Definition: lwpdrawobj.hxx:213
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:759
SdwPoint m_aVector[16]
Definition: lwpdrawobj.hxx:233
virtual void Read() override
@descr reading function of class LwpDrawRectangle
Definition: lwpdrawobj.cxx:652
LwpDrawRectangle(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawRectangle
Definition: lwpdrawobj.cxx:644
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:689
XFFrame * CreateRoundedRect(const OUString &rStyleName)
Definition: lwpdrawobj.cxx:716
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:674
virtual ~LwpDrawTextArt() override
SdwPoint m_aVector[4]
Definition: lwpdrawobj.hxx:319
virtual void Read() override
@descr read out the record of a draw object.
LwpDrawTextArt(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawTextBox
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
SdwTextArt m_aTextArtRec
Definition: lwpdrawobj.hxx:318
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
void CreateFWPath(XFDrawPath *pPath)
virtual ~LwpDrawTextBox() override
Definition: lwpdrawobj.cxx:960
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
SdwPoint m_aVector
Definition: lwpdrawobj.hxx:296
static void SetFontStyle(rtl::Reference< XFFont > const &pFont, SdwTextBoxRecord const *pRec)
Definition: lwpdrawobj.cxx:969
virtual void Read() override
@descr reading function of class LwpDrawTextBox
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
SdwTextBoxRecord m_aTextRec
Definition: lwpdrawobj.hxx:295
LwpDrawTextBox(SvStream *pStream)
@descr Constructor of class LwpDrawTextBox
Definition: lwpdrawobj.cxx:956
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
XFStyleManager * GetXFStyleManager()
static LwpGlobalMgr * GetInstance(LwpSvStream *pSvStream=nullptr)
void setX(tools::Long nX)
void setY(tools::Long nY)
SdwRectangle: Not like rectangle in SODC, rectangles in Word Pro are defined by 4 points.
Definition: lwpsdwrect.hxx:89
double GetRotationAngle() const
Definition: lwpsdwrect.cxx:148
bool IsRectRotated() const
Definition: lwpsdwrect.hxx:104
tools::Rectangle GetOriginalRect() const
Definition: lwpsdwrect.cxx:125
sal_uInt64 Tell() const
bool good() const
SvStream & ReadInt16(sal_Int16 &rInt16)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
sal_uInt64 Seek(sal_uInt64 nPos)
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 SeekRel(sal_Int64 nPos)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
sal_uInt64 remainingSize()
SvStream & ReadUChar(unsigned char &rChar)
Color object.
Definition: xfcolor.hxx:70
virtual void Add(XFContent *pContent)
@descr Add content.
virtual void SetStyleName(const OUString &style)
: All content except XFTextContent can have a style.
Definition: xfcontent.hxx:90
Line object of drawing layer.
Definition: xfdrawline.hxx:71
For svg path wrapper.
Definition: xfdrawpath.hxx:100
void ClosePath()
@descr Close path command.
Definition: xfdrawpath.cxx:115
void LineTo(XFPoint pt)
@descr Line command.
Definition: xfdrawpath.cxx:94
void CurveTo(XFPoint dest, XFPoint ctrl1, XFPoint ctrl2)
@descr Curve command.
Definition: xfdrawpath.cxx:103
void MoveTo(XFPoint pt)
@descr Move command.
Definition: xfdrawpath.cxx:85
Polygon object.
Style for all drawing object, which can includes line style, area style, wrap style.
Definition: xfdrawstyle.hxx:80
void SetArrowStart(const OUString &start, double size)
@descr Set drawing object arrow start style,only lines can have arrows.
void SetArrowEnd(const OUString &end, double size)
@descr Set drawing object arrow end style,only lines can have arrows.
void SetLineDashStyle(enumXFLineStyle style, double len1, double len2, double space)
@descr Set drawing object dash border style.
void SetLineStyle(double width, XFColor color)
@descr Set drawing object border line.
Definition: xfdrawstyle.cxx:88
void SetAreaColor(XFColor const &color)
@descr Set drawing object area fill color.
void SetAreaLineStyle(enumXFAreaLineStyle style, sal_Int32 angle, double space, XFColor lineColor)
@descr Set drawing object area grid style.
@descr The font struct of openoffice xml filter.
Definition: xffont.hxx:120
Base class for all frame object,include drawing,image,text-box.
Definition: xfframe.hxx:79
void SetPosition(double x, double y, double width, double height)
@descr Set frame position.
Definition: xfframe.hxx:227
Image object.
Definition: xfimage.hxx:71
Style object for aragraph.
Definition: xfparastyle.hxx:93
Paragraph object for SODC.
Definition: xfparagraph.hxx:73
Style manager for the filter.
IXFStyleRet AddStyle(std::unique_ptr< IXFStyle > pStyle)
Style for all frame objects.
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
float y
float x
const EnumerationType m_eType
OUString sName
GtkMediaStream * m_pStream
static bool IsValid(const BmpInfoHeader2 &rHeader)
The file declares the LwpDrawObjects and associated class like LwpDrawGroup, LwpDrawRectangle and so ...
const sal_uInt8 DRAW_FACESIZE
const double THRESHOLD
@ OT_TEXTART
@ OT_RNDRECT
@ OT_UNDEFINED
@ OT_POLYGON
@ AH_ARROW_INVFULLARROW
@ AH_ARROW_HALFARROW
@ AH_ARROW_TEE
@ AH_ARROW_INVLINEARROW
@ AH_ARROW_FULLARROW
@ AH_ARROW_SQUARE
@ AH_ARROW_INVHALFARROW
@ AH_ARROW_CIRCLE
@ AH_ARROW_LINEARROW
@ LS_NULL
@ LS_DOT
@ TA_ITALIC
@ TA_WORDUNDERLINE
@ TA_SMALLCAPS
@ TA_DOUBLEUNDER
@ TA_BOLD
@ TA_UNDERLINE
@ TA_STRIKETHRU
@ FT_FDIAGHATCH
@ FT_TRANSPARENT
@ FT_DIAGCROSSHATCH
@ FT_SOLID
@ FT_CROSSHATCH
@ FT_HORZHATCH
@ FT_VERTHATCH
@ FT_BDIAGHATCH
For LWP filter architecture prototype Implementation file of SdwRectangle.
const double CM_PER_INCH
Definition: lwptools.hxx:76
const double TWIPS_PER_CM
Definition: lwptools.hxx:82
constexpr double rad2deg(double v)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
#define N
IXFStyle * m_pStyle
Definition: xfstylecont.hxx:71
sal_uInt8 nLineStyle
sal_uInt8 nLineWidth
sal_uInt16 nRotation
sal_uInt16 nTranslation
sal_uInt32 nFileSize
sal_uInt8 nG
sal_uInt8 nR
sal_uInt8 unused
sal_uInt8 nB
sal_uInt16 n
std::vector< SdwPoint > aPts
sal_uInt16 nTextLen
SdwFMPATH aPath[2]
sal_Int16 nRotation
sal_uInt8 nIndex
sal_uInt8 tmpTextFaceName[DRAW_FACESIZE]
sal_uInt16 nTextCharacterSet
unsigned char sal_uInt8
@ enumXFFWSlantY
Definition: xfdefs.hxx:477
@ enumXFFWAdjustAutosize
Definition: xfdefs.hxx:482
@ enumXFFrameYPosFromTop
Definition: xfdefs.hxx:333
@ enumXFAreaLineSingle
Definition: xfdefs.hxx:382
@ enumXFAreaLineCrossed
Definition: xfdefs.hxx:383
@ enumXFFrameYRelFrame
Definition: xfdefs.hxx:318
@ enumXFLineDash
Definition: xfdefs.hxx:366
@ enumXFCrossoutSignel
Definition: xfdefs.hxx:146
@ enumXFCrossoutNone
Definition: xfdefs.hxx:145
@ enumXFUnderlineSingle
Definition: xfdefs.hxx:117
@ enumXFUnderlineNone
Definition: xfdefs.hxx:116
@ enumXFUnderlineDouble
Definition: xfdefs.hxx:118
@ enumXFFrameXPosFromLeft
Definition: xfdefs.hxx:311
@ enumXFTransformSmallCaps
Definition: xfdefs.hxx:159
@ enumXFAnchorFrame
Definition: xfdefs.hxx:262
@ enumXFFrameXRelFrame
Definition: xfdefs.hxx:300
#define FABS(f)
Definition: xfglobal.hxx:71