summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2016-12-08 07:17:00 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2016-12-11 00:26:54 +0000
commit9db5cfc889403e923a41dc88b07d0c973d227552 (patch)
tree7378e18b7138d8ff1a03293c44f8203587141ec5
parentd5e7e817980bfce29196dc55a20270201f77c673 (diff)
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@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx2
-rw-r--r--editeng/source/editeng/impedit3.cxx10
-rw-r--r--editeng/source/outliner/outliner.cxx2
-rw-r--r--include/vcl/outdev.hxx3
-rw-r--r--include/vcl/outdevstate.hxx3
-rw-r--r--vcl/source/edit/texteng.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx2
-rw-r--r--vcl/source/gdi/sallayout.cxx1
-rw-r--r--vcl/source/outdev/text.cxx44
-rw-r--r--vcl/source/outdev/textline.cxx2
10 files changed, 11 insertions, 60 deletions
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 900cada4db7a..b47d09fdf8d3 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 bcfb89e8bddc..cd90dbbbc3d8 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 a77e88199fa4..3e50f60bd605 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 15bdb8f035d4..7cdda54c2a73 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 4a509a15e063..c1f42f65426f 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 f1f8992d621b..1d043ac9efd0 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 56f7d97ada26..1a6a2b7def25 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 877d7e569114..3f77bbc0e0d9 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 c94b21df0fa9..73fc0a024c4a 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 6ac045977f06..fe82eaa01d1c 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;