30 #include <drawdoc.hxx>
35 #include <strings.hrc>
39 #include <section.hxx>
41 #include <viewimp.hxx>
60 #include <lineinfo.hxx>
90 #include <bitmaps.hlst>
128 struct SwPaintProperties;
147 class SwLineRect :
public SwRect
159 const Color& GetColor()
const {
return m_aColor; }
161 const SwTabFrame* GetTab()
const {
return m_pTabFrame; }
162 void SetPainted() { m_bPainted =
true; }
163 void Lock(
bool bLock)
170 bool IsPainted()
const {
return m_bPainted; }
171 bool IsLocked()
const {
return m_nLock != 0; }
172 SubColFlags GetSubColor()
const {
return m_nSubColor; }
180 static void dummy_function()
182 pid_t pid = getpid();
192 std::vector<SwLineRect> m_aLineRects;
193 typedef std::vector< SwLineRect >::const_iterator const_iterator;
194 typedef std::vector< SwLineRect >::iterator iterator;
195 typedef std::vector< SwLineRect >::reverse_iterator reverse_iterator;
196 typedef std::vector< SwLineRect >::size_type size_type;
214 void LockLines(
bool bLock );
217 bool isFull()
const {
return m_aLineRects.size() > 100; }
220 class SwSubsRects :
public SwLineRects
222 void RemoveSuperfluousSubsidiaryLines(
const SwLineRects &rRects, SwPaintProperties
const &
properties );
224 void PaintSubsidiary(
OutputDevice *pOut,
const SwLineRects *pRects, SwPaintProperties
const &
properties );
261 struct SwPaintProperties {
280 std::unique_ptr<BorderLines> pBLines;
281 std::unique_ptr<SwLineRects> pSLines;
282 std::unique_ptr<SwSubsRects> pSSubsLines;
285 std::unique_ptr<SwSubsRects> pSSpecSubsLines;
297 Color aSGlobalRetoucheColor;
304 : bSFlyMetafile(
false)
305 , pSFlyMetafileOut(nullptr)
306 , pSGlobalShell(nullptr)
307 , pSRetoucheFly(nullptr)
308 , pSRetoucheFly2(nullptr)
309 , pSFlyOnlyDraw(nullptr)
310 , pSProgress(nullptr)
330 return !gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() &&
331 !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() &&
332 !gProp.pSGlobalShell->GetViewOptions()->IsFormView() &&
338 return !gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() &&
339 !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() &&
340 !gProp.pSGlobalShell->GetViewOptions()->IsFormView() &&
341 !gProp.pSGlobalShell->GetViewOptions()->IsWhitespaceHidden() &&
347 return !gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() &&
348 !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() &&
349 !gProp.pSGlobalShell->GetViewOptions()->IsFormView() &&
356 bool isTableBoundariesEnabled()
358 if (!gProp.pSGlobalShell->GetViewOptions()->IsTable())
361 if (gProp.pSGlobalShell->GetViewOptions()->IsPagePreview())
364 if (gProp.pSGlobalShell->GetViewOptions()->IsReadonly())
367 if (gProp.pSGlobalShell->GetViewOptions()->IsFormView())
384 bool bSmallTwipToPxRelW =
false;
385 bool bSmallTwipToPxRelH =
false;
388 if ( (aCheckTwipToPxRelSz.Width()/100.0) < 2.0 )
390 bSmallTwipToPxRelW =
true;
392 if ( (aCheckTwipToPxRelSz.Height()/100.0) < 2.0 )
394 bSmallTwipToPxRelH =
true;
400 gProp.nSPixelSzW = aSz.Width();
401 if( !gProp.nSPixelSzW )
402 gProp.nSPixelSzW = 1;
403 gProp.nSPixelSzH = aSz.Height();
404 if( !gProp.nSPixelSzH )
405 gProp.nSPixelSzH = 1;
408 if ( !bSmallTwipToPxRelW )
410 gProp.nSHalfPixelSzW = gProp.nSPixelSzW / 2 + 1;
414 gProp.nSHalfPixelSzW = 0;
417 if ( !bSmallTwipToPxRelH )
419 gProp.nSHalfPixelSzH = gProp.nSPixelSzH / 2 + 1;
423 gProp.nSHalfPixelSzH = 0;
426 gProp.nSMinDistPixelW = gProp.nSPixelSzW * 2 + 1;
427 gProp.nSMinDistPixelH = gProp.nSPixelSzH * 2 + 1;
430 gProp.aSScaleX = double(rMap.
GetScaleX());
431 gProp.aSScaleY = double(rMap.
GetScaleY());
439 class SwSavePaintStatics :
public SwPaintProperties
442 SwSavePaintStatics();
443 ~SwSavePaintStatics();
448 SwSavePaintStatics::SwSavePaintStatics()
451 bSFlyMetafile = gProp.bSFlyMetafile;
452 pSGlobalShell = gProp.pSGlobalShell;
453 pSFlyMetafileOut = gProp.pSFlyMetafileOut;
454 pSRetoucheFly = gProp.pSRetoucheFly;
455 pSRetoucheFly2 = gProp.pSRetoucheFly2;
456 pSFlyOnlyDraw = gProp.pSFlyOnlyDraw;
457 pBLines = std::move(gProp.pBLines);
458 pSLines = std::move(gProp.pSLines);
459 pSSubsLines = std::move(gProp.pSSubsLines);
460 pSSpecSubsLines = std::move(gProp.pSSpecSubsLines);
461 pSProgress = gProp.pSProgress;
462 nSPixelSzW = gProp.nSPixelSzW;
463 nSPixelSzH = gProp.nSPixelSzH;
464 nSHalfPixelSzW = gProp.nSHalfPixelSzW;
465 nSHalfPixelSzH = gProp.nSHalfPixelSzH;
466 nSMinDistPixelW = gProp.nSMinDistPixelW;
467 nSMinDistPixelH = gProp.nSMinDistPixelH ;
469 aSScaleX = gProp.aSScaleX;
470 aSScaleY = gProp.aSScaleY;
473 gProp.bSFlyMetafile =
false;
474 gProp.pSFlyMetafileOut =
nullptr;
475 gProp.pSRetoucheFly =
nullptr;
476 gProp.pSRetoucheFly2 =
nullptr;
477 gProp.nSPixelSzW = gProp.nSPixelSzH =
478 gProp.nSHalfPixelSzW = gProp.nSHalfPixelSzH =
479 gProp.nSMinDistPixelW = gProp.nSMinDistPixelH = 0;
480 gProp.aSScaleX = gProp.aSScaleY = 1.0;
481 gProp.pSProgress =
nullptr;
484 SwSavePaintStatics::~SwSavePaintStatics()
487 gProp.pSGlobalShell = pSGlobalShell;
488 gProp.bSFlyMetafile = bSFlyMetafile;
489 gProp.pSFlyMetafileOut = pSFlyMetafileOut;
490 gProp.pSRetoucheFly = pSRetoucheFly;
491 gProp.pSRetoucheFly2 = pSRetoucheFly2;
492 gProp.pSFlyOnlyDraw = pSFlyOnlyDraw;
493 gProp.pBLines = std::move(pBLines);
494 gProp.pSLines = std::move(pSLines);
495 gProp.pSSubsLines = std::move(pSSubsLines);
496 gProp.pSSpecSubsLines = std::move(pSSpecSubsLines);
497 gProp.pSProgress = pSProgress;
498 gProp.nSPixelSzW = nSPixelSzW;
499 gProp.nSPixelSzH = nSPixelSzH;
500 gProp.nSHalfPixelSzW = nSHalfPixelSzW;
501 gProp.nSHalfPixelSzH = nSHalfPixelSzH;
502 gProp.nSMinDistPixelW = nSMinDistPixelW;
503 gProp.nSMinDistPixelH = nSMinDistPixelH;
504 aGlobalRetoucheColor = aSGlobalRetoucheColor;
505 gProp.aSScaleX = aSScaleX;
506 gProp.aSScaleY = aSScaleY;
511 if(!rContainer.empty())
513 m_Lines.append(std::move(rContainer));
526 if ( pCol !=
nullptr )
530 bool SwLineRect::MakeUnion(
const SwRect &rRect, SwPaintProperties
const &
properties)
539 const tools::Long nAdd = properties.nSPixelSzW + properties.nSHalfPixelSzW;
554 const tools::Long nAdd = properties.nSPixelSzW + properties.nSHalfPixelSzW;
572 for (reverse_iterator it = m_aLineRects.rbegin(); it != m_aLineRects.rend(); ++it)
574 SwLineRect &rLRect = *it;
576 if ( rLRect.GetTab() == pTab &&
577 !rLRect.IsPainted() && rLRect.GetSubColor() == nSCol &&
578 (rLRect.Height() > rLRect.Width()) == (rRect.
Height() > rRect.
Width()) &&
579 (pCol && rLRect.GetColor() == *pCol) )
581 if ( rLRect.MakeUnion( rRect, properties ) )
585 m_aLineRects.emplace_back(rRect, pCol, nStyle, pTab, nSCol);
588 void SwLineRects::ConnectEdges(
OutputDevice const *pOut, SwPaintProperties
const & properties )
593 if ( properties.aSScaleX < aEdgeScale || properties.aSScaleY < aEdgeScale )
599 std::vector<SwLineRect*> aCheck;
601 for (
size_t i = 0;
i < m_aLineRects.size(); ++
i)
603 SwLineRect& rL1 = m_aLineRects[
i];
604 if ( !rL1.GetTab() || rL1.IsPainted() || rL1.IsLocked() )
609 const bool bVert = rL1.Height() > rL1.Width();
614 nL1a = rL1.Top(); nL1b = rL1.Left();
615 nL1c = rL1.Right(); nL1d = rL1.Bottom();
619 nL1a = rL1.Left(); nL1b = rL1.Top();
620 nL1c = rL1.Bottom(); nL1d = rL1.Right();
624 for (iterator it2 = m_aLineRects.begin(); it2 != m_aLineRects.end(); ++it2)
626 SwLineRect &rL2 = *it2;
627 if ( rL2.GetTab() != rL1.GetTab() ||
630 (bVert == (rL2.Height() > rL2.Width())) )
636 nL2a = rL2.Top(); nL2b = rL2.Left();
637 nL2c = rL2.Right(); nL2d = rL2.Bottom();
641 nL2a = rL2.Left(); nL2b = rL2.Top();
642 nL2c = rL2.Bottom(); nL2d = rL2.Right();
645 if ( (nL1a - nAdd < nL2d && nL1d + nAdd > nL2a) &&
646 ((nL1b > nL2b && nL1c < nL2c) ||
647 (nL1c >= nL2c && nL1b - nAdd < nL2c) ||
648 (nL1b <= nL2b && nL1c + nAdd > nL2b)) )
650 aCheck.push_back( &rL2 );
653 if ( aCheck.size() < 2 )
656 bool bRemove =
false;
659 for (
size_t k = 0; !bRemove && k < aCheck.size(); ++k )
661 SwLineRect &rR1 = *aCheck[k];
663 for (
size_t k2 = k+1; !bRemove && k2 < aCheck.size(); ++k2 )
665 SwLineRect &rR2 = *aCheck[k2];
668 SwLineRect *pLA =
nullptr;
669 SwLineRect *pLB =
nullptr;
670 if ( rR1.Top() < rR2.Top() )
672 pLA = &rR1; pLB = &rR2;
674 else if ( rR1.Top() > rR2.Top() )
676 pLA = &rR2; pLB = &rR1;
679 if ( pLA && pLA->Bottom() + 60 > pLB->Top() )
681 if ( rL1.Top() < pLA->Top() )
683 if ( rL1.Bottom() == pLA->Bottom() )
687 aIns.Bottom( pLA->Bottom() );
688 if ( !rL1.Contains( aIns ) )
690 m_aLineRects.emplace_back(aIns, &rL1.GetColor(),
691 SvxBorderLineStyle::SOLID, rL1.GetTab(),
701 if ( rL1.Bottom() > pLB->Bottom() )
702 rL1.Top( pLB->Top() );
709 SwLineRect *pLA =
nullptr;
710 SwLineRect *pLB =
nullptr;
711 if ( rR1.Left() < rR2.Left() )
713 pLA = &rR1; pLB = &rR2;
715 else if ( rR1.Left() > rR2.Left() )
717 pLA = &rR2; pLB = &rR1;
720 if ( pLA && pLA->Right() + 60 > pLB->Left() )
722 if ( rL1.Left() < pLA->Left() )
724 if ( rL1.Right() == pLA->Right() )
728 aIns.Right( pLA->Right() );
729 if ( !rL1.Contains( aIns ) )
731 m_aLineRects.emplace_back(aIns, &rL1.GetColor(),
732 SvxBorderLineStyle::SOLID, rL1.GetTab(),
741 if ( rL1.Right() > pLB->Right() )
742 rL1.Left( pLB->Left() );
751 m_aLineRects.erase(m_aLineRects.begin() +
i);
757 void SwSubsRects::RemoveSuperfluousSubsidiaryLines(
const SwLineRects &rRects, SwPaintProperties
const & properties )
760 for (
size_t i = 0;
i < m_aLineRects.size(); ++
i)
764 const SwLineRect aSubsLineRect(m_aLineRects[i]);
768 if ( aSubsLineRect.IsPainted() ||
769 aSubsLineRect.IsLocked() )
772 const bool bVerticalSubs = aSubsLineRect.Height() > aSubsLineRect.Width();
773 SwRect aSubsRect( aSubsLineRect );
776 aSubsRect.AddLeft ( - (properties.nSPixelSzW+properties.nSHalfPixelSzW) );
777 aSubsRect.AddRight ( properties.nSPixelSzW+properties.nSHalfPixelSzW );
781 aSubsRect.AddTop ( - (properties.nSPixelSzH+properties.nSHalfPixelSzH) );
782 aSubsRect.AddBottom( properties.nSPixelSzH+properties.nSHalfPixelSzH );
784 for (const_iterator itK = rRects.m_aLineRects.begin(); itK != rRects.m_aLineRects.end();
787 const SwLineRect &rLine = *itK;
791 if ( rLine.IsLocked () )
794 if ( !bVerticalSubs == ( rLine.Height() > rLine.Width() ) )
797 if ( aSubsRect.Overlaps( rLine ) )
801 if ( aSubsRect.Left() <= rLine.Right() &&
802 aSubsRect.Right() >= rLine.Left() )
804 tools::Long nTmp = rLine.Top()-(properties.nSPixelSzH+1);
805 if ( aSubsLineRect.Top() < nTmp )
807 SwRect aNewSubsRect( aSubsLineRect );
808 aNewSubsRect.Bottom( nTmp );
809 m_aLineRects.emplace_back(aNewSubsRect,
nullptr,
810 aSubsLineRect.GetStyle(),
nullptr,
811 aSubsLineRect.GetSubColor());
813 nTmp = rLine.Bottom()+properties.nSPixelSzH+1;
814 if ( aSubsLineRect.Bottom() > nTmp )
816 SwRect aNewSubsRect( aSubsLineRect );
817 aNewSubsRect.Top( nTmp );
818 m_aLineRects.emplace_back(aNewSubsRect,
nullptr,
819 aSubsLineRect.GetStyle(),
nullptr,
820 aSubsLineRect.GetSubColor());
822 m_aLineRects.erase(m_aLineRects.begin() +
i);
829 if ( aSubsRect.Top() <= rLine.Bottom() &&
830 aSubsRect.Bottom() >= rLine.Top() )
832 tools::Long nTmp = rLine.Left()-(properties.nSPixelSzW+1);
833 if ( aSubsLineRect.Left() < nTmp )
835 SwRect aNewSubsRect( aSubsLineRect );
836 aNewSubsRect.Right( nTmp );
837 m_aLineRects.emplace_back(aNewSubsRect,
nullptr,
838 aSubsLineRect.GetStyle(),
nullptr,
839 aSubsLineRect.GetSubColor());
841 nTmp = rLine.Right()+properties.nSPixelSzW+1;
842 if ( aSubsLineRect.Right() > nTmp )
844 SwRect aNewSubsRect( aSubsLineRect );
845 aNewSubsRect.Left( nTmp );
846 m_aLineRects.emplace_back(aNewSubsRect,
nullptr,
847 aSubsLineRect.GetStyle(),
nullptr,
848 aSubsLineRect.GetSubColor());
850 m_aLineRects.erase(m_aLineRects.begin() +
i);
860 void SwLineRects::LockLines(
bool bLock )
862 for (SwLineRect& rLRect : m_aLineRects)
875 if ( rLRect.Height( ) > rLRect.Width( ) )
877 startX += nHalfLWidth;
879 endY = startY + rLRect.Height( );
883 startY += nHalfLWidth;
885 endX = startX + rLRect.Width( );
889 sal_uInt32( nHalfLWidth * 2 ), rLRect.GetStyle( ) );
892 void SwLineRects::PaintLines(
OutputDevice *pOut, SwPaintProperties
const &properties )
896 if (m_aLineRects.size() == m_nLastCount)
905 ConnectEdges( pOut, properties );
906 const Color *pLast =
nullptr;
908 bool bPaint2nd =
false;
909 size_t nMinCount = m_aLineRects.size();
911 for (
size_t i = 0;
i < m_aLineRects.size(); ++
i)
913 SwLineRect& rLRect = m_aLineRects[
i];
915 if ( rLRect.IsPainted() )
918 if ( rLRect.IsLocked() )
920 nMinCount =
std::min( nMinCount, i );
926 if ( rLRect.GetTab() )
928 if ( rLRect.Height() > rLRect.Width() )
931 SwTwips nLLeft = rLRect.Left() - 30,
932 nLRight = rLRect.Right() + 30,
933 nTLeft = rLRect.GetTab()->getFrameArea().Left() + rLRect.GetTab()->getFramePrintArea().Left(),
934 nTRight = rLRect.GetTab()->getFrameArea().Left() + rLRect.GetTab()->getFramePrintArea().Right();
935 if ( (nTLeft >= nLLeft && nTLeft <= nLRight) ||
936 (nTRight>= nLLeft && nTRight<= nLRight) )
942 SwTwips nLTop = rLRect.Top() - 30,
943 nLBottom = rLRect.Bottom() + 30,
944 nTTop = rLRect.GetTab()->getFrameArea().Top() + rLRect.GetTab()->getFramePrintArea().Top(),
945 nTBottom = rLRect.GetTab()->getFrameArea().Top() + rLRect.GetTab()->getFramePrintArea().Bottom();
946 if ( (nTTop >= nLTop && nTTop <= nLBottom) ||
947 (nTBottom >= nLTop && nTBottom <= nLBottom) )
953 if ( !pLast || *pLast != rLRect.GetColor() )
955 pLast = &rLRect.GetColor();
958 if( properties.pSGlobalShell->GetWin() &&
967 if( !rLRect.IsEmpty() )
976 for (
size_t i = 0;
i < m_aLineRects.size(); ++
i)
978 SwLineRect& rLRect = m_aLineRects[
i];
979 if ( rLRect.IsPainted() )
982 if ( rLRect.IsLocked() )
984 nMinCount =
std::min( nMinCount, i );
988 if ( !pLast || *pLast != rLRect.GetColor() )
990 pLast = &rLRect.GetColor();
993 if( properties.pSGlobalShell->GetWin() &&
1002 if( !rLRect.IsEmpty() )
1004 rLRect.SetPainted();
1007 m_nLastCount = nMinCount;
1013 const SwLineRects *pRects,
1014 SwPaintProperties
const & properties )
1016 if (m_aLineRects.empty())
1023 for (size_type i = 0;
i != m_aLineRects.size(); ++
i)
1025 SwLineRect& rLi = m_aLineRects[
i];
1026 const bool bVerticalSubs = rLi.Height() > rLi.Width();
1028 for (size_type k = i + 1; k != m_aLineRects.size(); ++k)
1030 SwLineRect& rLk = m_aLineRects[k];
1031 if ( rLi.SSize() == rLk.SSize() )
1033 if ( bVerticalSubs == ( rLk.Height() > rLk.Width() ) )
1035 if ( bVerticalSubs )
1039 if ( rLi.Top() == rLk.Top() &&
1040 ((nLi < rLk.Left() && nLi+21 > rLk.Left()) ||
1041 (nLk < rLi.Left() && nLk+21 > rLi.Left())))
1043 m_aLineRects.erase(m_aLineRects.begin() +
i);
1054 if ( rLi.Left() == rLk.Left() &&
1055 ((nLi < rLk.Top() && nLi+21 > rLk.Top()) ||
1056 (nLk < rLi.Top() && nLk+21 > rLi.Top())))
1058 m_aLineRects.erase(m_aLineRects.begin() +
i);
1070 if (pRects && (!pRects->m_aLineRects.empty()))
1071 RemoveSuperfluousSubsidiaryLines( *pRects, properties );
1073 if (m_aLineRects.empty())
1083 if( gProp.pSGlobalShell->GetWin() &&
1089 for (SwLineRect& rLRect : m_aLineRects)
1092 if ( !rLRect.IsPainted() &&
1093 !rLRect.IsLocked() )
1095 const Color *pCol =
nullptr;
1096 switch ( rLRect.GetSubColor() )
1108 rLRect.SetPainted();
1134 if ( !gProp.bSFlyMetafile && !pSh )
1140 gProp.pSFlyMetafileOut.get() : pRenderContext;
1148 SwRect aAlignedPxRect( aOrgPxRect );
1149 if ( rRect.
Top() > aPxCenterRect.Top() )
1152 aAlignedPxRect.AddTop( 1 );
1155 if ( rRect.
Bottom() < aPxCenterRect.Bottom() )
1158 aAlignedPxRect.AddBottom( - 1 );
1161 if ( rRect.
Left() > aPxCenterRect.Left() )
1164 aAlignedPxRect.AddLeft( 1 );
1167 if ( rRect.
Right() < aPxCenterRect.Right() )
1170 aAlignedPxRect.AddRight( - 1 );
1179 if ( aAlignedPxRect.Width() < 0 )
1181 aAlignedPxRect.Width(0);
1183 if ( aAlignedPxRect.Height() < 0 )
1185 aAlignedPxRect.Height(0);
1190 bool bZeroWidth =
false;
1191 if ( aAlignedPxRect.Width() == 0 )
1193 aAlignedPxRect.Width(1);
1196 bool bZeroHeight =
false;
1197 if ( aAlignedPxRect.Height() == 0 )
1199 aAlignedPxRect.Height(1);
1243 const tools::Long nW = nWidth % properties.nSPixelSzW;
1245 if ( !nW || nW > properties.nSHalfPixelSzW )
1246 return std::max(
tools::Long(1), nWidth - properties.nSHalfPixelSzW);
1255 const tools::Long nH = nHeight % properties.nSPixelSzH;
1257 if ( !nH || nH > properties.nSHalfPixelSzH )
1258 return std::max(
tools::Long(1), nHeight - properties.nSHalfPixelSzH);
1269 SwPaintProperties
const & properties)
1300 (rRect.*fnRect->
fnSubTop)( nDiff );
1309 static_cast<const SwTabFrame*
>(pFrame)->IsCollapsingBorders() )
1313 nDiff =
static_cast<const SwTabFrame*
>(pFrame)->GetBottomLineSize();
1348 ::SwAlignRect( rRect, properties.pSGlobalShell, properties.pSGlobalShell ? properties.pSGlobalShell->GetOut() : nullptr );
1376 static MapMode aMapMode(MapUnit::MapTwip);
1392 if (!gProp.pSRetoucheFly)
1393 gProp.pSRetoucheFly = gProp.pSRetoucheFly2;
1395 for (
size_t j = 0; (j < rObjs.
size()) && !rRegion.empty(); ++j)
1412 (
OUTDEV_PRINTER == gProp.pSGlobalShell->GetOut()->GetOutDevType() ||
1413 gProp.pSGlobalShell->IsPreview()))
1416 const bool bLowerOfSelf = pSelfFly && pFly->
IsLowerOf( pSelfFly );
1422 if (pSelfFly && pSelfFly->
IsLowerOf(pFly))
1426 if (gProp.pSRetoucheFly && gProp.pSRetoucheFly->IsLowerOf(pFly))
1429 #if OSL_DEBUG_LEVEL > 0
1432 if (pSelfFly && bLowerOfSelf)
1436 "Fly with wrong z-Order" );
1440 bool bStopOnHell =
true;
1456 bStopOnHell =
false;
1459 if (gProp.pSRetoucheFly)
1461 const SdrObject *pTmp = gProp.pSRetoucheFly->GetVirtDrawObj();
1474 bStopOnHell =
false;
1482 if ( (bStopOnHell && bHell) ||
1548 if (gProp.pSRetoucheFly == gProp.pSRetoucheFly2)
1549 gProp.pSRetoucheFly =
nullptr;
1554 const SwRect& _rAlignedPaintRect,
1556 SwPaintProperties
const & properties)
1569 bool bDrawTransparent =
false;
1570 if ( aColor.IsTransparent() )
1573 bDrawTransparent =
true;
1574 nTransparencyPercent = ((255 - aColor.GetAlpha())*100 + 0x7F)/0xFF;
1581 bDrawTransparent =
true;
1582 nTransparencyPercent = 100 - (_rGraphicObj.
GetAttr().
GetAlpha() * 100 + 127) / 255;
1585 if ( bDrawTransparent )
1636 const SwRect& _rAlignedPaintRect,
1638 bool _bNumberingGraphic,
1639 SwPaintProperties
const & properties,
1640 bool _bBackgrdAlreadyDrawn =
false)
1646 if ( !_bNumberingGraphic &&
1647 !_bBackgrdAlreadyDrawn &&
1673 SwPaintProperties
const & properties,
1674 bool bBackgrdAlreadyDrawn )
1680 SwRect aAlignedGrfRect = rGrf;
1684 const bool bNotInside = !rOut.
Contains( aAlignedGrfRect );
1694 if (pGrf->
GetGraphic().
GetType() == GraphicType::Default && !aOriginURL.isEmpty())
1709 aAlignedGrfRect.
Width(), aAlignedGrfRect.
Height(),
1710 aAlignedGrfRect.
Left(), aAlignedGrfRect.
Top()));
1727 const SwRect& rOriginalLayoutRect,
1732 if(rFillAttributes && rFillAttributes->isUsed())
1740 if (!aPaintRange.isEmpty() &&
1741 !rPaintRegion.empty() &&
1756 static const double fExpandX = 0.55;
1757 static const double fExpandY = 0.70;
1760 aPaintRange.expand(aPaintRange.getMinimum() - aSingleUnit);
1761 aPaintRange.expand(aPaintRange.getMaximum() + aSingleUnit);
1769 aPaintRange.expand(aPaintRange.getMaximum() + aSingleUnit);
1773 rOriginalLayoutRect.
Left(),
1774 rOriginalLayoutRect.
Top(),
1775 rOriginalLayoutRect.
Right(),
1776 rOriginalLayoutRect.
Bottom());
1782 if(rSequence.size())
1785 pPrimitives(&rSequence);
1788 if (rPaintRegion.size() > 1 || rPaintRegion[0] != rPaintRegion.
GetOrigin())
1791 primitives.resize(1);
1794 pPrimitives = &primitives;
1796 assert(pPrimitives && pPrimitives->size());
1806 aViewInformation2D) );
1807 pProcessor->process(*pPrimitives);
1822 const bool bConsiderBackgroundTransparency )
1831 if( pBrush && !bReplaceGrfNum )
1837 if (sh !=
nullptr && sh->
HasName()) {
1841 if( pGrf && GraphicType::NONE != pGrf->
GetType() )
1850 bReplaceGrfNum = bGrfNum;
1854 aGrf.
SSize( aGrfSize );
1856 bool bRetouche =
true;
1864 aGrf.
Pos().setY( rOrg.
Top() );
1869 aGrf.
Pos().setY( rOrg.
Top() );
1875 aGrf.
Pos().setX( rOrg.
Left() );
1890 aGrf.
Pos().setX( rOrg.
Left() );
1912 bRetouche = !rOut.
Contains( aGrf );
1921 SwRect aAlignedPaintRect = rOut;
1935 Point aPaintOffset( aAlignedPaintRect.
Pos() - aGrf.
Pos() );
1956 const double k1( 50 );
1957 const double k2( 7 );
1958 const Size aSize( aAlignedPaintRect.
SSize() );
1959 const double Abitmap( k1/k2 * static_cast<double>(aSize.Width())*aSize.Height() );
1962 aAlignedPaintRect.
SVRect(),
1964 Size( aPaintOffset.X(), aPaintOffset.Y() ),
1965 std::max( 128, static_cast<int>( sqrt(sqrt( Abitmap)) + .5 ) ) );
1971 bDraw = bRetouche =
false;
1979 default: OSL_ENSURE(
false,
"new Graphic position?" );
1984 bool bGrfBackgrdAlreadyDrawn =
false;
1996 bool bTransparentGrfWithNoFillBackgrd =
false;
1997 sal_Int32 nGrfTransparency = 0;
1998 bool bGrfIsTransparent =
false;
2004 if ( bConsiderBackgroundTransparency )
2011 bTransparentGrfWithNoFillBackgrd =
true;
2012 nGrfTransparency = 255 - aGrfAttr.
GetAlpha();
2017 bGrfIsTransparent =
true;
2023 const Color aColor( pBrush &&
2025 gProp.bSFlyMetafile )
2043 if (bConsiderBackgroundTransparency &&
2044 ( ( aColor.IsTransparent()) ||
2045 bTransparentGrfWithNoFillBackgrd ) )
2052 if ( gProp.pSGlobalShell->GetWin() &&
2090 if ( !bGrfIsTransparent )
2099 aDrawPoly.
Insert( aGrfPoly );
2103 bGrfBackgrdAlreadyDrawn =
true;
2111 (( bTransparentGrfWithNoFillBackgrd ? nGrfTransparency : (255 - aColor.GetAlpha())
2112 )*100 + 0x7F)/0xFF);
2122 if ( !bGrfIsTransparent )
2125 bGrfBackgrdAlreadyDrawn =
true;
2127 for(
size_t i = 0;
i < aRegion.size(); ++
i )
2129 rOutDev.
DrawRect( aRegion[
i].SVRect() );
2136 if( bDraw && aGrf.
Overlaps( rOut ) )
2138 bGrfBackgrdAlreadyDrawn );
2140 if( bReplaceGrfNum )
2176 aSizedRect.
AdjustLeft( -(aTwipToPxSize.Width()/2 + 1) );
2177 aSizedRect.
AdjustRight( aTwipToPxSize.Width()/2 + 1 );
2178 aSizedRect.
AdjustTop( -(aTwipToPxSize.Height()/2 + 1) );
2202 io_aSwRect =
SwRect( aSizedRect );
2204 #if OSL_DEBUG_LEVEL > 0
2207 OSL_ENSURE( aTestOrgPxRect == aTestNewPxRect,
2208 "Error in lcl_AlignRectToPixelSize(..): Adjusted rectangle has incorrect position or size");
2212 OSL_ENSURE( aTestOrgPxRect.
Left() >= (aTestNewPxRect.
Left()+1),
2213 "Error in lcl_AlignRectToPixelSize(..): Left() not correct adjusted");
2218 OSL_ENSURE( aTestOrgPxRect.
Right() <= (aTestNewPxRect.
Right()-1),
2219 "Error in lcl_AlignRectToPixelSize(..): Right() not correct adjusted");
2224 OSL_ENSURE( aTestOrgPxRect.
Top() >= (aTestNewPxRect.
Top()+1),
2225 "Error in lcl_AlignRectToPixelSize(..): Top() not correct adjusted");
2230 OSL_ENSURE( aTestOrgPxRect.
Bottom() <= (aTestNewPxRect.
Bottom()-1),
2231 "Error in lcl_AlignRectToPixelSize(..): Bottom() not correct adjusted");
2250 enum OverlapType { NO_OVERLAP, OVERLAP1, OVERLAP2, OVERLAP3 };
2252 enum class VerticalType {
LEFT,
RIGHT };
2261 OverlapType Overlaps(
const SwLineEntry& rComp )
const;
2267 void LimitVerticalEndPos(
const SwFrame& rFrame, VerticalType eType);
2272 SwLineEntry::SwLineEntry(
SwTwips nKey,
2278 mnStartPos( nStartPos ),
2279 mnEndPos( nEndPos ),
2282 maAttribute( rAttribute )
2316 SwLineEntry::OverlapType SwLineEntry::Overlaps(
const SwLineEntry& rNew )
const
2318 SwLineEntry::OverlapType eRet = OVERLAP3;
2320 if ( mnStartPos >= rNew.mnEndPos || mnEndPos <= rNew.mnStartPos )
2324 else if ( mnEndPos < rNew.mnEndPos )
2328 else if (mnStartPos <= rNew.mnStartPos)
2335 void SwLineEntry::LimitVerticalEndPos(
const SwFrame& rFrame, VerticalType eType)
2342 const auto& rCellFrame =
static_cast<const SwCellFrame&
>(rFrame);
2343 std::vector<const SwCellFrame*> aCoveredCells = rCellFrame.
GetCoveredCells();
2346 for (
auto it = aCoveredCells.rbegin(); it != aCoveredCells.rend(); ++it)
2352 if (eType == VerticalType::LEFT && rBox.
GetLeft())
2357 if (eType == VerticalType::RIGHT && rBox.
GetRight())
2368 struct lt_SwLineEntry
2370 bool operator()(
const SwLineEntry& e1,
const SwLineEntry& e2 )
const
2372 return e1.mnStartPos < e2.mnStartPos;
2383 class SwTabFramePainter
2385 SwLineEntryMap maVertLines;
2386 SwLineEntryMap maHoriLines;
2389 void Insert( SwLineEntry&,
bool bHori );
2392 void FindStylesForLine(
Point&,
2396 bool bOuter )
const;
2399 explicit SwTabFramePainter(
const SwTabFrame& rTabFrame );
2406 SwTabFramePainter::SwTabFramePainter(
const SwTabFrame& rTabFrame )
2407 : mrTabFrame( rTabFrame )
2410 HandleFrame(rTabFrame, aPaintArea);
2413 void SwTabFramePainter::HandleFrame(
const SwLayoutFrame& rLayoutFrame,
const SwRect& rPaintArea)
2422 if ( !pRowFrame->
IsRowSpanLine() || nRowSpan > 1 || nRowSpan < -1 )
2427 Insert(rLayoutFrame, rBox, rPaintArea);
2438 HandleFrame(*pLowerLayFrame, rPaintArea);
2449 SwLineEntryMap::const_iterator aIter = maHoriLines.begin();
2457 const Color* pHCColor =
nullptr;
2459 if( gProp.pSGlobalShell->GetWin() &&
2469 SwRect aUpperAligned( aUpper );
2473 std::shared_ptr<drawinglayer::primitive2d::SdrFrameBorderDataVector>
aData(
2474 std::make_shared<drawinglayer::primitive2d::SdrFrameBorderDataVector>());
2478 if ( bHori && aIter == maHoriLines.end() )
2480 aIter = maVertLines.begin();
2484 if ( !bHori && aIter == maVertLines.end() )
2487 const SwLineEntrySet& rEntrySet = (*aIter).second;
2488 for (
const SwLineEntry& rEntry : rEntrySet)
2495 aStart.setX( rEntry.mnStartPos );
2496 aStart.setY( rEntry.mnKey );
2497 aEnd.setX( rEntry.mnEndPos );
2498 aEnd.setY( rEntry.mnKey );
2502 aStart.setX( rEntry.mnKey );
2503 aStart.setY( rEntry.mnStartPos );
2504 aEnd.setX( rEntry.mnKey );
2505 aEnd.setY( rEntry.mnEndPos );
2509 aStyles[ 0 ] = rEntryStyle;
2510 FindStylesForLine(aStart, aEnd, aStyles, bHori, rEntry.mbOuter);
2512 if (!bHori && rEntry.mnLimitedEndPos)
2514 aEnd.setY(rEntry.mnLimitedEndPos);
2517 SwRect aRepaintRect( aStart, aEnd );
2520 SwTwips nRepaintRectSize = !rEntryStyle.GetWidth() ? 1 : rEntryStyle.GetWidth();
2523 aRepaintRect.Height( 2 * nRepaintRectSize );
2524 aRepaintRect.Pos().AdjustY( -nRepaintRectSize );
2530 if(aStyles[1].IsUsed() || aStyles[3].IsUsed() || aStyles[4].IsUsed() || aStyles[6].IsUsed())
2532 const double fLineWidthMaxLeft(std::max(aStyles[1].GetWidth(), aStyles[3].GetWidth()));
2533 const double fLineWidthMaxRight(std::max(aStyles[4].GetWidth(), aStyles[6].GetWidth()));
2534 aRepaintRect.Width(aRepaintRect.Width() + (fLineWidthMaxLeft + fLineWidthMaxRight));
2535 aRepaintRect.Pos().AdjustX( -fLineWidthMaxLeft );
2540 aRepaintRect.Width( 2 * nRepaintRectSize );
2541 aRepaintRect.Pos().AdjustX( -nRepaintRectSize );
2545 if(aStyles[3].IsUsed() || aStyles[1].IsUsed() || aStyles[6].IsUsed() || aStyles[4].IsUsed())
2547 const double fLineWidthMaxTop(std::max(aStyles[3].GetWidth(), aStyles[1].GetWidth()));
2548 const double fLineWidthMaxBottom(std::max(aStyles[6].GetWidth(), aStyles[4].GetWidth()));
2549 aRepaintRect.Height(aRepaintRect.Height() + (fLineWidthMaxTop + fLineWidthMaxBottom));
2550 aRepaintRect.Pos().AdjustY( -fLineWidthMaxTop );
2560 const Color* pTmpColor =
nullptr;
2561 if (0 == aStyles[ 0 ].GetWidth())
2563 if (isTableBoundariesEnabled() && gProp.pSGlobalShell->GetWin())
2564 aStyles[ 0 ].
Set( rCol, rCol, rCol,
false, 1, 0, 0 );
2566 aStyles[0].
SetType(SvxBorderLineStyle::NONE);
2569 pTmpColor = pHCColor;
2582 if (gProp.pSGlobalShell->GetWin())
2587 if (aStart.X() == aUpper.Left())
2588 aPaintStart.setX( aUpperAligned.Left() );
2589 else if (aStart.X() == aUpper.Right_())
2590 aPaintStart.setX( aUpperAligned.Right_() );
2591 if (aStart.Y() == aUpper.Top())
2592 aPaintStart.setY( aUpperAligned.Top() );
2593 else if (aStart.Y() == aUpper.Bottom_())
2594 aPaintStart.setY( aUpperAligned.Bottom_() );
2596 if (aEnd.X() == aUpper.Left())
2597 aPaintEnd.setX( aUpperAligned.Left() );
2598 else if (aEnd.X() == aUpper.Right_())
2599 aPaintEnd.setX( aUpperAligned.Right_() );
2600 if (aEnd.Y() == aUpper.Top())
2601 aPaintEnd.setY( aUpperAligned.Top() );
2602 else if (aEnd.Y() == aUpper.Bottom_())
2603 aPaintEnd.setY( aUpperAligned.Bottom_() );
2606 if(aStyles[0].IsUsed())
2616 aData->emplace_back(
2623 rInstance.addSdrConnectStyleData(
true, aStyles[1], -aY,
true);
2624 rInstance.addSdrConnectStyleData(
true, aStyles[2], -aX,
true);
2625 rInstance.addSdrConnectStyleData(
true, aStyles[3], aY,
false);
2627 rInstance.addSdrConnectStyleData(
false, aStyles[4], -aY,
true);
2628 rInstance.addSdrConnectStyleData(
false, aStyles[5], aX,
false);
2629 rInstance.addSdrConnectStyleData(
false, aStyles[6], aY,
false);
2640 aData->emplace_back(
2647 rInstance.addSdrConnectStyleData(
true, aStyles[3], -aY,
false);
2648 rInstance.addSdrConnectStyleData(
true, aStyles[2], -aX,
true);
2649 rInstance.addSdrConnectStyleData(
true, aStyles[1], aY,
true);
2651 rInstance.addSdrConnectStyleData(
false, aStyles[6], -aY,
false);
2652 rInstance.addSdrConnectStyleData(
false, aStyles[5], aX,
false);
2653 rInstance.addSdrConnectStyleData(
false, aStyles[4], aY,
true);
2672 mrTabFrame.ProcessPrimitives(aSequence);
2684 void SwTabFramePainter::FindStylesForLine( Point& rStartPoint,
2687 bool bHori,
bool bOuter )
const
2698 bool bWordTableCell =
false;
2699 SwViewShell* pShell = mrTabFrame.getRootFrame()->GetCurrShell();
2706 SwLineEntryMap::const_iterator aMapIter = maVertLines.find( rStartPoint.X() );
2707 OSL_ENSURE( aMapIter != maVertLines.end(),
"FindStylesForLine: Error" );
2708 const SwLineEntrySet& rVertSet = (*aMapIter).second;
2710 for (
const SwLineEntry& rEntry : rVertSet )
2714 if ( rStartPoint.Y() == rEntry.mnStartPos )
2715 pStyles[ 3 ] = rEntry.maAttribute;
2716 else if ( rStartPoint.Y() == rEntry.mnEndPos )
2717 pStyles[ 1 ] = rEntry.maAttribute;
2719 if (bWordTableCell && rStartPoint.X() == rEntry.mnKey && !bOuter && rEntry.mbOuter)
2721 rStartPoint.AdjustX(rEntry.maAttribute.GetWidth());
2726 if ( rStartPoint.Y() == rEntry.mnEndPos )
2727 pStyles[ 2 ] = rEntry.maAttribute;
2728 else if ( rEndPoint.Y() == rEntry.mnStartPos )
2729 pStyles[ 5 ] = rEntry.maAttribute;
2733 aMapIter = maHoriLines.find( rStartPoint.Y() );
2734 OSL_ENSURE( aMapIter != maHoriLines.end(),
"FindStylesForLine: Error" );
2735 const SwLineEntrySet& rHoriSet = (*aMapIter).second;
2737 for (
const SwLineEntry& rEntry : rHoriSet )
2741 if ( rStartPoint.X() == rEntry.mnEndPos )
2742 pStyles[ 2 ] = rEntry.maAttribute;
2743 else if ( rEndPoint.X() == rEntry.mnStartPos )
2744 pStyles[ 5 ] = rEntry.maAttribute;
2748 if ( rStartPoint.X() == rEntry.mnEndPos )
2749 pStyles[ 1 ] = rEntry.maAttribute;
2750 else if ( rStartPoint.X() == rEntry.mnStartPos )
2751 pStyles[ 3 ] = rEntry.maAttribute;
2753 if (bWordTableCell && rStartPoint.Y() == rEntry.mnKey && !bOuter && rEntry.mbOuter)
2755 rStartPoint.AdjustY(rEntry.maAttribute.GetWidth());
2762 aMapIter = maVertLines.find( rEndPoint.X() );
2763 OSL_ENSURE( aMapIter != maVertLines.end(),
"FindStylesForLine: Error" );
2764 const SwLineEntrySet& rVertSet2 = (*aMapIter).second;
2766 for (
const SwLineEntry& rEntry : rVertSet2 )
2768 if ( rEndPoint.Y() == rEntry.mnStartPos )
2769 pStyles[ 6 ] = rEntry.maAttribute;
2770 else if ( rEndPoint.Y() == rEntry.mnEndPos )
2771 pStyles[ 4 ] = rEntry.maAttribute;
2773 if (bWordTableCell && rEndPoint.X() == rEntry.mnKey && !bOuter && rEntry.mbOuter)
2775 rEndPoint.AdjustX(-rEntry.maAttribute.GetWidth());
2781 aMapIter = maHoriLines.find( rEndPoint.Y() );
2782 OSL_ENSURE( aMapIter != maHoriLines.end(),
"FindStylesForLine: Error" );
2783 const SwLineEntrySet& rHoriSet2 = (*aMapIter).second;
2785 for (
const SwLineEntry& rEntry : rHoriSet2 )
2787 if ( rEndPoint.X() == rEntry.mnEndPos )
2788 pStyles[ 4 ] = rEntry.maAttribute;
2789 else if ( rEndPoint.X() == rEntry.mnStartPos )
2790 pStyles[ 6 ] = rEntry.maAttribute;
2792 if (bWordTableCell && rEndPoint.Y() == rEntry.mnKey && !bOuter && rEntry.mbOuter)
2794 rEndPoint.AdjustY(-rEntry.maAttribute.GetWidth());
2809 return (pThisRowFrame
2810 && (pThisRowFrame->
GetUpper() == &rTabFrame)
2813 && ( !pThisRowFrame->
GetPrev()
2828 mrTabFrame, rFrame, rBoxItem));
2829 bool const bVert = mrTabFrame.IsVertical();
2830 bool const bR2L = mrTabFrame.IsRightToLeft();
2832 bool bWordTableCell =
false;
2842 aL.SetWordTableCell(bWordTableCell);
2844 aR.SetWordTableCell(bWordTableCell);
2846 aT.SetWordTableCell(bWordTableCell);
2848 aB.SetWordTableCell(bWordTableCell);
2860 if (!bWordTableCell || !bBottomIsOuter)
2876 if (bWordTableCell && bLeftIsOuter)
2882 SwLineEntry aLeft (nLeft, nTop, nBottom, bLeftIsOuter,
2883 bVert ? aB : (bR2L ? aR : aL));
2884 if (bWordTableCell && rBoxItem.
GetLeft())
2886 aLeft.LimitVerticalEndPos(rFrame, SwLineEntry::VerticalType::LEFT);
2889 SwLineEntry aRight (nRight, nTop, nBottom, bRightIsOuter,
2890 bVert ? (bBottomAsTop ? aB : aT) : (bR2L ? aL : aR));
2891 if (bWordTableCell && rBoxItem.
GetRight())
2893 aRight.LimitVerticalEndPos(rFrame, SwLineEntry::VerticalType::RIGHT);
2896 SwLineEntry aTop (nTop, nLeft, nRight, bTopIsOuter,
2897 bVert ? aL : (bBottomAsTop ? aB : aT));
2899 SwLineEntry aBottom(nBottom, nLeft, nRight, bBottomIsOuter,
2908 void SwTabFramePainter::Insert( SwLineEntry& rNew,
bool bHori )
2911 SwLineEntryMap* pLine2 = bHori ? &maHoriLines : &maVertLines;
2912 const SwTwips nKey = rNew.mnKey;
2913 SwLineEntryMap::iterator aMapIter = pLine2->find( nKey );
2915 SwLineEntrySet* pLineSet = aMapIter != pLine2->end() ? &((*aMapIter).second) :
nullptr;
2918 SwLineEntrySet aNewSet;
2919 (*pLine2)[ nKey ] = aNewSet;
2920 pLineSet = &(*pLine2)[ nKey ];
2922 SwLineEntrySet::iterator aIter = pLineSet->begin();
2924 while ( aIter != pLineSet->end() && rNew.mnStartPos < rNew.mnEndPos )
2926 const SwLineEntry& rOld = *aIter;
2928 if (rOld.mnLimitedEndPos || rOld.mbOuter != rNew.mbOuter)
2935 const SwLineEntry::OverlapType nOverlapType = rOld.Overlaps( rNew );
2941 if ( SwLineEntry::OVERLAP1 == nOverlapType )
2943 OSL_ENSURE( rNew.mnStartPos >= rOld.mnStartPos,
"Overlap type 3? How this?" );
2946 const SwLineEntry aLeft(nKey, rOld.mnStartPos, rNew.mnStartPos, rOld.mbOuter, rOldAttr);
2949 const SwLineEntry aMiddle(nKey, rNew.mnStartPos, rOld.mnEndPos, rOld.mbOuter, rCmpAttr);
2952 rNew.mnStartPos = rOld.mnEndPos;
2955 pLineSet->erase( aIter );
2956 if ( aLeft.mnStartPos < aLeft.mnEndPos ) pLineSet->insert( aLeft );
2957 if ( aMiddle.mnStartPos < aMiddle.mnEndPos ) pLineSet->insert( aMiddle );
2959 aIter = pLineSet->begin();
2963 else if ( SwLineEntry::OVERLAP2 == nOverlapType )
2966 const SwLineEntry aLeft(nKey, rOld.mnStartPos, rNew.mnStartPos, rOld.mbOuter, rOldAttr);
2969 const SwLineEntry aMiddle(nKey, rNew.mnStartPos, rNew.mnEndPos, rOld.mbOuter, rCmpAttr);
2972 const SwLineEntry aRight(nKey, rNew.mnEndPos, rOld.mnEndPos, rOld.mbOuter, rOldAttr);
2975 pLineSet->erase( aIter );
2976 if ( aLeft.mnStartPos < aLeft.mnEndPos ) pLineSet->insert( aLeft );
2977 if ( aMiddle.mnStartPos < aMiddle.mnEndPos ) pLineSet->insert( aMiddle );
2978 if ( aRight.mnStartPos < aRight.mnEndPos ) pLineSet->insert( aRight );
2980 rNew.mnStartPos = rNew.mnEndPos;
2984 else if ( SwLineEntry::OVERLAP3 == nOverlapType )
2987 const SwLineEntry aLeft(nKey, rNew.mnStartPos, rOld.mnStartPos, rOld.mbOuter, rNewAttr);
2990 const SwLineEntry aMiddle(nKey, rOld.mnStartPos, rNew.mnEndPos, rOld.mbOuter, rCmpAttr);
2993 const SwLineEntry aRight(nKey, rNew.mnEndPos, rOld.mnEndPos, rOld.mbOuter, rOldAttr);
2996 pLineSet->erase( aIter );
2997 if ( aLeft.mnStartPos < aLeft.mnEndPos ) pLineSet->insert( aLeft );
2998 if ( aMiddle.mnStartPos < aMiddle.mnEndPos ) pLineSet->insert( aMiddle );
2999 if ( aRight.mnStartPos < aRight.mnEndPos ) pLineSet->insert( aRight );
3001 rNew.mnStartPos = rNew.mnEndPos;
3009 if ( rNew.mnStartPos < rNew.mnEndPos )
3010 pLineSet->insert( rNew );
3025 explicit SwViewObjectContactRedirector(
const SwViewShell& rSh )
3026 : mrViewShell( rSh )
3034 bool bPaint(
true );
3048 rOriginal, rDisplayInfo, rVisitor );
3070 bool bResetRootPaint =
false;
3088 std::unique_ptr<SwSavePaintStatics> pStatics;
3089 if ( gProp.pSGlobalShell )
3090 pStatics.reset(
new SwSavePaintStatics());
3091 gProp.pSGlobalShell = pSh;
3109 bool bPerformLayoutAction(
true );
3113 if ( rTmpViewShell.IsInEndAction() ||
3114 rTmpViewShell.IsPaintInProgress() ||
3115 ( rTmpViewShell.Imp()->IsAction() &&
3116 rTmpViewShell.Imp()->GetLayAction().IsActionInProgress() ) )
3118 bPerformLayoutAction =
false;
3121 if(!bPerformLayoutAction)
3125 if ( bPerformLayoutAction )
3128 SwLayAction aAction( const_cast<SwRootFrame*>(
this), pSh->
Imp() );
3130 aAction.SetComplete(
false );
3131 aAction.SetReschedule( gProp.pSProgress !=
nullptr );
3132 aAction.Action(&rRenderContext);
3142 gProp.pSLines.reset(
new SwLineRects);
3161 "Neighbour of page is not a page.");
3162 pPageDeco =
static_cast<const SwPageFrame*
>(pPageDeco->GetPrev());
3165 const bool bBookMode = gProp.pSGlobalShell->GetViewOptions()->IsViewLayoutBookMode();
3167 pPage = static_cast<const SwPageFrame*>(pPage->
GetPrev());
3179 while ( pHiddenPage->
GetPrev() != nullptr )
3184 pControl->ShowAll(
false );
3189 SwViewObjectContactRedirector aSwRedirector( *pSh );
3201 bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
3203 if ( aRect.
Overlaps( aPaintRect ) )
3207 gProp.pSSubsLines.reset(
new SwSubsRects);
3208 gProp.pSSpecSubsLines.reset(
new SwSubsRects);
3210 gProp.pBLines.reset(
new BorderLines);
3212 aPaintRect.Intersection_( aRect );
3220 SwRect aPageRectTemp( aPaintRect );
3226 aPageRectRegion.
Exclude( aPaintRect.SVRect() );
3245 if(
OUTDEV_WINDOW == gProp.pSGlobalShell->GetOut()->GetOutDevType())
3270 gProp.pSLines->LockLines(
true );
3276 pPage->IsRightToLeft(),
3278 gProp.pSLines->PaintLines( pSh->
GetOut(),
gProp );
3279 gProp.pSLines->LockLines(
false );
3283 pPage->
PaintBaBo( aPaintRect, pPage,
true );
3290 gProp.pSSpecSubsLines->PaintSubsidiary( pSh->
GetOut(),
nullptr,
gProp );
3303 gProp.pSLines->PaintLines( pSh->
GetOut(),
gProp );
3306 gProp.pSSubsLines->PaintSubsidiary( pSh->
GetOut(), gProp.pSLines.get(),
gProp );
3307 gProp.pSSubsLines.reset();
3308 gProp.pSSpecSubsLines.reset();
3321 pPage->IsRightToLeft(),
3328 gProp.pBLines.reset();
3359 aEmptyPageRect.SSize( rFormatPage.getFrameArea().SSize() );
3362 bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
3365 if ( aRect.
Overlaps( aEmptyPageRect ) )
3380 SwRect aTmpPageRect( aEmptyPageRect );
3382 aEmptyPageRect = aTmpPageRect;
3393 DrawTextFlags::VCenter |
3394 DrawTextFlags::Center |
3395 DrawTextFlags::Clip );
3409 "Neighbour of page is not a page." );
3410 pPage =
static_cast<const SwPageFrame*
>(pPage->GetNext());
3413 gProp.pSLines.reset();
3415 if ( bResetRootPaint )
3421 gProp.pSProgress =
nullptr;
3422 gProp.pSGlobalShell =
nullptr;
3436 pCnt->
Calc(pRenderContext);
3450 bool Stop(
const SwRect& rRect)
const {
return (rRect.*m_fnCheck)(m_nLimit) > 0; }
3455 SwShortCut::SwShortCut(
const SwFrame& rFrame,
const SwRect& rRect )
3464 m_nLimit = rRect.
Top();
3469 m_nLimit = rRect.
Left() + rRect.
Width();
3475 m_nLimit = rRect.
Top() + rRect.
Height();
3482 m_nLimit = rRect.
Right();
3487 m_nLimit = rRect.
Left();
3496 SwTaggedPDFHelper aTaggedPDFHelper(
nullptr, &aFrameInfo,
nullptr, rRenderContext );
3503 SwShortCut aShortCut( *pFrame, rRect );
3506 pFrame->
Calc(&rRenderContext);
3515 bool bWin = gProp.pSGlobalShell->GetWin() !=
nullptr;
3524 if( aShortCut.Stop( aPaintRect ) )
3526 if ( bCnt && gProp.pSProgress )
3537 pFrame->
Retouch( pPage, rRect );
3542 if ( rRect.
Overlaps( aPaintRect ) )
3555 if ( aPaintRect.Left() == rRect.
Left() &&
3556 aPaintRect.Right() == rRect.
Right() )
3558 aPaintRect.Bottom( rRect.
Top() - 1 );
3559 if ( aPaintRect.Height() > 0 )
3560 gProp.pSGlobalShell->InvalidateWindows(aPaintRect);
3561 aPaintRect.Top( rRect.
Bottom() + 1 );
3563 if ( aPaintRect.Height() > 0 )
3564 gProp.pSGlobalShell->InvalidateWindows(aPaintRect);
3570 gProp.pSGlobalShell->InvalidateWindows( aPaintRect );
3576 pFrame->
Calc(&rRenderContext);
3582 aPaintRect.Intersection_( rRect );
3612 pFrame->
Calc(&rRenderContext);
3623 std::vector< double > aStrokePattern;
3625 aLinePolygon.
append(rStart);
3626 aLinePolygon.
append(rEnd);
3638 double nLuminance = aHslLine.
getZ() * 2.5;
3639 if ( nLuminance == 0 )
3641 else if ( nLuminance >= 1.0 )
3642 nLuminance = aHslLine.
getZ() * 0.4;
3643 aHslLine.
setZ( nLuminance );
3649 aLinePolygon, aOtherColor );
3652 aStrokePattern.push_back( 40 );
3653 aStrokePattern.push_back( 40 );
3659 aSeq[ aSeq.size( ) - 1 ] =
3671 if ( gProp.pSGlobalShell->GetOut()->GetOutDevType() ==
OUTDEV_PRINTER ||
3672 gProp.pSGlobalShell->GetViewOptions()->IsPDFExport() ||
3673 gProp.pSGlobalShell->GetViewOptions()->IsReadonly() ||
3674 gProp.pSGlobalShell->IsPreview() )
3678 while ( pBodyFrame && !pBodyFrame->
IsBodyFrame() )
3679 pBodyFrame = pBodyFrame->
GetNext();
3688 if ( pFirstFrame && pFirstFrame->
IsTabFrame() )
3689 pFlowFrame = static_cast< const SwTabFrame* >( pFirstFrame );
3697 if ( pFlowFrame && pFlowFrame->
IsPageBreak(
true ) )
3708 if ( gProp.pSGlobalShell->GetOut()->GetOutDevType() ==
OUTDEV_PRINTER ||
3709 gProp.pSGlobalShell->GetViewOptions()->IsPDFExport() ||
3710 gProp.pSGlobalShell->GetViewOptions()->IsReadonly() ||
3711 gProp.pSGlobalShell->IsPreview() )
3715 while ( pBodyFrame && !pBodyFrame->
IsBodyFrame() )
3716 pBodyFrame = pBodyFrame->
GetNext();
3732 gProp.pSGlobalShell->GetViewOptions()->IsLineBreak()) )
3741 double nWidth = aRect.Width();
3746 nWidth = aRect.Height();
3755 OUString aBreakText =
SwResId(STR_COLUMN_BREAK);
3770 aFontSize.
getX(), aFontSize.
getY(),
3771 aRect.Left() + nTextOff, aRect.Top() ) );
3775 aFontSize.
getX(), aFontSize.
getY(), 0.0, M_PI_2,
3776 aRect.Right(), aRect.Top() + nTextOff );
3782 aBreakText, 0, aBreakText.getLength(),
3783 std::vector< double >(),
3797 static_cast< const SwLayoutFrame*>( pFrame )->PaintBreak( );
3816 if ( !(gProp.pSGlobalShell->GetOut()->GetOutDevType() !=
OUTDEV_PRINTER &&
3817 !gProp.pSGlobalShell->GetViewOptions()->IsPDFExport() &&
3818 !gProp.pSGlobalShell->IsPreview() &&
3819 !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() &&
3820 !gProp.pSGlobalShell->GetViewOptions()->getBrowseMode() &&
3826 const SwRect& rVisArea = gProp.pSGlobalShell->VisArea();
3829 nXOff = std::max( aBodyRect.Left(), rVisArea.
Left() );
3836 pHeaderFrame =
nullptr;
3848 while ( pFootnoteContFrame )
3851 aBodyRect.AddBottom( pFootnoteContFrame->
getFrameArea().
Bottom() - aBodyRect.Bottom() );
3852 pFootnoteContFrame = pFootnoteContFrame->
GetNext();
3876 if ( !bBackgroundTransparent &&
3877 GetFormat()->IsBackgroundBrushInherited() )
3880 std::optional<Color> xSectionTOXColor;
3884 if (
GetBackgroundBrush( aFillAttributes, pBackgroundBrush, xSectionTOXColor, aDummyRect,
false,
false) )
3886 if ( xSectionTOXColor &&
3887 (xSectionTOXColor->IsTransparent()) &&
3890 bBackgroundTransparent =
true;
3892 else if(aFillAttributes && aFillAttributes->isUsed())
3894 bBackgroundTransparent = aFillAttributes->isTransparent();
3896 else if ( pBackgroundBrush )
3901 bBackgroundTransparent =
true;
3911 bBackgroundTransparent =
true;
3918 return bBackgroundTransparent;
3925 if (
nullptr == pUserCall )
3929 bool bPaint = gProp.pSFlyOnlyDraw ||
3938 if ( dynamic_cast< const SwFlyDrawObj *>( pObj ) !=
nullptr )
3942 if (
auto pFlyDraw = dynamic_cast<SwVirtFlyDrawObj *>( pObj ) )
3945 if ( gProp.pSFlyOnlyDraw && gProp.pSFlyOnlyDraw == pFly )
3964 pAnch = pDrawContact ? pDrawContact->
GetAnchorFrame(pObj) :
nullptr;
3983 if ( dynamic_cast< const SdrObjGroup *>( pObj ) == nullptr )
3985 OSL_FAIL(
"<SwFlyFrame::IsPaint(..)> - paint of drawing object without anchor frame!?" );
3994 else if ( gProp.pSFlyOnlyDraw )
4011 struct BorderLinesGuard
4013 explicit BorderLinesGuard() : m_pBorderLines(
std::move(gProp.pBLines))
4015 gProp.pBLines.reset(
new BorderLines);
4019 gProp.pBLines = std::move(m_pBorderLines);
4022 std::unique_ptr<BorderLines> m_pBorderLines;
4034 if (
auto pFly = pAnchoredObj->DynCastFlyFrame() )
4036 pFly->SetDeleted(bDeleted);
4049 if (bInGenerateThumbnail)
4060 gProp.pSLines->LockLines(
true);
4061 BorderLinesGuard blg;
4073 bool bIsChart =
false;
4100 bool bPaintCompleteBack( !pNoText );
4103 const bool bIsGraphicTransparent = pNoText && pNoText->
IsTransparent();
4104 if ( !bPaintCompleteBack &&
4105 ( bIsGraphicTransparent|| bContour ) )
4115 if(aFillAttributes && aFillAttributes->isUsed())
4117 bPaintCompleteBack =
true;
4126 bPaintCompleteBack = aBack &&
4132 const bool bPaintMarginOnly( !bPaintCompleteBack &&
4141 if (bIsGraphicTransparent &&
4151 gProp.pSRetoucheFly2 =
const_cast<SwFlyFrame*
>(
this);
4155 SwRect aPaintRect( aRect );
4159 gProp.pSRetoucheFly2 = pOldRet;
4163 if ( bPaintCompleteBack || bPaintMarginOnly )
4183 if ( bPaintMarginOnly ||
4184 ( pNoText && !bIsGraphicTransparent ) )
4193 rRenderContext.
Push();
4206 for (
size_t i = 0;
i < aRegion.size(); ++
i )
4211 rRenderContext.
Pop();
4215 for (
size_t i = 0;
i < aRegion.size(); ++
i )
4225 rRenderContext.
Pop();
4232 if( gProp.pSGlobalShell->GetWin()
4235 bool bSubsLineRectsCreated;
4236 if ( gProp.pSSubsLines )
4239 gProp.pSSubsLines->LockLines(
true );
4240 bSubsLineRectsCreated =
false;
4245 gProp.pSSubsLines.reset(
new SwSubsRects);
4246 bSubsLineRectsCreated =
true;
4249 bool bSpecSubsLineRectsCreated;
4250 if ( gProp.pSSpecSubsLines )
4253 gProp.pSSpecSubsLines->LockLines(
true );
4254 bSpecSubsLineRectsCreated =
false;
4259 gProp.pSSpecSubsLines.reset(
new SwSubsRects);
4260 bSpecSubsLineRectsCreated =
true;
4265 gProp.pSSpecSubsLines->PaintSubsidiary( &rRenderContext,
nullptr, gProp );
4266 gProp.pSSubsLines->PaintSubsidiary(&rRenderContext, gProp.pSLines.get(),
gProp);
4267 if ( !bSubsLineRectsCreated )
4269 gProp.pSSubsLines->LockLines(
false );
4273 gProp.pSSubsLines.reset();
4276 if ( !bSpecSubsLineRectsCreated )
4278 gProp.pSSpecSubsLines->LockLines(
false );
4282 gProp.pSSpecSubsLines.reset();
4292 gProp.pSLines->PaintLines( &rRenderContext, gProp );
4293 gProp.pSLines->LockLines(
false );
4309 rRenderContext.
Pop();
4311 if ( gProp.pSProgress && pNoText )
4335 const SwViewOption* pViewOption = gProp.pSGlobalShell->GetViewOptions();
4352 SwTabFramePainter
aHelper(*
this);
4353 aHelper.PaintLines(rRenderContext, rRect);
4359 else if ( gProp.pSGlobalShell->GetWin() && !gProp.pSGlobalShell->IsPreview() )
4364 SwRect aTabOutRect( rRect );
4385 const SvxShadowItem& rShadow,
const bool bDrawFullShadowRectangle,
4386 const bool bTop,
const bool bBottom,
4387 const bool bLeft,
const bool bRight,
4388 SwPaintProperties
const & properties)
4398 case SvxShadowLocation::BottomRight:
4400 if ( bDrawFullShadowRectangle )
4403 aOut.
Top( rOutRect.
Top() + nHeight );
4404 aOut.
Left( rOutRect.
Left() + nWidth );
4405 aRegion.push_back( aOut );
4411 aOut.
Top( rOutRect.
Bottom() - nHeight );
4413 aOut.
Left( rOutRect.
Left() + nWidth );
4414 aRegion.push_back( aOut );
4420 aOut.
Top( rOutRect.
Top() + nHeight );
4422 aOut.
Top( rOutRect.
Top() );
4425 aRegion.push_back( aOut );
4435 case SvxShadowLocation::TopLeft:
4437 if ( bDrawFullShadowRectangle )
4442 aRegion.push_back( aOut );
4448 aOut.
Bottom( rOutRect.
Top() + nHeight );
4451 aRegion.push_back( aOut );
4461 aOut.
Top( rOutRect.
Top() + nHeight );
4462 aRegion.push_back( aOut );
4469 rOutRect.
AddTop( nHeight );
4472 case SvxShadowLocation::TopRight:
4474 if ( bDrawFullShadowRectangle )
4478 aOut.
Left( rOutRect.
Left() + nWidth );
4479 aRegion.push_back( aOut );
4485 aOut.
Bottom( rOutRect.
Top() + nHeight );
4487 aOut.
Left( rOutRect.
Left() + nWidth );
4488 aRegion.push_back( aOut );
4498 aOut.
Top( rOutRect.
Top() + nHeight );
4499 aRegion.push_back( aOut );
4506 rOutRect.
AddTop( nHeight );
4509 case SvxShadowLocation::BottomLeft:
4511 if ( bDrawFullShadowRectangle )
4514 aOut.
Top( rOutRect.
Top() + nHeight );
4516 aRegion.push_back( aOut );
4525 aRegion.push_back( aOut );
4531 aOut.
Top( rOutRect.
Top() + nHeight );
4533 aOut.
Top( rOutRect.
Top() );
4536 aRegion.push_back( aOut );
4555 if( !aRegion.empty() && properties.pSGlobalShell->GetWin() &&
4573 for (
const SwRect & rOut : aRegion)
4599 const bool bTop = !bCnt || rAttrs.
GetTopLine ( *(
this) );
4600 const bool bBottom = !bCnt || rAttrs.
GetBottomLine( *(
this) );
4606 case SvxShadowLocation::BottomRight: rShadow.
SetLocation(SvxShadowLocation::BottomLeft);
break;
4607 case SvxShadowLocation::TopLeft: rShadow.
SetLocation(SvxShadowLocation::TopRight);
break;
4608 case SvxShadowLocation::TopRight: rShadow.
SetLocation(SvxShadowLocation::BottomRight);
break;
4609 case SvxShadowLocation::BottomLeft: rShadow.
SetLocation(SvxShadowLocation::TopLeft);
break;
4619 const bool bDrawFullShadowRectangle =
4627 lcl_PaintShadow(rRect, rOutRect, rShadow, bDrawFullShadowRectangle, bTop, bBottom,
true,
true, gProp);
4633 const Color *pColor,
4647 : (
IsInFly() ? SubColFlags::Fly : SubColFlags::Page ) );
4648 if( pColor && gProp.pSGlobalShell->GetWin() &&
4660 for (
size_t i = 0;
i < aRegion.size(); ++
i )
4661 gProp.pSLines->AddLineRect( aRegion[
i], pColor, nStyle, pTab, nSubCol, gProp );
4664 gProp.pSLines->AddLineRect( aOut, pColor, nStyle, pTab, nSubCol, gProp );
4671 class SwBorderRectanglePrimitive2D :
public BufferedDecompositionPrimitive2D
4685 virtual void create2DDecomposition(
4686 Primitive2DContainer& rContainer,
4687 const geometry::ViewInformation2D& rViewInformation)
const override;
4691 SwBorderRectanglePrimitive2D(
4706 virtual bool operator==(
const BasePrimitive2D& rPrimitive)
const override;
4709 virtual basegfx::B2DRange getB2DRange(
const geometry::ViewInformation2D& rViewInformation)
const override;
4712 virtual sal_uInt32 getPrimitive2DID()
const override;
4717 void SwBorderRectanglePrimitive2D::create2DDecomposition(
4718 Primitive2DContainer& rContainer,
4719 const geometry::ViewInformation2D& )
const
4727 std::shared_ptr<drawinglayer::primitive2d::SdrFrameBorderDataVector>
aData(
4728 std::make_shared<drawinglayer::primitive2d::SdrFrameBorderDataVector>());
4730 if(getStyleTop().IsUsed())
4734 aDown.setLength(getStyleTop().GetWidth() * 0.5);
4739 if(getStyleBottom().IsUsed())
4743 aUp.setLength(getStyleBottom().GetWidth() * 0.5);
4745 aBottomRight += aUp;
4748 if(getStyleLeft().IsUsed())
4752 aRight.setLength(getStyleLeft().GetWidth() * 0.5);
4754 aBottomLeft += aRight;
4757 if(getStyleRight().IsUsed())
4761 aLeft.setLength(getStyleRight().GetWidth() * 0.5);
4763 aBottomRight += aLeft;
4768 if(getStyleTop().IsUsed())
4772 aData->emplace_back(
4779 if(getStyleLeft().IsUsed())
4781 rInstance.addSdrConnectStyleData(
true, getStyleLeft(),
basegfx::B2DVector(aBottomLeft - aTopLeft),
false);
4784 if(getStyleRight().IsUsed())
4786 rInstance.addSdrConnectStyleData(
false, getStyleRight(),
basegfx::B2DVector(aBottomRight - aTopRight),
false);
4790 if(getStyleRight().IsUsed())
4794 aData->emplace_back(
4801 if(getStyleTop().IsUsed())
4803 rInstance.addSdrConnectStyleData(
true, getStyleTop(),
basegfx::B2DVector(aTopLeft - aTopRight),
false);
4806 if(getStyleBottom().IsUsed())
4808 rInstance.addSdrConnectStyleData(
false, getStyleBottom(),
basegfx::B2DVector(aBottomLeft - aBottomRight),
false);
4812 if(getStyleBottom().IsUsed())
4816 aData->emplace_back(
4823 if(getStyleRight().IsUsed())
4825 rInstance.addSdrConnectStyleData(
true, getStyleRight(),
basegfx::B2DVector(aTopRight - aBottomRight),
false);
4828 if(getStyleLeft().IsUsed())
4830 rInstance.addSdrConnectStyleData(
false, getStyleLeft(),
basegfx::B2DVector(aTopLeft - aBottomLeft),
false);
4834 if(getStyleLeft().IsUsed())
4838 aData->emplace_back(
4845 if(getStyleBottom().IsUsed())
4847 rInstance.addSdrConnectStyleData(
true, getStyleBottom(),
basegfx::B2DVector(aBottomRight - aBottomLeft),
false);
4850 if(getStyleTop().IsUsed())
4852 rInstance.addSdrConnectStyleData(
false, getStyleTop(),
basegfx::B2DVector(aTopRight - aTopLeft),
false);
4868 SwBorderRectanglePrimitive2D::SwBorderRectanglePrimitive2D(
4882 bool SwBorderRectanglePrimitive2D::operator==(
const BasePrimitive2D& rPrimitive)
const
4884 if(BasePrimitive2D::operator==(rPrimitive))
4886 const SwBorderRectanglePrimitive2D& rCompare =
static_cast<const SwBorderRectanglePrimitive2D&
>(rPrimitive);
4888 return (getB2DHomMatrix() == rCompare.getB2DHomMatrix() &&
4889 getStyleTop() == rCompare.getStyleTop() &&
4890 getStyleRight() == rCompare.getStyleRight() &&
4891 getStyleBottom() == rCompare.getStyleBottom() &&
4892 getStyleLeft() == rCompare.getStyleLeft());
4898 basegfx::B2DRange SwBorderRectanglePrimitive2D::getB2DRange(
const geometry::ViewInformation2D& )
const
4902 aRetval.transform(getB2DHomMatrix());
4907 sal_uInt32 SwBorderRectanglePrimitive2D::getPrimitive2DID()
const
4917 return opt ? &*opt :
nullptr;
4924 const SwRect& rPaintArea,
4925 const bool bVerticalLayout,
4926 const bool bVerticalLayoutLRBT,
4927 const bool bJoinWithPrev,
4928 const bool bJoinWithNext )
4930 SwRect aAlignedRect(rPaintArea);
4931 SwAlignRect(aAlignedRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut());
4934 bool bBottom =
true;
4941 bLeft = !bJoinWithPrev;
4942 bRight = !bJoinWithNext;
4945 bBottom = !bJoinWithPrev;
4946 bTop = !bJoinWithNext;
4949 bRight = !bJoinWithPrev;
4950 bLeft = !bJoinWithNext;
4953 bTop = !bJoinWithPrev;
4954 bBottom = !bJoinWithNext;
4964 if( aShadow.GetLocation() != SvxShadowLocation::NONE )
4967 false, bTop, bBottom, bLeft, bRight, gProp);
4974 aAlignedRect.
Left(), aAlignedRect.
Top()));
4976 bTop ? get_ptr(rFont.
GetAbsTopBorder(bVerticalLayout, bVerticalLayoutLRBT)) :
nullptr,
4979 bRight ? get_ptr(rFont.
GetAbsRightBorder(bVerticalLayout, bVerticalLayoutLRBT)) :
nullptr,
4986 bLeft ? get_ptr(rFont.
GetAbsLeftBorder(bVerticalLayout, bVerticalLayoutLRBT)) :
nullptr,
4990 aBorderLineTarget.
append(
4992 new drawinglayer::primitive2d::SwBorderRectanglePrimitive2D(
4998 gProp.pBLines->AddBorderLines(std::move(aBorderLineTarget));
5005 "lcl_HasNextCell( const SwFrame& rFrame ) should be called with SwCellFrame" );
5007 const SwFrame* pTmpFrame = &rFrame;
5010 if ( pTmpFrame->GetNext() )
5015 while ( pTmpFrame->IsCellFrame() );
5045 OSL_ENSURE( _pCellFrame,
"No cell frame available, dying soon" );
5049 const SwFrame* pTmpFrame = _pCellFrame;
5050 bool bCellAtBorder =
true;
5051 bool bCellAtLeftBorder = !_pCellFrame->
GetPrev();
5052 bool bCellAtRightBorder = !_pCellFrame->
GetNext();
5060 bCellAtBorder =
false;
5066 bCellAtLeftBorder =
false;
5070 bCellAtRightBorder =
false;
5074 OSL_ENSURE( pTmpFrame && pTmpFrame->
IsRowFrame(),
"No RowFrame available" );
5078 static_cast<const SwTabFrame*
>(pParentRowFrame->GetUpper());
5080 const bool bCellNeedsAttribute = bCellAtBorder &&
5083 ( !pParentRowFrame->GetPrev() &&
5087 ( !pParentRowFrame->GetNext() &&
5091 const SwFrame* pRet = _pCellFrame;
5092 if ( bCellNeedsAttribute )
5095 const SwFrame* pNextCell =
nullptr;
5096 bool bNoBordersInside =
false;
5098 if ( bCellAtLeftBorder && (
nullptr != ( pNextCell =
lcl_HasNextCell( *_pCellFrame ) ) ) )
5105 ( !rBorderBox.
GetTop() || !pParentRowFrame->GetPrev() ) &&
5107 ( !rBorderBox.
GetRight() || bCellAtRightBorder ) &&
5108 ( !rBorderBox.
GetBottom() || !pParentRowFrame->GetNext() );
5114 ( !rBorderBox.
GetTop() || !pParentRowFrame->GetPrev() ) &&
5115 ( !rBorderBox.
GetLeft() || bCellAtLeftBorder ) &&
5116 ( !rBorderBox.
GetRight() || bCellAtRightBorder ) &&
5117 ( !rBorderBox.
GetBottom() || !pParentRowFrame->GetNext() );
5120 if ( bNoBordersInside )
5138 pLowerCell = pLowerCell->
GetLower();
5140 OSL_ENSURE( pLowerCell && pLowerCell->
IsCellFrame(),
"No CellFrame available" );
5153 pLastTabFrame = pLastTabFrame->
GetFollow();
5165 while ( pLowerCell->
GetNext() )
5167 pLowerCell = pLowerCell->
GetNext();
5170 pLowerCell = pLowerCell->
GetLower();
5172 OSL_ENSURE( pLowerCell && pLowerCell->
IsCellFrame(),
"No CellFrame available" );
5188 getRootFrame()->GetCurrShell()->GetOut()->GetViewTransformation(),
5200 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D =
CreateProcessor2D();
5203 pProcessor2D->process( rSequence );
5217 if (
IsCellFrame() && !gProp.pSGlobalShell->GetViewOptions()->IsTable())
5231 const bool bLine = rAttrs.
IsLine();
5236 const bool bb4779636HackActive =
true;
5238 const SwFrame* pCellFrameForBottomBorderAttrs =
nullptr;
5239 const SwFrame* pCellFrameForTopBorderAttrs =
nullptr;
5240 bool bFoundCellForTopOrBorderAttrs =
false;
5244 if ( pCellFrameForBottomBorderAttrs !=
this )
5245 bFoundCellForTopOrBorderAttrs =
true;
5247 if ( pCellFrameForTopBorderAttrs !=
this )
5248 bFoundCellForTopOrBorderAttrs =
true;
5253 if ( !(bLine || bShadow || bFoundCellForTopOrBorderAttrs) )
5262 ::SwAlignRect( aRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
5266 bool bDrawOnlyShadowForTransparentFrame =
false;
5281 bDrawOnlyShadowForTransparentFrame =
true;
5301 if((bLine || bFoundCellForTopOrBorderAttrs) && !bDrawOnlyShadowForTransparentFrame)
5305 const SvxBorderLine* pLeftBorder(rBox.
GetLeft());
5306 const SvxBorderLine* pRightBorder(rBox.
GetRight());
5307 const SvxBorderLine* pTopBorder(rBox.
GetTop());
5308 const SvxBorderLine* pBottomBorder(rBox.
GetBottom());
5315 std::swap(pLeftBorder, pRightBorder);
5330 (aRect.*_rRectFn->fnSetTop)( (pPrevFrame->*_rRectFn->fnGetPrtBottom)() );
5333 pTopBorder =
nullptr;
5341 (aRect.*_rRectFn->fnSetBottom)( (pNextFrame->*_rRectFn->fnGetPrtTop)() );
5344 pBottomBorder =
nullptr;
5362 bool bWordBorder =
false;
5370 if (bInWordTableCell)
5375 if (pContentFrame->IsUndersized())
5377 pBottomBorder =
nullptr;
5381 if(
nullptr != pLeftBorder ||
nullptr != pRightBorder ||
nullptr != pTopBorder ||
nullptr != pBottomBorder)
5408 new drawinglayer::primitive2d::SwBorderRectanglePrimitive2D(
5415 if (bInWordTableCell)
5428 aBorderLineTarget.
append(aRetval);
5429 gProp.pBLines->AddBorderLines(std::move(aBorderLineTarget));
5476 case css::text::HorizontalAdjust_CENTER:
5477 nX += nPrtWidth/2 - nWidth/2;
break;
5478 case css::text::HorizontalAdjust_RIGHT:
5479 nX += nPrtWidth - nWidth;
break;
5480 case css::text::HorizontalAdjust_LEFT:
5483 SAL_WARN(
"sw.core",
"New adjustment for footnote lines?");
5489 nX),
Size( nLineWidth, nWidth ) )