summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-01 12:34:33 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-08-20 09:01:26 -0500
commit794d5ac4ac0b1dcaac289772ce096a4295d4e15d (patch)
treed02d4d13e793b0856c4dd962cf4b8d946942e3c4 /drawinglayer
parent71804294c79136ef43a8f91b5c961e266d32187a (diff)
vcl: use enum for complex text layout constants
Since these constants are bitfield flags, we define some methods to make working with them reasonably type safe. Move the definitions to outdevstate.hxx, since we need the values there, and that appears to be the "root most" header file. Also dump TEXT_LAYOUT_BIDI_LTR constant, since it means the same thing as TEXT_LAYOUT_DEFAULT (ie. 0), and leaving it in causes people to write weird code thinking that it's a real flag. Change-Id: Iddab86cd6c78181ceb8caa48e77e1f5a8e526343 Reviewed-on: https://gerrit.libreoffice.org/10676 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx8
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx4
2 files changed, 6 insertions, 6 deletions
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 943e16a37acd..8f77949f4adb 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -89,7 +89,7 @@ namespace
/// font, etc.
Font maFont;
RasterOp maRasterOp;
- sal_uInt32 mnLayoutMode;
+ ComplexTextLayoutMode mnLayoutMode;
LanguageType maLanguageType;
sal_uInt16 mnPushFlags;
@@ -116,7 +116,7 @@ namespace
maClipPolyPoygon(),
maFont(),
maRasterOp(ROP_OVERPAINT),
- mnLayoutMode(0),
+ mnLayoutMode(TEXT_LAYOUT_DEFAULT),
maLanguageType(0),
mnPushFlags(0),
mbLineColor(false),
@@ -184,8 +184,8 @@ namespace
bool isRasterOpForceBlack() const { return ROP_0 == maRasterOp; }
bool isRasterOpActive() const { return isRasterOpInvert() || isRasterOpForceBlack(); }
- sal_uInt32 getLayoutMode() const { return mnLayoutMode; }
- void setLayoutMode(sal_uInt32 nNew) { if(nNew != mnLayoutMode) mnLayoutMode = nNew; }
+ ComplexTextLayoutMode getLayoutMode() const { return mnLayoutMode; }
+ void setLayoutMode(ComplexTextLayoutMode nNew) { if(nNew != mnLayoutMode) mnLayoutMode = nNew; }
LanguageType getLanguageType() const { return maLanguageType; }
void setLanguageType(LanguageType aNew) { if(aNew != maLanguageType) maLanguageType = aNew; }
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 137901eb3f9e..869afd83fe6a 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -261,11 +261,11 @@ 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 sal_uInt32 nOldLayoutMode(mpOutputDevice->GetLayoutMode());
+ const ComplexTextLayoutMode nOldLayoutMode(mpOutputDevice->GetLayoutMode());
if(rTextCandidate.getFontAttribute().getRTL())
{
- sal_uInt32 nRTLLayoutMode(nOldLayoutMode & ~(TEXT_LAYOUT_COMPLEX_DISABLED|TEXT_LAYOUT_BIDI_STRONG));
+ ComplexTextLayoutMode nRTLLayoutMode(nOldLayoutMode & ~(TEXT_LAYOUT_COMPLEX_DISABLED|TEXT_LAYOUT_BIDI_STRONG));
nRTLLayoutMode |= TEXT_LAYOUT_BIDI_RTL|TEXT_LAYOUT_TEXTORIGIN_LEFT;
mpOutputDevice->SetLayoutMode(nRTLLayoutMode);
}