diff options
47 files changed, 154 insertions, 174 deletions
diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index e7879c53a728..ff4edd133942 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.cxx @@ -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; } diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index fa3d5b11295e..865bcc60b2c3 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -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) diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 0dc936043476..ea67fa1f1ecb 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -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; } diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx index 982efe88233f..f1951c6c6c5b 100644 --- a/canvas/source/vcl/textlayout.cxx +++ b/canvas/source/vcl/textlayout.cxx @@ -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 ); } } diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index ab398c519186..2c3d0bf7d87c 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -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; } diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index ff6d69426158..a691c8dee92a 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -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()); diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index b235827d3988..bb1d8e2f26f4 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -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); } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 4d8f67403d95..f52df1fed348 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -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 ); diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 8b2d79420a56..5ed9ff583329 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -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) diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index f47ef3e0bfb1..09246d6cc578 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -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() ); diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 9f3457c370ed..af914d1b4b15 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -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 diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 95e3756f408e..1f32068a598c 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -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; } diff --git a/include/vcl/outdevstate.hxx b/include/vcl/outdevstate.hxx index 06255171ffd3..adf915d42059 100644 --- a/include/vcl/outdevstate.hxx +++ b/include/vcl/outdevstate.hxx @@ -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; }; diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index 8a95b6a4707e..085210a31545 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -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 ); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 6f6d690c2352..cc1e338562ab 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -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 ) { diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index 3dcfb70ba6de..0f660a414065 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -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)))); diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index c825635b759c..a6596380b1bc 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -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 ); diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index d52a01dee554..6bc1e254a9b7 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -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(); diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx index 997b265a5239..6dcd57725946 100644 --- a/svx/source/sdr/contact/objectcontactofpageview.cxx +++ b/svx/source/sdr/contact/objectcontactofpageview.cxx @@ -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( diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index 567bd19dd1e9..8ba3bca167bf 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -794,7 +794,7 @@ public: class SwLayoutModeModifier { const OutputDevice& m_rOut; - ComplexTextLayoutMode m_nOldLayoutMode; + ComplexTextLayoutFlags m_nOldLayoutMode; public: SwLayoutModeModifier( const OutputDevice& rOutp ); ~SwLayoutModeModifier(); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index acc48ea81c27..344c94aaa37e 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -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() ) diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx index 721950e75c7a..d5261ea83a04 100644 --- a/sw/source/core/text/itradj.cxx +++ b/sw/source/core/text/itradj.cxx @@ -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() ); diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx index 6294a618512f..1fb0b0ddf2ea 100644 --- a/sw/source/core/text/porlin.cxx +++ b/sw/source/core/text/porlin.cxx @@ -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 : diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 12007210ccc5..c509ae6b6df8 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -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 ); } diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 5b8ca54a2ca0..94bb6612760e 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -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; } diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index ccd6936749b3..fc1e93a53a97 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -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; diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 0dd7670ad872..067ff03a2c11 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -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 : diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index f9791551bf9a..8c1f902fa684 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -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 ); diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 72ee5948a50e..26cf163b946d 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -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); } diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index fc2a28aad420..fdbb0aac5bee 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -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) diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 05e2e73aa814..73dc5f4edada 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -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 ); } diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 5ac14fb2f232..98a1f957b2a7 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -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; } diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index 152bdfce6086..f4e7d45b9a4a 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -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" ); diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index 663267aa7d3c..20576438ec8b 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -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 ), diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx index caf3a88b8a5e..a1ba920353ba 100644 --- a/vcl/source/filter/wmf/winmtf.hxx +++ b/vcl/source/filter/wmf/winmtf.hxx @@ -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(); }; diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index d33e24ccdf83..12fef7f872a8 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -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" ); diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 8986a41fa5c8..9fa5bb3eb3db 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -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; } diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index ea29eef04680..afbce6be2e87 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -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 ); diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 7bfa151fe3ec..869758780613 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -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() : diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx index 4ea9170942a1..843fb87a277b 100644 --- a/vcl/source/gdi/pdfwriter.cxx +++ b/vcl/source/gdi/pdfwriter.cxx @@ -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 ); } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index c16205e7ad41..26df395f92d3 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -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(); diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 506187fa2e3d..8cc2d681975e 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -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; diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx index a28eaf752e5c..6129fa0fa1d5 100644 --- a/vcl/source/gdi/textlayout.cxx +++ b/vcl/source/gdi/textlayout.cxx @@ -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. diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index 59477326ffb8..b1e6d6178cbf 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -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; diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx index 7a8a73c318d7..adf3c4134c55 100644 --- a/vcl/source/outdev/outdevstate.cxx +++ b/vcl/source/outdev/outdevstate.cxx @@ -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 ) ); diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 67b61b9c8391..114b35b09a22 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -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 diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index 8d0df9a2a83c..cdf40b3d6d2a 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -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; |