diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-18 10:29:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-18 15:22:40 +0200 |
commit | d7f2c36d25dd693ac4ac3ab645ee841e617d2bd1 (patch) | |
tree | 46516895aefcb6e8f54dd286c6af9d89fbecb44d /svx/source/dialog/fntctrl.cxx | |
parent | 5d86154f49d713dada4aaa541755076cfeefa2c6 (diff) |
loplugin:unusedmethods
Change-Id: I5f63ac44654ed3fc658e72e0d1148a5a22decc47
Reviewed-on: https://gerrit.libreoffice.org/60662
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/dialog/fntctrl.cxx')
-rw-r--r-- | svx/source/dialog/fntctrl.cxx | 229 |
1 files changed, 0 insertions, 229 deletions
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index e955713f2d50..b1a14c7961b2 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -910,235 +910,6 @@ static void SetPrevFontEscapement(SvxFont& rFont, sal_uInt8 nProp, sal_uInt8 nEs rFont.SetEscapement(nEsc); } -void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBackgroundToCharacter) -{ - sal_uInt16 nWhich; - SvxFont& rFont = GetFont(); - SvxFont& rCJKFont = GetCJKFont(); - SvxFont& rCTLFont = GetCTLFont(); - - // Preview string - if( GetWhich( rSet, SID_CHAR_DLG_PREVIEW_STRING, nWhich ) ) - { - const SfxStringItem& rItem = static_cast<const SfxStringItem&>( rSet.Get( nWhich ) ); - const OUString& aString = rItem.GetValue(); - if( !aString.isEmpty() ) - SetPreviewText( aString ); - else - SetFontNameAsPreviewText(); - } - - // Underline - FontLineStyle eUnderline; - if( GetWhich( rSet, SID_ATTR_CHAR_UNDERLINE, nWhich ) ) - { - const SvxUnderlineItem& rItem = static_cast<const SvxUnderlineItem&>( rSet.Get( nWhich ) ); - eUnderline = rItem.GetValue(); - SetTextLineColor( rItem.GetColor() ); - } - else - eUnderline = LINESTYLE_NONE; - - rFont.SetUnderline( eUnderline ); - rCJKFont.SetUnderline( eUnderline ); - rCTLFont.SetUnderline( eUnderline ); - - // Overline - FontLineStyle eOverline; - if( GetWhich( rSet, SID_ATTR_CHAR_OVERLINE, nWhich ) ) - { - const SvxOverlineItem& rItem = static_cast<const SvxOverlineItem&>( rSet.Get( nWhich ) ); - eOverline = rItem.GetValue(); - SetOverlineColor( rItem.GetColor() ); - } - else - eOverline = LINESTYLE_NONE; - - rFont.SetOverline( eOverline ); - rCJKFont.SetOverline( eOverline ); - rCTLFont.SetOverline( eOverline ); - - // Strikeout - FontStrikeout eStrikeout; - if( GetWhich( rSet, SID_ATTR_CHAR_STRIKEOUT, nWhich ) ) - { - const SvxCrossedOutItem& rItem = static_cast<const SvxCrossedOutItem&>( rSet.Get( nWhich ) ); - eStrikeout = rItem.GetValue(); - } - else - eStrikeout = STRIKEOUT_NONE; - - rFont.SetStrikeout( eStrikeout ); - rCJKFont.SetStrikeout( eStrikeout ); - rCTLFont.SetStrikeout( eStrikeout ); - - // WordLineMode - if( GetWhich( rSet, SID_ATTR_CHAR_WORDLINEMODE, nWhich ) ) - { - const SvxWordLineModeItem& rItem = static_cast<const SvxWordLineModeItem&>( rSet.Get( nWhich ) ); - rFont.SetWordLineMode( rItem.GetValue() ); - rCJKFont.SetWordLineMode( rItem.GetValue() ); - rCTLFont.SetWordLineMode( rItem.GetValue() ); - } - - // Emphasis - if( GetWhich( rSet, SID_ATTR_CHAR_EMPHASISMARK, nWhich ) ) - { - const SvxEmphasisMarkItem& rItem = static_cast<const SvxEmphasisMarkItem&>( rSet.Get( nWhich ) ); - FontEmphasisMark eMark = rItem.GetEmphasisMark(); - rFont.SetEmphasisMark( eMark ); - rCJKFont.SetEmphasisMark( eMark ); - rCTLFont.SetEmphasisMark( eMark ); - } - - // Relief - if( GetWhich( rSet, SID_ATTR_CHAR_RELIEF, nWhich ) ) - { - const SvxCharReliefItem& rItem = static_cast<const SvxCharReliefItem&>( rSet.Get( nWhich ) ); - FontRelief eFontRelief = rItem.GetValue(); - rFont.SetRelief( eFontRelief ); - rCJKFont.SetRelief( eFontRelief ); - rCTLFont.SetRelief( eFontRelief ); - } - - // Effects - if( GetWhich( rSet, SID_ATTR_CHAR_CASEMAP, nWhich ) ) - { - const SvxCaseMapItem& rItem = static_cast<const SvxCaseMapItem&>( rSet.Get( nWhich ) ); - SvxCaseMap eCaseMap = rItem.GetValue(); - rFont.SetCaseMap( eCaseMap ); - rCJKFont.SetCaseMap( eCaseMap ); - // #i78474# small caps do not exist in CTL fonts - rCTLFont.SetCaseMap( eCaseMap == SvxCaseMap::SmallCaps ? SvxCaseMap::NotMapped : eCaseMap ); - } - - // Outline - if( GetWhich( rSet, SID_ATTR_CHAR_CONTOUR, nWhich ) ) - { - const SvxContourItem& rItem = static_cast<const SvxContourItem&>( rSet.Get( nWhich ) ); - bool bOutline = rItem.GetValue(); - rFont.SetOutline( bOutline ); - rCJKFont.SetOutline( bOutline ); - rCTLFont.SetOutline( bOutline ); - } - - // Shadow - if( GetWhich( rSet, SID_ATTR_CHAR_SHADOWED, nWhich ) ) - { - const SvxShadowedItem& rItem = static_cast<const SvxShadowedItem&>( rSet.Get( nWhich ) ); - bool bShadow = rItem.GetValue(); - rFont.SetShadow( bShadow ); - rCJKFont.SetShadow( bShadow ); - rCTLFont.SetShadow( bShadow ); - } - - // Background - bool bTransparent; - if( GetWhich( rSet, bPreviewBackgroundToCharacter ? SID_ATTR_BRUSH : SID_ATTR_BRUSH_CHAR, nWhich ) ) - { - const SvxBrushItem& rBrush = static_cast<const SvxBrushItem&>( rSet.Get( nWhich ) ); - const Color& rColor = rBrush.GetColor(); - bTransparent = rColor.GetTransparency() > 0; - rFont.SetFillColor( rColor ); - rCJKFont.SetFillColor( rColor ); - rCTLFont.SetFillColor( rColor ); - } - else - bTransparent = TRUE; - - rFont.SetTransparent( bTransparent ); - rCJKFont.SetTransparent( bTransparent ); - rCTLFont.SetTransparent( bTransparent ); - - Color aBackCol( COL_TRANSPARENT ); - if( !bPreviewBackgroundToCharacter ) - { - if( GetWhich( rSet, SID_ATTR_BRUSH, nWhich ) ) - { - const SvxBrushItem& rBrush = static_cast<const SvxBrushItem&>( rSet.Get( nWhich ) ); - if( GPOS_NONE == rBrush.GetGraphicPos() ) - aBackCol = rBrush.GetColor(); - } - } - SetBackColor( aBackCol ); - - // Font - SetPrevFont( rSet, SID_ATTR_CHAR_FONT, rFont ); - SetPrevFont( rSet, SID_ATTR_CHAR_CJK_FONT, rCJKFont ); - SetPrevFont( rSet, SID_ATTR_CHAR_CTL_FONT, rCTLFont ); - - // Style - SetPrevFontStyle( rSet, SID_ATTR_CHAR_POSTURE, SID_ATTR_CHAR_WEIGHT, rFont ); - SetPrevFontStyle( rSet, SID_ATTR_CHAR_CJK_POSTURE, SID_ATTR_CHAR_CJK_WEIGHT, rCJKFont ); - SetPrevFontStyle( rSet, SID_ATTR_CHAR_CTL_POSTURE, SID_ATTR_CHAR_CTL_WEIGHT, rCTLFont ); - - // Size - SetFontSize( rSet, SID_ATTR_CHAR_FONTHEIGHT, rFont ); - SetFontSize( rSet, SID_ATTR_CHAR_CJK_FONTHEIGHT, rCJKFont ); - SetFontSize( rSet, SID_ATTR_CHAR_CTL_FONTHEIGHT, rCTLFont ); - - // Language - SetFontLang( rSet, SID_ATTR_CHAR_LANGUAGE, rFont ); - SetFontLang( rSet, SID_ATTR_CHAR_CJK_LANGUAGE, rCJKFont ); - SetFontLang( rSet, SID_ATTR_CHAR_CTL_LANGUAGE, rCTLFont ); - - // Color - if( GetWhich( rSet, SID_ATTR_CHAR_COLOR, nWhich ) ) - { - const SvxColorItem& rItem = static_cast<const SvxColorItem&>( rSet.Get( nWhich ) ); - Color aCol( rItem.GetValue() ); - rFont.SetColor( aCol ); - - rCJKFont.SetColor( aCol ); - rCTLFont.SetColor( aCol ); - - AutoCorrectFontColor(); // handle color COL_AUTO - } - - // Kerning - if( GetWhich( rSet, SID_ATTR_CHAR_KERNING, nWhich ) ) - { - const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>( rSet.Get( nWhich ) ); - short nKern = static_cast<short>(LogicToLogic( rItem.GetValue(), rSet.GetPool()->GetMetric( nWhich ), MapUnit::MapTwip )); - rFont.SetFixKerning( nKern ); - rCJKFont.SetFixKerning( nKern ); - rCTLFont.SetFixKerning( nKern ); - } - - // Escapement - const sal_uInt8 nProp = 100; - short nEsc; - sal_uInt8 nEscProp; - if( GetWhich( rSet, SID_ATTR_CHAR_ESCAPEMENT, nWhich ) ) - { - const SvxEscapementItem& rItem = static_cast<const SvxEscapementItem&>( rSet.Get( nWhich ) ); - nEsc = rItem.GetEsc(); - nEscProp = rItem.GetProportionalHeight(); - - if( nEsc == DFLT_ESC_AUTO_SUPER ) - nEsc = DFLT_ESC_SUPER; - else if( nEsc == DFLT_ESC_AUTO_SUB ) - nEsc = DFLT_ESC_SUB; - } - else - { - nEsc = 0; - nEscProp = 100; - } - SetPrevFontEscapement( rFont, nProp, nEscProp, nEsc ); - SetPrevFontEscapement( rCJKFont, nProp, nEscProp, nEsc ); - SetPrevFontEscapement( rCTLFont, nProp, nEscProp, nEsc ); - - // Font width scale - if( GetWhich( rSet, SID_ATTR_CHAR_SCALEWIDTH, nWhich ) ) - { - const SvxCharScaleWidthItem&rItem = static_cast<const SvxCharScaleWidthItem&>( rSet.Get( nWhich ) ); - SetFontWidthScale( rItem.GetValue() ); - } - - Invalidate(); -} - void SvxFontPrevWindow::Init(const SfxItemSet& rSet) { SvxFont& rFont = GetFont(); |