diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/portxt.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 9547147c4245..cd508425cb94 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -28,6 +28,8 @@ #include <porglue.hxx> #include <portab.hxx> #include <porfld.hxx> +#include <pagefrm.hxx> +#include <tgrditem.hxx> #include <wrong.hxx> #include <viewsh.hxx> #include <IDocumentSettingAccess.hxx> @@ -563,6 +565,14 @@ sal_Int32 SwTextPortion::GetSpaceCnt( const SwTextSizeInfo &rInf, { sal_Int32 nCnt = 0; sal_Int32 nPos = 0; + + if ( rInf.SnapToGrid() ) + { + SwTextGridItem const*const pGrid(GetGridItem(rInf.GetTextFrame()->FindPageFrame())); + if (pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && pGrid->IsSnapToChars()) + return 0; + } + if ( InExpGrp() ) { if( !IsBlankPortion() && !InNumberGrp() && !IsCombinedPortion() ) @@ -593,6 +603,13 @@ long SwTextPortion::CalcSpacing( long nSpaceAdd, const SwTextSizeInfo &rInf ) co { sal_Int32 nCnt = 0; + if ( rInf.SnapToGrid() ) + { + SwTextGridItem const*const pGrid(GetGridItem(rInf.GetTextFrame()->FindPageFrame())); + if (pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && pGrid->IsSnapToChars()) + return 0; + } + if ( InExpGrp() ) { if( !IsBlankPortion() && !InNumberGrp() && !IsCombinedPortion() ) |