summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-14 08:39:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-15 08:35:10 +0000
commit8ccbc16b5e3f94b8db105232d7085a8553e6bc03 (patch)
tree85b8affc4e3916a21c6b303c90dc0f080d464bbf /sc
parent7fafd1aea08ad036ef48f415db5df93df218bf6e (diff)
convert SvxFrameDirection to scoped enum
Based on the casts in chart2/source/view/main/ChartView.cxx and the similarity of naming of values, I conclude that this enum was intended to abstract over css::text::WritingMode2. Added a comment to that effect. Change-Id: I3af8bbe8b6ac8c4a9375f6ccde145b98b9c69a57 Reviewed-on: https://gerrit.libreoffice.org/35164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/docpool.cxx4
-rw-r--r--sc/source/core/data/documen8.cxx4
-rw-r--r--sc/source/core/data/drwlayer.cxx2
-rw-r--r--sc/source/core/data/stlsheet.cxx4
-rw-r--r--sc/source/filter/excel/xestyle.cxx2
-rw-r--r--sc/source/filter/excel/xlstyle.cxx14
-rw-r--r--sc/source/filter/oox/stylesbuffer.cxx10
-rw-r--r--sc/source/ui/app/inputwin.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx10
-rw-r--r--sc/source/ui/drawfunc/drtxtob2.cxx2
-rw-r--r--sc/source/ui/view/formatsh.cxx6
-rw-r--r--sc/source/ui/view/output2.cxx4
-rw-r--r--sc/source/ui/view/printfun.cxx2
13 files changed, 33 insertions, 33 deletions
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index daabc72fc5b1..df7470f2cea7 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -262,10 +262,10 @@ ScDocumentPool::ScDocumentPool()
rPoolDefaults[ ATTR_ROTATE_VALUE - ATTR_STARTINDEX ] = new SfxInt32Item( ATTR_ROTATE_VALUE, 0 );
rPoolDefaults[ ATTR_ROTATE_MODE - ATTR_STARTINDEX ] = new SvxRotateModeItem( SVX_ROTATE_MODE_BOTTOM, ATTR_ROTATE_MODE );
rPoolDefaults[ ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_VERTICAL_ASIAN );
- // The default for the ATTR_WRITINGDIR cell attribute must by FRMDIR_ENVIRONMENT,
+ // The default for the ATTR_WRITINGDIR cell attribute must by SvxFrameDirection::Environment,
// so that value is returned when asking for a default cell's attributes.
// The value from the page style is set as DefaultHorizontalTextDirection for the EditEngine.
- rPoolDefaults[ ATTR_WRITINGDIR - ATTR_STARTINDEX ] = new SvxFrameDirectionItem( FRMDIR_ENVIRONMENT, ATTR_WRITINGDIR );
+ rPoolDefaults[ ATTR_WRITINGDIR - ATTR_STARTINDEX ] = new SvxFrameDirectionItem( SvxFrameDirection::Environment, ATTR_WRITINGDIR );
rPoolDefaults[ ATTR_LINEBREAK - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_LINEBREAK );
rPoolDefaults[ ATTR_SHRINKTOFIT - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_SHRINKTOFIT );
rPoolDefaults[ ATTR_BORDER_TLBR - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_TLBR );
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 2472f4a76ee2..de5d06c09ff4 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -372,9 +372,9 @@ sal_uInt8 ScDocument::GetEditTextDirection(SCTAB nTab) const
SvxFrameDirection eDirection = (SvxFrameDirection)
static_cast<const SvxFrameDirectionItem&>(rStyleSet.Get( ATTR_WRITINGDIR )).GetValue();
- if ( eDirection == FRMDIR_HORI_LEFT_TOP )
+ if ( eDirection == SvxFrameDirection::Horizontal_LR_TB )
eRet = EE_HTEXTDIR_L2R;
- else if ( eDirection == FRMDIR_HORI_RIGHT_TOP )
+ else if ( eDirection == SvxFrameDirection::Horizontal_RL_TB )
eRet = EE_HTEXTDIR_R2L;
// else (invalid for EditEngine): keep "default"
}
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 8618c55e5769..c18c869a84cb 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -265,7 +265,7 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const OUString& rName ) :
SetScaleUnit(MapUnit::Map100thMM);
SfxItemPool& rPool = GetItemPool();
rPool.SetDefaultMetric(MapUnit::Map100thMM);
- SvxFrameDirectionItem aModeItem( FRMDIR_ENVIRONMENT, EE_PARA_WRITINGDIR );
+ SvxFrameDirectionItem aModeItem( SvxFrameDirection::Environment, EE_PARA_WRITINGDIR );
rPool.SetPoolDefaultItem( aModeItem );
// #i33700#
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index a9ee5354c768..ae7aed25f171 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -201,11 +201,11 @@ SfxItemSet& ScStyleSheet::GetItemSet()
// Writing direction: not as pool default because the default for cells
- // must remain FRMDIR_ENVIRONMENT, and each page style's setting is
+ // must remain SvxFrameDirection::Environment, and each page style's setting is
// supposed to be saved in the file format.
// The page default depends on the system language.
SvxFrameDirection eDirection = ScGlobal::IsSystemRTL() ?
- FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP;
+ SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB;
pSet->Put( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ) );
rItemPool.SetPoolDefaultItem( aPageItem );
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index f2a86739145b..d1c50ea852b0 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1488,7 +1488,7 @@ bool XclExpCellAlign::FillFromItemSet(
bUsed |= ScfTools::CheckItem( rItemSet, ATTR_SHRINKTOFIT, bStyle );
// CTL text direction
- SetScFrameDir(GETITEM( rItemSet, SvxFrameDirectionItem, ATTR_WRITINGDIR ).GetValue());
+ SetScFrameDir( GETITEM( rItemSet, SvxFrameDirectionItem, ATTR_WRITINGDIR ).GetValue() );
bUsed |= ScfTools::CheckItem( rItemSet, ATTR_WRITINGDIR, bStyle );
SAL_FALLTHROUGH;
diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx
index ca53689ac4ba..1df8cbab8a19 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -1596,12 +1596,12 @@ SvxCellJustifyMethod XclCellAlign::GetScVerJustifyMethod() const
SvxFrameDirection XclCellAlign::GetScFrameDir() const
{
- SvxFrameDirection eFrameDir = FRMDIR_ENVIRONMENT;
+ SvxFrameDirection eFrameDir = SvxFrameDirection::Environment;
switch( mnTextDir )
{
- case EXC_XF_TEXTDIR_CONTEXT: eFrameDir = FRMDIR_ENVIRONMENT; break;
- case EXC_XF_TEXTDIR_LTR: eFrameDir = FRMDIR_HORI_LEFT_TOP; break;
- case EXC_XF_TEXTDIR_RTL: eFrameDir = FRMDIR_HORI_RIGHT_TOP; break;
+ case EXC_XF_TEXTDIR_CONTEXT: eFrameDir = SvxFrameDirection::Environment; break;
+ case EXC_XF_TEXTDIR_LTR: eFrameDir = SvxFrameDirection::Horizontal_LR_TB; break;
+ case EXC_XF_TEXTDIR_RTL: eFrameDir = SvxFrameDirection::Horizontal_RL_TB; break;
default: OSL_FAIL( "XclCellAlign::GetScFrameDir - unknown CTL text direction" );
}
return eFrameDir;
@@ -1639,9 +1639,9 @@ void XclCellAlign::SetScFrameDir( SvxFrameDirection eFrameDir )
{
switch( eFrameDir )
{
- case FRMDIR_ENVIRONMENT: mnTextDir = EXC_XF_TEXTDIR_CONTEXT; break;
- case FRMDIR_HORI_LEFT_TOP: mnTextDir = EXC_XF_TEXTDIR_LTR; break;
- case FRMDIR_HORI_RIGHT_TOP: mnTextDir = EXC_XF_TEXTDIR_RTL; break;
+ case SvxFrameDirection::Environment: mnTextDir = EXC_XF_TEXTDIR_CONTEXT; break;
+ case SvxFrameDirection::Horizontal_LR_TB: mnTextDir = EXC_XF_TEXTDIR_LTR; break;
+ case SvxFrameDirection::Horizontal_RL_TB: mnTextDir = EXC_XF_TEXTDIR_RTL; break;
default: mnTextDir = EXC_XF_TEXTDIR_CONTEXT;
OSL_FAIL( "XclCellAlign::SetScFrameDir - unknown CTL text direction" );
}
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 40993276a934..eccdd456f900 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1243,19 +1243,19 @@ void Alignment::finalizeImport()
return nHori;
}
-::SvxFrameDirection Alignment::GetScFrameDir() const
+SvxFrameDirection Alignment::GetScFrameDir() const
{
- ::SvxFrameDirection eFrameDir = ::FRMDIR_ENVIRONMENT;
+ SvxFrameDirection eFrameDir = SvxFrameDirection::Environment;
switch( maApiData.mnWritingMode )
{
case css::text::WritingMode2::PAGE:
- eFrameDir = ::FRMDIR_ENVIRONMENT;
+ eFrameDir = SvxFrameDirection::Environment;
break;
case css::text::WritingMode2::LR_TB:
- eFrameDir = ::FRMDIR_HORI_LEFT_TOP;
+ eFrameDir = SvxFrameDirection::Horizontal_LR_TB;
break;
case css::text::WritingMode2::RL_TB:
- eFrameDir = ::FRMDIR_HORI_RIGHT_TOP;
+ eFrameDir = SvxFrameDirection::Horizontal_RL_TB;
break;
default:
OSL_FAIL( "GetScFrameDir - unknown CTL text direction" );
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index b320ba7f9f8c..433f5f61c01d 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1138,7 +1138,7 @@ static void lcl_ModifyRTLDefaults( SfxItemSet& rSet )
rSet.Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) );
// always using rtl writing direction would break formulas
- //rSet.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
+ //rSet.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) );
// PaperSize width is limited to USHRT_MAX in RTL mode (because of EditEngine's
// sal_uInt16 values in EditLine), so the text may be wrapped and line spacing must be
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 5e08e624f769..3887ac22669b 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -1173,16 +1173,16 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
{
SvxFrameDirection eAttrDir = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(
aAttrSet.Get( EE_PARA_WRITINGDIR )).GetValue();
- if ( eAttrDir == FRMDIR_ENVIRONMENT )
+ if ( eAttrDir == SvxFrameDirection::Environment )
{
// get "environment" direction from page style
if ( pViewData->GetDocument()->GetEditTextDirection( pViewData->GetTabNo() ) == EE_HTEXTDIR_R2L )
- eAttrDir = FRMDIR_HORI_RIGHT_TOP;
+ eAttrDir = SvxFrameDirection::Horizontal_RL_TB;
else
- eAttrDir = FRMDIR_HORI_LEFT_TOP;
+ eAttrDir = SvxFrameDirection::Horizontal_LR_TB;
}
- rDestSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, ( eAttrDir == FRMDIR_HORI_LEFT_TOP ) ) );
- rDestSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, ( eAttrDir == FRMDIR_HORI_RIGHT_TOP ) ) );
+ rDestSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, ( eAttrDir == SvxFrameDirection::Horizontal_LR_TB ) ) );
+ rDestSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, ( eAttrDir == SvxFrameDirection::Horizontal_RL_TB ) ) );
}
}
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index 9cf130add9dd..d31bc6a11857 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -168,7 +168,7 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
0 );
bool bLeft = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT );
aAttr.Put( SvxFrameDirectionItem(
- bLeft ? FRMDIR_HORI_LEFT_TOP : FRMDIR_HORI_RIGHT_TOP,
+ bLeft ? SvxFrameDirection::Horizontal_LR_TB : SvxFrameDirection::Horizontal_RL_TB,
EE_PARA_WRITINGDIR ) );
aAttr.Put( SvxAdjustItem(
bLeft ? SvxAdjust::Left : SvxAdjust::Right,
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 9102ee662008..3c2635c9599f 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2634,7 +2634,7 @@ void ScFormatShell::ExecuteTextDirection( SfxRequest& rReq )
case SID_ATTR_PARA_RIGHT_TO_LEFT:
{
SvxFrameDirection eDirection = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ) ?
- FRMDIR_HORI_LEFT_TOP : FRMDIR_HORI_RIGHT_TOP;
+ SvxFrameDirection::Horizontal_LR_TB : SvxFrameDirection::Horizontal_RL_TB;
pTabViewShell->ApplyAttr( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ) );
}
break;
@@ -2662,10 +2662,10 @@ void ScFormatShell::GetTextDirectionState( SfxItemSet& rSet )
{
SvxFrameDirection eCellDir = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(
rAttrSet.Get( ATTR_WRITINGDIR )).GetValue();
- if ( eCellDir == FRMDIR_ENVIRONMENT )
+ if ( eCellDir == SvxFrameDirection::Environment )
eBidiDir = (EEHorizontalTextDirection)GetViewData()->GetDocument()->
GetEditTextDirection( GetViewData()->GetTabNo() );
- else if ( eCellDir == FRMDIR_HORI_RIGHT_TOP )
+ else if ( eCellDir == SvxFrameDirection::Horizontal_RL_TB )
eBidiDir = EE_HTEXTDIR_R2L;
else
eBidiDir = EE_HTEXTDIR_L2R;
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index b45756b7b03a..d19365816222 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1421,9 +1421,9 @@ static SvxCellHorJustify getAlignmentFromContext( SvxCellHorJustify eInHorJust,
eInHorJust == SvxCellHorJustify::Block || eInHorJust == SvxCellHorJustify::Repeat)
{
SvxFrameDirection nDirection = lcl_GetValue<SvxFrameDirectionItem, SvxFrameDirection>(rPattern, ATTR_WRITINGDIR, pCondSet);
- if (nDirection == FRMDIR_HORI_LEFT_TOP || nDirection == FRMDIR_VERT_TOP_LEFT)
+ if (nDirection == SvxFrameDirection::Horizontal_LR_TB || nDirection == SvxFrameDirection::Vertical_LR_TB)
eHorJustContext = SvxCellHorJustify::Left;
- else if (nDirection == FRMDIR_ENVIRONMENT)
+ else if (nDirection == SvxFrameDirection::Environment)
{
SAL_WARN_IF( !pDoc, "sc.ui", "getAlignmentFromContext - pDoc==NULL");
// fdo#73588: The content of the cell must also
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index a423db307ec5..e3dd216bd699 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1704,7 +1704,7 @@ void ScPrintFunc::MakeEditEngine()
//! there's no way to set the background for note pages
pEditDefaults->ClearItem( EE_CHAR_COLOR );
if (ScGlobal::IsSystemRTL())
- pEditDefaults->Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
+ pEditDefaults->Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) );
}
pEditEngine->SetData( aFieldData ); // Set page count etc.