Convert ComplexTextLayoutMode to scoped enum
Change-Id: I257f8e15fec92f0701235a6fe4b6a2272498c4f1 Reviewed-on: https://gerrit.libreoffice.org/25667 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
committed by
Noel Grandin
parent
1741c0ff36
commit
52225a3b7f
@@ -276,22 +276,22 @@ namespace cairocanvas
|
||||
return uno::Reference< rendering::XCachedPrimitive >(nullptr); // no output necessary
|
||||
|
||||
// change text direction and layout mode
|
||||
ComplexTextLayoutMode nLayoutMode(TEXT_LAYOUT_DEFAULT);
|
||||
ComplexTextLayoutFlags nLayoutMode(ComplexTextLayoutFlags::Default);
|
||||
switch( textDirection )
|
||||
{
|
||||
case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
|
||||
// FALLTHROUGH intended
|
||||
case rendering::TextDirection::STRONG_LEFT_TO_RIGHT:
|
||||
nLayoutMode |= TEXT_LAYOUT_BIDI_STRONG;
|
||||
nLayoutMode |= TEXT_LAYOUT_TEXTORIGIN_LEFT;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::BiDiStrong;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::TextOriginLeft;
|
||||
break;
|
||||
|
||||
case rendering::TextDirection::WEAK_RIGHT_TO_LEFT:
|
||||
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl;
|
||||
SAL_FALLTHROUGH;
|
||||
case rendering::TextDirection::STRONG_RIGHT_TO_LEFT:
|
||||
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_BIDI_STRONG;
|
||||
nLayoutMode |= TEXT_LAYOUT_TEXTORIGIN_RIGHT;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::BiDiStrong;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::TextOriginRight;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,19 +51,19 @@ namespace cairocanvas
|
||||
sal_Int8 nTextDirection )
|
||||
{
|
||||
// TODO(P3): avoid if already correctly set
|
||||
ComplexTextLayoutMode nLayoutMode = TEXT_LAYOUT_DEFAULT;
|
||||
ComplexTextLayoutFlags nLayoutMode = ComplexTextLayoutFlags::Default;
|
||||
switch( nTextDirection )
|
||||
{
|
||||
case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
|
||||
break;
|
||||
case rendering::TextDirection::STRONG_LEFT_TO_RIGHT:
|
||||
nLayoutMode = TEXT_LAYOUT_BIDI_STRONG;
|
||||
nLayoutMode = ComplexTextLayoutFlags::BiDiStrong;
|
||||
break;
|
||||
case rendering::TextDirection::WEAK_RIGHT_TO_LEFT:
|
||||
nLayoutMode = TEXT_LAYOUT_BIDI_RTL;
|
||||
nLayoutMode = ComplexTextLayoutFlags::BiDiRtl;
|
||||
break;
|
||||
case rendering::TextDirection::STRONG_RIGHT_TO_LEFT:
|
||||
nLayoutMode = TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_BIDI_STRONG;
|
||||
nLayoutMode = ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::BiDiStrong;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -71,7 +71,7 @@ namespace cairocanvas
|
||||
|
||||
// set calculated layout mode. Origin is always the left edge,
|
||||
// as required at the API spec
|
||||
rOutDev.SetLayoutMode( nLayoutMode | TEXT_LAYOUT_TEXTORIGIN_LEFT );
|
||||
rOutDev.SetLayoutMode( nLayoutMode | ComplexTextLayoutFlags::TextOriginLeft );
|
||||
}
|
||||
|
||||
bool compareFallbacks(const SystemGlyphData&rA, const SystemGlyphData &rB)
|
||||
|
||||
@@ -596,22 +596,22 @@ namespace vclcanvas
|
||||
return uno::Reference< rendering::XCachedPrimitive >(nullptr); // no output necessary
|
||||
|
||||
// change text direction and layout mode
|
||||
ComplexTextLayoutMode nLayoutMode(TEXT_LAYOUT_DEFAULT);
|
||||
ComplexTextLayoutFlags nLayoutMode(ComplexTextLayoutFlags::Default);
|
||||
switch( textDirection )
|
||||
{
|
||||
case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
|
||||
// FALLTHROUGH intended
|
||||
case rendering::TextDirection::STRONG_LEFT_TO_RIGHT:
|
||||
nLayoutMode |= TEXT_LAYOUT_BIDI_STRONG;
|
||||
nLayoutMode |= TEXT_LAYOUT_TEXTORIGIN_LEFT;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::BiDiStrong;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::TextOriginLeft;
|
||||
break;
|
||||
|
||||
case rendering::TextDirection::WEAK_RIGHT_TO_LEFT:
|
||||
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl;
|
||||
SAL_FALLTHROUGH;
|
||||
case rendering::TextDirection::STRONG_RIGHT_TO_LEFT:
|
||||
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_BIDI_STRONG;
|
||||
nLayoutMode |= TEXT_LAYOUT_TEXTORIGIN_RIGHT;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::BiDiStrong;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::TextOriginRight;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,19 +48,19 @@ namespace vclcanvas
|
||||
sal_Int8 nTextDirection )
|
||||
{
|
||||
// TODO(P3): avoid if already correctly set
|
||||
ComplexTextLayoutMode nLayoutMode = TEXT_LAYOUT_DEFAULT;
|
||||
ComplexTextLayoutFlags nLayoutMode = ComplexTextLayoutFlags::Default;
|
||||
switch( nTextDirection )
|
||||
{
|
||||
case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
|
||||
break;
|
||||
case rendering::TextDirection::STRONG_LEFT_TO_RIGHT:
|
||||
nLayoutMode = TEXT_LAYOUT_BIDI_STRONG;
|
||||
nLayoutMode = ComplexTextLayoutFlags::BiDiStrong;
|
||||
break;
|
||||
case rendering::TextDirection::WEAK_RIGHT_TO_LEFT:
|
||||
nLayoutMode = TEXT_LAYOUT_BIDI_RTL;
|
||||
nLayoutMode = ComplexTextLayoutFlags::BiDiRtl;
|
||||
break;
|
||||
case rendering::TextDirection::STRONG_RIGHT_TO_LEFT:
|
||||
nLayoutMode = TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_BIDI_STRONG;
|
||||
nLayoutMode = ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::BiDiStrong;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -68,7 +68,7 @@ namespace vclcanvas
|
||||
|
||||
// set calculated layout mode. Origin is always the left edge,
|
||||
// as required at the API spec
|
||||
rOutDev.SetLayoutMode( nLayoutMode | TEXT_LAYOUT_TEXTORIGIN_LEFT );
|
||||
rOutDev.SetLayoutMode( nLayoutMode | ComplexTextLayoutFlags::TextOriginLeft );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1511,22 +1511,22 @@ namespace cppcanvas
|
||||
case MetaActionType::LAYOUTMODE:
|
||||
{
|
||||
// TODO(F2): A lot is missing here
|
||||
ComplexTextLayoutMode nLayoutMode = static_cast<MetaLayoutModeAction*>(pCurrAct)->GetLayoutMode();
|
||||
ComplexTextLayoutFlags nLayoutMode = static_cast<MetaLayoutModeAction*>(pCurrAct)->GetLayoutMode();
|
||||
::cppcanvas::internal::OutDevState& rState = rStates.getState();
|
||||
|
||||
ComplexTextLayoutMode nBidiLayoutMode = nLayoutMode & (TEXT_LAYOUT_BIDI_RTL|TEXT_LAYOUT_BIDI_STRONG);
|
||||
if( nBidiLayoutMode == TEXT_LAYOUT_DEFAULT)
|
||||
ComplexTextLayoutFlags nBidiLayoutMode = nLayoutMode & (ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::BiDiStrong);
|
||||
if( nBidiLayoutMode == ComplexTextLayoutFlags::Default)
|
||||
rState.textDirection = rendering::TextDirection::WEAK_LEFT_TO_RIGHT;
|
||||
else if( nBidiLayoutMode == TEXT_LAYOUT_BIDI_STRONG)
|
||||
else if( nBidiLayoutMode == ComplexTextLayoutFlags::BiDiStrong)
|
||||
rState.textDirection = rendering::TextDirection::STRONG_LEFT_TO_RIGHT;
|
||||
else if( nBidiLayoutMode == TEXT_LAYOUT_BIDI_RTL)
|
||||
else if( nBidiLayoutMode == ComplexTextLayoutFlags::BiDiRtl)
|
||||
rState.textDirection = rendering::TextDirection::WEAK_RIGHT_TO_LEFT;
|
||||
else if( nBidiLayoutMode == (TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_BIDI_STRONG))
|
||||
else if( nBidiLayoutMode == (ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::BiDiStrong))
|
||||
rState.textDirection = rendering::TextDirection::STRONG_RIGHT_TO_LEFT;
|
||||
|
||||
rState.textAlignment = 0; // TODO(F2): rendering::TextAlignment::LEFT_ALIGNED;
|
||||
if( (nLayoutMode & (TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_RIGHT) )
|
||||
&& !(nLayoutMode & TEXT_LAYOUT_TEXTORIGIN_LEFT ) )
|
||||
if( (nLayoutMode & (ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginRight) )
|
||||
&& !(nLayoutMode & ComplexTextLayoutFlags::TextOriginLeft ) )
|
||||
{
|
||||
rState.textAlignment = 1; // TODO(F2): rendering::TextAlignment::RIGHT_ALIGNED;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace
|
||||
/// font, etc.
|
||||
vcl::Font maFont;
|
||||
RasterOp maRasterOp;
|
||||
ComplexTextLayoutMode mnLayoutMode;
|
||||
ComplexTextLayoutFlags mnLayoutMode;
|
||||
LanguageType maLanguageType;
|
||||
PushFlags mnPushFlags;
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace
|
||||
maClipPolyPoygon(),
|
||||
maFont(),
|
||||
maRasterOp(ROP_OVERPAINT),
|
||||
mnLayoutMode(TEXT_LAYOUT_DEFAULT),
|
||||
mnLayoutMode(ComplexTextLayoutFlags::Default),
|
||||
maLanguageType(0),
|
||||
mnPushFlags(PushFlags::NONE),
|
||||
mbLineColor(false),
|
||||
@@ -183,8 +183,8 @@ namespace
|
||||
bool isRasterOpForceBlack() const { return ROP_0 == maRasterOp; }
|
||||
bool isRasterOpActive() const { return isRasterOpInvert() || isRasterOpForceBlack(); }
|
||||
|
||||
ComplexTextLayoutMode getLayoutMode() const { return mnLayoutMode; }
|
||||
void setLayoutMode(ComplexTextLayoutMode nNew) { if(nNew != mnLayoutMode) mnLayoutMode = nNew; }
|
||||
ComplexTextLayoutFlags getLayoutMode() const { return mnLayoutMode; }
|
||||
void setLayoutMode(ComplexTextLayoutFlags nNew) { if(nNew != mnLayoutMode) mnLayoutMode = nNew; }
|
||||
|
||||
LanguageType getLanguageType() const { return maLanguageType; }
|
||||
void setLanguageType(LanguageType aNew) { if(aNew != maLanguageType) maLanguageType = aNew; }
|
||||
@@ -1220,8 +1220,8 @@ namespace
|
||||
drawinglayer::primitive2d::getFontAttributeFromVclFont(
|
||||
aFontScaling,
|
||||
rFont,
|
||||
bool(rProperty.getLayoutMode() & TEXT_LAYOUT_BIDI_RTL),
|
||||
bool(rProperty.getLayoutMode() & TEXT_LAYOUT_BIDI_STRONG)));
|
||||
bool(rProperty.getLayoutMode() & ComplexTextLayoutFlags::BiDiRtl),
|
||||
bool(rProperty.getLayoutMode() & ComplexTextLayoutFlags::BiDiStrong)));
|
||||
|
||||
// add FontScaling
|
||||
rTextTransform.scale(aFontScaling.getX(), aFontScaling.getY());
|
||||
|
||||
@@ -246,12 +246,12 @@ namespace drawinglayer
|
||||
const basegfx::BColor aRGBFontColor(maBColorModifierStack.getModifiedColor(rTextCandidate.getFontColor()));
|
||||
const basegfx::B2DPoint aPoint(aLocalTransform * basegfx::B2DPoint(0.0, 0.0));
|
||||
const Point aStartPoint(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()));
|
||||
const ComplexTextLayoutMode nOldLayoutMode(mpOutputDevice->GetLayoutMode());
|
||||
const ComplexTextLayoutFlags nOldLayoutMode(mpOutputDevice->GetLayoutMode());
|
||||
|
||||
if(rTextCandidate.getFontAttribute().getRTL())
|
||||
{
|
||||
ComplexTextLayoutMode nRTLLayoutMode(nOldLayoutMode & ~(TEXT_LAYOUT_COMPLEX_DISABLED|TEXT_LAYOUT_BIDI_STRONG));
|
||||
nRTLLayoutMode |= TEXT_LAYOUT_BIDI_RTL|TEXT_LAYOUT_TEXTORIGIN_LEFT;
|
||||
ComplexTextLayoutFlags nRTLLayoutMode(nOldLayoutMode & ~ComplexTextLayoutFlags(ComplexTextLayoutFlags::ComplexDisabled|ComplexTextLayoutFlags::BiDiStrong));
|
||||
nRTLLayoutMode |= ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::TextOriginLeft;
|
||||
mpOutputDevice->SetLayoutMode(nRTLLayoutMode);
|
||||
}
|
||||
|
||||
|
||||
@@ -678,7 +678,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
|
||||
}
|
||||
}
|
||||
|
||||
// SW disables TEXT_LAYOUT_COMPLEX_DISABLED, so maybe I have to enable it...
|
||||
// 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 );
|
||||
@@ -4203,24 +4203,24 @@ void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara,
|
||||
// it also works for issue 55927
|
||||
}
|
||||
|
||||
ComplexTextLayoutMode nLayoutMode = pOutDev->GetLayoutMode();
|
||||
ComplexTextLayoutFlags nLayoutMode = pOutDev->GetLayoutMode();
|
||||
|
||||
// We always use the left position for DrawText()
|
||||
nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL);
|
||||
nLayoutMode &= ~(ComplexTextLayoutFlags::BiDiRtl);
|
||||
|
||||
if ( !bCTL && !bR2L)
|
||||
{
|
||||
// No CTL/Bidi checking necessary
|
||||
nLayoutMode |= ( TEXT_LAYOUT_COMPLEX_DISABLED | TEXT_LAYOUT_BIDI_STRONG );
|
||||
nLayoutMode |= ( ComplexTextLayoutFlags::ComplexDisabled | ComplexTextLayoutFlags::BiDiStrong );
|
||||
}
|
||||
else
|
||||
{
|
||||
// CTL/Bidi checking necessary
|
||||
// Don't use BIDI_STRONG, VCL must do some checks.
|
||||
nLayoutMode &= ~( TEXT_LAYOUT_COMPLEX_DISABLED | TEXT_LAYOUT_BIDI_STRONG );
|
||||
nLayoutMode &= ~ComplexTextLayoutFlags( ComplexTextLayoutFlags::ComplexDisabled | ComplexTextLayoutFlags::BiDiStrong );
|
||||
|
||||
if ( bR2L )
|
||||
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL|TEXT_LAYOUT_TEXTORIGIN_LEFT;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::TextOriginLeft;
|
||||
}
|
||||
|
||||
pOutDev->SetLayoutMode( nLayoutMode );
|
||||
|
||||
@@ -963,10 +963,10 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
|
||||
}
|
||||
|
||||
// VCL will take care of brackets and so on...
|
||||
ComplexTextLayoutMode nLayoutMode = pOutDev->GetLayoutMode();
|
||||
nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL|TEXT_LAYOUT_COMPLEX_DISABLED|TEXT_LAYOUT_BIDI_STRONG);
|
||||
ComplexTextLayoutFlags nLayoutMode = pOutDev->GetLayoutMode();
|
||||
nLayoutMode &= ~ComplexTextLayoutFlags(ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::ComplexDisabled|ComplexTextLayoutFlags::BiDiStrong);
|
||||
if ( bRightToLeftPara )
|
||||
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT | TEXT_LAYOUT_BIDI_STRONG;
|
||||
nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft | ComplexTextLayoutFlags::BiDiStrong;
|
||||
pOutDev->SetLayoutMode( nLayoutMode );
|
||||
|
||||
if(bStrippingPortions)
|
||||
|
||||
@@ -479,7 +479,7 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const lon
|
||||
if( !nLen )
|
||||
return;
|
||||
|
||||
const bool bRTL = bool(mpVDev->GetLayoutMode() & TEXT_LAYOUT_BIDI_RTL);
|
||||
const bool bRTL = bool(mpVDev->GetLayoutMode() & ComplexTextLayoutFlags::BiDiRtl);
|
||||
|
||||
sal_Int16 nScriptType = ScriptType::LATIN;
|
||||
Reference < XBreakIterator > xBI( Impl_GetBreakIterator() );
|
||||
|
||||
@@ -1461,7 +1461,7 @@ class VCL_DLLPUBLIC MetaLayoutModeAction : public MetaAction
|
||||
{
|
||||
private:
|
||||
|
||||
ComplexTextLayoutMode mnLayoutMode;
|
||||
ComplexTextLayoutFlags mnLayoutMode;
|
||||
|
||||
public:
|
||||
MetaLayoutModeAction();
|
||||
@@ -1473,9 +1473,9 @@ public:
|
||||
virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData ) override;
|
||||
virtual void Read( SvStream& rIStm, ImplMetaReadData* pData ) override;
|
||||
|
||||
explicit MetaLayoutModeAction( ComplexTextLayoutMode nLayoutMode );
|
||||
explicit MetaLayoutModeAction( ComplexTextLayoutFlags nLayoutMode );
|
||||
|
||||
ComplexTextLayoutMode GetLayoutMode() const { return mnLayoutMode; }
|
||||
ComplexTextLayoutFlags GetLayoutMode() const { return mnLayoutMode; }
|
||||
};
|
||||
|
||||
class VCL_DLLPUBLIC MetaTextLanguageAction : public MetaAction
|
||||
|
||||
@@ -375,7 +375,7 @@ private:
|
||||
mutable long mnEmphasisAscent;
|
||||
mutable long mnEmphasisDescent;
|
||||
DrawModeFlags mnDrawMode;
|
||||
ComplexTextLayoutMode mnTextLayoutMode;
|
||||
ComplexTextLayoutFlags mnTextLayoutMode;
|
||||
ImplMapRes maMapRes;
|
||||
ImplThresholdRes maThresRes;
|
||||
OutDevType meOutDevType;
|
||||
@@ -638,8 +638,8 @@ public:
|
||||
void SetDrawMode( DrawModeFlags nDrawMode );
|
||||
DrawModeFlags GetDrawMode() const { return mnDrawMode; }
|
||||
|
||||
void SetLayoutMode( ComplexTextLayoutMode nTextLayoutMode );
|
||||
ComplexTextLayoutMode GetLayoutMode() const { return mnTextLayoutMode; }
|
||||
void SetLayoutMode( ComplexTextLayoutFlags nTextLayoutMode );
|
||||
ComplexTextLayoutFlags GetLayoutMode() const { return mnTextLayoutMode; }
|
||||
|
||||
void SetDigitLanguage( LanguageType );
|
||||
LanguageType GetDigitLanguage() const { return meTextLanguage; }
|
||||
|
||||
+13
-33
@@ -58,41 +58,21 @@ namespace o3tl
|
||||
#define PUSH_ALLTEXT (PushFlags::TEXTCOLOR | PushFlags::TEXTFILLCOLOR | PushFlags::TEXTLINECOLOR | PushFlags::OVERLINECOLOR | PushFlags::TEXTALIGN | PushFlags::TEXTLAYOUTMODE | PushFlags::TEXTLANGUAGE)
|
||||
#define PUSH_ALLFONT (PUSH_ALLTEXT | PushFlags::FONT)
|
||||
|
||||
// LayoutModes for Complex Text Layout
|
||||
// Layout flags for Complex Text Layout
|
||||
// These are flag values, i.e they can be combined
|
||||
enum ComplexTextLayoutMode
|
||||
enum class ComplexTextLayoutFlags
|
||||
{
|
||||
TEXT_LAYOUT_DEFAULT = ((sal_uLong)0x00000000),
|
||||
TEXT_LAYOUT_BIDI_RTL = ((sal_uLong)0x00000001),
|
||||
TEXT_LAYOUT_BIDI_STRONG = ((sal_uLong)0x00000002),
|
||||
TEXT_LAYOUT_TEXTORIGIN_LEFT = ((sal_uLong)0x00000004),
|
||||
TEXT_LAYOUT_TEXTORIGIN_RIGHT = ((sal_uLong)0x00000008),
|
||||
TEXT_LAYOUT_COMPLEX_DISABLED = ((sal_uLong)0x00000100),
|
||||
TEXT_LAYOUT_ENABLE_LIGATURES = ((sal_uLong)0x00000200),
|
||||
TEXT_LAYOUT_SUBSTITUTE_DIGITS = ((sal_uLong)0x00000400)
|
||||
Default = 0x0000,
|
||||
BiDiRtl = 0x0001,
|
||||
BiDiStrong = 0x0002,
|
||||
TextOriginLeft = 0x0004,
|
||||
TextOriginRight = 0x0008,
|
||||
ComplexDisabled = 0x0100,
|
||||
LigaturesEnabled = 0x0200,
|
||||
SubstituteDigits = 0x0400
|
||||
};
|
||||
// make combining these type-safe
|
||||
inline ComplexTextLayoutMode operator| (ComplexTextLayoutMode lhs, ComplexTextLayoutMode rhs)
|
||||
{
|
||||
return static_cast<ComplexTextLayoutMode>(static_cast<sal_uLong>(lhs) | static_cast<sal_uLong>(rhs));
|
||||
}
|
||||
inline ComplexTextLayoutMode operator& (ComplexTextLayoutMode lhs, ComplexTextLayoutMode rhs)
|
||||
{
|
||||
return static_cast<ComplexTextLayoutMode>(static_cast<sal_uLong>(lhs) & static_cast<sal_uLong>(rhs));
|
||||
}
|
||||
inline ComplexTextLayoutMode operator~ (ComplexTextLayoutMode rhs)
|
||||
{
|
||||
return static_cast<ComplexTextLayoutMode>(0x7ff & ~(static_cast<sal_uLong>(rhs)));
|
||||
}
|
||||
inline ComplexTextLayoutMode& operator|= (ComplexTextLayoutMode& lhs, ComplexTextLayoutMode rhs)
|
||||
{
|
||||
lhs = static_cast<ComplexTextLayoutMode>(static_cast<sal_uLong>(lhs) | static_cast<sal_uLong>(rhs));
|
||||
return lhs;
|
||||
}
|
||||
inline ComplexTextLayoutMode& operator&= (ComplexTextLayoutMode& lhs, ComplexTextLayoutMode rhs)
|
||||
{
|
||||
lhs = static_cast<ComplexTextLayoutMode>(static_cast<sal_uLong>(lhs) & static_cast<sal_uLong>(rhs));
|
||||
return lhs;
|
||||
namespace o3tl {
|
||||
template<> struct typed_flags<ComplexTextLayoutFlags> : is_typed_flags<ComplexTextLayoutFlags, 0x070f> {};
|
||||
}
|
||||
|
||||
class OutDevState
|
||||
@@ -114,7 +94,7 @@ public:
|
||||
Point* mpRefPoint;
|
||||
TextAlign meTextAlign;
|
||||
RasterOp meRasterOp;
|
||||
ComplexTextLayoutMode mnTextLayoutMode;
|
||||
ComplexTextLayoutFlags mnTextLayoutMode;
|
||||
LanguageType meTextLanguage;
|
||||
PushFlags mnFlags;
|
||||
};
|
||||
|
||||
@@ -736,7 +736,7 @@ The following structure describes the permissions used in PDF security
|
||||
void IntersectClipRegion( const Rectangle& rRect );
|
||||
void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
|
||||
|
||||
void SetLayoutMode( ComplexTextLayoutMode nMode );
|
||||
void SetLayoutMode( ComplexTextLayoutFlags nMode );
|
||||
void SetDigitLanguage( LanguageType eLang );
|
||||
|
||||
void SetLineColor( const Color& rColor );
|
||||
|
||||
@@ -1890,8 +1890,8 @@ void ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup */, sal_uI
|
||||
if (!aDocument.HasTable(nVisTab))
|
||||
return;
|
||||
|
||||
ComplexTextLayoutMode nOldLayoutMode = pDev->GetLayoutMode();
|
||||
pDev->SetLayoutMode( TEXT_LAYOUT_DEFAULT ); // even if it's the same, to get the metafile action
|
||||
ComplexTextLayoutFlags nOldLayoutMode = pDev->GetLayoutMode();
|
||||
pDev->SetLayoutMode( ComplexTextLayoutFlags::Default ); // even if it's the same, to get the metafile action
|
||||
|
||||
if ( nAspect == ASPECT_THUMBNAIL )
|
||||
{
|
||||
|
||||
@@ -227,7 +227,7 @@ SmElementsControl::SmElementsControl(vcl::Window *pParent)
|
||||
{
|
||||
SetMapMode( MapMode(MAP_100TH_MM) );
|
||||
SetDrawMode( DrawModeFlags::Default );
|
||||
SetLayoutMode( TEXT_LAYOUT_DEFAULT );
|
||||
SetLayoutMode( ComplexTextLayoutFlags::Default );
|
||||
SetDigitLanguage( LANGUAGE_ENGLISH );
|
||||
|
||||
maFormat.SetBaseSize(PixelToLogic(Size(0, SmPtsTo100th_mm(12))));
|
||||
|
||||
@@ -273,8 +273,8 @@ void SmDocShell::ArrangeFormula()
|
||||
|
||||
// format/draw formulas always from left to right,
|
||||
// and numbers should not be converted
|
||||
ComplexTextLayoutMode nLayoutMode = pOutDev->GetLayoutMode();
|
||||
pOutDev->SetLayoutMode( TEXT_LAYOUT_DEFAULT );
|
||||
ComplexTextLayoutFlags nLayoutMode = pOutDev->GetLayoutMode();
|
||||
pOutDev->SetLayoutMode( ComplexTextLayoutFlags::Default );
|
||||
sal_Int16 nDigitLang = pOutDev->GetDigitLanguage();
|
||||
pOutDev->SetDigitLanguage( LANGUAGE_ENGLISH );
|
||||
|
||||
@@ -427,8 +427,8 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel
|
||||
|
||||
// format/draw formulas always from left to right
|
||||
// and numbers should not be converted
|
||||
ComplexTextLayoutMode nLayoutMode = rDev.GetLayoutMode();
|
||||
rDev.SetLayoutMode( TEXT_LAYOUT_DEFAULT );
|
||||
ComplexTextLayoutFlags nLayoutMode = rDev.GetLayoutMode();
|
||||
rDev.SetLayoutMode( ComplexTextLayoutFlags::Default );
|
||||
sal_Int16 nDigitLang = rDev.GetDigitLanguage();
|
||||
rDev.SetDigitLanguage( LANGUAGE_ENGLISH );
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
|
||||
pVirDev->SetFont( aFont );
|
||||
pVirDev->EnableRTL();
|
||||
if ( aParagraphIter->nFrameDirection == FRMDIR_HORI_RIGHT_TOP )
|
||||
pVirDev->SetLayoutMode( TEXT_LAYOUT_BIDI_RTL );
|
||||
pVirDev->SetLayoutMode( ComplexTextLayoutFlags::BiDiRtl );
|
||||
|
||||
const SvxCharScaleWidthItem& rCharScaleWidthItem = static_cast<const SvxCharScaleWidthItem&>(pCustomShape->GetMergedItem( EE_CHAR_FONTWIDTH ));
|
||||
sal_uInt16 nCharScaleWidth = rCharScaleWidthItem.GetValue();
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace sdr
|
||||
{
|
||||
// prepare OutputDevice (historical stuff, maybe soon removed)
|
||||
rDisplayInfo.ClearGhostedDrawMode(); // reset, else the VCL-paint with the processor will not do the right thing
|
||||
pOutDev->SetLayoutMode(TEXT_LAYOUT_DEFAULT); // reset, default is no BiDi/RTL
|
||||
pOutDev->SetLayoutMode(ComplexTextLayoutFlags::Default); // reset, default is no BiDi/RTL
|
||||
|
||||
// create renderer
|
||||
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
|
||||
|
||||
@@ -794,7 +794,7 @@ public:
|
||||
class SwLayoutModeModifier
|
||||
{
|
||||
const OutputDevice& m_rOut;
|
||||
ComplexTextLayoutMode m_nOldLayoutMode;
|
||||
ComplexTextLayoutFlags m_nOldLayoutMode;
|
||||
public:
|
||||
SwLayoutModeModifier( const OutputDevice& rOutp );
|
||||
~SwLayoutModeModifier();
|
||||
|
||||
@@ -284,14 +284,14 @@ void SwTextSizeInfo::CtorInitTextSizeInfo( OutputDevice* pRenderContext, SwTextF
|
||||
// Set default layout mode ( LTR or RTL ).
|
||||
if ( m_pFrame->IsRightToLeft() )
|
||||
{
|
||||
m_pOut->SetLayoutMode( TEXT_LAYOUT_BIDI_STRONG | TEXT_LAYOUT_BIDI_RTL );
|
||||
m_pRef->SetLayoutMode( TEXT_LAYOUT_BIDI_STRONG | TEXT_LAYOUT_BIDI_RTL );
|
||||
m_pOut->SetLayoutMode( ComplexTextLayoutFlags::BiDiStrong | ComplexTextLayoutFlags::BiDiRtl );
|
||||
m_pRef->SetLayoutMode( ComplexTextLayoutFlags::BiDiStrong | ComplexTextLayoutFlags::BiDiRtl );
|
||||
m_nDirection = DIR_RIGHT2LEFT;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pOut->SetLayoutMode( TEXT_LAYOUT_BIDI_STRONG );
|
||||
m_pRef->SetLayoutMode( TEXT_LAYOUT_BIDI_STRONG );
|
||||
m_pOut->SetLayoutMode( ComplexTextLayoutFlags::BiDiStrong );
|
||||
m_pRef->SetLayoutMode( ComplexTextLayoutFlags::BiDiStrong );
|
||||
m_nDirection = DIR_LEFT2RIGHT;
|
||||
}
|
||||
|
||||
@@ -591,7 +591,7 @@ void SwTextPaintInfo::DrawText_( const OUString &rText, const SwLinePortion &rPo
|
||||
if ( GetTextFrame()->IsRightToLeft() )
|
||||
GetTextFrame()->SwitchLTRtoRTL( aPoint );
|
||||
|
||||
if ( TEXT_LAYOUT_BIDI_STRONG != GetOut()->GetLayoutMode() )
|
||||
if ( ComplexTextLayoutFlags::BiDiStrong != GetOut()->GetLayoutMode() )
|
||||
aPoint.X() -= rPor.Width();
|
||||
|
||||
if ( GetTextFrame()->IsVertical() )
|
||||
|
||||
@@ -163,8 +163,8 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
|
||||
}
|
||||
else
|
||||
{
|
||||
ComplexTextLayoutMode nOldLayout = rInf.GetOut()->GetLayoutMode();
|
||||
rInf.GetOut()->SetLayoutMode ( nOldLayout | TEXT_LAYOUT_BIDI_RTL );
|
||||
ComplexTextLayoutFlags nOldLayout = rInf.GetOut()->GetLayoutMode();
|
||||
rInf.GetOut()->SetLayoutMode ( nOldLayout | ComplexTextLayoutFlags::BiDiRtl );
|
||||
nKashidasDropped = rInf.GetOut()->ValidateKashidas ( rInf.GetText(), nIdx, nNext - nIdx,
|
||||
nKashidasInAttr, pKashidaPos.get() + nKashidaIdx,
|
||||
pKashidaPosDropped.get() );
|
||||
|
||||
@@ -99,7 +99,7 @@ void SwLinePortion::PrePaint( const SwTextPaintInfo& rInf,
|
||||
SwTextPaintInfo aInf( rInf );
|
||||
|
||||
const bool bBidiPor = rInf.GetTextFrame()->IsRightToLeft() !=
|
||||
bool( TEXT_LAYOUT_BIDI_RTL & rInf.GetOut()->GetLayoutMode() );
|
||||
bool( ComplexTextLayoutFlags::BiDiRtl & rInf.GetOut()->GetLayoutMode() );
|
||||
|
||||
sal_uInt16 nDir = bBidiPor ?
|
||||
1800 :
|
||||
|
||||
@@ -300,13 +300,13 @@ SwLayoutModeModifier::~SwLayoutModeModifier()
|
||||
void SwLayoutModeModifier::Modify( bool bChgToRTL )
|
||||
{
|
||||
const_cast<OutputDevice&>(m_rOut).SetLayoutMode( bChgToRTL ?
|
||||
TEXT_LAYOUT_BIDI_STRONG | TEXT_LAYOUT_BIDI_RTL :
|
||||
TEXT_LAYOUT_BIDI_STRONG );
|
||||
ComplexTextLayoutFlags::BiDiStrong | ComplexTextLayoutFlags::BiDiRtl :
|
||||
ComplexTextLayoutFlags::BiDiStrong );
|
||||
}
|
||||
|
||||
void SwLayoutModeModifier::SetAuto()
|
||||
{
|
||||
const ComplexTextLayoutMode nNewLayoutMode = m_nOldLayoutMode & ~TEXT_LAYOUT_BIDI_STRONG;
|
||||
const ComplexTextLayoutFlags nNewLayoutMode = m_nOldLayoutMode & ~ComplexTextLayoutFlags::BiDiStrong;
|
||||
const_cast<OutputDevice&>(m_rOut).SetLayoutMode( nNewLayoutMode );
|
||||
}
|
||||
|
||||
|
||||
@@ -876,9 +876,9 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
|
||||
const bool bSwitchH2V = rInf.GetFrame() && rInf.GetFrame()->IsVertical();
|
||||
const bool bSwitchL2R = rInf.GetFrame() && rInf.GetFrame()->IsRightToLeft() &&
|
||||
! rInf.IsIgnoreFrameRTL();
|
||||
const ComplexTextLayoutMode nMode = rInf.GetOut().GetLayoutMode();
|
||||
const ComplexTextLayoutFlags nMode = rInf.GetOut().GetLayoutMode();
|
||||
const bool bBidiPor = ( bSwitchL2R !=
|
||||
( TEXT_LAYOUT_DEFAULT != ( TEXT_LAYOUT_BIDI_RTL & nMode ) ) );
|
||||
( ComplexTextLayoutFlags::Default != ( ComplexTextLayoutFlags::BiDiRtl & nMode ) ) );
|
||||
|
||||
// be sure to have the correct layout mode at the printer
|
||||
if ( pPrinter )
|
||||
@@ -1341,7 +1341,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
|
||||
rInf.GetIdx() + j, i - j );
|
||||
j = i + 1;
|
||||
SwTwips nAdd = pKernArray[ i ] + nKernSum;
|
||||
if ( ( TEXT_LAYOUT_BIDI_STRONG | TEXT_LAYOUT_BIDI_RTL ) == nMode )
|
||||
if ( ( ComplexTextLayoutFlags::BiDiStrong | ComplexTextLayoutFlags::BiDiRtl ) == nMode )
|
||||
nAdd *= -1;
|
||||
aTmpPos.X() = aTextOriginPos.X() + nAdd;
|
||||
}
|
||||
|
||||
@@ -282,9 +282,9 @@ void SwDoDrawCapital::DrawSpace( Point &rPos )
|
||||
if ( bSwitchL2R )
|
||||
rInf.GetFrame()->SwitchLTRtoRTL( aPos );
|
||||
|
||||
const ComplexTextLayoutMode nMode = rInf.GetpOut()->GetLayoutMode();
|
||||
const ComplexTextLayoutFlags nMode = rInf.GetpOut()->GetLayoutMode();
|
||||
const bool bBidiPor = ( bSwitchL2R !=
|
||||
( TEXT_LAYOUT_DEFAULT != ( TEXT_LAYOUT_BIDI_RTL & nMode ) ) );
|
||||
( ComplexTextLayoutFlags::Default != ( ComplexTextLayoutFlags::BiDiRtl & nMode ) ) );
|
||||
|
||||
if ( bBidiPor )
|
||||
nDiff = -nDiff;
|
||||
|
||||
@@ -1478,7 +1478,7 @@ void SwDrawTextInfo::Shift( sal_uInt16 nDir )
|
||||
#endif
|
||||
|
||||
const bool bBidiPor = ( GetFrame() && GetFrame()->IsRightToLeft() ) !=
|
||||
( TEXT_LAYOUT_DEFAULT != ( TEXT_LAYOUT_BIDI_RTL & GetpOut()->GetLayoutMode() ) );
|
||||
( ComplexTextLayoutFlags::Default != ( ComplexTextLayoutFlags::BiDiRtl & GetpOut()->GetLayoutMode() ) );
|
||||
|
||||
nDir = bBidiPor ?
|
||||
1800 :
|
||||
|
||||
@@ -260,8 +260,8 @@ HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal
|
||||
|
||||
if( mnStyle & QuickHelpFlags::BiDiRtl )
|
||||
{
|
||||
ComplexTextLayoutMode nLayoutMode = GetLayoutMode();
|
||||
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT;
|
||||
ComplexTextLayoutFlags nLayoutMode = GetLayoutMode();
|
||||
nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft;
|
||||
SetLayoutMode( nLayoutMode );
|
||||
}
|
||||
SetHelpText( rText );
|
||||
|
||||
@@ -81,8 +81,8 @@ void Control::dispose()
|
||||
void Control::EnableRTL( bool bEnable )
|
||||
{
|
||||
// convenience: for controls also switch layout mode
|
||||
SetLayoutMode( bEnable ? TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT :
|
||||
TEXT_LAYOUT_TEXTORIGIN_LEFT );
|
||||
SetLayoutMode( bEnable ? ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft :
|
||||
ComplexTextLayoutFlags::TextOriginLeft );
|
||||
CompatStateChanged( StateChangedType::Mirroring );
|
||||
OutputDevice::EnableRTL(bEnable);
|
||||
}
|
||||
|
||||
@@ -2245,12 +2245,12 @@ void Edit::StateChanged( StateChangedType nType )
|
||||
if (GetParent()->GetStyle() & WB_LEFT)
|
||||
mnAlign = EDIT_ALIGN_RIGHT;
|
||||
if (nType == StateChangedType::Mirroring)
|
||||
SetLayoutMode(TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT);
|
||||
SetLayoutMode(ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft);
|
||||
}
|
||||
else if (mbIsSubEdit && !GetParent()->IsRTLEnabled())
|
||||
{
|
||||
if (nType == StateChangedType::Mirroring)
|
||||
SetLayoutMode(TEXT_LAYOUT_TEXTORIGIN_LEFT);
|
||||
SetLayoutMode(ComplexTextLayoutFlags::TextOriginLeft);
|
||||
}
|
||||
|
||||
if (nStyle & WB_RIGHT)
|
||||
|
||||
@@ -2985,9 +2985,9 @@ long TextEngine::ImpGetPortionXOffset( sal_uInt32 nPara, TextLine* pLine, sal_uI
|
||||
|
||||
void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev )
|
||||
{
|
||||
ComplexTextLayoutMode nLayoutMode = pOutDev->GetLayoutMode();
|
||||
ComplexTextLayoutFlags nLayoutMode = pOutDev->GetLayoutMode();
|
||||
|
||||
nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_COMPLEX_DISABLED | TEXT_LAYOUT_BIDI_STRONG );
|
||||
nLayoutMode &= ~ComplexTextLayoutFlags(ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::ComplexDisabled | ComplexTextLayoutFlags::BiDiStrong );
|
||||
|
||||
pOutDev->SetLayoutMode( nLayoutMode );
|
||||
}
|
||||
|
||||
@@ -1484,15 +1484,15 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
|
||||
|
||||
case( MetaActionType::LAYOUTMODE ):
|
||||
{
|
||||
ComplexTextLayoutMode nLayoutMode = static_cast<const MetaLayoutModeAction*>(pAction)->GetLayoutMode();
|
||||
ComplexTextLayoutFlags nLayoutMode = static_cast<const MetaLayoutModeAction*>(pAction)->GetLayoutMode();
|
||||
mnHorTextAlign = 0;
|
||||
if ((nLayoutMode & TEXT_LAYOUT_BIDI_RTL) != TEXT_LAYOUT_DEFAULT)
|
||||
if ((nLayoutMode & ComplexTextLayoutFlags::BiDiRtl) != ComplexTextLayoutFlags::Default)
|
||||
{
|
||||
mnHorTextAlign = TA_RIGHT | TA_RTLREADING;
|
||||
}
|
||||
if ((nLayoutMode & TEXT_LAYOUT_TEXTORIGIN_RIGHT) != TEXT_LAYOUT_DEFAULT)
|
||||
if ((nLayoutMode & ComplexTextLayoutFlags::TextOriginRight) != ComplexTextLayoutFlags::Default)
|
||||
mnHorTextAlign |= TA_RIGHT;
|
||||
else if ((nLayoutMode & TEXT_LAYOUT_TEXTORIGIN_LEFT) != TEXT_LAYOUT_DEFAULT)
|
||||
else if ((nLayoutMode & ComplexTextLayoutFlags::TextOriginLeft) != ComplexTextLayoutFlags::Default)
|
||||
mnHorTextAlign &= ~TA_RIGHT;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1548,9 +1548,9 @@ bool EnhWMFReader::ReadEnhWMF()
|
||||
pWMF->SeekRel( 0x10 );
|
||||
pWMF->ReadUInt32( offDx );
|
||||
|
||||
ComplexTextLayoutMode nTextLayoutMode = TEXT_LAYOUT_DEFAULT;
|
||||
ComplexTextLayoutFlags nTextLayoutMode = ComplexTextLayoutFlags::Default;
|
||||
if ( nOptions & ETO_RTLREADING )
|
||||
nTextLayoutMode = TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT;
|
||||
nTextLayoutMode = ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft;
|
||||
pOut->SetTextLayoutMode( nTextLayoutMode );
|
||||
DBG_ASSERT( ( nOptions & ( ETO_PDY | ETO_GLYPH_INDEX ) ) == 0, "SJ: ETO_PDY || ETO_GLYPH_INDEX in EMF" );
|
||||
|
||||
|
||||
@@ -614,7 +614,7 @@ void WinMtfOutput::SelectObject( sal_Int32 nIndex )
|
||||
}
|
||||
}
|
||||
|
||||
void WinMtfOutput::SetTextLayoutMode( ComplexTextLayoutMode nTextLayoutMode )
|
||||
void WinMtfOutput::SetTextLayoutMode( ComplexTextLayoutFlags nTextLayoutMode )
|
||||
{
|
||||
mnTextLayoutMode = nTextLayoutMode;
|
||||
}
|
||||
@@ -805,8 +805,8 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) :
|
||||
mnTextAlign ( TA_LEFT | TA_TOP | TA_NOUPDATECP ),
|
||||
maLatestBkColor ( 0x12345678 ),
|
||||
maBkColor ( COL_WHITE ),
|
||||
mnLatestTextLayoutMode( TEXT_LAYOUT_DEFAULT ),
|
||||
mnTextLayoutMode ( TEXT_LAYOUT_DEFAULT ),
|
||||
mnLatestTextLayoutMode( ComplexTextLayoutFlags::Default ),
|
||||
mnTextLayoutMode ( ComplexTextLayoutFlags::Default ),
|
||||
mnLatestBkMode ( BkMode::NONE ),
|
||||
mnBkMode ( BkMode::OPAQUE ),
|
||||
meLatestRasterOp ( ROP_INVERT ),
|
||||
|
||||
@@ -419,7 +419,7 @@ struct SaveStruct
|
||||
{
|
||||
BkMode nBkMode;
|
||||
sal_uInt32 nMapMode, nGfxMode;
|
||||
ComplexTextLayoutMode nTextLayoutMode;
|
||||
ComplexTextLayoutFlags nTextLayoutMode;
|
||||
sal_Int32 nWinOrgX, nWinOrgY, nWinExtX, nWinExtY;
|
||||
sal_Int32 nDevOrgX, nDevOrgY, nDevWidth, nDevHeight;
|
||||
|
||||
@@ -482,8 +482,8 @@ class WinMtfOutput
|
||||
Color maTextColor;
|
||||
Color maLatestBkColor;
|
||||
Color maBkColor;
|
||||
ComplexTextLayoutMode mnLatestTextLayoutMode;
|
||||
ComplexTextLayoutMode mnTextLayoutMode;
|
||||
ComplexTextLayoutFlags mnLatestTextLayoutMode;
|
||||
ComplexTextLayoutFlags mnTextLayoutMode;
|
||||
BkMode mnLatestBkMode;
|
||||
BkMode mnBkMode;
|
||||
RasterOp meLatestRasterOp;
|
||||
@@ -583,7 +583,7 @@ public:
|
||||
void SelectObject( sal_Int32 nIndex );
|
||||
rtl_TextEncoding GetCharSet(){ return maFont.GetCharSet(); };
|
||||
const vcl::Font& GetFont() const { return maFont;}
|
||||
void SetTextLayoutMode( ComplexTextLayoutMode nLayoutMode );
|
||||
void SetTextLayoutMode( ComplexTextLayoutFlags nLayoutMode );
|
||||
|
||||
void ClearPath(){ aPathObj.Init(); };
|
||||
void ClosePath(){ aPathObj.ClosePath(); };
|
||||
|
||||
@@ -533,9 +533,9 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
|
||||
pWMF->ReadUInt16( nLen );
|
||||
pWMF->ReadUInt16( nOptions );
|
||||
|
||||
ComplexTextLayoutMode nTextLayoutMode = TEXT_LAYOUT_DEFAULT;
|
||||
ComplexTextLayoutFlags nTextLayoutMode = ComplexTextLayoutFlags::Default;
|
||||
if ( nOptions & ETO_RTLREADING )
|
||||
nTextLayoutMode = TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT;
|
||||
nTextLayoutMode = ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft;
|
||||
pOut->SetTextLayoutMode( nTextLayoutMode );
|
||||
DBG_ASSERT( ( nOptions & ( ETO_PDY | ETO_GLYPH_INDEX ) ) == 0, "SJ: ETO_PDY || ETO_GLYPH_INDEX in WMF" );
|
||||
|
||||
|
||||
@@ -1596,15 +1596,15 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
|
||||
|
||||
case( MetaActionType::LAYOUTMODE ):
|
||||
{
|
||||
ComplexTextLayoutMode nLayoutMode = static_cast<const MetaLayoutModeAction*>(pMA)->GetLayoutMode();
|
||||
ComplexTextLayoutFlags nLayoutMode = static_cast<const MetaLayoutModeAction*>(pMA)->GetLayoutMode();
|
||||
eSrcHorTextAlign = 0; // TA_LEFT
|
||||
if ((nLayoutMode & TEXT_LAYOUT_BIDI_RTL) != TEXT_LAYOUT_DEFAULT)
|
||||
if ((nLayoutMode & ComplexTextLayoutFlags::BiDiRtl) != ComplexTextLayoutFlags::Default)
|
||||
{
|
||||
eSrcHorTextAlign = W_TA_RIGHT | W_TA_RTLREADING;
|
||||
}
|
||||
if ((nLayoutMode & TEXT_LAYOUT_TEXTORIGIN_RIGHT) != TEXT_LAYOUT_DEFAULT)
|
||||
if ((nLayoutMode & ComplexTextLayoutFlags::TextOriginRight) != ComplexTextLayoutFlags::Default)
|
||||
eSrcHorTextAlign |= W_TA_RIGHT;
|
||||
else if ((nLayoutMode & TEXT_LAYOUT_TEXTORIGIN_LEFT) != TEXT_LAYOUT_DEFAULT)
|
||||
else if ((nLayoutMode & ComplexTextLayoutFlags::TextOriginLeft) != ComplexTextLayoutFlags::Default)
|
||||
eSrcHorTextAlign &= ~W_TA_RIGHT;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos )
|
||||
// recent add-ons. Newer metafiles must of course explicitly set
|
||||
// those states.
|
||||
pOut->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
|
||||
pOut->SetLayoutMode( TEXT_LAYOUT_DEFAULT );
|
||||
pOut->SetLayoutMode( ComplexTextLayoutFlags::Default );
|
||||
pOut->SetDigitLanguage( 0 );
|
||||
|
||||
OSL_TRACE("GDIMetaFile::Play on device of size: %ld x %ld", pOut->GetOutputSizePixel().Width(), pOut->GetOutputSizePixel().Height());
|
||||
@@ -576,7 +576,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
|
||||
// This is necessary, since old metafiles don't even know of these
|
||||
// recent add-ons. Newer metafiles must of course explicitly set
|
||||
// those states.
|
||||
pOut->SetLayoutMode( TEXT_LAYOUT_DEFAULT );
|
||||
pOut->SetLayoutMode( ComplexTextLayoutFlags::Default );
|
||||
pOut->SetDigitLanguage( 0 );
|
||||
|
||||
Play( pOut );
|
||||
|
||||
@@ -3373,13 +3373,13 @@ void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* )
|
||||
|
||||
MetaLayoutModeAction::MetaLayoutModeAction() :
|
||||
MetaAction ( MetaActionType::LAYOUTMODE ),
|
||||
mnLayoutMode( TEXT_LAYOUT_DEFAULT )
|
||||
mnLayoutMode( ComplexTextLayoutFlags::Default )
|
||||
{}
|
||||
|
||||
MetaLayoutModeAction::~MetaLayoutModeAction()
|
||||
{}
|
||||
|
||||
MetaLayoutModeAction::MetaLayoutModeAction( ComplexTextLayoutMode nLayoutMode ) :
|
||||
MetaLayoutModeAction::MetaLayoutModeAction( ComplexTextLayoutFlags nLayoutMode ) :
|
||||
MetaAction ( MetaActionType::LAYOUTMODE ),
|
||||
mnLayoutMode( nLayoutMode )
|
||||
{}
|
||||
@@ -3400,7 +3400,7 @@ void MetaLayoutModeAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
|
||||
{
|
||||
MetaAction::Write(rOStm, pData);
|
||||
VersionCompat aCompat(rOStm, StreamMode::WRITE, 1);
|
||||
rOStm.WriteUInt32( mnLayoutMode );
|
||||
rOStm.WriteUInt32( (sal_uInt32)mnLayoutMode );
|
||||
}
|
||||
|
||||
void MetaLayoutModeAction::Read( SvStream& rIStm, ImplMetaReadData* )
|
||||
@@ -3408,7 +3408,7 @@ void MetaLayoutModeAction::Read( SvStream& rIStm, ImplMetaReadData* )
|
||||
VersionCompat aCompat(rIStm, StreamMode::READ);
|
||||
sal_uInt32 tmp;
|
||||
rIStm.ReadUInt32( tmp );
|
||||
mnLayoutMode = static_cast<ComplexTextLayoutMode>(tmp);
|
||||
mnLayoutMode = static_cast<ComplexTextLayoutFlags>(tmp);
|
||||
}
|
||||
|
||||
MetaTextLanguageAction::MetaTextLanguageAction() :
|
||||
|
||||
@@ -273,7 +273,7 @@ void PDFWriter::IntersectClipRegion( const Rectangle& rRect )
|
||||
xImplementation->intersectClipRegion( rRect );
|
||||
}
|
||||
|
||||
void PDFWriter::SetLayoutMode( ComplexTextLayoutMode nMode )
|
||||
void PDFWriter::SetLayoutMode( ComplexTextLayoutFlags nMode )
|
||||
{
|
||||
xImplementation->setLayoutMode( nMode );
|
||||
}
|
||||
|
||||
@@ -8981,7 +8981,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
|
||||
// TODO: a real solution would be to map the layout engine's
|
||||
// glyphid (i.e. FreeType's synthetic glyphid for a Type1 font)
|
||||
// back to unicode and then to embeddable font's encoding
|
||||
if( (getReferenceDevice()->GetLayoutMode() & TEXT_LAYOUT_BIDI_RTL) != TEXT_LAYOUT_DEFAULT )
|
||||
if( (getReferenceDevice()->GetLayoutMode() & ComplexTextLayoutFlags::BiDiRtl) != ComplexTextLayoutFlags::Default )
|
||||
{
|
||||
size_t nI = aUnicodes.size()-1;
|
||||
for( int n = 0; n < nChars; n++, nI-- )
|
||||
@@ -9786,8 +9786,8 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrik
|
||||
}
|
||||
|
||||
// strikeout string is left aligned non-CTL text
|
||||
ComplexTextLayoutMode nOrigTLM = m_pReferenceDevice->GetLayoutMode();
|
||||
m_pReferenceDevice->SetLayoutMode( TEXT_LAYOUT_BIDI_STRONG|TEXT_LAYOUT_COMPLEX_DISABLED );
|
||||
ComplexTextLayoutFlags nOrigTLM = m_pReferenceDevice->GetLayoutMode();
|
||||
m_pReferenceDevice->SetLayoutMode( ComplexTextLayoutFlags::BiDiStrong|ComplexTextLayoutFlags::ComplexDisabled );
|
||||
|
||||
push( PushFlags::CLIPREGION );
|
||||
FontMetric aRefDevFontMetric = m_pReferenceDevice->GetFontMetric();
|
||||
|
||||
@@ -679,7 +679,7 @@ private:
|
||||
Color m_aOverlineColor;
|
||||
basegfx::B2DPolyPolygon m_aClipRegion;
|
||||
bool m_bClipRegion;
|
||||
ComplexTextLayoutMode m_nLayoutMode;
|
||||
ComplexTextLayoutFlags m_nLayoutMode;
|
||||
LanguageType m_aDigitLanguage;
|
||||
sal_Int32 m_nTransparentPercent;
|
||||
PushFlags m_nFlags;
|
||||
@@ -703,7 +703,7 @@ private:
|
||||
m_aTextLineColor( COL_TRANSPARENT ),
|
||||
m_aOverlineColor( COL_TRANSPARENT ),
|
||||
m_bClipRegion( false ),
|
||||
m_nLayoutMode( TEXT_LAYOUT_DEFAULT ),
|
||||
m_nLayoutMode( ComplexTextLayoutFlags::Default ),
|
||||
m_aDigitLanguage( 0 ),
|
||||
m_nTransparentPercent( 0 ),
|
||||
m_nFlags( PushFlags::ALL ),
|
||||
@@ -1112,7 +1112,7 @@ public:
|
||||
|
||||
bool intersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
|
||||
|
||||
void setLayoutMode( ComplexTextLayoutMode nLayoutMode )
|
||||
void setLayoutMode( ComplexTextLayoutFlags nLayoutMode )
|
||||
{
|
||||
m_aGraphicsStack.front().m_nLayoutMode = nLayoutMode;
|
||||
m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateLayoutMode;
|
||||
|
||||
@@ -258,11 +258,11 @@ namespace vcl
|
||||
return Rectangle();
|
||||
|
||||
// determine text layout mode from the RTL-ness of the control whose text we render
|
||||
ComplexTextLayoutMode nTextLayoutMode = m_bRTLEnabled ? TEXT_LAYOUT_BIDI_RTL : TEXT_LAYOUT_DEFAULT;
|
||||
ComplexTextLayoutFlags nTextLayoutMode = m_bRTLEnabled ? ComplexTextLayoutFlags::BiDiRtl : ComplexTextLayoutFlags::Default;
|
||||
m_rReferenceDevice.SetLayoutMode( nTextLayoutMode );
|
||||
m_rTargetDevice.SetLayoutMode( nTextLayoutMode | TEXT_LAYOUT_TEXTORIGIN_LEFT );
|
||||
m_rTargetDevice.SetLayoutMode( nTextLayoutMode | ComplexTextLayoutFlags::TextOriginLeft );
|
||||
|
||||
// TEXT_LAYOUT_TEXTORIGIN_LEFT is because when we do actually draw the text (in DrawText( Point, ... )), then
|
||||
// ComplexTextLayoutFlags::TextOriginLeft is because when we do actually draw the text (in DrawText( Point, ... )), then
|
||||
// our caller gives us the left border of the draw position, regardless of script type, text layout,
|
||||
// and the like in our ctor, we set the map mode of the target device from pixel to twip, but our caller doesn't know this,
|
||||
// but passed pixel coordinates. So, adjust the rect.
|
||||
|
||||
@@ -77,10 +77,10 @@ OutputDevice::OutputDevice() :
|
||||
mnEmphasisAscent = 0;
|
||||
mnEmphasisDescent = 0;
|
||||
mnDrawMode = DrawModeFlags::Default;
|
||||
mnTextLayoutMode = TEXT_LAYOUT_DEFAULT;
|
||||
mnTextLayoutMode = ComplexTextLayoutFlags::Default;
|
||||
|
||||
if( AllSettings::GetLayoutRTL() ) //#i84553# tip BiDi preference to RTL
|
||||
mnTextLayoutMode = TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT;
|
||||
mnTextLayoutMode = ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft;
|
||||
|
||||
meOutDevType = OUTDEV_DONTKNOW;
|
||||
meOutDevViewType = OUTDEV_VIEWTYPE_DONTKNOW;
|
||||
|
||||
@@ -40,7 +40,7 @@ OutDevState::OutDevState()
|
||||
, mpRefPoint(nullptr)
|
||||
, meTextAlign(ALIGN_TOP)
|
||||
, meRasterOp(ROP_OVERPAINT)
|
||||
, mnTextLayoutMode(TEXT_LAYOUT_DEFAULT)
|
||||
, mnTextLayoutMode(ComplexTextLayoutFlags::Default)
|
||||
, meTextLanguage(0)
|
||||
, mnFlags(PushFlags::NONE)
|
||||
{
|
||||
@@ -263,7 +263,7 @@ void OutputDevice::SetDrawMode( DrawModeFlags nDrawMode )
|
||||
mpAlphaVDev->SetDrawMode( nDrawMode );
|
||||
}
|
||||
|
||||
void OutputDevice::SetLayoutMode( ComplexTextLayoutMode nTextLayoutMode )
|
||||
void OutputDevice::SetLayoutMode( ComplexTextLayoutFlags nTextLayoutMode )
|
||||
{
|
||||
if( mpMetaFile )
|
||||
mpMetaFile->AddAction( new MetaLayoutModeAction( nTextLayoutMode ) );
|
||||
|
||||
@@ -1198,11 +1198,11 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
|
||||
if( nEndIndex < nMinIndex )
|
||||
nEndIndex = nMinIndex;
|
||||
|
||||
if( mnTextLayoutMode & TEXT_LAYOUT_BIDI_RTL )
|
||||
if( mnTextLayoutMode & ComplexTextLayoutFlags::BiDiRtl )
|
||||
nLayoutFlags |= SalLayoutFlags::BiDiRtl;
|
||||
if( mnTextLayoutMode & TEXT_LAYOUT_BIDI_STRONG )
|
||||
if( mnTextLayoutMode & ComplexTextLayoutFlags::BiDiStrong )
|
||||
nLayoutFlags |= SalLayoutFlags::BiDiStrong;
|
||||
else if( !(mnTextLayoutMode & TEXT_LAYOUT_BIDI_RTL) )
|
||||
else if( !(mnTextLayoutMode & ComplexTextLayoutFlags::BiDiRtl) )
|
||||
{
|
||||
// disable Bidi if no RTL hint and no RTL codes used
|
||||
const sal_Unicode* pStr = rStr.getStr() + nMinIndex;
|
||||
@@ -1223,9 +1223,9 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
|
||||
if( maFont.IsVertical() )
|
||||
nLayoutFlags |= SalLayoutFlags::Vertical;
|
||||
|
||||
if( mnTextLayoutMode & TEXT_LAYOUT_ENABLE_LIGATURES )
|
||||
if( mnTextLayoutMode & ComplexTextLayoutFlags::LigaturesEnabled )
|
||||
nLayoutFlags |= SalLayoutFlags::EnableLigatures;
|
||||
else if( mnTextLayoutMode & TEXT_LAYOUT_COMPLEX_DISABLED )
|
||||
else if( mnTextLayoutMode & ComplexTextLayoutFlags::ComplexDisabled )
|
||||
nLayoutFlags |= SalLayoutFlags::ComplexDisabled;
|
||||
else
|
||||
{
|
||||
@@ -1247,7 +1247,7 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
|
||||
nLayoutFlags |= SalLayoutFlags::ComplexDisabled;
|
||||
}
|
||||
|
||||
if( meTextLanguage ) //TODO: (mnTextLayoutMode & TEXT_LAYOUT_SUBSTITUTE_DIGITS)
|
||||
if( meTextLanguage ) //TODO: (mnTextLayoutMode & ComplexTextLayoutFlags::SubstituteDigits)
|
||||
{
|
||||
// disable character localization when no digits used
|
||||
const sal_Unicode* pBase = rStr.getStr();
|
||||
@@ -1270,10 +1270,10 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
|
||||
}
|
||||
|
||||
// right align for RTL text, DRAWPOS_REVERSED, RTL window style
|
||||
bool bRightAlign = bool(mnTextLayoutMode & TEXT_LAYOUT_BIDI_RTL);
|
||||
if( mnTextLayoutMode & TEXT_LAYOUT_TEXTORIGIN_LEFT )
|
||||
bool bRightAlign = bool(mnTextLayoutMode & ComplexTextLayoutFlags::BiDiRtl);
|
||||
if( mnTextLayoutMode & ComplexTextLayoutFlags::TextOriginLeft )
|
||||
bRightAlign = false;
|
||||
else if ( mnTextLayoutMode & TEXT_LAYOUT_TEXTORIGIN_RIGHT )
|
||||
else if ( mnTextLayoutMode & ComplexTextLayoutFlags::TextOriginRight )
|
||||
bRightAlign = true;
|
||||
// SSA: hack for western office, ie text get right aligned
|
||||
// for debugging purposes of mirrored UI
|
||||
|
||||
@@ -629,8 +629,8 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
|
||||
nBaseY += nDistY;
|
||||
|
||||
// strikeout text has to be left aligned
|
||||
ComplexTextLayoutMode nOrigTLM = mnTextLayoutMode;
|
||||
mnTextLayoutMode = TEXT_LAYOUT_BIDI_STRONG | TEXT_LAYOUT_COMPLEX_DISABLED;
|
||||
ComplexTextLayoutFlags nOrigTLM = mnTextLayoutMode;
|
||||
mnTextLayoutMode = ComplexTextLayoutFlags::BiDiStrong | ComplexTextLayoutFlags::ComplexDisabled;
|
||||
pLayout = ImplLayout( aStrikeoutText, 0, aStrikeoutText.getLength() );
|
||||
mnTextLayoutMode = nOrigTLM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user