sw/source/core/draw/dcontact.cxx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-)
New commits: commit 5021cb725d727f493ec7f11691936d3efafdbca7 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Tue Feb 28 11:22:08 2017 +0100 simplify setContextWritingMode a bit Change-Id: Iab0462703634866a47b77c4862de52b69390b992 Reviewed-on: https://gerrit.libreoffice.org/34727 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index fe9b058..6192fd2 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -74,22 +74,18 @@ using namespace ::com::sun::star; -void setContextWritingMode( SdrObject* pObj, SwFrame* pAnchor ) +void setContextWritingMode(SdrObject* pObj, SwFrame* pAnchor) { - if( pObj && pAnchor ) - { - short nWritingDirection = text::WritingMode2::LR_TB; - if( pAnchor->IsVertical() ) - { - nWritingDirection = text::WritingMode2::TB_RL; - } else if( pAnchor->IsRightToLeft() ) - { - nWritingDirection = text::WritingMode2::RL_TB; - } - pObj->SetContextWritingMode( nWritingDirection ); - } + if(!pObj || !pAnchor) + return; + short nWritingDirection = + pAnchor->IsVertical() ? text::WritingMode2::TB_RL : + pAnchor->IsRightToLeft() ? text::WritingMode2::RL_TB : + text::WritingMode2::LR_TB; + pObj->SetContextWritingMode(nWritingDirection); } + /** The Get reverse way: seeks the format to the specified object. * If the object is a SwVirtFlyDrawObj then the format of this * will be acquired. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits