[Libreoffice-commits] core.git: sw/source
Bjoern Michaelsen
bjoern.michaelsen at canonical.com
Wed Mar 1 10:09:11 UTC 2017
sw/source/core/draw/dcontact.cxx | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
New commits:
commit 5021cb725d727f493ec7f11691936d3efafdbca7
Author: Bjoern Michaelsen <bjoern.michaelsen at 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 <ci at libreoffice.org>
Reviewed-by: Julien Nabet <serval2412 at 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.
More information about the Libreoffice-commits
mailing list