summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-27 21:41:13 +0100
committerMichael Stahl <mstahl@redhat.com>2017-03-28 15:38:01 +0000
commitb3545786dafcf2293168fea894b4a61ae64b52f3 (patch)
tree697982c2d5b38e93372d10b1a0b81bc8c3739b59 /sw
parent16b67b4bd394aee3b46a9d46ea7f919dfb35a855 (diff)
Resolves: tdf#106748 infinite dashed line from annotations to FAR_AWAY things
we (very irritatingly) create dashed lines by creating a sequence of dash drawing layer objects, so if its hugely long we create a hugely long sequence Change-Id: I38a0c6052cf058d5e02ebef7dd6a90e27f6e5454 Reviewed-on: https://gerrit.libreoffice.org/35781 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/notxtfrm.cxx2
-rw-r--r--sw/source/core/fields/postithelper.cxx2
-rw-r--r--sw/source/core/inc/frame.hxx2
-rw-r--r--sw/source/core/inc/notxtfrm.hxx2
-rw-r--r--sw/source/core/inc/txtfrm.hxx2
-rw-r--r--sw/source/core/layout/unusedf.cxx2
-rw-r--r--sw/source/core/text/frmcrsr.cxx5
7 files changed, 10 insertions, 7 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index e4e945f5e706..b232f782d82a 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -505,7 +505,7 @@ void SwNoTextFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBord
}
bool SwNoTextFrame::GetCharRect( SwRect &rRect, const SwPosition& rPos,
- SwCursorMoveState *pCMS ) const
+ SwCursorMoveState *pCMS, bool /*bAllowFarAway*/ ) const
{
if ( &rPos.nNode.GetNode() != static_cast<SwNode const *>(GetNode()) )
return false;
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index 42f5757e2e70..effde49a1218 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -60,7 +60,7 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos(
aRet = VISIBLE;
o_rInfo.mpAnchorFrame = pTextFrame;
- pTextFrame->GetCharRect( o_rInfo.mPosition, rAnchorPos );
+ pTextFrame->GetCharRect(o_rInfo.mPosition, rAnchorPos, nullptr, false);
if ( pAnnotationStartPos != nullptr )
{
o_rInfo.mnStartNodeIdx = pAnnotationStartPos->nNode.GetIndex();
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 83c98a5a5126..22a1e6f5375d 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -658,7 +658,7 @@ public:
virtual bool GetCursorOfst( SwPosition *, Point&,
SwCursorMoveState* = nullptr, bool bTestBackground = false ) const;
virtual bool GetCharRect( SwRect &, const SwPosition&,
- SwCursorMoveState* = nullptr ) const;
+ SwCursorMoveState* = nullptr, bool bAllowFarAway = true ) const;
virtual void Paint( vcl::RenderContext& rRenderContext, SwRect const&,
SwPrintData const*const pPrintData = nullptr ) const;
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index ce44b31b90d0..387449fba3c1 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -47,7 +47,7 @@ public:
virtual void Paint( vcl::RenderContext& rRenderContext, SwRect const&,
SwPrintData const*const pPrintData = nullptr ) const override;
virtual bool GetCharRect( SwRect &, const SwPosition&,
- SwCursorMoveState* = nullptr) const override;
+ SwCursorMoveState* = nullptr, bool bAllowFarAway = true ) const override;
virtual bool GetCursorOfst(SwPosition* pPos, Point& aPoint,
SwCursorMoveState* = nullptr, bool bTestBackground = false) const override;
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 6fe54f9e4088..660a91a8fa00 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -228,7 +228,7 @@ public:
* Returns false if rPos > number of character is string
*/
virtual bool GetCharRect( SwRect& rRect, const SwPosition& rPos,
- SwCursorMoveState* pCMS = nullptr ) const override;
+ SwCursorMoveState* pCMS = nullptr, bool bAllowFarAway = true ) const override;
/// A slimmer version of GetCharRect for autopositioning Frames
bool GetAutoPos( SwRect &, const SwPosition& ) const;
diff --git a/sw/source/core/layout/unusedf.cxx b/sw/source/core/layout/unusedf.cxx
index c6b328a2bab9..bf9b4be70113 100644
--- a/sw/source/core/layout/unusedf.cxx
+++ b/sw/source/core/layout/unusedf.cxx
@@ -69,7 +69,7 @@ void SwFlyFrame::Paste( SwFrame *, SwFrame * )
#endif
bool SwFrame::GetCharRect( SwRect&, const SwPosition&,
- SwCursorMoveState* ) const
+ SwCursorMoveState*, bool ) const
{
OSL_FAIL( "GetCharRect() of the base called." );
return false;
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 3697c6417e3f..807507fd743e 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -173,7 +173,7 @@ SwTextFrame *SwTextFrame::GetFrameAtPos( const SwPosition &rPos )
*/
bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
- SwCursorMoveState *pCMS ) const
+ SwCursorMoveState *pCMS, bool bAllowFarAway ) const
{
OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTextFrame::GetCharRect with swapped frame" );
@@ -192,7 +192,10 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
SwTextFrame *pFrame = GetAdjFrameAtPos( const_cast<SwTextFrame*>(this), rPos, bRightMargin,
bNoScroll );
pFrame->GetFormatted();
+
const SwFrame* pTmpFrame = static_cast<SwFrame*>(pFrame->GetUpper());
+ if (pTmpFrame->Frame().Top() == FAR_AWAY && !bAllowFarAway)
+ return false;
SwRectFnSet aRectFnSet(pFrame);
const SwTwips nUpperMaxY = aRectFnSet.GetPrtBottom(*pTmpFrame);