[Libreoffice-commits] core.git: drawinglayer/source editeng/source include/vcl vcl/source
Khaled Hosny
khaledhosny at eglug.org
Sun Dec 11 00:27:35 UTC 2016
drawinglayer/source/processor2d/vclprocessor2d.cxx | 2
editeng/source/editeng/impedit3.cxx | 10 +---
editeng/source/outliner/outliner.cxx | 2
include/vcl/outdev.hxx | 3 -
include/vcl/outdevstate.hxx | 3 -
vcl/source/edit/texteng.cxx | 2
vcl/source/gdi/pdfwriter_impl.cxx | 2
vcl/source/gdi/sallayout.cxx | 1
vcl/source/outdev/text.cxx | 44 ---------------------
vcl/source/outdev/textline.cxx | 2
10 files changed, 11 insertions(+), 60 deletions(-)
New commits:
commit 9db5cfc889403e923a41dc88b07d0c973d227552
Author: Khaled Hosny <khaledhosny at eglug.org>
Date: Thu Dec 8 07:17:00 2016 +0200
Drop ComplexDisabled flags that does nothing
There is no such thing as simple text layout in this brave new world.
Change-Id: I641b7efa5ec8fdd9839c291e7f2fdb736361ef1e
Reviewed-on: https://gerrit.libreoffice.org/31824
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 900cada..b47d09f 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -262,7 +262,7 @@ namespace drawinglayer
if(rTextCandidate.getFontAttribute().getRTL())
{
- ComplexTextLayoutFlags nRTLLayoutMode(nOldLayoutMode & ~ComplexTextLayoutFlags(ComplexTextLayoutFlags::ComplexDisabled|ComplexTextLayoutFlags::BiDiStrong));
+ ComplexTextLayoutFlags nRTLLayoutMode(nOldLayoutMode & ~ComplexTextLayoutFlags(ComplexTextLayoutFlags::BiDiStrong));
nRTLLayoutMode |= ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::TextOriginLeft;
mpOutputDevice->SetLayoutMode(nRTLLayoutMode);
}
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index bcfb89e..cd90dbb 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -679,8 +679,6 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
}
}
- // SW disables ComplexTextLayoutFlags::ComplexDisabled, so maybe I have to enable it...
-
// Saving both layout mode and language (since I'm potentially changing both)
GetRefDevice()->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
@@ -4255,14 +4253,14 @@ void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara,
if ( !bCTL && !bR2L)
{
- // No CTL/Bidi checking necessary
- nLayoutMode |= ( ComplexTextLayoutFlags::ComplexDisabled | ComplexTextLayoutFlags::BiDiStrong );
+ // No Bidi checking necessary
+ nLayoutMode |= ComplexTextLayoutFlags::BiDiStrong;
}
else
{
- // CTL/Bidi checking necessary
+ // Bidi checking necessary
// Don't use BIDI_STRONG, VCL must do some checks.
- nLayoutMode &= ~ComplexTextLayoutFlags( ComplexTextLayoutFlags::ComplexDisabled | ComplexTextLayoutFlags::BiDiStrong );
+ nLayoutMode &= ~ComplexTextLayoutFlags( ComplexTextLayoutFlags::BiDiStrong );
if ( bR2L )
nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::TextOriginLeft;
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index a77e881..3e50f60 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -955,7 +955,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
// VCL will take care of brackets and so on...
ComplexTextLayoutFlags nLayoutMode = pOutDev->GetLayoutMode();
- nLayoutMode &= ~ComplexTextLayoutFlags(ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::ComplexDisabled|ComplexTextLayoutFlags::BiDiStrong);
+ nLayoutMode &= ~ComplexTextLayoutFlags(ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::BiDiStrong);
if ( bRightToLeftPara )
nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft | ComplexTextLayoutFlags::BiDiStrong;
pOutDev->SetLayoutMode( nLayoutMode );
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 15bdb8f..7cdda54 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -137,7 +137,6 @@ enum class SalLayoutFlags
KerningPairs = 0x0010,
KerningAsian = 0x0020,
Vertical = 0x0040,
- ComplexDisabled = 0x0100,
EnableLigatures = 0x0200,
SubstituteDigits = 0x0400,
KashidaJustification = 0x0800,
@@ -145,7 +144,7 @@ enum class SalLayoutFlags
};
namespace o3tl
{
- template<> struct typed_flags<SalLayoutFlags> : is_typed_flags<SalLayoutFlags, 0x2f77> {};
+ template<> struct typed_flags<SalLayoutFlags> : is_typed_flags<SalLayoutFlags, 0x2e77> {};
}
typedef std::vector< Rectangle > MetricVector;
diff --git a/include/vcl/outdevstate.hxx b/include/vcl/outdevstate.hxx
index 4a509a1..c1f42f6 100644
--- a/include/vcl/outdevstate.hxx
+++ b/include/vcl/outdevstate.hxx
@@ -67,11 +67,10 @@ enum class ComplexTextLayoutFlags
BiDiStrong = 0x0002,
TextOriginLeft = 0x0004,
TextOriginRight = 0x0008,
- ComplexDisabled = 0x0100,
LigaturesEnabled = 0x0200
};
namespace o3tl {
- template<> struct typed_flags<ComplexTextLayoutFlags> : is_typed_flags<ComplexTextLayoutFlags, 0x030f> {};
+ template<> struct typed_flags<ComplexTextLayoutFlags> : is_typed_flags<ComplexTextLayoutFlags, 0x020f> {};
}
class OutDevState
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index f1f8992..1d043ac 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -2958,7 +2958,7 @@ void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev )
{
ComplexTextLayoutFlags nLayoutMode = pOutDev->GetLayoutMode();
- nLayoutMode &= ~ComplexTextLayoutFlags(ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::ComplexDisabled | ComplexTextLayoutFlags::BiDiStrong );
+ nLayoutMode &= ~ComplexTextLayoutFlags(ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::BiDiStrong );
pOutDev->SetLayoutMode( nLayoutMode );
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 56f7d97..1a6a2b7 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -9416,7 +9416,7 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrik
// strikeout string is left aligned non-CTL text
ComplexTextLayoutFlags nOrigTLM = m_pReferenceDevice->GetLayoutMode();
- m_pReferenceDevice->SetLayoutMode( ComplexTextLayoutFlags::BiDiStrong|ComplexTextLayoutFlags::ComplexDisabled );
+ m_pReferenceDevice->SetLayoutMode(ComplexTextLayoutFlags::BiDiStrong);
push( PushFlags::CLIPREGION );
FontMetric aRefDevFontMetric = m_pReferenceDevice->GetFontMetric();
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 877d7e5..3f77bbc 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -71,7 +71,6 @@ std::ostream &operator <<(std::ostream& s, ImplLayoutArgs &rArgs)
TEST(KerningPairs);
TEST(KerningAsian);
TEST(Vertical);
- TEST(ComplexDisabled);
TEST(EnableLigatures);
TEST(SubstituteDigits);
TEST(KashidaJustification);
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index c94b21d..73fc0a0 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1209,50 +1209,6 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
if( mnTextLayoutMode & ComplexTextLayoutFlags::LigaturesEnabled )
nLayoutFlags |= SalLayoutFlags::EnableLigatures;
- else if( mnTextLayoutMode & ComplexTextLayoutFlags::ComplexDisabled )
- nLayoutFlags |= SalLayoutFlags::ComplexDisabled;
- else
- {
- // disable CTL for non-CTL text
- const sal_Unicode* pStr = rStr.getStr() + nMinIndex;
- const sal_Unicode* pEnd = rStr.getStr() + nEndIndex;
- bool bIsCJKIdeograph = false;
- for( ; pStr < pEnd; ++pStr )
- {
- if (pStr + 1 < pEnd && rtl::isHighSurrogate(pStr[0]) && rtl::isLowSurrogate(pStr[1]))
- {
- sal_uInt32 nCode = rtl::combineSurrogates( pStr[0] , pStr[1] );
- if ( !bIsCJKIdeograph && nCode >= 0xE0100 && nCode < 0xE01F0 ) // Variation Selector Supplements
- break;
-
- if ( nCode >= 0x20000 && nCode <= 0x2CEB0 )// CJK Unified Ideographs Extension B-E
- bIsCJKIdeograph = true;
- ++pStr;
- continue;
- }
-
- if ( ((*pStr >= 0xF900) && (*pStr < 0xFB00)) // CJK Compatibility Ideographs
- || ((*pStr >= 0x3400) && (*pStr < 0xA000)) // CJK Unified Ideographs and Extension A
- )
- {
- bIsCJKIdeograph = true;
- continue;
- }
-
- if( ((*pStr >= 0x0300) && (*pStr < 0x0370)) // diacritical marks
- || ((*pStr >= 0x0590) && (*pStr < 0x10A0)) // many CTL scripts
- || ((*pStr >= 0x1100) && (*pStr < 0x1200)) // hangul jamo
- || ((*pStr >= 0x1700) && (*pStr < 0x1900)) // many CTL scripts
- || ((*pStr >= 0xFB1D) && (*pStr < 0xFE00)) // middle east presentation
- || ((*pStr >= 0xFE70) && (*pStr < 0xFEFF)) // arabic presentation B
- || (!bIsCJKIdeograph && (*pStr >= 0xFE00) && (*pStr < 0xFE10)) // variation selectors in BMP
- )
- break;
- bIsCJKIdeograph = false;
- }
- if( pStr >= pEnd )
- nLayoutFlags |= SalLayoutFlags::ComplexDisabled;
- }
if( meTextLanguage ) //TODO: (mnTextLayoutMode & ComplexTextLayoutFlags::SubstituteDigits)
{
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 6ac0459..fe82eaa 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -630,7 +630,7 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
// strikeout text has to be left aligned
ComplexTextLayoutFlags nOrigTLM = mnTextLayoutMode;
- mnTextLayoutMode = ComplexTextLayoutFlags::BiDiStrong | ComplexTextLayoutFlags::ComplexDisabled;
+ mnTextLayoutMode = ComplexTextLayoutFlags::BiDiStrong;
pLayout = ImplLayout( aStrikeoutText, 0, aStrikeoutText.getLength() );
mnTextLayoutMode = nOrigTLM;
More information about the Libreoffice-commits
mailing list