sw/source/core/view/viewimp.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 28c842ba5271947a47d32cf70077b2b6fe28eeec Author: Tamás Zolnai <[email protected]> AuthorDate: Tue Nov 11 15:51:38 2025 +0100 Commit: Tamás Zolnai <[email protected]> CommitDate: Wed Nov 12 11:18:21 2025 +0100 tdf#169384: Apply proper subdivison settings by startup in Writer. Internal division numbers need to be increased by one to get proper grid distance values. See also SwViewShell::ImplApplyViewOptions() method which applies grid settings in other use cases. Change-Id: Ia9c299b555bcdf7ca6d28b4c9838f8effcde1d16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193841 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <[email protected]> diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index 4a093f2bb9e7..3cd4a5f05eba 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -65,8 +65,8 @@ void SwViewShellImp::Init( const SwViewOption *pNewOpt ) const Size &rSz = pNewOpt->GetSnapSize(); m_pDrawView->SetGridCoarse( rSz ); const Size aFSize - ( rSz.Width() ? rSz.Width() /std::max(short(1),pNewOpt->GetDivisionX()):0, - rSz.Height()? rSz.Height()/std::max(short(1),pNewOpt->GetDivisionY()):0); + ( rSz.Width() ? rSz.Width() / (pNewOpt->GetDivisionX() + 1):0, + rSz.Height()? rSz.Height()/ (pNewOpt->GetDivisionY() + 1):0); m_pDrawView->SetGridFine( aFSize ); Fraction aSnGrWdtX(rSz.Width(), pNewOpt->GetDivisionX() + 1); Fraction aSnGrWdtY(rSz.Height(), pNewOpt->GetDivisionY() + 1);
