summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-11-05 11:11:29 +0300
committerJustin Luth <justin_luth@sil.org>2016-11-07 15:57:05 +0000
commitab64ae2a828f4acd6d118abc14193c543d04b940 (patch)
tree17e7af1eb21659be7a7401e9f3cd87aabd1f8bbc /editeng
parent07b1e1025653c05f6422278da793261cbff42c71 (diff)
tdf#90070 don't clip flys with borders
regression from commit e598ab04476a32a08f18e8f0662fafa5f78f1a4a very aggressively forced a new frame size via compat setting CLIPPED_PICTURES on any fly - not just images. This only affects MS-format documents, EXCEPT that it is a document property, so if the file every spent any part of it's life in MS-format, it will always retain that compatibility setting. That explains why the problem was intermittent for me - and was hard to reproduce in a clean document, even though I'd seen it in .ODTs. bIgnoreLine (ignore the fact that there is no visible line) was a confusing word choice for "if there is no line, then return a spacing size of zero". bEvenIfNoLine=false is better. Change-Id: I50a3bdef3a67339ae517ee6319920651bc56f9be Reviewed-on: https://gerrit.libreoffice.org/30585 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit d034f273cb24ebe4fde20ad9089ac11cccf316d0) Reviewed-on: https://gerrit.libreoffice.org/30595
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/frmitems.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 00a41e259c68..5c9c0ea68f40 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2390,7 +2390,7 @@ void SvxBoxItem::SetDistance( sal_uInt16 nNew, SvxBoxItemLine nLine )
}
-sal_uInt16 SvxBoxItem::CalcLineSpace( SvxBoxItemLine nLine, bool bIgnoreLine ) const
+sal_uInt16 SvxBoxItem::CalcLineSpace( SvxBoxItemLine nLine, bool bEvenIfNoLine ) const
{
SvxBorderLine* pTmp = nullptr;
sal_uInt16 nDist = 0;
@@ -2420,11 +2420,19 @@ sal_uInt16 SvxBoxItem::CalcLineSpace( SvxBoxItemLine nLine, bool bIgnoreLine ) c
{
nDist = nDist + pTmp->GetScaledWidth();
}
- else if( !bIgnoreLine )
+ else if( !bEvenIfNoLine )
nDist = 0;
return nDist;
}
+bool SvxBoxItem::HasBorder( bool bTreatPaddingAsBorder ) const
+{
+ return CalcLineSpace( SvxBoxItemLine::BOTTOM, bTreatPaddingAsBorder )
+ || CalcLineSpace( SvxBoxItemLine::RIGHT, bTreatPaddingAsBorder )
+ || CalcLineSpace( SvxBoxItemLine::TOP, bTreatPaddingAsBorder )
+ || CalcLineSpace( SvxBoxItemLine::LEFT, bTreatPaddingAsBorder );
+}
+
// class SvxBoxInfoItem --------------------------------------------------
SvxBoxInfoItem::SvxBoxInfoItem( const sal_uInt16 nId ) :