diff options
Diffstat (limited to 'sw/source')
25 files changed, 98 insertions, 98 deletions
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 1c5c1da46120..1d59814cd810 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -493,7 +493,7 @@ void InitCore() aAttrTab[ RES_CHRATR_CTL_POSTURE - POOLATTR_BEGIN ] = new SvxPostureItem(ITALIC_NONE, RES_CHRATR_CTL_POSTURE ); aAttrTab[ RES_CHRATR_CTL_WEIGHT - POOLATTR_BEGIN ] = new SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_CTL_WEIGHT ); - aAttrTab[ RES_CHRATR_ROTATE - POOLATTR_BEGIN ] = new SvxCharRotateItem( 0, false, RES_CHRATR_ROTATE ); + aAttrTab[ RES_CHRATR_ROTATE - POOLATTR_BEGIN ] = new SvxCharRotateItem( Degree10(0), false, RES_CHRATR_ROTATE ); aAttrTab[ RES_CHRATR_EMPHASIS_MARK - POOLATTR_BEGIN ] = new SvxEmphasisMarkItem( FontEmphasisMark::NONE, RES_CHRATR_EMPHASIS_MARK ); aAttrTab[ RES_CHRATR_TWO_LINES - POOLATTR_BEGIN ] = new SvxTwoLinesItem( false, 0, 0, RES_CHRATR_TWO_LINES ); aAttrTab[ RES_CHRATR_SCALEW - POOLATTR_BEGIN ] = new SvxCharScaleWidthItem( 100, RES_CHRATR_SCALEW ); diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index a72e4836b3ca..92dbbdb29f49 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -133,7 +133,7 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * pViewShell) if( 0 > nTmpY ) { nTmpY = -nTmpY; - m_aTextCursor.SetOrientation( 900 ); + m_aTextCursor.SetOrientation( Degree10(900) ); aRect = SwRect( m_pCursorShell->m_aCharRect.Pos(), Size( m_pCursorShell->m_aCharRect.Height(), nTmpY ) ); aRect.Pos().setX(aRect.Pos().getX() + m_pCursorShell->m_aCursorHeight.getX()); diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 5c2fdf4cf16e..68f122f443de 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -1604,7 +1604,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId ) } break; case RES_POOLCHR_VERT_NUM: - aSet.Put( SvxCharRotateItem( 900, false, RES_CHRATR_ROTATE ) ); + aSet.Put( SvxCharRotateItem( Degree10(900), false, RES_CHRATR_ROTATE ) ); break; case RES_POOLFRM_FRAME: diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 5114516c82fc..2e607b83093a 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -771,7 +771,7 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA, convertTwipToMm100( rCrop.GetBottom() )); const SwRotationGrf& rRotation = rSet.GetRotationGrf(); - rGA.SetRotation( rRotation.GetValue() ); + rGA.SetRotation( Degree10(rRotation.GetValue()) ); rGA.SetLuminance( rSet.GetLuminanceGrf().GetValue() ); rGA.SetContrast( rSet.GetContrastGrf().GetValue() ); diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx index 08152e3c7181..64739ef6d114 100644 --- a/sw/source/core/inc/drawfont.hxx +++ b/sw/source/core/inc/drawfont.hxx @@ -584,7 +584,7 @@ public: m_bPosMatchesBounds = bNew; } - void Shift( sal_uInt16 nDir ); + void Shift( Degree10 nDir ); // sets a new color at the output device if necessary if a font is passed // as argument, the change if made to the font otherwise the font at the diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index 96d1fbe187b5..f58a65ac9455 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -48,7 +48,7 @@ const sal_Unicode CH_FULL_BLANK = 0x3000; const sal_Unicode CH_NB_SPACE = 0xA0; const sal_Unicode CH_SIX_PER_EM = 0x2006; // six-per-em space -sal_uInt16 UnMapDirection( sal_uInt16 nDir, const bool bVertFormat, const bool bVertFormatLRBT ); +Degree10 UnMapDirection( Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT ); class SwSubFont : public SvxFont { @@ -92,7 +92,7 @@ class SwSubFont : public SvxFont inline void SetStrikeout( const FontStrikeout eStrikeout ); inline void SetItalic( const FontItalic eItalic ); inline void SetOutline( const bool bOutline ); - inline void SetVertical( const sal_uInt16 nDir, const bool bVertFormat ); + inline void SetVertical( const Degree10 nDir, const bool bVertFormat ); inline void SetShadow( const bool bShadow ); inline void SetAutoKern( FontKerning nAutoKern ); inline void SetWordLineMode( const bool bWordLineMode ); @@ -216,7 +216,7 @@ public: void SetOverColor( const Color &rColor ) { m_aOverColor = rColor; } inline void SetStrikeout( const FontStrikeout eStrikeout ); inline void SetOutline( const bool bOutline ); - void SetVertical(sal_uInt16 nDir, const bool bVertLayout = false, + void SetVertical(Degree10 nDir, const bool bVertLayout = false, const bool bVertLayoutLRBT = false); inline void SetShadow( const bool bShadow ); inline void SetAutoKern( FontKerning nAutoKern ); @@ -281,7 +281,7 @@ public: FontWeight GetWeight() const { return m_aSub[m_nActual].GetWeight(); } FontEmphasisMark GetEmphasisMark() const { return m_aSub[m_nActual].GetEmphasisMark(); } - sal_uInt16 GetOrientation(const bool bVertLayout = false, + Degree10 GetOrientation(const bool bVertLayout = false, const bool bVertFormatLRBT = false) const; const OUString& GetName( const SwFontScript nWhich ) const @@ -817,7 +817,7 @@ inline void SwFont::SetGreyWave( const bool bNew ) m_bGreyWave = bNew; } -inline void SwSubFont::SetVertical( const sal_uInt16 nDir, const bool bVertFormat ) +inline void SwSubFont::SetVertical( const Degree10 nDir, const bool bVertFormat ) { m_nFontCacheId = nullptr; Font::SetVertical( bVertFormat ); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index fdfe346772f7..ffd391d0d13c 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4775,7 +4775,7 @@ void PaintCharacterBorder( bool bLeft = true; bool bRight = true; - switch (rFont.GetOrientation(bVerticalLayout, bVerticalLayoutLRBT)) + switch (rFont.GetOrientation(bVerticalLayout, bVerticalLayoutLRBT).get()) { case 0 : bLeft = !bJoinWithPrev; diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx index aa1b9f67e728..8bac38c92c7e 100644 --- a/sw/source/core/text/atrstck.cxx +++ b/sw/source/core/text/atrstck.cxx @@ -773,7 +773,7 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, bool bPush ) // 2. attribute is active if ( !bRuby && static_cast<const SvxTwoLinesItem&>(rItem).GetValue() ) { - rFnt.SetVertical( 0, m_bVertLayout ); + rFnt.SetVertical( Degree10(0), m_bVertLayout ); break; } @@ -799,7 +799,7 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, bool bPush ) break; } case RES_TXTATR_CJK_RUBY : - rFnt.SetVertical( 0, m_bVertLayout ); + rFnt.SetVertical( Degree10(0), m_bVertLayout ); break; case RES_TXTATR_REFMARK : if ( bPush ) diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 2a24b76dd1a5..2d46fec51020 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -131,7 +131,7 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh, m_pFnt.reset( new SwFont(&pFormat->GetAttrSet(), &pFrame->GetDoc().getIDocumentSettingAccess()) ); m_pFnt->Invalidate(); m_pFnt->ChgPhysFnt( m_pSh, *m_pSh->GetOut() ); - m_pFnt->SetVertical( 0, pFrame->IsVertical() ); + m_pFnt->SetVertical( Degree10(0), pFrame->IsVertical() ); } if( bLineNum ) @@ -538,7 +538,7 @@ bool SwTextFrame::PaintEmpty( const SwRect &rRect, bool bCheck ) const pFnt->SetStyleName(OUString(), SwFontScript::Latin); pFnt->SetCharSet( RTL_TEXTENCODING_SYMBOL, SwFontScript::Latin ); } - pFnt->SetVertical( 0, IsVertical() ); + pFnt->SetVertical( Degree10(0), IsVertical() ); SwFrameSwapper aSwapper( this, true ); SwLayoutModeModifier aLayoutModeModifier( *pSh->GetOut() ); aLayoutModeModifier.Modify( IsRightToLeft() ); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index f3ebd605d918..846701fd240b 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -607,7 +607,7 @@ SwTransparentTextGuard::~SwTransparentTextGuard() aVCLGradient.SetStyle(GradientStyle::Linear); aVCLGradient.SetStartColor(aTransColor); aVCLGradient.SetEndColor(aTransColor); - aVCLGradient.SetAngle(0); + aVCLGradient.SetAngle(Degree10(0)); aVCLGradient.SetBorder(0); aVCLGradient.SetOfsX(0); aVCLGradient.SetOfsY(0); @@ -690,7 +690,7 @@ void SwTextPaintInfo::DrawText_( const OUString &rText, const SwLinePortion &rPo } else { - switch( m_pFnt->GetOrientation(GetTextFrame()->IsVertical()) ) + switch( m_pFnt->GetOrientation(GetTextFrame()->IsVertical()).get() ) { case 0 : aFontPos.AdjustX(nLeftBorderSpace ); @@ -880,7 +880,7 @@ static void lcl_DrawSpecial( const SwTextPaintInfo& rTextPaintInfo, const SwLine // Some of the current values are set at the font: if ( ! bRotate ) - s_aFnt.SetVertical( 0, rTextPaintInfo.GetTextFrame()->IsVertical() ); + s_aFnt.SetVertical( Degree10(0), rTextPaintInfo.GetTextFrame()->IsVertical() ); else s_aFnt.SetVertical( pOldFnt->GetOrientation() ); @@ -894,13 +894,13 @@ static void lcl_DrawSpecial( const SwTextPaintInfo& rTextPaintInfo, const SwLine rNonConstTextPaintInfo.SetFont( &s_aFnt ); // The maximum width depends on the current orientation - const sal_uInt16 nDir = s_aFnt.GetOrientation( rTextPaintInfo.GetTextFrame()->IsVertical() ); + const Degree10 nDir = s_aFnt.GetOrientation( rTextPaintInfo.GetTextFrame()->IsVertical() ); SwTwips nMaxWidth; - if (nDir == 900 || nDir == 2700) + if (nDir == Degree10(900) || nDir == Degree10(2700)) nMaxWidth = rRect.Height(); else { - assert(nDir == 0); //Unknown direction set at font + assert(nDir == Degree10(0)); //Unknown direction set at font nMaxWidth = rRect.Width(); } @@ -933,7 +933,7 @@ static void lcl_DrawSpecial( const SwTextPaintInfo& rTextPaintInfo, const SwLine // adjust values so that tab is vertically and horizontally centered SwTwips nX = rRect.Left(); SwTwips nY = rRect.Top(); - switch ( nDir ) + switch ( nDir.get() ) { case 0 : if ( bCenter ) @@ -1058,7 +1058,7 @@ void SwTextPaintInfo::DrawPostIts( bool bScript ) const const sal_uInt16 nFontHeight = m_pFnt->GetHeight( m_pVsh, *GetOut() ); const sal_uInt16 nFontAscent = m_pFnt->GetAscent( m_pVsh, *GetOut() ); - switch ( m_pFnt->GetOrientation( GetTextFrame()->IsVertical() ) ) + switch ( m_pFnt->GetOrientation( GetTextFrame()->IsVertical() ).get() ) { case 0 : aSize.setWidth( nPostItsWidth ); diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 42a43d4ca744..aae48722464f 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -1495,16 +1495,16 @@ SwLinePortion *SwTextFormatter::NewPortion( SwTextFormatInfo &rInf ) const SwAttrSet& rSet = pInfo->GetAnchorCharFormat(const_cast<SwDoc&>(*pDoc))->GetAttrSet(); const SfxPoolItem* pItem; - sal_uInt16 nDir = 0; + Degree10 nDir(0); if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_ROTATE, true, &pItem )) nDir = static_cast<const SvxCharRotateItem*>(pItem)->GetValue(); - if ( 0 != nDir ) + if ( nDir ) { delete pPor; pPor = new SwRotatedPortion(rInf.GetIdx() + TextFrameIndex(1), - 900 == nDir + Degree10(900) == nDir ? DIR_BOTTOM2TOP : DIR_TOP2BOTTOM ); } @@ -1516,11 +1516,11 @@ SwLinePortion *SwTextFormatter::NewPortion( SwTextFormatInfo &rInf ) if ( pNumFnt ) { - sal_uInt16 nDir = pNumFnt->GetOrientation( rInf.GetTextFrame()->IsVertical() ); - if ( 0 != nDir ) + Degree10 nDir = pNumFnt->GetOrientation( rInf.GetTextFrame()->IsVertical() ); + if ( nDir ) { delete pPor; - pPor = new SwRotatedPortion(TextFrameIndex(0), 900 == nDir + pPor = new SwRotatedPortion(TextFrameIndex(0), Degree10(900) == nDir ? DIR_BOTTOM2TOP : DIR_TOP2BOTTOM ); diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx index ab48848c7510..3a6177ef384e 100644 --- a/sw/source/core/text/porlin.cxx +++ b/sw/source/core/text/porlin.cxx @@ -96,15 +96,15 @@ void SwLinePortion::PrePaint( const SwTextPaintInfo& rInf, const bool bBidiPor = rInf.GetTextFrame()->IsRightToLeft() != bool( ComplexTextLayoutFlags::BiDiRtl & rInf.GetOut()->GetLayoutMode() ); - sal_uInt16 nDir = bBidiPor ? - 1800 : + Degree10 nDir = bBidiPor ? + Degree10(1800) : rInf.GetFont()->GetOrientation( rInf.GetTextFrame()->IsVertical() ); // pLast == this *only* for the 1st portion in the line so nLastWidth is 0; // allow this too, will paint outside the frame but might look better... if (nLastWidth > nHalfView || pLast == this) { - switch (nDir) + switch (nDir.get()) { case 0: nPos = sal_uInt16( rInf.X() ); diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index 59cff49d2f69..e61c52b295aa 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -786,7 +786,7 @@ static bool lcl_CheckRotation(const SfxPoolItem *const pItem, { if ( pItem ) { - rValue = static_cast<const SvxCharRotateItem*>(pItem)->GetValue(); + rValue = static_cast<const SvxCharRotateItem*>(pItem)->GetValue() != Degree10(0); if( !rpRef ) rpRef = static_cast<const SvxCharRotateItem*>(pItem); else if( static_cast<const SvxCharRotateItem*>(pItem)->GetValue() != @@ -1731,7 +1731,7 @@ void SwTextPainter::PaintMultiPortion( const SwRect &rPaint, { // we do not allow any rotation inside a bidi portion SwFont* pTmpFont = GetInfo().GetFont(); - pTmpFont->SetVertical( 0, GetInfo().GetTextFrame()->IsVertical() ); + pTmpFont->SetVertical( Degree10(0), GetInfo().GetTextFrame()->IsVertical() ); } if( pPor->IsMultiPortion() && static_cast<SwMultiPortion*>(pPor)->IsBidi() ) diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 3d220f42cf2f..a304958613a7 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -236,7 +236,7 @@ SwTwips SwTextFrame::EmptyHeight() const } if ( IsVertical() ) - pFnt->SetVertical( 2700 ); + pFnt->SetVertical( Degree10(2700) ); OutputDevice* pOut = pSh ? pSh->GetOut() : nullptr; if ( !pOut || !pSh->GetViewOptions()->getBrowseMode() || @@ -586,7 +586,7 @@ void SwControlCharPortion::Paint( const SwTextPaintInfo &rInf ) const Point aOldPos = rInf.GetPos(); Point aNewPos( aOldPos ); auto const deltaX((Width() / 2) - mnHalfCharWidth); - switch (rInf.GetFont()->GetOrientation(rInf.GetTextFrame()->IsVertical())) + switch (rInf.GetFont()->GetOrientation(rInf.GetTextFrame()->IsVertical()).get()) { case 0: aNewPos.AdjustX(deltaX); diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index 023ffee1b32a..6a4847229a5e 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -405,7 +405,7 @@ void SwDropPortion::Paint( const SwTextPaintInfo &rInf ) const if ( rInf.GetFont()->GetOrientation( rInf.GetTextFrame()->IsVertical() ) ) { pTmpFont.reset(new SwFont( *rInf.GetFont() )); - pTmpFont->SetVertical( 0, rInf.GetTextFrame()->IsVertical() ); + pTmpFont->SetVertical( Degree10(0), rInf.GetTextFrame()->IsVertical() ); } SwFontSave aFontSave( rInf, pTmpFont.get() ); @@ -620,7 +620,7 @@ SwDropPortion *SwTextFormatter::NewDropPortion( SwTextFormatInfo &rInf ) } // we do not allow a vertical font for the drop portion - pTmpFnt->SetVertical( 0, rInf.GetTextFrame()->IsVertical() ); + pTmpFnt->SetVertical( Degree10(0), rInf.GetTextFrame()->IsVertical() ); // find next attribute change / script change const TextFrameIndex nTmpIdx = nNextChg; diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 273dd5b688c1..e62fd8d17b87 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -356,9 +356,9 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf ) ( rInf.Width() <= rInf.X() + PrtWidth() && rInf.X() <= rInf.Width() ) ; // #95477# Rotated tab stops get the width of one blank - const sal_uInt16 nDir = rInf.GetFont()->GetOrientation( rInf.GetTextFrame()->IsVertical() ); + const Degree10 nDir = rInf.GetFont()->GetOrientation( rInf.GetTextFrame()->IsVertical() ); - if( ! bFull && 0 == nDir ) + if( ! bFull && Degree10(0) == nDir ) { const PortionType nWhich = GetWhichPor(); switch( nWhich ) diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 16b88d3fef39..34bb365233c3 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -296,11 +296,11 @@ static void lcl_calcLinePos( const CalcLinePosData &rData, sal_Int32 nKernStart = nStart ? rData.pKernArray[sal_Int32(nStart) - 1] : 0; sal_Int32 nKernEnd = rData.pKernArray[sal_Int32(nEnd) - 1]; - const sal_uInt16 nDir = rData.bBidiPor ? 1800 + const Degree10 nDir = rData.bBidiPor ? Degree10(1800) : UnMapDirection(rData.rFont.GetOrientation(), rData.bSwitchH2V, rData.bSwitchH2VLRBT); - switch ( nDir ) + switch ( nDir.get() ) { case 0 : rStart.AdjustX(nKernStart ); @@ -1735,12 +1735,12 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) Point aEnd; tools::Long nKernVal = pKernArray[sal_Int32(rInf.GetLen()) - 1]; - const sal_uInt16 nDir = bBidiPor - ? 1800 + const Degree10 nDir = bBidiPor + ? Degree10(1800) : UnMapDirection(GetFont().GetOrientation(), bSwitchH2V, bSwitchH2VLRBT); - switch ( nDir ) + switch ( nDir.get() ) { case 0 : aEnd.setX( rInf.GetPos().X() + nKernVal ); diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index a67b8922b49d..e2f0b0b71d6c 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -124,7 +124,7 @@ void SwFont::SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder ) const std::optional<editeng::SvxBorderLine>& SwFont::GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const { - switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) + switch (GetOrientation(bVertLayout, bVertLayoutLRBT).get()) { case 0 : return m_aTopBorder; @@ -148,7 +148,7 @@ SwFont::GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) cons const std::optional<editeng::SvxBorderLine>& SwFont::GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const { - switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) + switch (GetOrientation(bVertLayout, bVertLayoutLRBT).get()) { case 0 : return m_aBottomBorder; @@ -172,7 +172,7 @@ SwFont::GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) c const std::optional<editeng::SvxBorderLine>& SwFont::GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const { - switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) + switch (GetOrientation(bVertLayout, bVertLayoutLRBT).get()) { case 0 : return m_aLeftBorder; @@ -196,7 +196,7 @@ SwFont::GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) con const std::optional<editeng::SvxBorderLine>& SwFont::GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const { - switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) + switch (GetOrientation(bVertLayout, bVertLayoutLRBT).get()) { case 0 : return m_aRightBorder; @@ -221,7 +221,7 @@ SvxShadowLocation SwFont::GetAbsShadowLocation(const bool bVertLayout, const bool bVertLayoutLRBT) const { SvxShadowLocation aLocation = SvxShadowLocation::NONE; - switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) + switch (GetOrientation(bVertLayout, bVertLayoutLRBT).get()) { case 0: aLocation = m_aShadowLocation; @@ -305,16 +305,16 @@ sal_uInt16 SwFont::CalcShadowSpace(const SvxShadowItemSide nShadow, const bool b const bool bSkipRight) const { sal_uInt16 nSpace = 0; - const sal_uInt16 nOrient = GetOrientation(bVertLayout, bVertLayoutLRBT); + const Degree10 nOrient = GetOrientation(bVertLayout, bVertLayoutLRBT); const SvxShadowLocation aLoc = GetAbsShadowLocation(bVertLayout, bVertLayoutLRBT); switch( nShadow ) { case SvxShadowItemSide::TOP: if(( aLoc == SvxShadowLocation::TopLeft || aLoc == SvxShadowLocation::TopRight ) && - ( nOrient == 0 || nOrient == 1800 || - ( nOrient == 900 && !bSkipRight ) || - ( nOrient == 2700 && !bSkipLeft ))) + ( nOrient == Degree10(0) || nOrient == Degree10(1800) || + ( nOrient == Degree10(900) && !bSkipRight ) || + ( nOrient == Degree10(2700) && !bSkipLeft ))) { nSpace = m_nShadowWidth; } @@ -323,9 +323,9 @@ sal_uInt16 SwFont::CalcShadowSpace(const SvxShadowItemSide nShadow, const bool b case SvxShadowItemSide::BOTTOM: if(( aLoc == SvxShadowLocation::BottomLeft || aLoc == SvxShadowLocation::BottomRight ) && - ( nOrient == 0 || nOrient == 1800 || - ( nOrient == 900 && !bSkipLeft ) || - ( nOrient == 2700 && !bSkipRight ))) + ( nOrient == Degree10(0) || nOrient == Degree10(1800) || + ( nOrient == Degree10(900) && !bSkipLeft ) || + ( nOrient == Degree10(2700) && !bSkipRight ))) { nSpace = m_nShadowWidth; } @@ -334,9 +334,9 @@ sal_uInt16 SwFont::CalcShadowSpace(const SvxShadowItemSide nShadow, const bool b case SvxShadowItemSide::LEFT: if(( aLoc == SvxShadowLocation::TopLeft || aLoc == SvxShadowLocation::BottomLeft ) && - ( nOrient == 900 || nOrient == 2700 || - ( nOrient == 0 && !bSkipLeft ) || - ( nOrient == 1800 && !bSkipRight ))) + ( nOrient == Degree10(900) || nOrient == Degree10(2700) || + ( nOrient == Degree10(0) && !bSkipLeft ) || + ( nOrient == Degree10(1800) && !bSkipRight ))) { nSpace = m_nShadowWidth; } @@ -345,9 +345,9 @@ sal_uInt16 SwFont::CalcShadowSpace(const SvxShadowItemSide nShadow, const bool b case SvxShadowItemSide::RIGHT: if(( aLoc == SvxShadowLocation::TopRight || aLoc == SvxShadowLocation::BottomRight ) && - ( nOrient == 900 || nOrient == 2700 || - ( nOrient == 0 && !bSkipRight ) || - ( nOrient == 1800 && !bSkipLeft ))) + ( nOrient == Degree10(900) || nOrient == Degree10(2700) || + ( nOrient == Degree10(0) && !bSkipRight ) || + ( nOrient == Degree10(1800) && !bSkipLeft ))) { nSpace = m_nShadowWidth; } @@ -361,23 +361,23 @@ sal_uInt16 SwFont::CalcShadowSpace(const SvxShadowItemSide nShadow, const bool b } // maps directions for vertical layout -static sal_uInt16 MapDirection(sal_uInt16 nDir, const bool bVertFormat, const bool bVertFormatLRBT) +static Degree10 MapDirection(Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT) { if ( bVertFormat ) { - switch ( nDir ) + switch ( nDir.get() ) { case 0 : if (bVertFormatLRBT) - nDir = 900; + nDir = Degree10(900); else - nDir = 2700; + nDir = Degree10(2700); break; case 900 : - nDir = 0; + nDir = Degree10(0); break; case 2700 : - nDir = 1800; + nDir = Degree10(1800); break; #if OSL_DEBUG_LEVEL > 0 default : @@ -391,14 +391,14 @@ static sal_uInt16 MapDirection(sal_uInt16 nDir, const bool bVertFormat, const bo // maps the absolute direction set at the font to its logical counterpart // in the rotated environment -sal_uInt16 UnMapDirection(sal_uInt16 nDir, const bool bVertFormat, const bool bVertFormatLRBT) +Degree10 UnMapDirection(Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT) { if (bVertFormatLRBT) { - switch (nDir) + switch (nDir.get()) { case 900: - nDir = 0; + nDir = Degree10(0); break; default: SAL_WARN("sw.core", "unsupported direction for VertLRBT"); @@ -409,16 +409,16 @@ sal_uInt16 UnMapDirection(sal_uInt16 nDir, const bool bVertFormat, const bool bV if ( bVertFormat ) { - switch ( nDir ) + switch ( nDir.get() ) { case 0 : - nDir = 900; + nDir = Degree10(900); break; case 1800 : - nDir = 2700; + nDir = Degree10(2700); break; case 2700 : - nDir = 0; + nDir = Degree10(0); break; #if OSL_DEBUG_LEVEL > 0 default : @@ -430,12 +430,12 @@ sal_uInt16 UnMapDirection(sal_uInt16 nDir, const bool bVertFormat, const bool bV return nDir; } -sal_uInt16 SwFont::GetOrientation(const bool bVertFormat, const bool bVertFormatLRBT) const +Degree10 SwFont::GetOrientation(const bool bVertFormat, const bool bVertFormatLRBT) const { return UnMapDirection(m_aSub[m_nActual].GetOrientation(), bVertFormat, bVertFormatLRBT); } -void SwFont::SetVertical(sal_uInt16 nDir, const bool bVertFormat, const bool bVertLayoutLRBT) +void SwFont::SetVertical(Degree10 nDir, const bool bVertFormat, const bool bVertLayoutLRBT) { // map direction if frame has vertical layout nDir = MapDirection(nDir, bVertFormat, bVertLayoutLRBT); @@ -696,7 +696,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, if( SfxItemState::SET == pAttrSet->GetItemState( RES_CHRATR_TWO_LINES, true, &pTwoLinesItem )) if ( static_cast<const SvxTwoLinesItem*>(pTwoLinesItem)->GetValue() ) - SetVertical( 0 ); + SetVertical( Degree10(0) ); } else { @@ -883,7 +883,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, if ( ! rTwoLinesItem.GetValue() ) SetVertical( pAttrSet->GetCharRotate().GetValue() ); else - SetVertical( 0 ); + SetVertical( Degree10(0) ); if( pIDocumentSettingAccess && pIDocumentSettingAccess->get( DocumentSettingId::SMALL_CAPS_PERCENTAGE_66 )) { m_aSub[ SwFontScript::Latin ].m_bSmallCapsPercentage66 = true; @@ -1397,7 +1397,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo const & rInf, Point& rPos ) bVert = rInf.GetFrame()->IsVertical(); bVertLRBT = rInf.GetFrame()->IsVertLRBT(); } - const sal_uInt16 nDir = UnMapDirection(GetOrientation(), bVert, bVertLRBT); + const Degree10 nDir = UnMapDirection(GetOrientation(), bVert, bVertLRBT); switch ( GetEscapement() ) { @@ -1406,7 +1406,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo const & rInf, Point& rPos ) pLastFont->GetFontHeight( rInf.GetShell(), rInf.GetOut() ) + pLastFont->GetFontAscent( rInf.GetShell(), rInf.GetOut() ); - switch ( nDir ) + switch ( nDir.get() ) { case 0 : rPos.AdjustY(nOfst ); @@ -1424,7 +1424,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo const & rInf, Point& rPos ) nOfst = pLastFont->GetFontAscent( rInf.GetShell(), rInf.GetOut() ) - m_nOrgAscent; - switch ( nDir ) + switch ( nDir.get() ) { case 0 : rPos.AdjustY(nOfst ); @@ -1441,7 +1441,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo const & rInf, Point& rPos ) default : nOfst = (static_cast<tools::Long>(m_nOrgHeight) * GetEscapement()) / 100; - switch ( nDir ) + switch ( nDir.get() ) { case 0 : rPos.AdjustY( -nOfst ); @@ -1457,7 +1457,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo const & rInf, Point& rPos ) } // used during painting of small capitals -void SwDrawTextInfo::Shift( sal_uInt16 nDir ) +void SwDrawTextInfo::Shift( Degree10 nDir ) { #ifdef DBG_UTIL OSL_ENSURE( m_bPos, "DrawTextInfo: Undefined Position" ); @@ -1474,9 +1474,9 @@ void SwDrawTextInfo::Shift( sal_uInt16 nDir ) bVert = GetFrame()->IsVertical(); bVertLRBT = GetFrame()->IsVertLRBT(); } - nDir = bBidiPor ? 1800 : UnMapDirection(nDir, bVert, bVertLRBT); + nDir = bBidiPor ? Degree10(1800) : UnMapDirection(nDir, bVert, bVertLRBT); - switch ( nDir ) + switch ( nDir.get() ) { case 0 : m_aPos.AdjustX(GetSize().Width() ); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 78e6bba0bde2..53f7462de3a9 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4686,7 +4686,7 @@ void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem& rHt) break; case RES_CHRATR_ROTATE: - bMustWrite = static_cast< const SvxCharRotateItem& >(rHt).GetValue() != 0; + bMustWrite = static_cast< const SvxCharRotateItem& >(rHt).GetValue() != Degree10(0); break; case RES_CHRATR_EMPHASIS_MARK: bMustWrite = static_cast< const SvxEmphasisMarkItem& >(rHt).GetEmphasisMark() != FontEmphasisMark::NONE; @@ -9095,7 +9095,7 @@ void DocxAttributeOutput::FormatFillGradient( const XFillGradientItem& rFillGrad // /oox/source/vml/vmlformatting.cxx :: FillModel::pushToPropMap // and also in // /oox/source/drawingml/fillproperties.cxx :: FillProperties::pushToPropMap - sal_Int32 nReverseAngle = 4500 - rGradient.GetAngle(); + sal_Int32 nReverseAngle = (Degree10(4500) - rGradient.GetAngle()).get(); nReverseAngle = nReverseAngle / 10; nReverseAngle = (270 - nReverseAngle) % 360; if (nReverseAngle != 0) diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index b28c2bd4d2cf..413ef854121d 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2076,11 +2076,11 @@ static sal_uInt16 lcl_TCFlags(SwDoc &rDoc, const SwTableBox * pBox, sal_Int32 nR if ( SfxItemState::SET == aCoreSet.GetItemState(RES_CHRATR_ROTATE, true, &pRotItem)) { const SvxCharRotateItem * pRotate = static_cast<const SvxCharRotateItem*>(pRotItem); - if(pRotate && pRotate->GetValue() == 900) + if(pRotate && pRotate->GetValue() == Degree10(900)) { nFlags = nFlags | 0x0004 | 0x0008; } - else if(pRotate && pRotate->GetValue() == 2700 ) + else if(pRotate && pRotate->GetValue() == Degree10(2700) ) { nFlags = nFlags | 0x0004 | 0x0010; } diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 849d68ca1dbb..59e5b6beb731 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -3559,7 +3559,7 @@ void SwWW8ImplReader::Read_DoubleLine_Rotate( sal_uInt16, const sal_uInt8* pData case 1: // rotated characters { bool bFitToLine = 0 != *(pData+1); - NewAttr( SvxCharRotateItem( 900, bFitToLine, RES_CHRATR_ROTATE )); + NewAttr( SvxCharRotateItem( Degree10(900), bFitToLine, RES_CHRATR_ROTATE )); } break; } diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index b41601be1ea5..da8c13e04caa 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -406,8 +406,8 @@ namespace if ( !aMetadata.read(aGraphic) ) return; - sal_uInt16 aRotation = aMetadata.getRotation(); - if (aRotation != 0) + Degree10 aRotation = aMetadata.getRotation(); + if (aRotation) { std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(nullptr, "modules/swriter/ui/queryrotateintostandarddialog.ui")); std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("QueryRotateIntoStandardOrientationDialog")); diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index b0ba28e53074..e0af002ba981 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2246,7 +2246,7 @@ void SwBaseShell::GetTextFontCtrlState( SfxItemSet& rSet ) } bool bVertical = rSh.IsInVerticalText(); - aFont.SetOrientation(bVertical ? 2700 : 0); + aFont.SetOrientation(Degree10(bVertical ? 2700 : 0)); aFont.SetVertical(bVertical); GetView().GetEditWin().SetInputContext( InputContext( aFont, InputContextFlags::Text | InputContextFlags::ExtText ) ); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index b0e133d92403..ff12532203b6 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -241,8 +241,8 @@ ErrCode SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter, GraphicNativeMetadata aMetadata; if ( aMetadata.read(aGraphic) ) { - const sal_uInt16 aRotation = aMetadata.getRotation(); - if (aRotation != 0) + const Degree10 aRotation = aMetadata.getRotation(); + if (aRotation) { GraphicNativeTransform aTransform( aGraphic ); aTransform.rotate( aRotation ); diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index 5849365ea243..904af3e672a4 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -456,7 +456,7 @@ void SwView::GetState(SfxItemSet &rSet) { SfxImageItem aImageItem(nWhich); if(m_pWrtShell->IsInVerticalText()) - aImageItem.SetRotation( 2700 ); + aImageItem.SetRotation( Degree10(2700) ); if(m_pWrtShell->IsInRightToLeftText()) aImageItem.SetMirrored( true ); rSet.Put(aImageItem); |