summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2015-08-09 22:55:06 +0800
committerNorbert Thiebaud <nthiebaud@gmail.com>2015-08-16 01:14:41 +0000
commit6cd04e9ea447a4828a6fc03d47a7d136f3914501 (patch)
treec358d05813f2a00fb44b96189aaec0965893430b
parent26d8d33f3adfcbfd49ef1ea809202deabcea4957 (diff)
Fix tdf#64975: FORMATTING: autoIndent for Chinese should be two
characters. Now it detects CJK language and ident accordingly: 2 chars for Chinese and 1 chars for the others (Japanese and Korean). Change-Id: Ib722e90ecae615faa7887ce1c874aacbb93f8a5e Reviewed-on: https://gerrit.libreoffice.org/17614 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r--sw/source/core/text/itrcrsr.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 65a279d6d88e..746e5622db99 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -46,6 +46,7 @@
#include "crstate.hxx"
#include <pormulti.hxx>
#include <numrule.hxx>
+#include <com/sun/star/i18n/ScriptType.hpp>
// Not reentrant !!!
// is set in GetCharRect and is interpreted in UnitUp/Down.
@@ -247,6 +248,10 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrm *pNewFrm, SwTextSizeInfo *pNewI
rSpace.IsAutoFirst() )
{
nFirstLineOfs = GetFnt()->GetSize( GetFnt()->GetActual() ).Height();
+ LanguageType aLang = pNode->GetLang( 0, 1, css::i18n::ScriptType::ASIAN);
+ if (aLang != LANGUAGE_KOREAN && aLang != LANGUAGE_JAPANESE)
+ nFirstLineOfs<<=1;
+
const SvxLineSpacingItem *pSpace = aLineInf.GetLineSpacing();
if( pSpace )
{