svdfmtf.cxx (2ef01c2f) | svdfmtf.cxx (47a7c0c1) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 54 unchanged lines hidden (view full) --- 63#include <svx/svdetc.hxx> 64#include <svl/itemset.hxx> 65#include <basegfx/polygon/b2dpolygon.hxx> 66#include <vcl/salbtype.hxx> // FRound 67#include <basegfx/matrix/b2dhommatrix.hxx> 68#include <basegfx/matrix/b2dhommatrixtools.hxx> 69#include <svx/xlinjoit.hxx> 70#include <svx/xlndsit.hxx> | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 54 unchanged lines hidden (view full) --- 63#include <svx/svdetc.hxx> 64#include <svl/itemset.hxx> 65#include <basegfx/polygon/b2dpolygon.hxx> 66#include <vcl/salbtype.hxx> // FRound 67#include <basegfx/matrix/b2dhommatrix.hxx> 68#include <basegfx/matrix/b2dhommatrixtools.hxx> 69#include <svx/xlinjoit.hxx> 70#include <svx/xlndsit.hxx> |
71#include <basegfx/polygon/b2dpolygonclipper.hxx> 72#include <svx/xbtmpit.hxx> |
|
71 72//////////////////////////////////////////////////////////////////////////////////////////////////// 73 74ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFileImport(SdrModel& rModel): 75 nMapScalingOfs(0), 76 pLineAttr(NULL),pFillAttr(NULL),pTextAttr(NULL), 77 pPage(NULL),pModel(NULL),nLayer(0), 78 nLineWidth(0), 79 maLineJoin(basegfx::B2DLINEJOIN_NONE), 80 maLineCap(com::sun::star::drawing::LineCap_BUTT), 81 maDash(XDASH_RECT, 0, 0, 0, 0, 0), 82 bFntDirty(sal_True), | 73 74//////////////////////////////////////////////////////////////////////////////////////////////////// 75 76ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFileImport(SdrModel& rModel): 77 nMapScalingOfs(0), 78 pLineAttr(NULL),pFillAttr(NULL),pTextAttr(NULL), 79 pPage(NULL),pModel(NULL),nLayer(0), 80 nLineWidth(0), 81 maLineJoin(basegfx::B2DLINEJOIN_NONE), 82 maLineCap(com::sun::star::drawing::LineCap_BUTT), 83 maDash(XDASH_RECT, 0, 0, 0, 0, 0), 84 bFntDirty(sal_True), |
83 bLastObjWasPolyWithoutLine(sal_False),bNoLine(sal_False),bNoFill(sal_False),bLastObjWasLine(sal_False) | 85 bLastObjWasPolyWithoutLine(sal_False), 86 bNoLine(sal_False), 87 bNoFill(sal_False), 88 bLastObjWasLine(sal_False), 89 maClip() |
84{ 85 aVD.EnableOutput(sal_False); 86 87 // #i111954# init to no fill and no line initially 88 aVD.SetLineColor(); 89 aVD.SetFillColor(); 90 91 aOldLineColor.SetRed( aVD.GetLineColor().GetRed() + 1 ); // invalidate old line color 92 pLineAttr=new SfxItemSet(rModel.GetItemPool(),XATTR_LINE_FIRST,XATTR_LINE_LAST); 93 pFillAttr=new SfxItemSet(rModel.GetItemPool(),XATTR_FILL_FIRST,XATTR_FILL_LAST); 94 pTextAttr=new SfxItemSet(rModel.GetItemPool(),EE_ITEMS_START,EE_ITEMS_END); 95 pModel=&rModel; | 90{ 91 aVD.EnableOutput(sal_False); 92 93 // #i111954# init to no fill and no line initially 94 aVD.SetLineColor(); 95 aVD.SetFillColor(); 96 97 aOldLineColor.SetRed( aVD.GetLineColor().GetRed() + 1 ); // invalidate old line color 98 pLineAttr=new SfxItemSet(rModel.GetItemPool(),XATTR_LINE_FIRST,XATTR_LINE_LAST); 99 pFillAttr=new SfxItemSet(rModel.GetItemPool(),XATTR_FILL_FIRST,XATTR_FILL_LAST); 100 pTextAttr=new SfxItemSet(rModel.GetItemPool(),EE_ITEMS_START,EE_ITEMS_END); 101 pModel=&rModel; |
102 checkClip(); |
|
96} 97 98ImpSdrGDIMetaFileImport::~ImpSdrGDIMetaFileImport() 99{ 100 delete pLineAttr; 101 delete pFillAttr; 102 delete pTextAttr; 103} --- 269 unchanged lines hidden (view full) --- 373 if (bText) 374 { 375 pObj->SetMergedItemSet(*pTextAttr); 376 pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_LEFT ) ); 377 } 378 } 379} 380 | 103} 104 105ImpSdrGDIMetaFileImport::~ImpSdrGDIMetaFileImport() 106{ 107 delete pLineAttr; 108 delete pFillAttr; 109 delete pTextAttr; 110} --- 269 unchanged lines hidden (view full) --- 380 if (bText) 381 { 382 pObj->SetMergedItemSet(*pTextAttr); 383 pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_LEFT ) ); 384 } 385 } 386} 387 |
381void ImpSdrGDIMetaFileImport::InsertObj( SdrObject* pObj, sal_Bool bScale ) | 388void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj, sal_Bool bScale) |
382{ | 389{ |
383 if ( bScale && !aScaleRect.IsEmpty() ) | 390 if ( bScale && !aScaleRect.IsEmpty() ) |
384 { 385 if ( bSize ) 386 pObj->NbcResize( Point(), aScaleX, aScaleY ); 387 if ( bMov ) 388 pObj->NbcMove( Size( aOfs.X(), aOfs.Y() ) ); 389 } 390 | 391 { 392 if ( bSize ) 393 pObj->NbcResize( Point(), aScaleX, aScaleY ); 394 if ( bMov ) 395 pObj->NbcMove( Size( aOfs.X(), aOfs.Y() ) ); 396 } 397 |
391 // #i111954# check object for visibility 392 // used are SdrPathObj, SdrRectObj, SdrCircObj, SdrGrafObj 393 bool bVisible(false); 394 395 if(pObj->HasLineStyle()) | 398 if(isClip()) |
396 { | 399 { |
397 bVisible = true; 398 } | 400 const basegfx::B2DPolyPolygon aPoly(pObj->TakeXorPoly()); 401 const basegfx::B2DRange aOldRange(aPoly.getB2DRange()); 402 const SdrLayerID aOldLayer(pObj->GetLayer()); 403 const SfxItemSet aOldItemSet(pObj->GetMergedItemSet()); 404 const SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(pObj); 405 BitmapEx aBitmapEx; |
399 | 406 |
400 if(!bVisible && pObj->HasFillStyle()) 401 { 402 bVisible = true; 403 } | 407 if(pSdrGrafObj) 408 { 409 aBitmapEx = pSdrGrafObj->GetGraphic().GetBitmapEx(); 410 } |
404 | 411 |
405 if(!bVisible) 406 { 407 SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(pObj); | 412 SdrObject::Free(pObj); |
408 | 413 |
409 if(pTextObj && pTextObj->HasText()) | 414 if(!aOldRange.isEmpty()) |
410 { | 415 { |
411 bVisible = true; | 416 // clip against ClipRegion 417 const basegfx::B2DPolyPolygon aNewPoly( 418 basegfx::tools::clipPolyPolygonOnPolyPolygon( 419 aPoly, 420 maClip, 421 true, 422 aPoly.isClosed() ? false : true)); 423 const basegfx::B2DRange aNewRange(aNewPoly.getB2DRange()); 424 425 if(!aNewRange.isEmpty()) 426 { 427 pObj = new SdrPathObj( 428 aNewPoly.isClosed() ? OBJ_POLY : OBJ_PLIN, 429 aNewPoly); 430 431 pObj->SetLayer(aOldLayer); 432 pObj->SetMergedItemSet(aOldItemSet); 433 434 if(!!aBitmapEx) 435 { 436 // aNewRange is inside of aOldRange and defines which part of aBitmapEx is used 437 const double fScaleX(aBitmapEx.GetSizePixel().Width() / (aOldRange.getWidth() ? aOldRange.getWidth() : 1.0)); 438 const double fScaleY(aBitmapEx.GetSizePixel().Height() / (aOldRange.getHeight() ? aOldRange.getHeight() : 1.0)); 439 basegfx::B2DRange aPixel(aNewRange); 440 basegfx::B2DHomMatrix aTrans; 441 442 aTrans.translate(-aOldRange.getMinX(), -aOldRange.getMinY()); 443 aTrans.scale(fScaleX, fScaleY); 444 aPixel.transform(aTrans); 445 446 const BitmapEx aClippedBitmap( 447 aBitmapEx, 448 Point(floor(std::max(0.0, aPixel.getMinX())), floor(std::max(0.0, aPixel.getMinY()))), 449 Size(ceil(aPixel.getWidth()), ceil(aPixel.getHeight()))); 450 451 pObj->SetMergedItem(XFillStyleItem(XFILL_BITMAP)); 452 pObj->SetMergedItem(XFillBitmapItem(String(), aClippedBitmap.GetBitmap())); 453 } 454 } |
412 } 413 } 414 | 455 } 456 } 457 |
415 if(!bVisible) | 458 if(pObj) |
416 { | 459 { |
417 SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(pObj); | 460 // #i111954# check object for visibility 461 // used are SdrPathObj, SdrRectObj, SdrCircObj, SdrGrafObj 462 bool bVisible(false); |
418 | 463 |
419 if(pGrafObj) | 464 if(pObj->HasLineStyle()) |
420 { | 465 { |
421 // this may be refined to check if the graphic really is visible. It 422 // is here to ensure that graphic objects without fill, line and text 423 // get created | |
424 bVisible = true; 425 } | 466 bVisible = true; 467 } |
426 } | |
427 | 468 |
428 if(!bVisible) 429 { 430 SdrObject::Free(pObj); | 469 if(!bVisible && pObj->HasFillStyle()) 470 { 471 bVisible = true; 472 } 473 474 if(!bVisible) 475 { 476 SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(pObj); 477 478 if(pTextObj && pTextObj->HasText()) 479 { 480 bVisible = true; 481 } 482 } 483 484 if(!bVisible) 485 { 486 SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(pObj); 487 488 if(pGrafObj) 489 { 490 // this may be refined to check if the graphic really is visible. It 491 // is here to ensure that graphic objects without fill, line and text 492 // get created 493 bVisible = true; 494 } 495 } 496 497 if(!bVisible) 498 { 499 SdrObject::Free(pObj); 500 } 501 else 502 { 503 aTmpList.InsertObject( pObj ); 504 if ( HAS_BASE( SdrPathObj, pObj ) ) 505 { 506 FASTBOOL bClosed=pObj->IsClosedObj(); 507 bLastObjWasPolyWithoutLine=bNoLine && bClosed; 508 bLastObjWasLine=!bClosed; 509 } 510 else 511 { 512 bLastObjWasPolyWithoutLine = sal_False; 513 bLastObjWasLine = sal_False; 514 } 515 } |
431 } | 516 } |
432 else 433 { 434 aTmpList.InsertObject( pObj ); 435 if ( HAS_BASE( SdrPathObj, pObj ) ) 436 { 437 FASTBOOL bClosed=pObj->IsClosedObj(); 438 bLastObjWasPolyWithoutLine=bNoLine && bClosed; 439 bLastObjWasLine=!bClosed; 440 } 441 else 442 { 443 bLastObjWasPolyWithoutLine = sal_False; 444 bLastObjWasLine = sal_False; 445 } 446 } | |
447} 448 449/**************************************************************************************************/ 450 451void ImpSdrGDIMetaFileImport::DoAction(MetaPixelAction& /*rAct*/) 452{ 453} 454 --- 41 unchanged lines hidden (view full) --- 496 maDash = XDash(); 497 InsertObj(pPath, false); 498 } 499 } 500} 501 502void ImpSdrGDIMetaFileImport::DoAction(MetaRectAction& rAct) 503{ | 517} 518 519/**************************************************************************************************/ 520 521void ImpSdrGDIMetaFileImport::DoAction(MetaPixelAction& /*rAct*/) 522{ 523} 524 --- 41 unchanged lines hidden (view full) --- 566 maDash = XDash(); 567 InsertObj(pPath, false); 568 } 569 } 570} 571 572void ImpSdrGDIMetaFileImport::DoAction(MetaRectAction& rAct) 573{ |
504 SdrRectObj* pRect=new SdrRectObj(rAct.GetRect()); | 574 SdrRectObj* pRect=new SdrRectObj(rAct.GetRect()); |
505 SetAttributes(pRect); 506 InsertObj(pRect); 507} 508 509void ImpSdrGDIMetaFileImport::DoAction(MetaRoundRectAction& rAct) 510{ | 575 SetAttributes(pRect); 576 InsertObj(pRect); 577} 578 579void ImpSdrGDIMetaFileImport::DoAction(MetaRoundRectAction& rAct) 580{ |
511 SdrRectObj* pRect=new SdrRectObj(rAct.GetRect()); | 581 SdrRectObj* pRect=new SdrRectObj(rAct.GetRect()); |
512 SetAttributes(pRect); 513 long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2; 514 if (nRad!=0) { 515 SfxItemSet aSet(*pLineAttr->GetPool(),SDRATTR_ECKENRADIUS,SDRATTR_ECKENRADIUS); 516 aSet.Put(SdrEckenradiusItem(nRad)); 517 pRect->SetMergedItemSet(aSet); 518 } 519 InsertObj(pRect); 520} 521 522/**************************************************************************************************/ 523 524void ImpSdrGDIMetaFileImport::DoAction(MetaEllipseAction& rAct) 525{ | 582 SetAttributes(pRect); 583 long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2; 584 if (nRad!=0) { 585 SfxItemSet aSet(*pLineAttr->GetPool(),SDRATTR_ECKENRADIUS,SDRATTR_ECKENRADIUS); 586 aSet.Put(SdrEckenradiusItem(nRad)); 587 pRect->SetMergedItemSet(aSet); 588 } 589 InsertObj(pRect); 590} 591 592/**************************************************************************************************/ 593 594void ImpSdrGDIMetaFileImport::DoAction(MetaEllipseAction& rAct) 595{ |
526 SdrCircObj* pCirc=new SdrCircObj(OBJ_CIRC,rAct.GetRect()); | 596 SdrCircObj* pCirc=new SdrCircObj(OBJ_CIRC,rAct.GetRect()); |
527 SetAttributes(pCirc); 528 InsertObj(pCirc); 529} 530 531void ImpSdrGDIMetaFileImport::DoAction(MetaArcAction& rAct) 532{ | 597 SetAttributes(pCirc); 598 InsertObj(pCirc); 599} 600 601void ImpSdrGDIMetaFileImport::DoAction(MetaArcAction& rAct) 602{ |
533 Point aCenter(rAct.GetRect().Center()); | 603 Point aCenter(rAct.GetRect().Center()); |
534 long nStart=GetAngle(rAct.GetStartPoint()-aCenter); 535 long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); 536 SdrCircObj* pCirc=new SdrCircObj(OBJ_CARC,rAct.GetRect(),nStart,nEnd); 537 SetAttributes(pCirc); 538 InsertObj(pCirc); 539} 540 541void ImpSdrGDIMetaFileImport::DoAction(MetaPieAction& rAct) 542{ | 604 long nStart=GetAngle(rAct.GetStartPoint()-aCenter); 605 long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); 606 SdrCircObj* pCirc=new SdrCircObj(OBJ_CARC,rAct.GetRect(),nStart,nEnd); 607 SetAttributes(pCirc); 608 InsertObj(pCirc); 609} 610 611void ImpSdrGDIMetaFileImport::DoAction(MetaPieAction& rAct) 612{ |
543 Point aCenter(rAct.GetRect().Center()); | 613 Point aCenter(rAct.GetRect().Center()); |
544 long nStart=GetAngle(rAct.GetStartPoint()-aCenter); 545 long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); 546 SdrCircObj* pCirc=new SdrCircObj(OBJ_SECT,rAct.GetRect(),nStart,nEnd); 547 SetAttributes(pCirc); 548 InsertObj(pCirc); 549} 550 551void ImpSdrGDIMetaFileImport::DoAction(MetaChordAction& rAct) 552{ | 614 long nStart=GetAngle(rAct.GetStartPoint()-aCenter); 615 long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); 616 SdrCircObj* pCirc=new SdrCircObj(OBJ_SECT,rAct.GetRect(),nStart,nEnd); 617 SetAttributes(pCirc); 618 InsertObj(pCirc); 619} 620 621void ImpSdrGDIMetaFileImport::DoAction(MetaChordAction& rAct) 622{ |
553 Point aCenter(rAct.GetRect().Center()); | 623 Point aCenter(rAct.GetRect().Center()); |
554 long nStart=GetAngle(rAct.GetStartPoint()-aCenter); 555 long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); 556 SdrCircObj* pCirc=new SdrCircObj(OBJ_CCUT,rAct.GetRect(),nStart,nEnd); 557 SetAttributes(pCirc); 558 InsertObj(pCirc); 559} 560 561/**************************************************************************************************/ --- 92 unchanged lines hidden (view full) --- 654 } 655 } 656 } 657 } 658 659 return false; 660} 661 | 624 long nStart=GetAngle(rAct.GetStartPoint()-aCenter); 625 long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); 626 SdrCircObj* pCirc=new SdrCircObj(OBJ_CCUT,rAct.GetRect(),nStart,nEnd); 627 SetAttributes(pCirc); 628 InsertObj(pCirc); 629} 630 631/**************************************************************************************************/ --- 92 unchanged lines hidden (view full) --- 724 } 725 } 726 } 727 } 728 729 return false; 730} 731 |
732void ImpSdrGDIMetaFileImport::checkClip() 733{ 734 if(aVD.IsClipRegion()) 735 { 736 Region aRegion(aVD.GetClipRegion()); |
|
662 | 737 |
738 maClip = aRegion.ConvertToB2DPolyPolygon(); 739 740 if(isClip()) 741 { 742 const basegfx::B2DHomMatrix aTransform( 743 basegfx::tools::createScaleTranslateB2DHomMatrix( 744 fScaleX, 745 fScaleY, 746 aOfs.X(), 747 aOfs.Y())); 748 749 maClip.transform(aTransform); 750 } 751 } 752} 753 754bool ImpSdrGDIMetaFileImport::isClip() const 755{ 756 return !maClip.getB2DRange().isEmpty(); 757} 758 |
|
663void ImpSdrGDIMetaFileImport::DoAction( MetaPolyLineAction& rAct ) 664{ 665 // #i73407# reformulation to use new B2DPolygon classes 666 basegfx::B2DPolygon aSource(rAct.GetPolygon().getB2DPolygon()); 667 668 if(aSource.count()) 669 { 670 const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); --- 10 unchanged lines hidden (view full) --- 681 } 682 else if(bLastObjWasPolyWithoutLine && CheckLastPolyLineAndFillMerge(basegfx::B2DPolyPolygon(aSource))) 683 { 684 bCreateLineObject = false; 685 } 686 687 if(bCreateLineObject) 688 { | 759void ImpSdrGDIMetaFileImport::DoAction( MetaPolyLineAction& rAct ) 760{ 761 // #i73407# reformulation to use new B2DPolygon classes 762 basegfx::B2DPolygon aSource(rAct.GetPolygon().getB2DPolygon()); 763 764 if(aSource.count()) 765 { 766 const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); --- 10 unchanged lines hidden (view full) --- 777 } 778 else if(bLastObjWasPolyWithoutLine && CheckLastPolyLineAndFillMerge(basegfx::B2DPolyPolygon(aSource))) 779 { 780 bCreateLineObject = false; 781 } 782 783 if(bCreateLineObject) 784 { |
689 SdrPathObj* pPath = new SdrPathObj( | 785 SdrPathObj* pPath = new SdrPathObj( |
690 aSource.isClosed() ? OBJ_POLY : OBJ_PLIN, 691 basegfx::B2DPolyPolygon(aSource)); 692 nLineWidth = nNewLineWidth; 693 maLineJoin = rLineInfo.GetLineJoin(); 694 maLineCap = rLineInfo.GetLineCap(); 695 maDash = XDash(XDASH_RECT, 696 rLineInfo.GetDotCount(), rLineInfo.GetDotLen(), 697 rLineInfo.GetDashCount(), rLineInfo.GetDashLen(), --- 15 unchanged lines hidden (view full) --- 713 { 714 const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); 715 aSource.transform(aTransform); 716 717 if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(basegfx::B2DPolyPolygon(aSource))) 718 { 719 // #i73407# make sure polygon is closed, it's a filled primitive 720 aSource.setClosed(true); | 786 aSource.isClosed() ? OBJ_POLY : OBJ_PLIN, 787 basegfx::B2DPolyPolygon(aSource)); 788 nLineWidth = nNewLineWidth; 789 maLineJoin = rLineInfo.GetLineJoin(); 790 maLineCap = rLineInfo.GetLineCap(); 791 maDash = XDash(XDASH_RECT, 792 rLineInfo.GetDotCount(), rLineInfo.GetDotLen(), 793 rLineInfo.GetDashCount(), rLineInfo.GetDashLen(), --- 15 unchanged lines hidden (view full) --- 809 { 810 const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); 811 aSource.transform(aTransform); 812 813 if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(basegfx::B2DPolyPolygon(aSource))) 814 { 815 // #i73407# make sure polygon is closed, it's a filled primitive 816 aSource.setClosed(true); |
721 722 SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, basegfx::B2DPolyPolygon(aSource)); | 817 SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, basegfx::B2DPolyPolygon(aSource)); |
723 SetAttributes(pPath); 724 InsertObj(pPath, false); 725 } 726 } 727} 728 729void ImpSdrGDIMetaFileImport::DoAction(MetaPolyPolygonAction& rAct) 730{ --- 4 unchanged lines hidden (view full) --- 735 { 736 const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); 737 aSource.transform(aTransform); 738 739 if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource)) 740 { 741 // #i73407# make sure polygon is closed, it's a filled primitive 742 aSource.setClosed(true); | 818 SetAttributes(pPath); 819 InsertObj(pPath, false); 820 } 821 } 822} 823 824void ImpSdrGDIMetaFileImport::DoAction(MetaPolyPolygonAction& rAct) 825{ --- 4 unchanged lines hidden (view full) --- 830 { 831 const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); 832 aSource.transform(aTransform); 833 834 if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource)) 835 { 836 // #i73407# make sure polygon is closed, it's a filled primitive 837 aSource.setClosed(true); |
743 744 SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource); | 838 SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource); |
745 SetAttributes(pPath); 746 InsertObj(pPath, false); 747 } 748 } 749} 750 751/**************************************************************************************************/ 752 --- 83 unchanged lines hidden (view full) --- 836 aStr.Erase(rAct.GetLen()); 837 ImportText( rAct.GetPoint(), aStr, rAct ); 838} 839 840void ImpSdrGDIMetaFileImport::DoAction(MetaBmpAction& rAct) 841{ 842 Rectangle aRect(rAct.GetPoint(),rAct.GetBitmap().GetSizePixel()); 843 aRect.Right()++; aRect.Bottom()++; | 839 SetAttributes(pPath); 840 InsertObj(pPath, false); 841 } 842 } 843} 844 845/**************************************************************************************************/ 846 --- 83 unchanged lines hidden (view full) --- 930 aStr.Erase(rAct.GetLen()); 931 ImportText( rAct.GetPoint(), aStr, rAct ); 932} 933 934void ImpSdrGDIMetaFileImport::DoAction(MetaBmpAction& rAct) 935{ 936 Rectangle aRect(rAct.GetPoint(),rAct.GetBitmap().GetSizePixel()); 937 aRect.Right()++; aRect.Bottom()++; |
844 SdrGrafObj* pGraf=new SdrGrafObj(Graphic(rAct.GetBitmap()),aRect); | 938 SdrGrafObj* pGraf=new SdrGrafObj(Graphic(rAct.GetBitmap()),aRect); |
845 InsertObj(pGraf); 846} 847 848void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScaleAction& rAct) 849{ 850 Rectangle aRect(rAct.GetPoint(),rAct.GetSize()); 851 aRect.Right()++; aRect.Bottom()++; | 939 InsertObj(pGraf); 940} 941 942void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScaleAction& rAct) 943{ 944 Rectangle aRect(rAct.GetPoint(),rAct.GetSize()); 945 aRect.Right()++; aRect.Bottom()++; |
852 SdrGrafObj* pGraf=new SdrGrafObj(Graphic(rAct.GetBitmap()),aRect); | 946 SdrGrafObj* pGraf=new SdrGrafObj(Graphic(rAct.GetBitmap()),aRect); |
853 InsertObj(pGraf); 854} 855 856void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExAction& rAct) 857{ 858 Rectangle aRect(rAct.GetPoint(),rAct.GetBitmapEx().GetSizePixel()); 859 aRect.Right()++; aRect.Bottom()++; | 947 InsertObj(pGraf); 948} 949 950void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExAction& rAct) 951{ 952 Rectangle aRect(rAct.GetPoint(),rAct.GetBitmapEx().GetSizePixel()); 953 aRect.Right()++; aRect.Bottom()++; |
860 SdrGrafObj* pGraf=new SdrGrafObj( rAct.GetBitmapEx(), aRect ); | 954 SdrGrafObj* pGraf=new SdrGrafObj( rAct.GetBitmapEx(), aRect ); |
861 InsertObj(pGraf); 862} 863 864void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScaleAction& rAct) 865{ 866 Rectangle aRect(rAct.GetPoint(),rAct.GetSize()); 867 aRect.Right()++; aRect.Bottom()++; | 955 InsertObj(pGraf); 956} 957 958void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScaleAction& rAct) 959{ 960 Rectangle aRect(rAct.GetPoint(),rAct.GetSize()); 961 aRect.Right()++; aRect.Bottom()++; |
868 SdrGrafObj* pGraf=new SdrGrafObj( rAct.GetBitmapEx(), aRect ); | 962 SdrGrafObj* pGraf=new SdrGrafObj( rAct.GetBitmapEx(), aRect ); |
869 InsertObj(pGraf); 870} 871 872//////////////////////////////////////////////////////////////////////////////////////////////////// 873 874void ImpSdrGDIMetaFileImport::DoAction( MetaHatchAction& rAct ) 875{ 876 // #i73407# reformulation to use new B2DPolygon classes 877 basegfx::B2DPolyPolygon aSource(rAct.GetPolyPolygon().getB2DPolyPolygon()); 878 879 if(aSource.count()) 880 { 881 const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); 882 aSource.transform(aTransform); 883 884 if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource)) 885 { 886 const Hatch& rHatch = rAct.GetHatch(); | 963 InsertObj(pGraf); 964} 965 966//////////////////////////////////////////////////////////////////////////////////////////////////// 967 968void ImpSdrGDIMetaFileImport::DoAction( MetaHatchAction& rAct ) 969{ 970 // #i73407# reformulation to use new B2DPolygon classes 971 basegfx::B2DPolyPolygon aSource(rAct.GetPolyPolygon().getB2DPolyPolygon()); 972 973 if(aSource.count()) 974 { 975 const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); 976 aSource.transform(aTransform); 977 978 if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource)) 979 { 980 const Hatch& rHatch = rAct.GetHatch(); |
887 SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource); | 981 SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource); |
888 SfxItemSet aHatchAttr(pModel->GetItemPool(), 889 XATTR_FILLSTYLE, XATTR_FILLSTYLE, 890 XATTR_FILLHATCH, XATTR_FILLHATCH, 0, 0 ); 891 XHatchStyle eStyle; 892 893 switch(rHatch.GetStyle()) 894 { 895 case(HATCH_TRIPLE) : --- 73 unchanged lines hidden (view full) --- 969 // #i73407# reformulation to use new B2DPolygon classes 970 basegfx::B2DPolyPolygon aSource(pAct->GetPolyPolygon().getB2DPolyPolygon()); 971 972 if(aSource.count()) 973 { 974 if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource)) 975 { 976 const Gradient& rGrad = pAct->GetGradient(); | 982 SfxItemSet aHatchAttr(pModel->GetItemPool(), 983 XATTR_FILLSTYLE, XATTR_FILLSTYLE, 984 XATTR_FILLHATCH, XATTR_FILLHATCH, 0, 0 ); 985 XHatchStyle eStyle; 986 987 switch(rHatch.GetStyle()) 988 { 989 case(HATCH_TRIPLE) : --- 73 unchanged lines hidden (view full) --- 1063 // #i73407# reformulation to use new B2DPolygon classes 1064 basegfx::B2DPolyPolygon aSource(pAct->GetPolyPolygon().getB2DPolyPolygon()); 1065 1066 if(aSource.count()) 1067 { 1068 if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource)) 1069 { 1070 const Gradient& rGrad = pAct->GetGradient(); |
977 SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource); | 1071 SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource); |
978 SfxItemSet aGradAttr(pModel->GetItemPool(), 979 XATTR_FILLSTYLE, XATTR_FILLSTYLE, 980 XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0 ); 981 XGradient aXGradient; 982 983 aXGradient.SetGradientStyle((XGradientStyle)rGrad.GetStyle()); 984 aXGradient.SetStartColor(rGrad.GetStartColor()); 985 aXGradient.SetEndColor(rGrad.GetEndColor()); --- 49 unchanged lines hidden --- | 1072 SfxItemSet aGradAttr(pModel->GetItemPool(), 1073 XATTR_FILLSTYLE, XATTR_FILLSTYLE, 1074 XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0 ); 1075 XGradient aXGradient; 1076 1077 aXGradient.SetGradientStyle((XGradientStyle)rGrad.GetStyle()); 1078 aXGradient.SetStartColor(rGrad.GetStartColor()); 1079 aXGradient.SetEndColor(rGrad.GetEndColor()); --- 49 unchanged lines hidden --- |