diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2017-02-28 11:22:08 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-03-01 10:08:41 +0000 |
commit | 5021cb725d727f493ec7f11691936d3efafdbca7 (patch) | |
tree | 9f61c5379caa3045af22f4949306332836ced297 /sw | |
parent | f01a975cb22d33a386bfd8db4ea6b4b77aceca1b (diff) |
simplify setContextWritingMode a bit
Change-Id: Iab0462703634866a47b77c4862de52b69390b992
Reviewed-on: https://gerrit.libreoffice.org/34727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/draw/dcontact.cxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index fe9b058a55a2..6192fd2c5703 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. |