diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-14 08:39:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-15 08:35:10 +0000 |
commit | 8ccbc16b5e3f94b8db105232d7085a8553e6bc03 (patch) | |
tree | 85b8affc4e3916a21c6b303c90dc0f080d464bbf /svx | |
parent | 7fafd1aea08ad036ef48f415db5df93df218bf6e (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 'svx')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 10 | ||||
-rw-r--r-- | svx/source/dialog/frmdirlbox.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/pagectrl.cxx | 13 | ||||
-rw-r--r-- | svx/source/table/svdotable.cxx | 2 |
4 files changed, 14 insertions, 13 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index a999791a5c5a..318844aa5c70 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -60,15 +60,15 @@ using namespace com::sun::star::uno; struct FWCharacterData // representing a single character { - std::vector< tools::PolyPolygon > vOutlines; + std::vector< tools::PolyPolygon > vOutlines; Rectangle aBoundRect; }; struct FWParagraphData // representing a single paragraph { - OUString aString; + OUString aString; std::vector< FWCharacterData > vCharacters; Rectangle aBoundRect; - sal_Int16 nFrameDirection; + SvxFrameDirection nFrameDirection; }; struct FWTextArea // representing multiple concluding paragraphs { @@ -81,7 +81,7 @@ struct FWData // representing the whole text double fHorizontalTextScaling; sal_uInt32 nMaxParagraphsPerTextArea; sal_Int32 nSingleLineHeight; - bool bSingleLineMode; + bool bSingleLineMode; }; @@ -264,7 +264,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F pVirDev->SetMapMode( MapUnit::Map100thMM ); pVirDev->SetFont( aFont ); pVirDev->EnableRTL(); - if ( aParagraphIter->nFrameDirection == FRMDIR_HORI_RIGHT_TOP ) + if ( aParagraphIter->nFrameDirection == SvxFrameDirection::Horizontal_RL_TB ) pVirDev->SetLayoutMode( ComplexTextLayoutFlags::BiDiRtl ); const SvxCharScaleWidthItem& rCharScaleWidthItem = static_cast<const SvxCharScaleWidthItem&>(pCustomShape->GetMergedItem( EE_CHAR_FONTWIDTH )); diff --git a/svx/source/dialog/frmdirlbox.cxx b/svx/source/dialog/frmdirlbox.cxx index 5d259f42d70c..83ecb4bb0ac1 100644 --- a/svx/source/dialog/frmdirlbox.cxx +++ b/svx/source/dialog/frmdirlbox.cxx @@ -38,7 +38,7 @@ inline SvxFrameDirection lclVoidToEnum( void* pDirection ) FrameDirectionListBox::FrameDirectionListBox( vcl::Window* pParent, WinBits nBits ) : ListBox(pParent, nBits) - , meSaveValue(FRMDIR_HORI_LEFT_TOP) + , meSaveValue(SvxFrameDirection::Horizontal_LR_TB) { } diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index 38a1169e1cd2..f59900ac4332 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -48,7 +48,7 @@ SvxPageWindow::SvxPageWindow(vcl::Window* pParent) pBorder(nullptr), bResetBackground(false), bFrameDirection(false), - nFrameDirection(0), + nFrameDirection(SvxFrameDirection::Horizontal_LR_TB), nHdLeft(0), nHdRight(0), @@ -262,29 +262,30 @@ void SvxPageWindow::DrawPage(vcl::RenderContext& rRenderContext, const Point& rO long nAWidth = rRenderContext.GetTextWidth(sText.copy(0,1)); switch (nFrameDirection) { - case FRMDIR_HORI_LEFT_TOP: + case SvxFrameDirection::Horizontal_LR_TB: aPos = aRect.TopLeft(); aPos.X() += PixelToLogic(Point(1,1)).X(); aMove.Y() = 0; cArrow = 0x2192; break; - case FRMDIR_HORI_RIGHT_TOP: + case SvxFrameDirection::Horizontal_RL_TB: aPos = aRect.TopRight(); aPos.X() -= nAWidth; aMove.Y() = 0; aMove.X() *= -1; cArrow = 0x2190; break; - case FRMDIR_VERT_TOP_LEFT: + case SvxFrameDirection::Vertical_LR_TB: aPos = aRect.TopLeft(); aPos.X() += rRenderContext.PixelToLogic(Point(1,1)).X(); aMove.X() = 0; break; - case FRMDIR_VERT_TOP_RIGHT: + case SvxFrameDirection::Vertical_RL_TB: aPos = aRect.TopRight(); aPos.X() -= nAWidth; aMove.X() = 0; break; + default: break; } sText += OUStringLiteral1(cArrow); for (sal_Int32 i = 0; i < sText.getLength(); i++) @@ -427,7 +428,7 @@ void SvxPageWindow::EnableFrameDirection(bool bEnable) bFrameDirection = bEnable; } -void SvxPageWindow::SetFrameDirection(sal_Int32 nDirection) +void SvxPageWindow::SetFrameDirection(SvxFrameDirection nDirection) { nFrameDirection = nDirection; } diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 0436d57e0106..3ccbc3e744cd 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1969,7 +1969,7 @@ WritingMode SdrTableObj::GetWritingMode() const if ( ( eWritingMode != WritingMode_TB_RL ) && ( rSet.GetItemState( EE_PARA_WRITINGDIR, false, &pItem ) == SfxItemState::SET ) ) { - if ( static_cast< const SvxFrameDirectionItem * >( pItem )->GetValue() == FRMDIR_HORI_LEFT_TOP ) + if ( static_cast< const SvxFrameDirectionItem * >( pItem )->GetValue() == SvxFrameDirection::Horizontal_LR_TB ) eWritingMode = WritingMode_LR_TB; else eWritingMode = WritingMode_RL_TB; |