diff options
148 files changed, 849 insertions, 970 deletions
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 947396a060f3..fbf2cd7d0f29 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -1015,7 +1015,7 @@ Document::retrieveCharacterAttributes( //character font name aAttribs[i].Name = "CharFontName"; aAttribs[i].Handle = -1; - aAttribs[i].Value = css::uno::makeAny( aFont.GetFamilyName() ); + aAttribs[i].Value = css::uno::makeAny( aFont.GetName() ); aAttribs[i].State = css::beans::PropertyState_DIRECT_VALUE; i++; diff --git a/accessibility/source/helper/characterattributeshelper.cxx b/accessibility/source/helper/characterattributeshelper.cxx index 1fb79e743bb4..3f82d708959e 100644 --- a/accessibility/source/helper/characterattributeshelper.cxx +++ b/accessibility/source/helper/characterattributeshelper.cxx @@ -31,7 +31,7 @@ CharacterAttributesHelper::CharacterAttributesHelper( const vcl::Font& rFont, sa m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharColor" ), makeAny( (sal_Int32) nColor ) ) ); m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontCharSet" ), makeAny( (sal_Int16) rFont.GetCharSet() ) ) ); m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontFamily" ), makeAny( (sal_Int16) rFont.GetFamily() ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontName" ), makeAny( rFont.GetFamilyName() ) ) ); + m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontName" ), makeAny( rFont.GetName() ) ) ); m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontPitch" ), makeAny( (sal_Int16) rFont.GetPitch() ) ) ); m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontStyleName" ), makeAny( rFont.GetStyleName() ) ) ); m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharHeight" ), makeAny( (sal_Int16) rFont.GetSize().Height() ) ) ); diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index bc6177c4e3d9..2729774f1996 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1234,7 +1234,7 @@ void EditorWindow::ImplSetFont() vcl::Font aTmpFont(OutputDevice::GetDefaultFont(DefaultFontType::FIXED, Application::GetSettings().GetUILanguageTag().getLanguageType(), GetDefaultFontFlags::NONE, this)); - sFontName = aTmpFont.GetFamilyName(); + sFontName = aTmpFont.GetName(); } Size aFontSize(0, officecfg::Office::Common::Font::SourceViewFont::FontHeight::get()); vcl::Font aFont(sFontName, aFontSize); diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 1e076b3f2f4d..735ebdf24b33 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -499,7 +499,7 @@ namespace cairocanvas << (rSysFontData.bAntialias ? "AA " : "") << (rSysFontData.bFakeBold ? "FB " : "") << (rSysFontData.bFakeItalic ? "FI " : "") << " || Name:" - << aFont.GetFamilyName() << " - " + << aFont.GetName() << " - " << maText.Text.copy(maText.StartPosition, maText.Length)); cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size()); diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx index 1039115143e6..b25390c1fa2b 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.cxx +++ b/chart2/source/controller/dialogs/tp_DataSource.cxx @@ -248,7 +248,7 @@ DataSourceTabPage::DataSourceTabPage( // set symbol font for arrows // note: StarSymbol is substituted to OpenSymbol for OOo vcl::Font aSymbolFont( m_pBTN_UP->GetFont()); - aSymbolFont.SetFamilyName( "StarSymbol" ); + aSymbolFont.SetName( "StarSymbol" ); m_pBTN_UP->SetControlFont( aSymbolFont ); m_pBTN_DOWN->SetControlFont( aSymbolFont ); diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx index f190dfd537f9..9301e47cf770 100644 --- a/chart2/source/controller/main/ChartController_TextEdit.cxx +++ b/chart2/source/controller/main/ChartController_TextEdit.cxx @@ -167,7 +167,7 @@ void ChartController::executeDispatch_InsertSpecialCharacter() aSet.Put( SfxBoolItem( FN_PARAM_2, true ) ); //maybe not necessary in future vcl::Font aCurFont = m_pDrawViewWrapper->getOutliner()->GetRefDevice()->GetFont(); - aSet.Put( SvxFontItem( aCurFont.GetFamily(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), SID_ATTR_CHAR_FONT ) ); + aSet.Put( SvxFontItem( aCurFont.GetFamily(), aCurFont.GetName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), SID_ATTR_CHAR_FONT ) ); std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( m_pChartWindow, aSet, getFrame(), RID_SVXDLG_CHARMAP )); OSL_ENSURE( pDlg, "Couldn't create SvxCharacterMap dialog" ); diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx index cecaeb7511a1..cdc4de6b1442 100644 --- a/chart2/source/tools/CharacterProperties.cxx +++ b/chart2/source/tools/CharacterProperties.cxx @@ -414,7 +414,7 @@ void CharacterProperties::AddDefaultsToMap( nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aDefaultLocale_CTL, false), COMPLEX); vcl::Font aFontCTL = OutputDevice::GetDefaultFont( DefaultFontType::CTL_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_NAME, OUString( aFont.GetFamilyName() ) ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_NAME, OUString( aFont.GetName() ) ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_STYLE_NAME, OUString(aFont.GetStyleName()) ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_FAMILY, sal_Int16(aFont.GetFamily()) );//awt::FontFamily::SWISS ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_CHAR_SET, sal_Int16(aFont.GetCharSet()) );//use awt::CharSet::DONTKNOW instead of SYSTEM to avoid assertion issue 50249 @@ -444,7 +444,7 @@ void CharacterProperties::AddDefaultsToMap( ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_WEIGHT, awt::FontWeight::NORMAL ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_POSTURE, awt::FontSlant_NONE ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_LOCALE, aDefaultLocale_CJK ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_NAME, OUString( aFontCJK.GetFamilyName() ) ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_NAME, OUString( aFontCJK.GetName() ) ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_STYLE_NAME, OUString(aFontCJK.GetStyleName()) ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_FAMILY, sal_Int16(aFontCJK.GetFamily()) ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_CHAR_SET, sal_Int16(aFontCJK.GetCharSet()) ); @@ -455,7 +455,7 @@ void CharacterProperties::AddDefaultsToMap( ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_WEIGHT, awt::FontWeight::NORMAL ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_POSTURE, awt::FontSlant_NONE ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_LOCALE, aDefaultLocale_CTL ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_NAME, OUString( aFontCTL.GetFamilyName() ) ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_NAME, OUString( aFontCTL.GetName() ) ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_STYLE_NAME, OUString(aFontCTL.GetStyleName()) ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_FAMILY, sal_Int16(aFontCTL.GetFamily()) ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_CHAR_SET, sal_Int16(aFontCTL.GetCharSet()) ); diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index e2e54dfc80e2..fee3e34b0fff 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -757,7 +757,7 @@ struct FontAttribSetter if(rPropName == "CharFontName") { OUString aName = rProp.second.get<OUString>(); - mrFont.SetFamilyName(aName); + mrFont.SetName(aName); } else if(rPropName == "CharColor") { diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 69a5d66f51ac..4a3dae4036e0 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -759,7 +759,7 @@ namespace cppcanvas if( rParms.mrParms.maFontName.is_initialized() ) aFontRequest.FontDescription.FamilyName = *rParms.mrParms.maFontName; else - aFontRequest.FontDescription.FamilyName = rFont.GetFamilyName(); + aFontRequest.FontDescription.FamilyName = rFont.GetName(); aFontRequest.FontDescription.StyleName = rFont.GetStyleName(); diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index fa4d3314e412..b17931ca3df5 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -96,7 +96,7 @@ SvxCharacterMap::SvxCharacterMap( vcl::Window* pParent, bool bOne_, const SfxIte else if ( pFontNameItem ) { vcl::Font aTmpFont( GetCharFont() ); - aTmpFont.SetFamilyName( pFontNameItem->GetValue() ); + aTmpFont.SetName( pFontNameItem->GetValue() ); SetCharFont( aTmpFont ); } @@ -164,9 +164,9 @@ short SvxCharacterMap::Execute() const SfxItemPool* pPool = pSet->GetPool(); const vcl::Font& rFont( GetCharFont() ); pSet->Put( SfxStringItem( pPool->GetWhich(SID_CHARMAP), GetCharacters() ) ); - pSet->Put( SvxFontItem( rFont.GetFamily(), rFont.GetFamilyName(), + pSet->Put( SvxFontItem( rFont.GetFamily(), rFont.GetName(), rFont.GetStyleName(), rFont.GetPitch(), rFont.GetCharSet(), pPool->GetWhich(SID_ATTR_CHAR_FONT) ) ); - pSet->Put( SfxStringItem( pPool->GetWhich(SID_FONT_NAME), rFont.GetFamilyName() ) ); + pSet->Put( SfxStringItem( pPool->GetWhich(SID_FONT_NAME), rFont.GetName() ) ); pSet->Put( SfxInt32Item( pPool->GetWhich(SID_ATTR_CHAR), GetChar() ) ); } } @@ -325,12 +325,12 @@ void SvxCharacterMap::init() m_pShowText->Hide(); } - OUString aDefStr( aFont.GetFamilyName() ); + OUString aDefStr( aFont.GetName() ); OUString aLastName; int nCount = GetDevFontCount(); for ( int i = 0; i < nCount; i++ ) { - OUString aFontName( GetDevFont( i ).GetFamilyName() ); + OUString aFontName( GetDevFont( i ).GetName() ); if ( aFontName != aLastName ) { aLastName = aFontName; @@ -388,10 +388,10 @@ void SvxCharacterMap::SetCharFont( const vcl::Font& rFont ) // like "Times New Roman;Times" resolved vcl::Font aTmp( GetFontMetric( rFont ) ); - if ( m_pFontLB->GetEntryPos( aTmp.GetFamilyName() ) == LISTBOX_ENTRY_NOTFOUND ) + if ( m_pFontLB->GetEntryPos( aTmp.GetName() ) == LISTBOX_ENTRY_NOTFOUND ) return; - m_pFontLB->SelectEntry( aTmp.GetFamilyName() ); + m_pFontLB->SelectEntry( aTmp.GetName() ); aFont = aTmp; FontSelectHdl(*m_pFontLB); diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 3625d82722d5..362cdd12b87c 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -361,7 +361,7 @@ IMPL_LINK_TYPED(SvxFontSubstTabPage, NonPropFontsHdl, Button*, pBox, void) { const FontMetric& rFontMetric = aFntLst.GetFontName( nFont ); if(!bNonPropOnly || rFontMetric.GetPitch() == PITCH_FIXED) - m_pFontNameLB->InsertEntry(rFontMetric.GetFamilyName()); + m_pFontNameLB->InsertEntry(rFontMetric.GetName()); } m_pFontNameLB->SelectEntry(sFontName); } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 458d6546d2fe..2d6550eaccea 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -498,7 +498,7 @@ namespace if ( eState >= SfxItemState::DEFAULT ) { const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(&( _pPage->GetItemSet().Get( _nFontWhich ) )); - aFontMetrics.SetFamilyName(pFontItem->GetFamilyName()); + aFontMetrics.SetName(pFontItem->GetFamilyName()); aFontMetrics.SetStyleName(pFontItem->GetStyleName()); aFontMetrics.SetFamily(pFontItem->GetFamily()); aFontMetrics.SetPitch(pFontItem->GetPitch()); @@ -530,7 +530,7 @@ namespace _rFont.SetLanguage(_pLanguageLB->GetSelectLanguage()); _rFont.SetFamily( aFontMetrics.GetFamily() ); - _rFont.SetFamilyName( aFontMetrics.GetFamilyName() ); + _rFont.SetName( aFontMetrics.GetName() ); _rFont.SetStyleName( aFontMetrics.GetStyleName() ); _rFont.SetPitch( aFontMetrics.GetPitch() ); _rFont.SetCharSet( aFontMetrics.GetCharSet() ); @@ -934,7 +934,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp if ( nEntryPos >= m_pImpl->m_nExtraEntryPos ) aStyleBoxText.clear(); FontMetric aInfo( pFontList->Get( rFontName, aStyleBoxText ) ); - SvxFontItem aFontItem( aInfo.GetFamily(), aInfo.GetFamilyName(), aInfo.GetStyleName(), + SvxFontItem aFontItem( aInfo.GetFamily(), aInfo.GetName(), aInfo.GetStyleName(), aInfo.GetPitch(), aInfo.GetCharSet(), nWhich ); pOld = GetOldItem( rSet, nSlot ); diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 325f93012c5b..74c0f70dbe6d 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -723,7 +723,7 @@ IMPL_LINK_NOARG_TYPED(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, void) aFmt.SetSuffix(OUString()); if( !pLevelSettings->sBulletFont.isEmpty() && pLevelSettings->sBulletFont.compareTo( - rActBulletFont.GetFamilyName())) + rActBulletFont.GetName())) { //search for the font if(!pList) diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index db4db5197c0a..19574fa309a3 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -236,7 +236,7 @@ void OSqlEdit::ImplSetFont() if ( sFontName.isEmpty() ) { vcl::Font aTmpFont( OutputDevice::GetDefaultFont( DefaultFontType::FIXED, Application::GetSettings().GetUILanguageTag().getLanguageType(), GetDefaultFontFlags::NONE, this ) ); - sFontName = aTmpFont.GetFamilyName(); + sFontName = aTmpFont.GetName(); } Size aFontSize( 0, officecfg::Office::Common::Font::SourceViewFont::FontHeight::get() ); diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 1c4b3c596f43..ffbb1158b6a0 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -384,7 +384,7 @@ bool ORTFImportExport::Write() OString aFonts(OUStringToOString(m_aFont.Name, eDestEnc)); if (aFonts.isEmpty()) { - OUString aName = Application::GetSettings().GetStyleSettings().GetAppFont().GetFamilyName(); + OUString aName = Application::GetSettings().GetStyleSettings().GetAppFont().GetName(); aFonts = OUStringToOString(aName, eDestEnc); } diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index f58d8a0e19ef..4afe19ce221c 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1225,7 +1225,7 @@ static char* getFonts (const char* pCommand) aChildren.push_back(std::make_pair("", aChild)); nSizeCount++; } - aValues.add_child(rFontMetric.GetFamilyName().toUtf8().getStr(), aChildren); + aValues.add_child(rFontMetric.GetName().toUtf8().getStr(), aChildren); } } aTree.add_child("commandValues", aValues); @@ -1530,7 +1530,7 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/, for (sal_uInt16 i = 0; i < nFontCount; ++i) { const FontMetric& rFontMetric = pList->GetFontName(i); - OUString aFontName = rFontMetric.GetFamilyName(); + OUString aFontName = rFontMetric.GetName(); if (!aSearchedFontName.equals(aFontName.toUtf8().getStr())) continue; diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 092e71cff25c..ee7df1f3c161 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -440,7 +440,7 @@ namespace drawinglayer bool bBiDiStrong) { const attribute::FontAttribute aRetval( - rFont.GetFamilyName(), + rFont.GetName(), rFont.GetStyleName(), static_cast<sal_uInt16>(rFont.GetWeight()), RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(), diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index fdc9d6a65e02..a556fd3ef137 100644 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -83,7 +83,7 @@ void EditCharAttribFont::SetFont( SvxFont& rFont, OutputDevice* ) { const SvxFontItem& rAttr = static_cast<const SvxFontItem&>(*GetItem()); - rFont.SetFamilyName( rAttr.GetFamilyName() ); + rFont.SetName( rAttr.GetFamilyName() ); rFont.SetFamily( rAttr.GetFamily() ); rFont.SetPitch( rAttr.GetPitch() ); rFont.SetCharSet( rAttr.GetCharSet() ); diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index f1207662c9fb..58be84016e0b 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -2035,7 +2035,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S if ( bSearchInParent || ( rSet.GetItemState( nWhich_FontInfo ) == SfxItemState::SET ) ) { const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(rSet.Get( nWhich_FontInfo )); - rFont.SetFamilyName( rFontItem.GetFamilyName() ); + rFont.SetName( rFontItem.GetFamilyName() ); rFont.SetFamily( rFontItem.GetFamily() ); rFont.SetPitch( rFontItem.GetPitch() ); rFont.SetCharSet( rFontItem.GetCharSet() ); diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index ad52b0f22033..d6b3e669ee81 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2565,7 +2565,7 @@ void EditEngine::SetFontInfoInItemSet( SfxItemSet& rSet, const vcl::Font& rFont void EditEngine::SetFontInfoInItemSet( SfxItemSet& rSet, const SvxFont& rFont ) { rSet.Put( SvxLanguageItem( rFont.GetLanguage(), EE_CHAR_LANGUAGE ) ); - rSet.Put( SvxFontItem( rFont.GetFamily(), rFont.GetFamilyName(), OUString(), rFont.GetPitch(), rFont.GetCharSet(), EE_CHAR_FONTINFO ) ); + rSet.Put( SvxFontItem( rFont.GetFamily(), rFont.GetName(), OUString(), rFont.GetPitch(), rFont.GetCharSet(), EE_CHAR_FONTINFO ) ); rSet.Put( SvxFontHeightItem( rFont.GetSize().Height(), 100, EE_CHAR_FONTHEIGHT ) ); rSet.Put( SvxCharScaleWidthItem( 100, EE_CHAR_FONTWIDTH ) ); rSet.Put( SvxShadowedItem( rFont.IsShadow(), EE_CHAR_SHADOW ) ); diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index 52a1d8919ab2..584634c9c435 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -653,13 +653,13 @@ void EditHTMLParser::ImpSetStyleSheet( sal_uInt16 nHLevel ) if ( nHLevel == STYLE_PRE ) { vcl::Font aFont = OutputDevice::GetDefaultFont( DefaultFontType::FIXED, LANGUAGE_SYSTEM, GetDefaultFontFlags::NONE ); - SvxFontItem aFontItem( aFont.GetFamily(), aFont.GetFamilyName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO ); + SvxFontItem aFontItem( aFont.GetFamily(), aFont.GetName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO ); aItems.Put( aFontItem ); - SvxFontItem aFontItemCJK( aFont.GetFamily(), aFont.GetFamilyName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO_CJK ); + SvxFontItem aFontItemCJK( aFont.GetFamily(), aFont.GetName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO_CJK ); aItems.Put( aFontItemCJK ); - SvxFontItem aFontItemCTL( aFont.GetFamily(), aFont.GetFamilyName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO_CTL ); + SvxFontItem aFontItemCTL( aFont.GetFamily(), aFont.GetName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO_CTL ); aItems.Put( aFontItemCTL ); } diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index bcf5da84c2f1..a918adf2e008 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -152,7 +152,7 @@ void EditRTFParser::AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& r aSz = mpEditEngine->GetRefDevice()->LogicToLogic(aSz, &aPntMode, &_aEditMapMode); SvxFontHeightItem aFontHeightItem( aSz.Width(), 100, EE_CHAR_FONTHEIGHT ); vcl::Font aDefFont( GetDefFont() ); - SvxFontItem aFontItem( aDefFont.GetFamily(), aDefFont.GetFamilyName(), + SvxFontItem aFontItem( aDefFont.GetFamily(), aDefFont.GetName(), aDefFont.GetStyleName(), aDefFont.GetPitch(), aDefFont.GetCharSet(), EE_CHAR_FONTINFO ); sal_Int32 nStartPara = mpEditEngine->GetEditDoc().GetPos( rStart.GetNode() ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 1cc860aa9a76..fac9787daa03 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2600,7 +2600,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo if ( ( nScriptTypeI18N == i18n::ScriptType::ASIAN ) || ( nScriptTypeI18N == i18n::ScriptType::COMPLEX ) ) { const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ) )); - rFont.SetFamilyName( rFontItem.GetFamilyName() ); + rFont.SetName( rFontItem.GetFamilyName() ); rFont.SetFamily( rFontItem.GetFamily() ); rFont.SetPitch( rFontItem.GetPitch() ); rFont.SetCharSet( rFontItem.GetCharSet() ); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 6e0d3434a910..beaf19680d3c 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1661,7 +1661,7 @@ void ImpEditEngine::SetLanguageAndFont( { // set new font attribute SvxFontItem aFontItem = static_cast<const SvxFontItem&>( aNewSet.Get( nFontWhichId ) ); - aFontItem.SetFamilyName( pFont->GetFamilyName()); + aFontItem.SetFamilyName( pFont->GetName()); aFontItem.SetFamily( pFont->GetFamily()); aFontItem.SetStyleName( pFont->GetStyleName()); aFontItem.SetPitch( pFont->GetPitch()); diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx index deb8acb62852..78077148985b 100644 --- a/editeng/source/editeng/textconv.cxx +++ b/editeng/source/editeng/textconv.cxx @@ -252,7 +252,7 @@ void TextConvWrapper::SetLanguageAndFont( const ESelection &rESel, { // set new font attribute SvxFontItem aFontItem = static_cast<const SvxFontItem&>( aNewSet.Get( nFontWhichId ) ); - aFontItem.SetFamilyName( pFont->GetFamilyName()); + aFontItem.SetFamilyName( pFont->GetName()); aFontItem.SetFamily( pFont->GetFamily()); aFontItem.SetStyleName( pFont->GetStyleName()); aFontItem.SetPitch( pFont->GetPitch()); diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index 199c50cfd002..2791bf44293c 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -50,8 +50,8 @@ void SvxBulletItem::StoreFont( SvStream& rStream, const vcl::Font& rFont ) nTemp = (sal_uInt16)rFont.GetStrikeout(); rStream.WriteUInt16( nTemp ); nTemp = (sal_uInt16)rFont.GetItalic(); rStream.WriteUInt16( nTemp ); - // UNICODE: rStream << rFont.GetFamilyName(); - rStream.WriteUniOrByteString(rFont.GetFamilyName(), rStream.GetStreamCharSet()); + // UNICODE: rStream << rFont.GetName(); + rStream.WriteUniOrByteString(rFont.GetName(), rStream.GetStreamCharSet()); rStream.WriteBool( rFont.IsOutline() ); rStream.WriteBool( rFont.IsShadow() ); @@ -79,9 +79,9 @@ vcl::Font SvxBulletItem::CreateFont( SvStream& rStream, sal_uInt16 nVer ) rStream.ReadUInt16( nTemp ); aFont.SetStrikeout((FontStrikeout)nTemp); rStream.ReadUInt16( nTemp ); aFont.SetItalic((FontItalic)nTemp); - // UNICODE: rStream >> aName; aFont.SetFamilyName( aName ); + // UNICODE: rStream >> aName; aFont.SetName( aName ); OUString aName = rStream.ReadUniOrByteString(rStream.GetStreamCharSet()); - aFont.SetFamilyName( aName ); + aFont.SetName( aName ); if( nVer == 1 ) { @@ -231,7 +231,7 @@ void SvxBulletItem::CopyValidProperties( const SvxBulletItem& rCopyFrom ) { vcl::Font _aFont = GetFont(); vcl::Font aNewFont = rCopyFrom.GetFont(); - _aFont.SetFamilyName( aNewFont.GetFamilyName() ); + _aFont.SetName( aNewFont.GetName() ); _aFont.SetFamily( aNewFont.GetFamily() ); _aFont.SetStyleName( aNewFont.GetStyleName() ); _aFont.SetColor( aNewFont.GetColor() ); diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index b6247b4b4d3a..4d59e45f176e 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -249,7 +249,7 @@ void SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pConverte { cBullet = ConvertFontToSubsFontChar(pConverter, cBullet); OUString sFontName = GetFontToSubsFontName(pConverter); - pBulletFont->SetFamilyName(sFontName); + pBulletFont->SetName(sFontName); } rStream.WriteUInt16( NUMITEM_VERSION_04 ); @@ -677,7 +677,7 @@ void SvxNumRule::Store( SvStream &rStream ) { if(!pConverter) pConverter = - CreateFontToSubsFontConverter(aFmts[i]->GetBulletFont()->GetFamilyName(), + CreateFontToSubsFontConverter(aFmts[i]->GetBulletFont()->GetName(), FontToSubsFontFlags::EXPORT|FontToSubsFontFlags::ONLYOLDSOSYMBOLFONTS); } aFmts[i]->Store(rStream, pConverter); diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 411ecb7a3846..2837368be930 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -149,7 +149,7 @@ SvxFontListItem::SvxFontListItem( const FontList* pFontLst, aFontNameSeq.realloc( nCount ); for ( sal_Int32 i = 0; i < nCount; i++ ) - aFontNameSeq[i] = pFontList->GetFontName(i).GetFamilyName(); + aFontNameSeq[i] = pFontList->GetFontName(i).GetName(); } } @@ -3541,7 +3541,7 @@ void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rCo GetDefaultFontFlags::OnlyOne ) ); SvxFontItem* pItem = aItemArr[ n ]; pItem->SetFamily( aFont.GetFamily() ); - pItem->SetFamilyName( aFont.GetFamilyName() ); + pItem->SetFamilyName( aFont.GetName() ); pItem->SetStyleName( OUString() ); pItem->SetPitch( aFont.GetPitch()); pItem->SetCharSet(aFont.GetCharSet()); diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx index 869783e6f886..f63a44f5ad45 100644 --- a/editeng/source/misc/acorrcfg.cxx +++ b/editeng/source/misc/acorrcfg.cxx @@ -432,7 +432,7 @@ void SvxSwAutoCorrCfg::Load(bool bInit) case 17: { OUString sTemp; pValues[nProp] >>= sTemp; - rSwFlags.aBulletFont.SetFamilyName(sTemp); + rSwFlags.aBulletFont.SetName(sTemp); } break; // "Format/Option/ChangeToBullets/SpecialCharacter/Font", case 18: @@ -508,7 +508,7 @@ void SvxSwAutoCorrCfg::Load(bool bInit) case 43 : { OUString sTemp; pValues[nProp] >>= sTemp; - rSwFlags.aByInputBulletFont.SetFamilyName(sTemp); + rSwFlags.aByInputBulletFont.SetName(sTemp); } break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/Font", case 44 : @@ -582,7 +582,7 @@ void SvxSwAutoCorrCfg::ImplCommit() pValues[nProp] <<= (sal_Int32)rSwFlags.cBullet; break; // "Format/Option/ChangeToBullets/SpecialCharacter/Char", case 17: - pValues[nProp] <<= OUString(rSwFlags.aBulletFont.GetFamilyName()); + pValues[nProp] <<= OUString(rSwFlags.aBulletFont.GetName()); break; // "Format/Option/ChangeToBullets/SpecialCharacter/Font", case 18: pValues[nProp] <<= (sal_Int32)rSwFlags.aBulletFont.GetFamily(); @@ -626,7 +626,7 @@ void SvxSwAutoCorrCfg::ImplCommit() pValues[nProp] <<= (sal_Int32)rSwFlags.cByInputBullet; break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/Char", case 43 : - pValues[nProp] <<= OUString(rSwFlags.aByInputBulletFont.GetFamilyName()); + pValues[nProp] <<= OUString(rSwFlags.aByInputBulletFont.GetName()); break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/Font", case 44 : pValues[nProp] <<= (sal_Int32)rSwFlags.aByInputBulletFont.GetFamily(); diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index 91d17414d980..68582a73073f 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -642,7 +642,7 @@ SET_FONTALIGNMENT: { const vcl::Font& rSVFont = GetFont( sal_uInt16(nTokenValue) ); SvxFontItem aTmpItem( rSVFont.GetFamily(), - rSVFont.GetFamilyName(), rSVFont.GetStyleName(), + rSVFont.GetName(), rSVFont.GetStyleName(), rSVFont.GetPitch(), rSVFont.GetCharSet(), SID_ATTR_CHAR_FONT ); SetScriptAttr( eCharType, *pSet, aTmpItem ); @@ -1823,7 +1823,7 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) nValue = 0; const vcl::Font& rSVFont = GetFont( sal_uInt16(nValue) ); SvxFontItem aTmpItem( - rSVFont.GetFamily(), rSVFont.GetFamilyName(), + rSVFont.GetFamily(), rSVFont.GetName(), rSVFont.GetStyleName(), rSVFont.GetPitch(), rSVFont.GetCharSet(), SID_ATTR_CHAR_FONT ); SetScriptAttr( NOTDEF_CHARTYPE, aTmp, aTmpItem ); diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 893ee1a15b16..83a804d343f0 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -563,7 +563,7 @@ void SvxRTFParser::ReadFontTable() if (!sAltNm.isEmpty()) sFntNm = sFntNm + ";" + sAltNm; - pFont->SetFamilyName( sFntNm ); + pFont->SetName( sFntNm ); m_FontTable.insert(std::make_pair(nInsFontNo, std::move(pFont))); pFont.reset(new vcl::Font); pFont->SetCharSet( nSystemChar ); @@ -806,7 +806,7 @@ const vcl::Font& SvxRTFParser::GetFont( sal_uInt16 nId ) } const SvxFontItem& rDfltFont = static_cast<const SvxFontItem&>( pAttrPool->GetDefaultItem( aPlainMap.nFont )); - pDfltFont->SetFamilyName( rDfltFont.GetStyleName() ); + pDfltFont->SetName( rDfltFont.GetStyleName() ); pDfltFont->SetFamily( rDfltFont.GetFamily() ); return *pDfltFont; } diff --git a/editeng/source/uno/unofdesc.cxx b/editeng/source/uno/unofdesc.cxx index dcc488599e6c..368513d03ae1 100644 --- a/editeng/source/uno/unofdesc.cxx +++ b/editeng/source/uno/unofdesc.cxx @@ -40,7 +40,7 @@ using namespace ::com::sun::star; void SvxUnoFontDescriptor::ConvertToFont( const awt::FontDescriptor& rDesc, vcl::Font& rFont ) { - rFont.SetFamilyName( rDesc.Name ); + rFont.SetName( rDesc.Name ); rFont.SetStyleName( rDesc.StyleName ); rFont.SetSize( Size( rDesc.Width, rDesc.Height ) ); rFont.SetFamily( (FontFamily)rDesc.Family ); @@ -57,7 +57,7 @@ void SvxUnoFontDescriptor::ConvertToFont( const awt::FontDescriptor& rDesc, vcl: void SvxUnoFontDescriptor::ConvertFromFont( const vcl::Font& rFont, awt::FontDescriptor& rDesc ) { - rDesc.Name = rFont.GetFamilyName(); + rDesc.Name = rFont.GetName(); rDesc.StyleName = rFont.GetStyleName(); rDesc.Width = sal::static_int_cast< sal_Int16 >(rFont.GetSize().Width()); rDesc.Height = sal::static_int_cast< sal_Int16 >(rFont.GetSize().Height()); diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx index 5b82177e737e..bef80878706a 100644 --- a/extensions/source/propctrlr/fontdialog.cxx +++ b/extensions/source/propctrlr/fontdialog.cxx @@ -493,7 +493,7 @@ namespace pcr vcl::Font aDefaultVCLFont = Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont(); SfxPoolItem** pCounter = _rppDefaults; // want to modify this without affecting the out param _rppDefaults - *pCounter++ = new SvxFontItem(aDefaultVCLFont.GetFamily(), aDefaultVCLFont.GetFamilyName(), aDefaultVCLFont.GetStyleName(), aDefaultVCLFont.GetPitch(), aDefaultVCLFont.GetCharSet(), CFID_FONT); + *pCounter++ = new SvxFontItem(aDefaultVCLFont.GetFamily(), aDefaultVCLFont.GetName(), aDefaultVCLFont.GetStyleName(), aDefaultVCLFont.GetPitch(), aDefaultVCLFont.GetCharSet(), CFID_FONT); *pCounter++ = new SvxFontHeightItem(aDefaultVCLFont.GetHeight(), 100, CFID_HEIGHT); *pCounter++ = new SvxWeightItem(aDefaultVCLFont.GetWeight(), CFID_WEIGHT); *pCounter++ = new SvxPostureItem(aDefaultVCLFont.GetItalic(), CFID_POSTURE); @@ -505,7 +505,7 @@ namespace pcr *pCounter++ = new SvxCharReliefItem(aDefaultVCLFont.GetRelief(), CFID_RELIEF); *pCounter++ = new SvxEmphasisMarkItem(aDefaultVCLFont.GetEmphasisMark(), CFID_EMPHASIS); - *pCounter++ = new SvxFontItem(aDefaultVCLFont.GetFamily(), aDefaultVCLFont.GetFamilyName(), aDefaultVCLFont.GetStyleName(), aDefaultVCLFont.GetPitch(), aDefaultVCLFont.GetCharSet(), CFID_CJK_FONT); + *pCounter++ = new SvxFontItem(aDefaultVCLFont.GetFamily(), aDefaultVCLFont.GetName(), aDefaultVCLFont.GetStyleName(), aDefaultVCLFont.GetPitch(), aDefaultVCLFont.GetCharSet(), CFID_CJK_FONT); *pCounter++ = new SvxFontHeightItem(aDefaultVCLFont.GetHeight(), 100, CFID_CJK_HEIGHT); *pCounter++ = new SvxWeightItem(aDefaultVCLFont.GetWeight(), CFID_CJK_WEIGHT); *pCounter++ = new SvxPostureItem(aDefaultVCLFont.GetItalic(), CFID_CJK_POSTURE); diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index 260b29b857a0..82480e20ff53 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -371,7 +371,7 @@ void Writer::setClipping( const tools::PolyPolygon* pClipPolyPolygon ) // that we care about. bool compare_fonts_for_me(const vcl::Font& rFont1, const vcl::Font& rFont2) { - return rFont1.GetFamilyName() == rFont2.GetFamilyName() && + return rFont1.GetName() == rFont2.GetName() && rFont1.GetWeight() == rFont2.GetWeight() && rFont1.GetItalic() == rFont2.GetItalic() && rFont1.IsOutline() == rFont2.IsOutline() && diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index 984f234991c7..9ec66e92268c 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -2292,7 +2292,7 @@ void OS2METReader::ReadFont(sal_uInt16 nFieldSize) OUString aStr( str, strlen(str), osl_getThreadTextEncoding() ); if ( aStr.compareToIgnoreAsciiCase( "Helv" ) == 0 ) aStr = "Helvetica"; - pF->aFont.SetFamilyName( aStr ); + pF->aFont.SetName( aStr ); break; } } diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index e7bbf7125b71..00d5392ab385 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -1571,7 +1571,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) pPict->Read( &sFName, nLen ); sFName[ nLen ] = 0; OUString aString( sFName, strlen(sFName), osl_getThreadTextEncoding() ); - aActFont.SetFamilyName( aString ); + aActFont.SetName( aString ); eActMethod=PDM_UNDEFINED; break; } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 971b5717b52e..c34f8dc42968 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -2150,7 +2150,7 @@ bool SdrPowerPointImport::ReadFontCollection() vcl::Font aFont; aFont.SetCharSet( pFont->eCharSet ); - aFont.SetFamilyName( pFont->aName ); + aFont.SetName( pFont->aName ); aFont.SetFamily( pFont->eFamily ); aFont.SetPitch( pFont->ePitch ); aFont.SetHeight( 100 ); @@ -3631,7 +3631,7 @@ void PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx { vcl::Font aFont; aFont.SetCharSet( pFontEnityAtom->eCharSet ); - aFont.SetFamilyName( pFontEnityAtom->aName ); + aFont.SetName( pFontEnityAtom->aName ); aFont.SetFamily( pFontEnityAtom->eFamily ); aFont.SetPitch( pFontEnityAtom->ePitch ); rNumberFormat.SetBulletFont( &aFont ); @@ -3690,7 +3690,7 @@ bool PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx { vcl::Font aFont; aFont.SetCharSet( pFontEnityAtom->eCharSet ); - aFont.SetFamilyName( pFontEnityAtom->aName ); + aFont.SetName( pFontEnityAtom->aName ); aFont.SetFamily( pFontEnityAtom->eFamily ); aFont.SetPitch( pFontEnityAtom->ePitch ); rNumberFormat.SetBulletFont( &aFont ); @@ -3710,7 +3710,7 @@ void PPTNumberFormatCreator::ImplGetNumberFormat( SdrPowerPointImport& rManager, if ( pAtom ) { rtl_TextEncoding eCharSet( pAtom->eCharSet ); - aFont.SetFamilyName( pAtom->aName ); + aFont.SetName( pAtom->aName ); aFont.SetCharSet( eCharSet ); aFont.SetFamily( pAtom->eFamily ); aFont.SetPitch( pAtom->ePitch ); diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx index 16aa15751712..2d62da72117b 100644 --- a/filter/source/svg/svgfontexport.cxx +++ b/filter/source/svg/svgfontexport.cxx @@ -53,7 +53,7 @@ SVGFontExport::GlyphSet& SVGFontExport::implGetGlyphSet( const vcl::Font& rFont { FontWeight eWeight( WEIGHT_NORMAL ); FontItalic eItalic( ITALIC_NONE ); - OUString aFontName( rFont.GetFamilyName() ); + OUString aFontName( rFont.GetName() ); sal_Int32 nNextTokenPos( 0 ); switch( rFont.GetWeight() ) @@ -222,7 +222,7 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont ) else aFontStyle = "normal"; - mrExport.AddAttribute( XML_NAMESPACE_NONE, "font-family", GetMappedFontName( rFont.GetFamilyName() ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "font-family", GetMappedFontName( rFont.GetName() ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, "units-per-em", aUnitsPerEM ); mrExport.AddAttribute( XML_NAMESPACE_NONE, "font-weight", aFontWeight ); mrExport.AddAttribute( XML_NAMESPACE_NONE, "font-style", aFontStyle ); @@ -314,7 +314,7 @@ void SVGFontExport::EmbedFonts() { vcl::Font aFont; - aFont.SetFamilyName( (*aGlyphTreeIter).first ); + aFont.SetName( (*aGlyphTreeIter).first ); aFont.SetWeight( (*aFontWeightIter).first ); aFont.SetItalic( (*aFontItalicIter).first ); diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 5b602718734c..8613369d3432 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -377,12 +377,12 @@ void SVGAttributeWriter::setFontFamily() { if( mrExport.IsUsePositionedCharacters() ) { - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFontFamily, mrFontExport.GetMappedFontName( maCurFont.GetFamilyName() ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFontFamily, mrFontExport.GetMappedFontName( maCurFont.GetName() ) ); } else { sal_Int32 nNextTokenPos( 0 ); - const OUString& rsFontName = maCurFont.GetFamilyName(); + const OUString& rsFontName = maCurFont.GetName(); OUString sFontFamily( rsFontName.getToken( 0, ';', nNextTokenPos ) ); FontPitch ePitch = maCurFont.GetPitch(); if( ePitch == PITCH_FIXED ) @@ -729,12 +729,12 @@ void SVGTextWriter::addFontAttributes( bool bIsTextContainer ) if( maCurrentFont != maParentFont ) { - const OUString& rsCurFontName = maCurrentFont.GetFamilyName(); + const OUString& rsCurFontName = maCurrentFont.GetName(); long int nCurFontSize = maCurrentFont.GetHeight(); FontItalic eCurFontItalic = maCurrentFont.GetItalic(); FontWeight eCurFontWeight = maCurrentFont.GetWeight(); - const OUString& rsParFontName = maParentFont.GetFamilyName(); + const OUString& rsParFontName = maParentFont.GetName(); long int nParFontSize = maParentFont.GetHeight(); FontItalic eParFontItalic = maParentFont.GetItalic(); FontWeight eParFontWeight = maParentFont.GetWeight(); @@ -840,7 +840,7 @@ void SVGTextWriter::addFontAttributes( bool bIsTextContainer ) void SVGTextWriter::implSetFontFamily() { sal_Int32 nNextTokenPos( 0 ); - const OUString& rsFontName = maCurrentFont.GetFamilyName(); + const OUString& rsFontName = maCurrentFont.GetName(); OUString sFontFamily( rsFontName.getToken( 0, ';', nNextTokenPos ) ); FontPitch ePitch = maCurrentFont.GetPitch(); if( ePitch == PITCH_FIXED ) diff --git a/forms/source/richtext/richtextengine.cxx b/forms/source/richtext/richtextengine.cxx index f0d10d11ac6d..ede2b4dccb9e 100644 --- a/forms/source/richtext/richtextengine.cxx +++ b/forms/source/richtext/richtextengine.cxx @@ -39,6 +39,9 @@ namespace frm { + + + //= RichTextEngine @@ -59,8 +62,8 @@ namespace frm // defaults vcl::Font aFont = Application::GetSettings().GetStyleSettings().GetAppFont(); - aFont.SetFamilyName( "Times New Roman" ); - pPool->SetPoolDefaultItem( SvxFontItem( aFont.GetFamily(), aFont.GetFamilyName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO ) ); + aFont.SetName( "Times New Roman" ); + pPool->SetPoolDefaultItem( SvxFontItem( aFont.GetFamily(), aFont.GetName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO ) ); // 12 pt font size MapMode aPointMapMode( MAP_POINT ); diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx index bf50ab7da401..c8a2c2df9037 100644 --- a/include/vcl/font.hxx +++ b/include/vcl/font.hxx @@ -43,57 +43,33 @@ namespace vcl { class VCL_DLLPUBLIC Font { -public: - explicit Font(); - Font( const Font& ); // TODO make me explicit - explicit Font( const OUString& rFamilyName, const Size& ); - explicit Font( const OUString& rFamilyName, const OUString& rStyleName, const Size& ); - explicit Font( FontFamily eFamily, const Size& ); - virtual ~Font(); - - const OUString& GetFamilyName() const; - FontFamily GetFamily(); - FontFamily GetFamily() const; - const OUString& GetStyleName() const; - - FontWeight GetWeight(); - FontWeight GetWeight() const; - FontItalic GetItalic(); - FontItalic GetItalic() const; - FontPitch GetPitch(); - FontPitch GetPitch() const; - FontWidth GetWidthType(); - FontWidth GetWidthType() const; - rtl_TextEncoding GetCharSet() const; - FontAlign GetAlign() const; - - bool IsSymbolFont() const; - - void SetFamilyName( const OUString& rFamilyName ); - void SetStyleName( const OUString& rStyleName ); - void SetFamily( FontFamily ); - - void SetPitch( FontPitch ePitch ); - void SetItalic( FontItalic ); - void SetWeight( FontWeight ); - void SetWidthType( FontWidth ); - void SetCharSet( rtl_TextEncoding ); - void SetAlign( FontAlign ); +private: + ImplFont* mpImplFont; + void MakeUnique(); - void SetSymbolFlag( bool ); +public: + Font(); + Font( const Font& ); + Font( const OUString& rFamilyName, const Size& ); + Font( const OUString& rFamilyName, const OUString& rStyleName, const Size& ); + Font( FontFamily eFamily, const Size& ); + ~Font(); // setting the color on the font is obsolete, the only remaining // valid use is for keeping backward compatibility with old MetaFiles - const Color& GetColor() const; - const Color& GetFillColor() const; - - bool IsTransparent() const; - void SetColor( const Color& ); + const Color& GetColor() const; void SetFillColor( const Color& ); - + const Color& GetFillColor() const; void SetTransparent( bool bTransparent ); + bool IsTransparent() const; + void SetAlign( FontAlign ); + FontAlign GetAlign() const; + void SetName( const OUString& rFamilyName ); + const OUString& GetName() const; + void SetStyleName( const OUString& rStyleName ); + const OUString& GetStyleName() const; void SetSize( const Size& ); const Size& GetSize() const; void SetHeight( long nHeight ); @@ -101,6 +77,14 @@ public: void SetWidth( long nWidth ); long GetWidth() const; + void SetFamily( FontFamily ); + FontFamily GetFamily(); + FontFamily GetFamily() const; + void SetCharSet( rtl_TextEncoding ); + rtl_TextEncoding GetCharSet() const; + void SetSymbolFlag( bool ); + bool IsSymbolFont() const; + // Prefer LanguageTag over LanguageType void SetLanguageTag( const LanguageTag & ); const LanguageTag& GetLanguageTag() const; @@ -110,6 +94,9 @@ public: LanguageType GetLanguage() const; void SetCJKContextLanguage( LanguageType ); LanguageType GetCJKContextLanguage() const; + void SetPitch( FontPitch ePitch ); + FontPitch GetPitch(); + FontPitch GetPitch() const; void SetOrientation( short nLineOrientation ); short GetOrientation() const; @@ -117,8 +104,17 @@ public: bool IsVertical() const; void SetKerning( FontKerning nKerning ); FontKerning GetKerning() const; - bool IsKerning() const; + bool IsKerning() const; + void SetWeight( FontWeight ); + FontWeight GetWeight(); + FontWeight GetWeight() const; + void SetWidthType( FontWidth ); + FontWidth GetWidthType(); + FontWidth GetWidthType() const; + void SetItalic( FontItalic ); + FontItalic GetItalic(); + FontItalic GetItalic() const; void SetOutline( bool bOutline ); bool IsOutline() const; void SetShadow( bool bShadow ); @@ -149,11 +145,6 @@ public: friend VCL_DLLPUBLIC SvStream& ::WriteFont( SvStream& rOStm, const vcl::Font& ); static Font identifyFont( const void* pBuffer, sal_uInt32 nLen ); - -private: - ImplFont* mpImplFont; - void MakeUnique(); - }; } diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx index a263fdadd36b..e37b91ffac75 100644 --- a/include/vcl/metric.hxx +++ b/include/vcl/metric.hxx @@ -38,9 +38,9 @@ typedef boost::intrusive_ptr< ImplFontMetric > ImplFontMetricPtr; class VCL_DLLPUBLIC FontMetric : public vcl::Font { public: - explicit FontMetric(); - FontMetric( const FontMetric& ); // TODO make this explicit - virtual ~FontMetric(); + FontMetric(); + FontMetric( const FontMetric& ); + ~FontMetric(); FontType GetType() const; @@ -81,7 +81,7 @@ inline std::basic_ostream<charT, traits> & operator <<( std::basic_ostream<charT, traits> & stream, const FontMetric& rMetric ) { stream << "{" - << "name=" << "\"" << rMetric.GetFamilyName() << "\"" + << "name=" << "\"" << rMetric.GetName() << "\"" << ",size=(" << rMetric.GetSize().Width() << "," << rMetric.GetSize().Height() << ")" << ",ascent=" << rMetric.GetAscent() << ",descent=" << rMetric.GetDescent() diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 873d6bf93a0a..6a5263f1e0e0 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -380,7 +380,7 @@ namespace if ( SfxItemState::SET == _rItemSet.GetItemState( _nFont,true,&pItem) && dynamic_cast< const SvxFontItem *>( pItem ) != nullptr) { const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(pItem); - aNewFont.SetFamilyName(pFontItem->GetFamilyName()); + aNewFont.SetName( pFontItem->GetFamilyName()); aNewFont.SetStyleName(pFontItem->GetStyleName()); aNewFont.SetFamily(pFontItem->GetFamily()); aNewFont.SetPitch(pFontItem->GetPitch()); diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 05e7fa8c9543..e1eb4955e627 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -197,7 +197,7 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool) vcl::Font aStdFont = OutputDevice::GetDefaultFont( DefaultFontType::LATIN_SPREADSHEET, LANGUAGE_ENGLISH_US, GetDefaultFontFlags::OnlyOne ); SvxFontItem* pStdFont = new SvxFontItem( aStdFont.GetFamily(), - aStdFont.GetFamilyName(), aStdFont.GetStyleName(), + aStdFont.GetName(), aStdFont.GetStyleName(), aStdFont.GetPitch(), aStdFont.GetCharSet(), ATTR_FONT ); diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 01039b195d50..61ab5ca3424f 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -368,8 +368,8 @@ void ScPatternAttr::GetFont( // FontItem: - if (rFont.GetFamilyName() != pFontAttr->GetFamilyName()) - rFont.SetFamilyName( pFontAttr->GetFamilyName() ); + if (rFont.GetName() != pFontAttr->GetFamilyName()) + rFont.SetName( pFontAttr->GetFamilyName() ); if (rFont.GetStyleName() != pFontAttr->GetStyleName()) rFont.SetStyleName( pFontAttr->GetStyleName() ); diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index aec6dcbd3b91..450445486cf0 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -202,7 +202,7 @@ static void lcl_CheckFont( SfxItemSet& rSet, LanguageType eLang, DefaultFontType if ( eLang != LANGUAGE_NONE && eLang != LANGUAGE_DONTKNOW && eLang != LANGUAGE_SYSTEM ) { vcl::Font aDefFont = OutputDevice::GetDefaultFont( nFontType, eLang, GetDefaultFontFlags::OnlyOne ); - SvxFontItem aNewItem( aDefFont.GetFamily(), aDefFont.GetFamilyName(), aDefFont.GetStyleName(), + SvxFontItem aNewItem( aDefFont.GetFamily(), aDefFont.GetName(), aDefFont.GetStyleName(), aDefFont.GetPitch(), aDefFont.GetCharSet(), nItemId ); if ( aNewItem != rSet.Get( nItemId ) ) { diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index aa10ec5946dd..46db04a9c451 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -825,19 +825,19 @@ ScAutoFormat::ScAutoFormat() : vcl::Font aStdFont = OutputDevice::GetDefaultFont( DefaultFontType::LATIN_SPREADSHEET, LANGUAGE_ENGLISH_US, GetDefaultFontFlags::OnlyOne ); SvxFontItem aFontItem( - aStdFont.GetFamily(), aStdFont.GetFamilyName(), aStdFont.GetStyleName(), + aStdFont.GetFamily(), aStdFont.GetName(), aStdFont.GetStyleName(), aStdFont.GetPitch(), aStdFont.GetCharSet(), ATTR_FONT ); aStdFont = OutputDevice::GetDefaultFont( DefaultFontType::CJK_SPREADSHEET, LANGUAGE_ENGLISH_US, GetDefaultFontFlags::OnlyOne ); SvxFontItem aCJKFontItem( - aStdFont.GetFamily(), aStdFont.GetFamilyName(), aStdFont.GetStyleName(), + aStdFont.GetFamily(), aStdFont.GetName(), aStdFont.GetStyleName(), aStdFont.GetPitch(), aStdFont.GetCharSet(), ATTR_CJK_FONT ); aStdFont = OutputDevice::GetDefaultFont( DefaultFontType::CTL_SPREADSHEET, LANGUAGE_ENGLISH_US, GetDefaultFontFlags::OnlyOne ); SvxFontItem aCTLFontItem( - aStdFont.GetFamily(), aStdFont.GetFamilyName(), aStdFont.GetStyleName(), + aStdFont.GetFamily(), aStdFont.GetName(), aStdFont.GetStyleName(), aStdFont.GetPitch(), aStdFont.GetCharSet(), ATTR_CTL_FONT ); SvxFontHeightItem aHeight( 200, 100, ATTR_FONT_HEIGHT ); // 10 pt; diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 18edb9072e2d..8299b9dcfea1 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -729,7 +729,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico ScPatternAttr::GetFont( aFont, aItemSet, SC_AUTOCOL_RAW ); // font name and style - aNewData.maName = XclTools::GetXclFontName( aFont.GetFamilyName() ); + aNewData.maName = XclTools::GetXclFontName( aFont.GetName() ); aNewData.mnWeight = (aFont.GetWeight() > WEIGHT_NORMAL) ? EXC_FONTWGHT_BOLD : EXC_FONTWGHT_NORMAL; aNewData.mbItalic = (aFont.GetItalic() != ITALIC_NONE); bool bNewFont = !(aFontData.maName == aNewData.maName); diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx index 3b8b6de243b8..9005282156d9 100644 --- a/sc/source/filter/excel/xlstyle.cxx +++ b/sc/source/filter/excel/xlstyle.cxx @@ -198,7 +198,7 @@ void XclFontData::Clear() void XclFontData::FillFromVclFont( const vcl::Font& rFont ) { - maName = XclTools::GetXclFontName( rFont.GetFamilyName() ); // substitute with MS fonts + maName = XclTools::GetXclFontName( rFont.GetName() ); // substitute with MS fonts maStyle.clear(); maColor = rFont.GetColor(); SetScUnderline( rFont.GetUnderline() ); diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index dc3fcec3f330..3ea7a9ac8be2 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -314,7 +314,7 @@ static inline void lcl_FillProperty( PropertyValue& rVal, const OUString& rPropN /** Fills the sequence with all font attributes of rFont. */ static void lcl_FillFontAttributes( Sequence< PropertyValue >& rSeq, const vcl::Font& rFont ) { - SvxFontItem aFontItem( rFont.GetFamily(), rFont.GetFamilyName(), rFont.GetStyleName(), rFont.GetPitch(), rFont.GetCharSet(), ATTR_FONT ); + SvxFontItem aFontItem( rFont.GetFamily(), rFont.GetName(), rFont.GetStyleName(), rFont.GetPitch(), rFont.GetCharSet(), ATTR_FONT ); SvxFontHeightItem aHeightItem( rFont.GetSize().Height(), 100, ATTR_FONT_HEIGHT ); SvxLanguageItem aLangItem( rFont.GetLanguage(), ATTR_FONT_LANGUAGE ); diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 5efc9c74d180..ad25cd7ea48d 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -231,7 +231,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq ) { OUString aFontName(pFontItem->GetValue()); vcl::Font aFont(aFontName, Size(1,1)); // Size nur wg. CTOR - aNewItem = SvxFontItem( aFont.GetFamily(), aFont.GetFamilyName(), + aNewItem = SvxFontItem( aFont.GetFamily(), aFont.GetName(), aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), ATTR_FONT ); } @@ -261,7 +261,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq ) if ( pReqArgs->GetItemState( SID_HYPERLINK_SETLINK, true, &pItem ) == SfxItemState::SET ) { const SvxHyperlinkItem* pHyper = static_cast<const SvxHyperlinkItem*>(pItem); - const OUString& rName = pHyper->GetName(); + const OUString& rName = pHyper->GetName(); const OUString& rURL = pHyper->GetURL(); const OUString& rTarget = pHyper->GetTargetFrame(); SvxLinkInsertMode eMode = pHyper->GetInsertMode(); diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index 647c2d5023ad..7a911868a2a2 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -103,7 +103,7 @@ static void lcl_SetFontProperties( const SvxPostureItem& rPostureItem ) { rFont.SetFamily ( rFontItem.GetFamily() ); - rFont.SetFamilyName ( rFontItem.GetFamilyName() ); + rFont.SetName ( rFontItem.GetFamilyName() ); rFont.SetStyleName ( rFontItem.GetStyleName() ); rFont.SetCharSet ( rFontItem.GetCharSet() ); rFont.SetPitch ( rFontItem.GetPitch() ); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index e389787209a0..e4c790b7bb93 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2352,7 +2352,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) SfxAllItemSet aSet( GetPool() ); aSet.Put( SfxBoolItem( FN_PARAM_1, false ) ); - aSet.Put( SvxFontItem( aCurFont.GetFamily(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), GetPool().GetWhich(SID_ATTR_CHAR_FONT) ) ); + aSet.Put( SvxFontItem( aCurFont.GetFamily(), aCurFont.GetName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), GetPool().GetWhich(SID_ATTR_CHAR_FONT) ) ); std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( pTabViewShell->GetDialogParent(), aSet, pTabViewShell->GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP )); diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 01b54bdc566b..109376b75a1f 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -399,7 +399,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) { OUString aFontName(pFontItem->GetValue()); vcl::Font aFont(aFontName, Size(1,1)); // Size just because CTOR - aNewItem = SvxFontItem( aFont.GetFamily(), aFont.GetFamilyName(), + aNewItem = SvxFontItem( aFont.GetFamily(), aFont.GetName(), aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), ATTR_FONT ); } diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 267fa8b04e48..e88e5da8ba25 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -2975,7 +2975,7 @@ void ScViewFunc::InsertSpecialChar( const OUString& rStr, const vcl::Font& rFont const sal_Unicode* pChar = rStr.getStr(); ScTabViewShell* pViewShell = GetViewData().GetViewShell(); SvxFontItem aFontItem( rFont.GetFamily(), - rFont.GetFamilyName(), + rFont.GetName(), rFont.GetStyleName(), rFont.GetPitch(), rFont.GetCharSet(), diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 7424e800fb02..fc50caf9a1f2 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -185,13 +185,13 @@ void SdDrawDocument::CreateLayoutTemplates() getDefaultFonts( aLatinFont, aCJKFont, aCTLFont ); - SvxFontItem aSvxFontItem( aLatinFont.GetFamily(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(), + SvxFontItem aSvxFontItem( aLatinFont.GetFamily(), aLatinFont.GetName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(), aLatinFont.GetCharSet(), EE_CHAR_FONTINFO ); - SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamily(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(), + SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamily(), aCJKFont.GetName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(), aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK ); - SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamily(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(), + SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamily(), aCTLFont.GetName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(), aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL ); rISet.Put( aSvxFontItem ); @@ -564,13 +564,13 @@ void SdDrawDocument::CreateDefaultCellStyles() getDefaultFonts( aLatinFont, aCJKFont, aCTLFont ); - SvxFontItem aSvxFontItem( aLatinFont.GetFamily(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(), + SvxFontItem aSvxFontItem( aLatinFont.GetFamily(), aLatinFont.GetName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(), aLatinFont.GetCharSet(), EE_CHAR_FONTINFO ); - SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamily(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(), + SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamily(), aCJKFont.GetName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(), aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK ); - SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamily(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(), + SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamily(), aCTLFont.GetName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(), aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL ); rISet.Put( aSvxFontItem ); diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 0df8f1c5fa32..bc1f18b7ae35 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -192,13 +192,13 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const OUString& rLayoutName, bool mpDoc->getDefaultFonts( aLatinFont, aCJKFont, aCTLFont ); // Font for title and outline - SvxFontItem aSvxFontItem( aLatinFont.GetFamily(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(), + SvxFontItem aSvxFontItem( aLatinFont.GetFamily(), aLatinFont.GetName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(), aLatinFont.GetCharSet(), EE_CHAR_FONTINFO ); - SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamily(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(), + SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamily(), aCJKFont.GetName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(), aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK ); - SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamily(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(), + SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamily(), aCTLFont.GetName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(), aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL ); vcl::Font aBulletFont( GetBulletFont() ); diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index 63982286c944..51a434477f49 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -1410,7 +1410,7 @@ sal_uInt32 FontCollection::GetId( FontCollectionEntry& rEntry ) } vcl::Font aFont; aFont.SetCharSet( rEntry.CharSet ); - aFont.SetFamilyName( rEntry.Original ); + aFont.SetName( rEntry.Original ); aFont.SetHeight( 100 ); if ( !pVDev ) diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index b1192422599f..2d09b7a587be 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -110,7 +110,7 @@ SfxItemPool* GetAnnotationPool() mpAnnotationPool->SetPoolDefaultItem(SvxFontHeightItem(423,100,EE_CHAR_FONTHEIGHT)); vcl::Font aAppFont( Application::GetSettings().GetStyleSettings().GetAppFont() ); - mpAnnotationPool->SetPoolDefaultItem(SvxFontItem(aAppFont.GetFamily(),aAppFont.GetFamilyName(),"",PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); + mpAnnotationPool->SetPoolDefaultItem(SvxFontItem(aAppFont.GetFamily(),aAppFont.GetName(),"",PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); } return mpAnnotationPool; diff --git a/sd/source/ui/func/bulmaper.cxx b/sd/source/ui/func/bulmaper.cxx index 96316eb88945..2f27d91b2495 100644 --- a/sd/source/ui/func/bulmaper.cxx +++ b/sd/source/ui/func/bulmaper.cxx @@ -66,7 +66,7 @@ void SdBulletMapper::MapFontsInNumRule( SvxNumRule& aNumRule, const SfxItemSet& const SvxFontItem& rFItem = static_cast<const SvxFontItem&>(rSet.Get(GetWhich( (sal_uInt16)nFontID ))); aMyFont.SetFamily(rFItem.GetFamily()); - aMyFont.SetFamilyName(rFItem.GetFamilyName()); + aMyFont.SetName(rFItem.GetFamilyName()); aMyFont.SetCharSet(rFItem.GetCharSet()); aMyFont.SetPitch(rFItem.GetPitch()); diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index 5e5d4fdc669e..445e4e8a3bc4 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -205,7 +205,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq ) const SvxFontItem* pFItem = SfxItemSet::GetItem<SvxFontItem>(pDlg->GetOutputItemSet(), SID_ATTR_CHAR_FONT, false); if ( pFItem ) { - aFont.SetFamilyName( pFItem->GetFamilyName() ); + aFont.SetName( pFItem->GetFamilyName() ); aFont.SetStyleName( pFItem->GetStyleName() ); aFont.SetCharSet( pFItem->GetCharSet() ); aFont.SetPitch( pFItem->GetPitch() ); @@ -261,7 +261,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq ) // set attributes (set font) SfxItemSet aSet(pOL->GetEmptyItemSet()); - SvxFontItem aFontItem (aFont.GetFamily(), aFont.GetFamilyName(), + SvxFontItem aFontItem (aFont.GetFamily(), aFont.GetName(), aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO); diff --git a/sd/source/ui/func/fuhhconv.cxx b/sd/source/ui/func/fuhhconv.cxx index 380d760c8e37..fa55949b149d 100644 --- a/sd/source/ui/func/fuhhconv.cxx +++ b/sd/source/ui/func/fuhhconv.cxx @@ -171,7 +171,7 @@ void FuHangulHanjaConversion::ConvertStyles( sal_Int16 nTargetLanguage, const vc { // set new font attribute SvxFontItem aFontItem( static_cast<const SvxFontItem&>( rSet.Get( EE_CHAR_FONTINFO_CJK ) ) ); - aFontItem.SetFamilyName( pTargetFont->GetFamilyName()); + aFontItem.SetFamilyName( pTargetFont->GetName()); aFontItem.SetFamily( pTargetFont->GetFamily()); aFontItem.SetStyleName( pTargetFont->GetStyleName()); aFontItem.SetPitch( pTargetFont->GetPitch()); diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx index 6f08a5d7e0d5..502f52c2f38c 100644 --- a/sd/source/ui/presenter/PresenterTextView.cxx +++ b/sd/source/ui/presenter/PresenterTextView.cxx @@ -312,7 +312,7 @@ EditEngine* PresenterTextView::Implementation::CreateEditEngine() mpEditEngineItemPool->SetPoolDefaultItem( SvxFontItem( aFont.GetFamily(), - aFont.GetFamilyName(), + aFont.GetName(), aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 66bdc03540b5..ab3e8ecc2291 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -134,7 +134,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie maBulletFont.SetColor( COL_AUTO ); maBulletFont.SetHeight( 1000 ); maBulletFont.SetCharSet(RTL_TEXTENCODING_MS_1252); // and replacing other values by standard - maBulletFont.SetFamilyName( "StarSymbol" ); + maBulletFont.SetName( "StarSymbol" ); maBulletFont.SetWeight(WEIGHT_NORMAL); maBulletFont.SetUnderline(UNDERLINE_NONE); maBulletFont.SetStrikeout(STRIKEOUT_NONE); diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 24f626d3fd48..d6c91b76cb8a 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -160,7 +160,7 @@ SmFontFormat::SmFontFormat() SmFontFormat::SmFontFormat( const vcl::Font &rFont ) { - aName = rFont.GetFamilyName(); + aName = rFont.GetName(); nCharSet = (sal_Int16) rFont.GetCharSet(); nFamily = (sal_Int16) rFont.GetFamily(); nPitch = (sal_Int16) rFont.GetPitch(); @@ -172,7 +172,7 @@ SmFontFormat::SmFontFormat( const vcl::Font &rFont ) const vcl::Font SmFontFormat::GetFont() const { vcl::Font aRes; - aRes.SetFamilyName( aName ); + aRes.SetName( aName ); aRes.SetCharSet( (rtl_TextEncoding) nCharSet ); aRes.SetFamily( (FontFamily) nFamily ); aRes.SetPitch( (FontPitch) nPitch ); @@ -881,7 +881,7 @@ void SmMathConfig::LoadFormat() if (bUseDefaultFont) { aFnt = pFormat->GetFont( i ); - aFnt.SetFamilyName( GetDefaultFontName( nLang, i ) ); + aFnt.SetName( GetDefaultFontName( nLang, i ) ); } else { diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index b6e95594c612..852bc1b564ef 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -271,7 +271,7 @@ void SmShowFont::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRec rRenderContext.SetFont(aFont); rRenderContext.SetTextColor(aTextColor); - OUString sText(rRenderContext.GetFont().GetFamilyName()); + OUString sText(rRenderContext.GetFont().GetName()); Size aTextSize(rRenderContext.GetTextWidth(sText), rRenderContext.GetTextHeight()); rRenderContext.DrawText(Point((rRenderContext.GetOutputSize().Width() - aTextSize.Width()) / 2, @@ -302,7 +302,7 @@ void SmShowFont::SetFont(const vcl::Font& rFont) IMPL_LINK_TYPED( SmFontDialog, FontSelectHdl, ComboBox&, rComboBox, void ) { - maFont.SetFamilyName(rComboBox.GetText()); + maFont.SetName(rComboBox.GetText()); m_pShowFont->SetFont(maFont); } @@ -336,7 +336,7 @@ void SmFontDialog::SetFont(const vcl::Font &rFont) { maFont = rFont; - m_pFontBox->SetText(maFont.GetFamilyName()); + m_pFontBox->SetText(maFont.GetName()); m_pBoldCheckBox->Check(IsBold(maFont)); m_pItalicCheckBox->Check(IsItalic(maFont)); m_pShowFont->SetFont(maFont); @@ -360,7 +360,7 @@ SmFontDialog::SmFontDialog(vcl::Window * pParent, OutputDevice *pFntListDevice, sal_uInt16 nCount = aFontList.GetFontNameCount(); for (sal_uInt16 i = 0; i < nCount; ++i) { - m_pFontBox->InsertEntry( aFontList.GetFontName(i).GetFamilyName() ); + m_pFontBox->InsertEntry( aFontList.GetFontName(i).GetName() ); } maFont.SetSize(Size(0, 24)); maFont.SetWeight(WEIGHT_NORMAL); @@ -1758,7 +1758,7 @@ void SmSymDefineDialog::FillFonts(bool bDelete) { sal_uInt16 nCount = pFontList->GetFontNameCount(); for (sal_uInt16 i = 0; i < nCount; i++) - pFonts->InsertEntry( pFontList->GetFontName(i).GetFamilyName() ); + pFonts->InsertEntry( pFontList->GetFontName(i).GetName() ); } } @@ -2018,7 +2018,7 @@ void SmSymDefineDialog::UpdateButtons() && aTmpSymbolSetName.equalsIgnoreAsciiCase(pOldSymbolSetName->GetText()) && aTmpSymbolName.equals(pOrigSymbol->GetName()) && pFonts->GetSelectEntry().equalsIgnoreAsciiCase( - pOrigSymbol->GetFace().GetFamilyName()) + pOrigSymbol->GetFace().GetName()) && pStyles->GetText().equalsIgnoreAsciiCase( GetFontStyles().GetStyleName(pOrigSymbol->GetFace())) && pCharsetDisplay->GetSelectCharacter() == pOrigSymbol->GetCharacter(); @@ -2281,7 +2281,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, { // choose font and style accordingly const vcl::Font &rFont = pSymbol->GetFace(); - SelectFont(rFont.GetFamilyName(), false); + SelectFont(rFont.GetName(), false); SelectStyle(GetFontStyles().GetStyleName(rFont), false); // Since setting the Font via the Style name of the SymbolFonts doesn't diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 53f33fdf39b2..41c6d6cd1bcf 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -336,7 +336,7 @@ void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool) vcl::Font aFont = OutputDevice::GetDefaultFont( rFntDta.nFontType, nLang, GetDefaultFontFlags::OnlyOne ); rEditEngineItemPool.SetPoolDefaultItem( - SvxFontItem( aFont.GetFamily(), aFont.GetFamilyName(), + SvxFontItem( aFont.GetFamily(), aFont.GetName(), aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), rFntDta.nFontInfoId ) ); } diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx index c1917dabb61f..94222820af1d 100644 --- a/starmath/source/format.cxx +++ b/starmath/source/format.cxx @@ -89,7 +89,7 @@ OUString GetDefaultFontName( LanguageType nLang, sal_uInt16 nIdent ) return OutputDevice::GetDefaultFont( pTable[ nIdent ], nLang, - GetDefaultFontFlags::OnlyOne ).GetFamilyName(); + GetDefaultFontFlags::OnlyOne ).GetName(); } } diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index ebacd2cc27b7..7e430252a14f 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -133,7 +133,7 @@ void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat, aSize = Size(rDev.GetTextWidth(rText), rDev.GetTextHeight()); const FontMetric aFM (rDev.GetFontMetric()); - bool bIsMath = aFM.GetFamilyName().equalsIgnoreAsciiCase( FONTNAME_MATH ); + bool bIsMath = aFM.GetName().equalsIgnoreAsciiCase( FONTNAME_MATH ); bool bAllowSmaller = bIsMath && !SmIsMathAlpha(rText); const long nFontHeight = rDev.GetFont().GetSize().Height(); diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index d0c7d79a2775..2c19f8a28e85 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -454,7 +454,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any* if(sFontName.isEmpty()) throw IllegalArgumentException(); - if(OUString(aFormat.GetFont((*ppEntries)->mnMemberId).GetFamilyName()) != sFontName) + if(OUString(aFormat.GetFont((*ppEntries)->mnMemberId).GetName()) != sFontName) { const SmFace rOld = aFormat.GetFont((*ppEntries)->mnMemberId); @@ -661,7 +661,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any* for (sal_uInt32 i = 0; i < nSize ; i++, pDescriptor++) { vcl::Font aFont; - aFont.SetFamilyName ( pDescriptor->sFontName ); + aFont.SetName ( pDescriptor->sFontName ); aFont.SetCharSet ( static_cast < rtl_TextEncoding > (pDescriptor->nCharSet) ); aFont.SetFamily ( static_cast < FontFamily > (pDescriptor->nFamily ) ); aFont.SetPitch ( static_cast < FontPitch > (pDescriptor->nPitch ) ); @@ -727,7 +727,7 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu case HANDLE_CUSTOM_FONT_NAME_FIXED : { const SmFace & rFace = aFormat.GetFont((*ppEntries)->mnMemberId); - *pValue <<= OUString(rFace.GetFamilyName()); + *pValue <<= OUString(rFace.GetName()); } break; case HANDLE_CUSTOM_FONT_FIXED_POSTURE: @@ -879,7 +879,7 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu pDescriptor->nCharacter = static_cast < sal_Int32 > ((*aIter)->GetCharacter()); vcl::Font rFont = (*aIter)->GetFace(); - pDescriptor->sFontName = rFont.GetFamilyName(); + pDescriptor->sFontName = rFont.GetName(); pDescriptor->nCharSet = sal::static_int_cast< sal_Int16 >(rFont.GetCharSet()); pDescriptor->nFamily = sal::static_int_cast< sal_Int16 >(rFont.GetFamily()); pDescriptor->nPitch = sal::static_int_cast< sal_Int16 >(rFont.GetPitch()); diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx index cfb4917881e3..f66c385dc72d 100644 --- a/starmath/source/utility.cxx +++ b/starmath/source/utility.cxx @@ -73,7 +73,7 @@ vcl::Font SmFontPickList::Get(sal_uInt16 nPos) const bool SmFontPickList::CompareItem(const vcl::Font & rFirstFont, const vcl::Font & rSecondFont) { - return rFirstFont.GetFamilyName() == rSecondFont.GetFamilyName() && + return rFirstFont.GetName() == rSecondFont.GetName() && rFirstFont.GetFamily() == rSecondFont.GetFamily() && rFirstFont.GetCharSet() == rSecondFont.GetCharSet() && rFirstFont.GetWeight() == rSecondFont.GetWeight() && @@ -82,7 +82,7 @@ bool SmFontPickList::CompareItem(const vcl::Font & rFirstFont, const vcl::Font & OUString SmFontPickList::GetStringItem(const vcl::Font &rFont) { - OUStringBuffer aString(rFont.GetFamilyName()); + OUStringBuffer aString(rFont.GetName()); if (IsItalic( rFont )) { diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 8bd7b594b08a..5c411202463c 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1036,7 +1036,7 @@ void FontNameBox::Fill( const FontList* pList ) for ( sal_uInt16 i = 0; i < nFontCount; i++ ) { const FontMetric& rFontMetric = pList->GetFontName( i ); - sal_uLong nIndex = InsertEntry( rFontMetric.GetFamilyName() ); + sal_uLong nIndex = InsertEntry( rFontMetric.GetName() ); if ( nIndex != LISTBOX_ERROR ) { if ( nIndex < mpFontList->size() ) { @@ -1140,7 +1140,7 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) Rectangle aTextRect; // Preview the font name - OUString sFontName = rFontMetric.GetFamilyName(); + OUString sFontName = rFontMetric.GetName(); //If it shouldn't or can't draw its own name because it doesn't have the glyphs if (!canRenderNameOfSelectedFont(*pRenderContext)) @@ -1171,7 +1171,7 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) if (!bSymbolFont) { - const bool bNameBeginsWithLatinText = rFontMetric.GetFamilyName()[0] <= 'z'; + const bool bNameBeginsWithLatinText = rFontMetric.GetName()[0] <= 'z'; if (bNameBeginsWithLatinText || !bUsingCorrectFont) sSampleText = makeShortRepresentativeTextForSelectedFont(*pRenderContext); diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx index ccbb3a13ef5f..fcaac738b646 100644 --- a/svtools/source/control/ctrltool.cxx +++ b/svtools/source/control/ctrltool.cxx @@ -259,7 +259,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, bool bAll, if ( !bAll && (aFontMetric.GetType() == TYPE_RASTER) ) continue; - OUString aSearchName(aFontMetric.GetFamilyName()); + OUString aSearchName(aFontMetric.GetName()); ImplFontListNameInfo* pData; sal_uLong nIndex; aSearchName = ImplMakeSearchString(aSearchName); @@ -483,13 +483,13 @@ OUString FontList::GetStyleName(const FontMetric& rInfo) const OUString FontList::GetFontMapText( const FontMetric& rInfo ) const { - if ( rInfo.GetFamilyName().isEmpty() ) + if ( rInfo.GetName().isEmpty() ) { return OUString(); } // Search Fontname - ImplFontListNameInfo* pData = ImplFindByName( rInfo.GetFamilyName() ); + ImplFontListNameInfo* pData = ImplFindByName( rInfo.GetName() ); if ( !pData ) { if (maMapNotAvailable.isEmpty()) @@ -649,7 +649,7 @@ FontMetric FontList::Get(const OUString& rName, const OUString& rStyleName) cons aInfo = *pFontMetric; // set Fontname to keep FontAlias - aInfo.SetFamilyName( rName ); + aInfo.SetName( rName ); aInfo.SetStyleName( rStyleName ); return aInfo; @@ -686,7 +686,7 @@ FontMetric FontList::Get(const OUString& rName, aInfo = *pFontMetric; // set Fontname to keep FontAlias - aInfo.SetFamilyName( rName ); + aInfo.SetName( rName ); return aInfo; } @@ -734,12 +734,12 @@ const sal_IntPtr* FontList::GetSizeAry( const FontMetric& rInfo ) const } // use standard sizes if no name - if ( rInfo.GetFamilyName().isEmpty() ) + if ( rInfo.GetName().isEmpty() ) return aStdSizeAry; // first search fontname in order to use device from the matching font OutputDevice* pDevice = mpDev; - ImplFontListNameInfo* pData = ImplFindByName( rInfo.GetFamilyName() ); + ImplFontListNameInfo* pData = ImplFindByName( rInfo.GetName() ); if ( pData ) pDevice = pData->mpFirst->GetDevice(); diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx index 6e0e55e8f4a9..55eb7ba54d92 100644 --- a/svtools/source/control/stdmenu.cxx +++ b/svtools/source/control/stdmenu.cxx @@ -57,7 +57,7 @@ void FontNameMenu::Fill( const FontList* pList ) sal_uInt16 nFontCount = ::std::min( pList->GetFontNameCount(), static_cast< sal_uInt16 >(100) ); for (sal_uInt16 i = 0; i < nFontCount; ++i) { - const OUString& rName = pList->GetFontName( i ).GetFamilyName(); + const OUString& rName = pList->GetFontName( i ).GetName(); // sort with the I18nHelper sal_uInt16 j = GetItemCount(); diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx index ebe0e7863ecd..4ba252b5702c 100644 --- a/svtools/source/misc/sampletext.cxx +++ b/svtools/source/misc/sampletext.cxx @@ -19,7 +19,7 @@ // that caused it to be added static UScriptCode lcl_getHardCodedScriptNameForFont (const OutputDevice &rDevice) { - const OUString &rName = rDevice.GetFont().GetFamilyName(); + const OUString &rName = rDevice.GetFont().GetName(); if (rName == "GB18030 Bitmap") { @@ -105,49 +105,49 @@ static UScriptCode lcl_getHardCodedScriptNameForFont (const OutputDevice &rDevic bool isOpenSymbolFont(const vcl::Font &rFont) { - return rFont.GetFamilyName().equalsIgnoreAsciiCase("starsymbol") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("opensymbol"); + return rFont.GetName().equalsIgnoreAsciiCase("starsymbol") || + rFont.GetName().equalsIgnoreAsciiCase("opensymbol"); } bool isSymbolFont(const vcl::Font &rFont) { return (rFont.GetCharSet() == RTL_TEXTENCODING_SYMBOL) || - rFont.GetFamilyName().equalsIgnoreAsciiCase("Apple Color Emoji") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("cmsy10") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("cmex10") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("esint10") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("feta26") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("jsMath-cmsy10") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("jsMath-cmex10") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("msam10") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("msbm10") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("wasy10") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("Denemo") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("GlyphBasic1") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("GlyphBasic2") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("GlyphBasic3") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("GlyphBasic4") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("Letters Laughing") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("MusiQwik") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("MusiSync") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("stmary10") || - rFont.GetFamilyName().equalsIgnoreAsciiCase("Symbol") || - rFont.GetFamilyName().startsWith("STIXIntegrals") || - rFont.GetFamilyName().startsWith("STIXNonUnicode") || - rFont.GetFamilyName().startsWith("STIXSize") || - rFont.GetFamilyName().startsWith("STIXVariants") || + rFont.GetName().equalsIgnoreAsciiCase("Apple Color Emoji") || + rFont.GetName().equalsIgnoreAsciiCase("cmsy10") || + rFont.GetName().equalsIgnoreAsciiCase("cmex10") || + rFont.GetName().equalsIgnoreAsciiCase("esint10") || + rFont.GetName().equalsIgnoreAsciiCase("feta26") || + rFont.GetName().equalsIgnoreAsciiCase("jsMath-cmsy10") || + rFont.GetName().equalsIgnoreAsciiCase("jsMath-cmex10") || + rFont.GetName().equalsIgnoreAsciiCase("msam10") || + rFont.GetName().equalsIgnoreAsciiCase("msbm10") || + rFont.GetName().equalsIgnoreAsciiCase("wasy10") || + rFont.GetName().equalsIgnoreAsciiCase("Denemo") || + rFont.GetName().equalsIgnoreAsciiCase("GlyphBasic1") || + rFont.GetName().equalsIgnoreAsciiCase("GlyphBasic2") || + rFont.GetName().equalsIgnoreAsciiCase("GlyphBasic3") || + rFont.GetName().equalsIgnoreAsciiCase("GlyphBasic4") || + rFont.GetName().equalsIgnoreAsciiCase("Letters Laughing") || + rFont.GetName().equalsIgnoreAsciiCase("MusiQwik") || + rFont.GetName().equalsIgnoreAsciiCase("MusiSync") || + rFont.GetName().equalsIgnoreAsciiCase("stmary10") || + rFont.GetName().equalsIgnoreAsciiCase("Symbol") || + rFont.GetName().startsWith("STIXIntegrals") || + rFont.GetName().startsWith("STIXNonUnicode") || + rFont.GetName().startsWith("STIXSize") || + rFont.GetName().startsWith("STIXVariants") || isOpenSymbolFont(rFont); } bool canRenderNameOfSelectedFont(OutputDevice &rDevice) { const vcl::Font &rFont = rDevice.GetFont(); - return !isSymbolFont(rFont) && ( -1 == rDevice.HasGlyphs(rFont, rFont.GetFamilyName()) ); + return !isSymbolFont(rFont) && ( -1 == rDevice.HasGlyphs(rFont, rFont.GetName()) ); } OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice &rDevice) { - if (rDevice.GetFont().GetFamilyName() == "Symbol") + if (rDevice.GetFont().GetName() == "Symbol") { static const sal_Unicode aImplAppleSymbolText[] = { 0x03BC, 0x2202, 0x2211, 0x220F, 0x03C0, 0x222B, 0x03A9, 0x221A, 0}; diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 55d95ee29c69..5deea9502202 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -160,7 +160,7 @@ void CalculateHorizontalScalingFactor( const SdrObject* pCustomShape, const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(pCustomShape->GetMergedItem( EE_CHAR_FONTINFO )); aFont.SetHeight( pCustomShape->GetLogicRect().GetHeight() / rFWData.nMaxParagraphsPerTextArea ); aFont.SetAlign( ALIGN_TOP ); - aFont.SetFamilyName( rFontItem.GetFamilyName() ); + aFont.SetName( rFontItem.GetFamilyName() ); aFont.SetFamily( rFontItem.GetFamily() ); aFont.SetStyleName( rFontItem.GetStyleName() ); aFont.SetOrientation( 0 ); @@ -248,7 +248,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F aFont.SetHeight( rFWData.nSingleLineHeight ); aFont.SetAlign( ALIGN_TOP ); - aFont.SetFamilyName( rFontItem.GetFamilyName() ); + aFont.SetName( rFontItem.GetFamilyName() ); aFont.SetFamily( rFontItem.GetFamily() ); aFont.SetStyleName( rFontItem.GetStyleName() ); aFont.SetOrientation( 0 ); diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 682035c8f6f4..1aa7a6ddca15 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -673,7 +673,7 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl if ((pImpl->m_bCJKEnabled) || (pImpl->m_bCTLEnabled)) pImpl->maText = makeRepresentativeTextForFont(LATIN, rFont); else - pImpl->maText = rFont.GetFamilyName(); + pImpl->maText = rFont.GetName(); if (pImpl->m_bCJKEnabled) { @@ -878,7 +878,7 @@ static void SetPrevFont(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont { const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(rSet.Get(nWhich)); rFont.SetFamily(rFontItem.GetFamily()); - rFont.SetFamilyName(rFontItem.GetFamilyName()); + rFont.SetName(rFontItem.GetFamilyName()); rFont.SetPitch(rFontItem.GetPitch()); rFont.SetCharSet(rFontItem.GetCharSet()); rFont.SetStyleName(rFontItem.GetStyleName()); @@ -1415,7 +1415,7 @@ void SvxFontPrevWindow::SetFont( const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFo { const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>( rSet.Get(nWhich) ); rFont.SetFamily( rFontItem.GetFamily() ); - rFont.SetFamilyName( rFontItem.GetFamilyName() ); + rFont.SetName( rFontItem.GetFamilyName() ); rFont.SetPitch( rFontItem.GetPitch() ); rFont.SetCharSet( rFontItem.GetCharSet() ); rFont.SetStyleName( rFontItem.GetStyleName() ); diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 676ed96821eb..3cef94fd240c 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -82,7 +82,7 @@ using ::com::sun::star::awt::XVclWindowPeer; css::awt::FontDescriptor ImplCreateFontDescriptor( const vcl::Font& rFont ) { css::awt::FontDescriptor aFD; - aFD.Name = rFont.GetFamilyName(); + aFD.Name = rFont.GetName(); aFD.StyleName = rFont.GetStyleName(); aFD.Height = (sal_Int16)rFont.GetSize().Height(); aFD.Width = (sal_Int16)rFont.GetSize().Width(); @@ -105,7 +105,7 @@ css::awt::FontDescriptor ImplCreateFontDescriptor( const vcl::Font& rFont ) vcl::Font ImplCreateFont( const css::awt::FontDescriptor& rDescr ) { vcl::Font aFont; - aFont.SetFamilyName( rDescr.Name ); + aFont.SetName( rDescr.Name ); aFont.SetStyleName( rDescr.StyleName ); aFont.SetSize( ::Size( rDescr.Width, rDescr.Height ) ); aFont.SetFamily( (FontFamily)rDescr.Family ); diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 2679bf40c0d5..591d8ad6beff 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -1533,8 +1533,10 @@ sal_uInt16 OutlineTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 /*m if( eNumType == SVX_NUM_CHAR_SPECIAL) { sal_Unicode cChar = aFmt.GetBulletChar(); + //const vcl::Font* pFont = aFmt.GetBulletFont(); sal_Unicode ccChar = _pSet->sBulletChar[0]; - if ( !((cChar == ccChar) && + // rtl::OUString sFont = _pSet->sBulletFont; + if ( !((cChar == ccChar) && //pFont && sFont.compareTo(pFont->GetName()) && _pSet->eLabelFollowedBy == aFmt.GetLabelFollowedBy() && _pSet->nTabValue == aFmt.GetListtabPos() && _pSet->eNumAlign == aFmt.GetNumAdjust() && @@ -1598,6 +1600,8 @@ void OutlineTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uI for (sal_uInt16 iLevel=0;iLevel < nCount;iLevel++) { SvxNumberFormat aFmt(aNum.GetLevel(iLevel)); + //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix())[0]; + //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix())[0]; sal_Int16 eNumType = aFmt.GetNumberingType(); NumSettings_Impl* _pSet = (*pItemArr->pNumSettingsArr)[iLevel].get(); @@ -1612,9 +1616,9 @@ void OutlineTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uI { sal_Unicode cChar = aFmt.GetBulletChar(); OUString sChar(cChar); - _pSet->sBulletChar = sChar; + _pSet->sBulletChar = sChar;//OUString(cChar); if ( aFmt.GetBulletFont() ) - _pSet->sBulletFont = rtl::OUString(aFmt.GetBulletFont()->GetFamilyName()); + _pSet->sBulletFont = rtl::OUString(aFmt.GetBulletFont()->GetName()); _pSet->nNumberType = eNumType; pItemArr->bIsCustomized = true; }else if ((eNumType&(~LINK_TOKEN)) == SVX_NUM_BITMAP ) { @@ -1632,7 +1636,7 @@ void OutlineTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uI _pSet->sSuffix = aFmt.GetSuffix(); _pSet->nNumberType = eNumType; if ( aFmt.GetBulletFont() ) - _pSet->sBulletFont = rtl::OUString(aFmt.GetBulletFont()->GetFamilyName()); + _pSet->sBulletFont = rtl::OUString(aFmt.GetBulletFont()->GetName()); pItemArr->bIsCustomized = true; } } @@ -1663,6 +1667,7 @@ void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[nIndex]; if (isDefault) pItemArr=pDefaultOutlineSettingsArrs[nIndex]; + //Font& rActBulletFont = lcl_GetDefaultBulletFont(); NumSettingsArr_Impl *pNumSettingsArr=pItemArr->pNumSettingsArr; NumSettings_Impl* pLevelSettings = nullptr; @@ -1676,6 +1681,7 @@ void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 break; SvxNumberFormat aFmt(aNum.GetLevel(i)); + //aFmt.SetBulletFont(&pLevelSettings->aFont); vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont(); if (pLevelSettings->nNumberType !=aFmt.GetNumberingType()) isResetSize=true; aFmt.SetNumberingType( pLevelSettings->nNumberType ); @@ -1683,7 +1689,7 @@ void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 if(aFmt.GetNumberingType() == SVX_NUM_CHAR_SPECIAL) { if( pLevelSettings->sBulletFont.getLength() && - pLevelSettings->sBulletFont.compareTo(rActBulletFont.GetFamilyName())) + pLevelSettings->sBulletFont.compareTo(rActBulletFont.GetName())) { //search for the font if(!pList) diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx index a3b6c015e72d..21876e9db994 100644 --- a/svx/source/styles/CommonStylePreviewRenderer.cxx +++ b/svx/source/styles/CommonStylePreviewRenderer.cxx @@ -133,7 +133,7 @@ bool CommonStylePreviewRenderer::recalculate() if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_FONT)) != nullptr) { const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(pItem); - pFont->SetFamilyName(pFontItem->GetFamilyName()); + pFont->SetName(pFontItem->GetFamilyName()); pFont->SetStyleName(pFontItem->GetStyleName()); } else diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 5710493f767b..04d97c7c59a5 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -411,9 +411,9 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr vcl::Font aFnt(mpVD->GetFont()); const sal_uInt32 nHeight(FRound(aFnt.GetSize().Height() * mfScaleY)); - mpTextAttr->Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetFamilyName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO ) ); - mpTextAttr->Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetFamilyName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO_CJK ) ); - mpTextAttr->Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetFamilyName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO_CTL ) ); + mpTextAttr->Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO ) ); + mpTextAttr->Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO_CJK ) ); + mpTextAttr->Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO_CTL ) ); mpTextAttr->Put(SvxPostureItem(aFnt.GetItalic(), EE_CHAR_ITALIC)); mpTextAttr->Put(SvxWeightItem(aFnt.GetWeight(), EE_CHAR_WEIGHT)); mpTextAttr->Put( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT ) ); diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index a761f74e71a7..855fd69dbf3e 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -727,7 +727,7 @@ void SdrModel::SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt // get DEFAULTFONT_LATIN_TEXT and set at pool as dynamic default vcl::Font aFont(OutputDevice::GetDefaultFont(DefaultFontType::LATIN_TEXT, nLanguage, GetDefaultFontFlags::OnlyOne)); aSvxFontItem.SetFamily(aFont.GetFamily()); - aSvxFontItem.SetFamilyName(aFont.GetFamilyName()); + aSvxFontItem.SetFamilyName(aFont.GetName()); aSvxFontItem.SetStyleName(OUString()); aSvxFontItem.SetPitch( aFont.GetPitch()); aSvxFontItem.SetCharSet( aFont.GetCharSet() ); @@ -736,7 +736,7 @@ void SdrModel::SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt // get DEFAULTFONT_CJK_TEXT and set at pool as dynamic default vcl::Font aFontCJK(OutputDevice::GetDefaultFont(DefaultFontType::CJK_TEXT, nLanguage, GetDefaultFontFlags::OnlyOne)); aSvxFontItemCJK.SetFamily( aFontCJK.GetFamily()); - aSvxFontItemCJK.SetFamilyName(aFontCJK.GetFamilyName()); + aSvxFontItemCJK.SetFamilyName(aFontCJK.GetName()); aSvxFontItemCJK.SetStyleName(OUString()); aSvxFontItemCJK.SetPitch( aFontCJK.GetPitch()); aSvxFontItemCJK.SetCharSet( aFontCJK.GetCharSet()); @@ -745,7 +745,7 @@ void SdrModel::SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt // get DEFAULTFONT_CTL_TEXT and set at pool as dynamic default vcl::Font aFontCTL(OutputDevice::GetDefaultFont(DefaultFontType::CTL_TEXT, nLanguage, GetDefaultFontFlags::OnlyOne)); aSvxFontItemCTL.SetFamily(aFontCTL.GetFamily()); - aSvxFontItemCTL.SetFamilyName(aFontCTL.GetFamilyName()); + aSvxFontItemCTL.SetFamilyName(aFontCTL.GetName()); aSvxFontItemCTL.SetStyleName(OUString()); aSvxFontItemCTL.SetPitch( aFontCTL.GetPitch() ); aSvxFontItemCTL.SetCharSet( aFontCTL.GetCharSet()); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 0b3d1724721c..67e2ab6b525f 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -657,7 +657,7 @@ void SvxStyleBox_Impl::SetupEntry(vcl::RenderContext& rRenderContext, vcl::Windo // setup the font properties SvxFont aFont; - aFont.SetFamilyName(pFontItem->GetFamilyName()); + aFont.SetName(pFontItem->GetFamilyName()); aFont.SetStyleName(pFontItem->GetStyleName()); aFont.SetSize(aPixelSize); @@ -1000,13 +1000,13 @@ void SvxFontNameBox_Impl::Update( const SvxFontItem* pFontItem ) { if ( pFontItem ) { - aCurFont.SetFamilyName ( pFontItem->GetFamilyName() ); + aCurFont.SetName ( pFontItem->GetFamilyName() ); aCurFont.SetFamily ( pFontItem->GetFamily() ); aCurFont.SetStyleName ( pFontItem->GetStyleName() ); aCurFont.SetPitch ( pFontItem->GetPitch() ); aCurFont.SetCharSet ( pFontItem->GetCharSet() ); } - OUString aCurName = aCurFont.GetFamilyName(); + OUString aCurName = aCurFont.GetName(); if ( GetText() != aCurName ) SetText( aCurName ); } @@ -1145,7 +1145,7 @@ void SvxFontNameBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) aCurFont.GetItalic() ) ); SvxFontItem aFontItem( aFontMetric.GetFamily(), - aFontMetric.GetFamilyName(), + aFontMetric.GetName(), aFontMetric.GetStyleName(), aFontMetric.GetPitch(), aFontMetric.GetCharSet(), @@ -1172,7 +1172,7 @@ void SvxFontNameBox_Impl::Select() aCurFont = aFontMetric; pFontItem.reset( new SvxFontItem( aFontMetric.GetFamily(), - aFontMetric.GetFamilyName(), + aFontMetric.GetName(), aFontMetric.GetStyleName(), aFontMetric.GetPitch(), aFontMetric.GetCharSet(), diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index 22ea34f2b70f..5e51c2e66291 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -196,7 +196,7 @@ void SvxFontSizeBox_Impl::UpdateFont( const css::awt::FontDescriptor& rCurrentFo if ( !rCurrentFont.Name.isEmpty() ) { FontMetric _aFontMetric; - _aFontMetric.SetFamilyName( rCurrentFont.Name ); + _aFontMetric.SetName( rCurrentFont.Name ); _aFontMetric.SetStyleName( rCurrentFont.StyleName ); _aFontMetric.SetHeight( rCurrentFont.Height ); Fill( &_aFontMetric, _pFontList ); diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 57cc458cbdf3..f9137bc4b791 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -127,7 +127,7 @@ namespace vcl::Font aFnt( OutputDevice::GetDefaultFont( nFntType, nLng, GetDefaultFontFlags::OnlyOne ) ); - rSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetFamilyName(), + rSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), OUString(), aFnt.GetPitch(), aFnt.GetCharSet(), aArr[n].nResFntId )); } @@ -156,7 +156,7 @@ namespace vcl::Font aFnt( OutputDevice::GetDefaultFont( aArr[n].nFntType, nLng, GetDefaultFontFlags::OnlyOne ) ); - rSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetFamilyName(), + rSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), OUString(), aFnt.GetPitch(), aFnt.GetCharSet(), aArr[n].nResFntId )); } @@ -469,7 +469,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId, vcl::Font aFnt( OutputDevice::GetDefaultFont( nFontTypes[i], nLng, GetDefaultFontFlags::OnlyOne ) ); - aSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetFamilyName(), + aSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), OUString(), aFnt.GetPitch(), aFnt.GetCharSet(), aFontWhich[i] )); } @@ -1202,7 +1202,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId ) { const vcl::Font& rBulletFont = numfunc::GetDefBulletFont(); SetAllScriptItem( aSet, SvxFontItem( rBulletFont.GetFamily(), - rBulletFont.GetFamilyName(), rBulletFont.GetStyleName(), + rBulletFont.GetName(), rBulletFont.GetStyleName(), rBulletFont.GetPitch(), rBulletFont.GetCharSet(), RES_CHRATR_FONT )); } break; diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index e1e86963fd02..8d128f6c831b 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -103,7 +103,7 @@ static void lcl_PaintReplacement( const SwRect &rRect, const OUString &rText, pFont = new vcl::Font(); pFont->SetWeight( WEIGHT_BOLD ); pFont->SetStyleName( OUString() ); - pFont->SetFamilyName("Arial Unicode"); + pFont->SetName("Arial Unicode"); pFont->SetFamily( FAMILY_SWISS ); pFont->SetTransparent( true ); } diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index bd5e6a52a191..2c1c57d4dcc3 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1620,7 +1620,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) m_aDelPam.GetMark()->nContent = 1; SetAllScriptItem( aSet, SvxFontItem( m_aFlags.aBulletFont.GetFamily(), - m_aFlags.aBulletFont.GetFamilyName(), + m_aFlags.aBulletFont.GetName(), m_aFlags.aBulletFont.GetStyleName(), m_aFlags.aBulletFont.GetPitch(), m_aFlags.aBulletFont.GetCharSet(), diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index e732c684ecb2..60c2eed78c76 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -287,7 +287,7 @@ public: sal_uInt16 GetOrientation( const bool bVertLayout = false ) const; inline const OUString& GetName( const sal_uInt8 nWhich ) const - { return m_aSub[nWhich].GetFamilyName(); } + { return m_aSub[nWhich].GetName(); } inline LanguageType GetLanguage( const sal_uInt8 nWhich ) const { return m_aSub[nWhich].GetLanguage(); } inline rtl_TextEncoding GetCharSet( const sal_uInt8 nWhich ) const @@ -449,7 +449,7 @@ inline void SwFont::SetFamily( const FontFamily eFamily, const sal_uInt8 nWhich inline void SwSubFont::SetName( const OUString& rName ) { m_pMagic = nullptr; - Font::SetFamilyName( rName ); + Font::SetName( rName ); } inline void SwFont::SetName( const OUString& rName, const sal_uInt8 nWhich ) diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index c982844163c4..08003e07f25a 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -7370,7 +7370,7 @@ const vcl::Font& SwPageFrame::GetEmptyPageFont() pEmptyPgFont->SetSize( Size( 0, 80 * 20 )); // == 80 pt pEmptyPgFont->SetWeight( WEIGHT_BOLD ); pEmptyPgFont->SetStyleName( aEmptyOUStr ); - pEmptyPgFont->SetFamilyName("Helvetica"); + pEmptyPgFont->SetName("Helvetica"); pEmptyPgFont->SetFamily( FAMILY_SWISS ); pEmptyPgFont->SetTransparent( true ); pEmptyPgFont->SetColor( COL_GRAY ); diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index dc01d799dd9a..c470a067f710 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -537,7 +537,7 @@ SwNumberPortion *SwTextFormatter::NewNumberPortion( SwTextFormatInfo &rInf ) con { const sal_uInt8 nAct = pNumFnt->GetActual(); pNumFnt->SetFamily( pFormatFnt->GetFamily(), nAct ); - pNumFnt->SetName( pFormatFnt->GetFamilyName(), nAct ); + pNumFnt->SetName( pFormatFnt->GetName(), nAct ); pNumFnt->SetStyleName( pFormatFnt->GetStyleName(), nAct ); pNumFnt->SetCharSet( pFormatFnt->GetCharSet(), nAct ); pNumFnt->SetPitch( pFormatFnt->GetPitch(), nAct ); diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 3bc1da5c22dc..abd97f7ed2a4 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -361,7 +361,7 @@ sal_uInt16 SwFntObj::GetFontLeading( const SwViewShell *pSh, const OutputDevice& bSymbol = RTL_TEXTENCODING_SYMBOL == aMet.GetCharSet(); GuessLeading( *pSh, aMet ); nExtLeading = static_cast<sal_uInt16>(aMet.GetExternalLeading()); - /* HACK: FIXME There is something wrong with Writer's bullet rendering, causing lines + /* HACK: There is something wrong with Writer's bullet rendering, causing lines with bullets to be higher than they should be. I think this is because Writer uses font's external leading incorrect, as the vertical distance added to every line instead of only a distance between multiple lines, @@ -376,7 +376,7 @@ sal_uInt16 SwFntObj::GetFontLeading( const SwViewShell *pSh, const OutputDevice& Interestingly enough, bSymbol is false for 'StarSymbol; Arial Unicode MS', so also check explicitly. */ - if( bSymbol || IsStarSymbol( pPrtFont->GetFamilyName())) + if( bSymbol || IsStarSymbol( pPrtFont->GetName())) nExtLeading = 0; } diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 5d47d9bc8064..06b524eb7e1c 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -492,7 +492,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, { const SvxFontItem *pFont = static_cast<const SvxFontItem *>(pItem); m_aSub[SW_LATIN].SetFamily( pFont->GetFamily() ); - m_aSub[SW_LATIN].Font::SetFamilyName( pFont->GetFamilyName() ); + m_aSub[SW_LATIN].Font::SetName( pFont->GetFamilyName() ); m_aSub[SW_LATIN].Font::SetStyleName( pFont->GetStyleName() ); m_aSub[SW_LATIN].Font::SetPitch( pFont->GetPitch() ); m_aSub[SW_LATIN].Font::SetCharSet( pFont->GetCharSet() ); @@ -522,7 +522,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, { const SvxFontItem *pFont = static_cast<const SvxFontItem *>(pItem); m_aSub[SW_CJK].SetFamily( pFont->GetFamily() ); - m_aSub[SW_CJK].Font::SetFamilyName( pFont->GetFamilyName() ); + m_aSub[SW_CJK].Font::SetName( pFont->GetFamilyName() ); m_aSub[SW_CJK].Font::SetStyleName( pFont->GetStyleName() ); m_aSub[SW_CJK].Font::SetPitch( pFont->GetPitch() ); m_aSub[SW_CJK].Font::SetCharSet( pFont->GetCharSet() ); @@ -558,7 +558,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, { const SvxFontItem *pFont = static_cast<const SvxFontItem *>(pItem); m_aSub[SW_CTL].SetFamily( pFont->GetFamily() ); - m_aSub[SW_CTL].Font::SetFamilyName( pFont->GetFamilyName() ); + m_aSub[SW_CTL].Font::SetName( pFont->GetFamilyName() ); m_aSub[SW_CTL].Font::SetStyleName( pFont->GetStyleName() ); m_aSub[SW_CTL].Font::SetPitch( pFont->GetPitch() ); m_aSub[SW_CTL].Font::SetCharSet( pFont->GetCharSet() ); @@ -758,7 +758,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, { const SvxFontItem& rFont = pAttrSet->GetFont(); m_aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); - m_aSub[SW_LATIN].SetFamilyName( rFont.GetFamilyName() ); + m_aSub[SW_LATIN].SetName( rFont.GetFamilyName() ); m_aSub[SW_LATIN].SetStyleName( rFont.GetStyleName() ); m_aSub[SW_LATIN].SetPitch( rFont.GetPitch() ); m_aSub[SW_LATIN].SetCharSet( rFont.GetCharSet() ); @@ -774,7 +774,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, { const SvxFontItem& rFont = pAttrSet->GetCJKFont(); m_aSub[SW_CJK].SetFamily( rFont.GetFamily() ); - m_aSub[SW_CJK].SetFamilyName( rFont.GetFamilyName() ); + m_aSub[SW_CJK].SetName( rFont.GetFamilyName() ); m_aSub[SW_CJK].SetStyleName( rFont.GetStyleName() ); m_aSub[SW_CJK].SetPitch( rFont.GetPitch() ); m_aSub[SW_CJK].SetCharSet( rFont.GetCharSet() ); @@ -794,7 +794,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, { const SvxFontItem& rFont = pAttrSet->GetCTLFont(); m_aSub[SW_CTL].SetFamily( rFont.GetFamily() ); - m_aSub[SW_CTL].SetFamilyName( rFont.GetFamilyName() ); + m_aSub[SW_CTL].SetName( rFont.GetFamilyName() ); m_aSub[SW_CTL].SetStyleName( rFont.GetStyleName() ); m_aSub[SW_CTL].SetPitch( rFont.GetPitch() ); m_aSub[SW_CTL].SetCharSet( rFont.GetCharSet() ); diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 7ae1320d46f1..ecb3bfb90088 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1084,7 +1084,7 @@ void SwTextNode::SetLanguageAndFont( const SwPaM &rPaM, if (pFont) { SvxFontItem aFontItem = static_cast<const SvxFontItem&>( aSet.Get( nFontWhichId ) ); - aFontItem.SetFamilyName( pFont->GetFamilyName()); + aFontItem.SetFamilyName( pFont->GetName()); aFontItem.SetFamily( pFont->GetFamily()); aFontItem.SetStyleName( pFont->GetStyleName()); aFontItem.SetPitch( pFont->GetPitch()); diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 0bd244589e2f..41904cebfdbb 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -816,7 +816,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam) if( !pBulletFontNames[i].isEmpty() && !SwXNumberingRules::isInvalidStyle(pBulletFontNames[i]) && - (!aFormat.GetBulletFont() || aFormat.GetBulletFont()->GetFamilyName() != pBulletFontNames[i]) + (!aFormat.GetBulletFont() || aFormat.GetBulletFont()->GetName() != pBulletFontNames[i]) ) { const SvxFontListItem* pFontListItem = diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 118d4d524aab..f18f9ef29fb8 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -89,6 +89,7 @@ #include <cassert> #include <memory> #include <set> +#include <limits> namespace { @@ -243,6 +244,8 @@ namespace sw }; } + +class SwStyleBase_Impl; class SwXStyle : public cppu::WeakImplHelper < css::style::XStyle, @@ -269,6 +272,8 @@ protected: css::uno::Reference<css::container::XNameAccess> m_xStyleFamily; css::uno::Reference<css::beans::XPropertySet> m_xStyleData; + template<sal_uInt16> + void SetPropertyValue(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any&, SwStyleBase_Impl&); void SAL_CALL SetPropertyValues_Impl( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) throw (css::beans::UnknownPropertyException, css::beans::PropertyVetoException, @@ -359,6 +364,8 @@ public: void Invalidate(); void ApplyDescriptorProperties(); void SetStyleName(const OUString& rSet){ m_sStyleName = rSet;} + void SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& rBase) throw(beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception); + void PutItemToSet(const SvxSetItem* pSetItem, const SfxItemPropertySet& rPropSet, const SfxItemPropertySimpleEntry& rEntry, const uno::Any& rVal, SwStyleBase_Impl& rBaseImpl); }; class SwXFrameStyle @@ -1092,7 +1099,7 @@ static uno::Reference<beans::XPropertySet> lcl_InitStandardStyle(const SfxStyleF if(eFamily != SFX_STYLE_FAMILY_PARA && eFamily != SFX_STYLE_FAMILY_PAGE) return {}; auto aResult(rxStyleFamily->getByName("Standard")); - if(!aResult.isExtractableTo(cppu::UnoType<return_t>::get())) + if(!aResult.has<return_t>()) return {}; return aResult.get<return_t>(); } @@ -1108,7 +1115,7 @@ static uno::Reference<container::XNameAccess> lcl_InitStyleFamily(SwDoc* pDoc, c uno::Reference<style::XStyleFamiliesSupplier> xFamilySupplier(xModel, uno::UNO_QUERY); auto xFamilies = xFamilySupplier->getStyleFamilies(); auto aResult(xFamilies->getByName(rEntry.m_sName)); - if(!aResult.isExtractableTo(cppu::UnoType<return_t>::get())) + if(!aResult.has<return_t>()) return {}; return aResult.get<return_t>(); } @@ -1399,580 +1406,453 @@ const SwPageDesc* SwStyleBase_Impl::GetOldPageDesc() return m_pOldPageDesc; } +static void lcl_SetDefaultWay(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + // default ItemSet handling + SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet(); + SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID); + aSet.SetParent(&rStyleSet); + rPropSet.setPropertyValue(rEntry, rValue, aSet); + rStyleSet.Put(aSet); +} -static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, - const SfxItemPropertySet& rPropSet, - const uno::Any& rValue, - SwStyleBase_Impl& rBase, - SfxStyleSheetBasePool* pBasePool, - SwDoc* pDoc, - SfxStyleFamily eFamily) - throw(beans::PropertyVetoException, lang::IllegalArgumentException, - lang::WrappedTargetException, uno::RuntimeException, - std::exception) - +sal_uInt8 lcl_TranslateMetric(const SfxItemPropertySimpleEntry& rEntry, SwDoc* pDoc, uno::Any& o_aValue) { - //UUUU adapted switch logic to a more readable state; removed goto's and made - // execution of standard setting of proerty in ItemSet dependent of this variable - bool bDone(false); + // check for needed metric translation + if(!(rEntry.nMemberId & SFX_METRIC_ITEM)) + return rEntry.nMemberId; + // exception: If these ItemTypes are used, do not convert when these are negative + // since this means they are intended as percent values + if((XATTR_FILLBMP_SIZEX == rEntry.nWID || XATTR_FILLBMP_SIZEY == rEntry.nWID) + && o_aValue.has<sal_Int32>() + && o_aValue.get<sal_Int32>() < 0) + return rEntry.nMemberId; + if(!pDoc) + return rEntry.nMemberId & (~SFX_METRIC_ITEM); - //UUUU - const sal_uInt8 nMemberId(rEntry.nMemberId & (~SFX_METRIC_ITEM)); + const SfxItemPool& rPool = pDoc->GetAttrPool(); + const SfxMapUnit eMapUnit(rPool.GetMetric(rEntry.nWID)); + if(eMapUnit != SFX_MAPUNIT_100TH_MM) + SvxUnoConvertFromMM(eMapUnit, o_aValue); + return rEntry.nMemberId & (~SFX_METRIC_ITEM); +} +template<> +void SwXStyle::SetPropertyValue<FN_UNO_HIDDEN>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + bool bHidden = false; + if(rValue >>= bHidden) + { + //make it a 'real' style - necessary for pooled styles + o_rStyleBase.getNewBase()->GetItemSet(); + o_rStyleBase.getNewBase()->SetHidden(bHidden); + } + lcl_SetDefaultWay(rEntry, rPropSet, rValue, o_rStyleBase); +} +template<> +void SwXStyle::SetPropertyValue<FN_UNO_STYLE_INTEROP_GRAB_BAG>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + o_rStyleBase.getNewBase()->GetItemSet(); + o_rStyleBase.getNewBase()->SetGrabBagItem(rValue); + lcl_SetDefaultWay(rEntry, rPropSet, rValue, o_rStyleBase); +} +template<> +void SwXStyle::SetPropertyValue<XATTR_FILLGRADIENT>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ uno::Any aValue(rValue); - - //UUUU check for needed metric translation - if(rEntry.nMemberId & SFX_METRIC_ITEM) + const auto nMemberId(lcl_TranslateMetric(rEntry, m_pDoc, aValue)); + if(MID_NAME == nMemberId) { - bool bDoIt(true); - - if(XATTR_FILLBMP_SIZEX == rEntry.nWID || XATTR_FILLBMP_SIZEY == rEntry.nWID) - { - // exception: If these ItemTypes are used, do not convert when these are negative - // since this means they are intended as percent values - sal_Int32 nValue = 0; - - if(aValue >>= nValue) - { - bDoIt = nValue > 0; - } - } - - if(bDoIt && pDoc) - { - const SfxItemPool& rPool = pDoc->GetAttrPool(); - const SfxMapUnit eMapUnit(rPool.GetMetric(rEntry.nWID)); - - if(eMapUnit != SFX_MAPUNIT_100TH_MM) - { - SvxUnoConvertFromMM(eMapUnit, aValue); - } - } + // add set commands for FillName items + SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet(); + if(!aValue.has<OUString>()) + throw lang::IllegalArgumentException(); + SvxShape::SetFillAttribute(rEntry.nWID, aValue.get<OUString>(), rStyleSet); } - - switch(rEntry.nWID) + else if(MID_GRAFURL == nMemberId) { - case FN_UNO_HIDDEN: - { - bool bHidden = false; - if ( rValue >>= bHidden ) - { - //make it a 'real' style - necessary for pooled styles - rBase.getNewBase()->GetItemSet(); - rBase.getNewBase()->SetHidden( bHidden ); - } - } - break; - - case FN_UNO_STYLE_INTEROP_GRAB_BAG: + if(XATTR_FILLBITMAP == rEntry.nWID) { - rBase.getNewBase()->GetItemSet(); - rBase.getNewBase()->SetGrabBagItem(rValue); + // Bitmap also has the MID_GRAFURL mode where a Bitmap URL is used + const Graphic aNullGraphic; + SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet(); + XFillBitmapItem aXFillBitmapItem(rStyleSet.GetPool(), aNullGraphic); + aXFillBitmapItem.PutValue(aValue, nMemberId); + rStyleSet.Put(aXFillBitmapItem); } - break; - - case XATTR_FILLGRADIENT: - case XATTR_FILLHATCH: - case XATTR_FILLBITMAP: - case XATTR_FILLFLOATTRANSPARENCE: - // not yet needed; activate when LineStyle support may be added - // case XATTR_LINESTART: - // case XATTR_LINEEND: - // case XATTR_LINEDASH: - { - if(MID_NAME == nMemberId) - { - //UUUU add set commands for FillName items - OUString aTempName; - SfxItemSet& rStyleSet = rBase.GetItemSet(); - - if(!(aValue >>= aTempName)) - { - throw lang::IllegalArgumentException(); - } - - SvxShape::SetFillAttribute(rEntry.nWID, aTempName, rStyleSet); - bDone = true; - } - else if(MID_GRAFURL == nMemberId) - { - if(XATTR_FILLBITMAP == rEntry.nWID) - { - //UUUU Bitmap also has the MID_GRAFURL mode where a Bitmap URL is used - const Graphic aNullGraphic; - SfxItemSet& rStyleSet = rBase.GetItemSet(); - XFillBitmapItem aXFillBitmapItem(rStyleSet.GetPool(), aNullGraphic); - - aXFillBitmapItem.PutValue(aValue, nMemberId); - rStyleSet.Put(aXFillBitmapItem); - bDone = true; - } - } - - break; - } - case RES_BACKGROUND: - { - //UUUU - SfxItemSet& rStyleSet = rBase.GetItemSet(); - const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rStyleSet, RES_BACKGROUND, true, pDoc->IsInXMLImport())); - SvxBrushItem aChangedBrushItem(aOriginalBrushItem); - - aChangedBrushItem.PutValue(aValue, nMemberId); - - if (!(aChangedBrushItem == aOriginalBrushItem) || - // 0xff is already the default - but if BackTransparent is set - // to true, it must be applied in the item set on ODF import - // to potentially override parent style, which is unknown yet - (MID_GRAPHIC_TRANSPARENT == nMemberId && aValue.has<bool>() && aValue.get<bool>())) - { - setSvxBrushItemAsFillAttributesToTargetSet(aChangedBrushItem, rStyleSet); - } - - bDone = true; - break; - } - case OWN_ATTR_FILLBMP_MODE: - { - //UUUU - drawing::BitmapMode eMode; - - if(!(aValue >>= eMode)) - { - sal_Int32 nMode = 0; - - if(!(aValue >>= nMode)) - { - throw lang::IllegalArgumentException(); - } - - eMode = (drawing::BitmapMode)nMode; - } - - SfxItemSet& rStyleSet = rBase.GetItemSet(); + } + else + lcl_SetDefaultWay(rEntry, rPropSet, aValue, o_rStyleBase); +} +template<> +void SwXStyle::SetPropertyValue<RES_BACKGROUND>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet(); + const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rStyleSet, RES_BACKGROUND, true, m_pDoc->IsInXMLImport())); + SvxBrushItem aChangedBrushItem(aOriginalBrushItem); - rStyleSet.Put(XFillBmpStretchItem(drawing::BitmapMode_STRETCH == eMode)); - rStyleSet.Put(XFillBmpTileItem(drawing::BitmapMode_REPEAT == eMode)); + uno::Any aValue(rValue); + const auto nMemberId(lcl_TranslateMetric(rEntry, m_pDoc, aValue)); + aChangedBrushItem.PutValue(aValue, nMemberId); - bDone = true; - break; - } - case RES_PAPER_BIN: - { - SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccess().getPrinter( true ); - OUString sTmp; - sal_uInt16 nBin = USHRT_MAX; - if ( !( aValue >>= sTmp ) ) - throw lang::IllegalArgumentException(); - if ( sTmp == "[From printer settings]" ) - nBin = USHRT_MAX-1; - else if ( pPrinter ) - { - for (sal_uInt16 i=0, nEnd = pPrinter->GetPaperBinCount(); i < nEnd; i++ ) - { - if (sTmp == pPrinter->GetPaperBinName ( i ) ) - { - nBin = i; - break; - } - } - } - if ( nBin == USHRT_MAX ) - throw lang::IllegalArgumentException(); - else - { - SfxItemSet& rStyleSet = rBase.GetItemSet(); - SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID); - aSet.SetParent(&rStyleSet); - rPropSet.setPropertyValue(rEntry, uno::makeAny ( static_cast < sal_Int8 > ( nBin == USHRT_MAX-1 ? -1 : nBin ) ), aSet); - rStyleSet.Put(aSet); - } + // 0xff is already the default - but if BackTransparent is set + // to true, it must be applied in the item set on ODF import + // to potentially override parent style, which is unknown yet + if(aChangedBrushItem == aOriginalBrushItem && (MID_GRAPHIC_TRANSPARENT != nMemberId || !aValue.has<bool>() || !aValue.get<bool>())) + return; - bDone = true; - break; - } - case FN_UNO_NUM_RULES: // special handling for a SvxNumRuleItem: + setSvxBrushItemAsFillAttributesToTargetSet(aChangedBrushItem, rStyleSet); +} +template<> +void SwXStyle::SetPropertyValue<OWN_ATTR_FILLBMP_MODE>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + drawing::BitmapMode eMode; + if(!(rValue >>= eMode)) + { + if(!rValue.has<sal_Int32>()) + throw lang::IllegalArgumentException(); + eMode = ((drawing::BitmapMode)rValue.get<sal_Int32>()); + } + SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet(); + rStyleSet.Put(XFillBmpStretchItem(drawing::BitmapMode_STRETCH == eMode)); + rStyleSet.Put(XFillBmpTileItem(drawing::BitmapMode_REPEAT == eMode)); +} +template<> +void SwXStyle::SetPropertyValue<RES_PAPER_BIN>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + if(!rValue.has<OUString>()) + throw lang::IllegalArgumentException(); + SfxPrinter* pPrinter = m_pDoc->getIDocumentDeviceAccess().getPrinter(true); + OUString sValue(rValue.get<OUString>()); + using printeridx_t = decltype(pPrinter->GetPaperBinCount()); + printeridx_t nBin = std::numeric_limits<printeridx_t>::max(); + if(sValue == "[From printer settings]") + nBin = std::numeric_limits<printeridx_t>::max()-1; + else if(pPrinter) + { + for(sal_uInt16 i=0, nEnd = pPrinter->GetPaperBinCount(); i < nEnd; ++i) { - if(aValue.getValueType() == cppu::UnoType<container::XIndexReplace>::get()) + if (sValue == pPrinter->GetPaperBinName(i)) { - uno::Reference< container::XIndexReplace > const * pxRulesRef = - static_cast<uno::Reference< container::XIndexReplace > const *>(aValue.getValue()); - - uno::Reference<lang::XUnoTunnel> xNumberTunnel( *pxRulesRef, uno::UNO_QUERY); - - SwXNumberingRules* pSwXRules = nullptr; - if(xNumberTunnel.is()) - { - pSwXRules = reinterpret_cast< SwXNumberingRules * >( - sal::static_int_cast< sal_IntPtr >(xNumberTunnel->getSomething( SwXNumberingRules::getUnoTunnelId()) )); - } - if(pSwXRules) - { - const OUString* pCharStyleNames = pSwXRules->GetNewCharStyleNames(); - const OUString* pBulletFontNames = pSwXRules->GetBulletFontNames(); - - SwNumRule aSetRule(*pSwXRules->GetNumRule()); - const SwCharFormats* pFormats = pDoc->GetCharFormats(); - const size_t nChCount = pFormats->size(); - for(sal_uInt16 i = 0; i < MAXLEVEL; i++) - { - - const SwNumFormat* pFormat = aSetRule.GetNumFormat( i ); - if(pFormat) - { - SwNumFormat aFormat(*pFormat); - if (!pCharStyleNames[i].isEmpty() && - !SwXNumberingRules::isInvalidStyle(pCharStyleNames[i]) && - (!pFormat->GetCharFormat() || pFormat->GetCharFormat()->GetName() != pCharStyleNames[i]) ) - { - - SwCharFormat* pCharFormat = nullptr; - for(size_t j = 0; j< nChCount; ++j) - { - SwCharFormat* pTmp = (*pFormats)[j]; - if(pTmp->GetName() == pCharStyleNames[i]) - { - pCharFormat = pTmp; - break; - } - } - if(!pCharFormat && pBasePool) - { - - SfxStyleSheetBase* pBase; - pBase = static_cast<SfxStyleSheetBasePool*>(pBasePool)->Find(pCharStyleNames[i], SFX_STYLE_FAMILY_CHAR); - if(!pBase) - pBase = &pBasePool->Make(pCharStyleNames[i], SFX_STYLE_FAMILY_CHAR); - pCharFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat(); - - } - - aFormat.SetCharFormat( pCharFormat ); - } - // same for fonts: - if (!pBulletFontNames[i].isEmpty() && - !SwXNumberingRules::isInvalidStyle(pBulletFontNames[i]) && - (!pFormat->GetBulletFont() || pFormat->GetBulletFont()->GetFamilyName() != pBulletFontNames[i]) ) - { - const SvxFontListItem* pFontListItem = - static_cast<const SvxFontListItem*>(pDoc->GetDocShell() - ->GetItem( SID_ATTR_CHAR_FONTLIST )); - const FontList* pList = pFontListItem->GetFontList(); - FontMetric aFontMetric = pList->Get( - pBulletFontNames[i],WEIGHT_NORMAL, ITALIC_NONE); - vcl::Font aFont(aFontMetric); - aFormat.SetBulletFont(&aFont); - } - aSetRule.Set( i, &aFormat ); - } - } - rBase.getNewBase()->SetNumRule(aSetRule); - } - } - else - throw lang::IllegalArgumentException(); - - bDone = true; - break; - } - - case RES_PARATR_OUTLINELEVEL: - { - sal_Int16 nLevel = 0; - aValue >>= nLevel; - if( 0 <= nLevel && nLevel <= MAXLEVEL) - rBase.getNewBase()->GetCollection()->SetAttrOutlineLevel( nLevel ); - - bDone = true; - break; - } - - case FN_UNO_FOLLOW_STYLE: - { - OUString sTmp; - aValue >>= sTmp; - OUString aString; - SwStyleNameMapper::FillUIName(sTmp, aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), true ) ; - rBase.getNewBase()->SetFollow( aString ); - - bDone = true; - break; - } - case RES_PAGEDESC : - { - if (MID_PAGEDESC_PAGEDESCNAME != nMemberId) + nBin = i; break; - // special handling for RES_PAGEDESC - if(aValue.getValueType() != ::cppu::UnoType<OUString>::get()) - throw lang::IllegalArgumentException(); - SfxItemSet& rStyleSet = rBase.GetItemSet(); - - std::unique_ptr<SwFormatPageDesc> pNewDesc; - const SfxPoolItem* pItem; - if(SfxItemState::SET == rStyleSet.GetItemState( RES_PAGEDESC, true, &pItem ) ) - { - pNewDesc.reset( new SwFormatPageDesc(*static_cast<const SwFormatPageDesc*>(pItem)) ); - } - else - pNewDesc.reset( new SwFormatPageDesc ); - OUString uDescName; - aValue >>= uDescName; - OUString sDescName; - SwStyleNameMapper::FillUIName(uDescName, sDescName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, true ); - if(!pNewDesc->GetPageDesc() || pNewDesc->GetPageDesc()->GetName() != sDescName) - { - bool bPut = false; - if (!sDescName.isEmpty()) - { - SwPageDesc* pPageDesc = SwPageDesc::GetByName(*pDoc, sDescName); - if(pPageDesc) - { - pNewDesc->RegisterToPageDesc( *pPageDesc ); - bPut = true; - } - else - { - throw lang::IllegalArgumentException(); - } - } - if(!bPut) - { - rStyleSet.ClearItem(RES_BREAK); - rStyleSet.Put(SwFormatPageDesc()); - } - else - rStyleSet.Put(*pNewDesc); - } - bDone = true; - break; } - case RES_TEXT_VERT_ADJUST: + } + if(nBin == std::numeric_limits<printeridx_t>::max()) + throw lang::IllegalArgumentException(); + SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet(); + SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID); + aSet.SetParent(&rStyleSet); + rPropSet.setPropertyValue(rEntry, uno::makeAny(static_cast<sal_Int8>(nBin == std::numeric_limits<printeridx_t>::max()-1 ? -1 : nBin)), aSet); + rStyleSet.Put(aSet); +} +template<> +void SwXStyle::SetPropertyValue<FN_UNO_NUM_RULES>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + if(!rValue.has<uno::Reference<container::XIndexReplace>>() || !rValue.has<uno::Reference<lang::XUnoTunnel>>()) + throw lang::IllegalArgumentException(); + auto xNumberTunnel(rValue.get<uno::Reference<lang::XUnoTunnel>>()); + SwXNumberingRules* pSwXRules = reinterpret_cast<SwXNumberingRules*>(sal::static_int_cast<sal_IntPtr>(xNumberTunnel->getSomething(SwXNumberingRules::getUnoTunnelId()))); + if(!pSwXRules) + return; + SwNumRule aSetRule(*pSwXRules->GetNumRule()); + for(sal_uInt16 i = 0; i < MAXLEVEL; ++i) + { + const SwNumFormat* pFormat = aSetRule.GetNumFormat(i); + if(!pFormat) + continue; + SwNumFormat aFormat(*pFormat); + const auto pCharName(pSwXRules->GetNewCharStyleNames()[i]); + if(!pCharName.isEmpty() + && !SwXNumberingRules::isInvalidStyle(pCharName) + && (!pFormat->GetCharFormat() || pFormat->GetCharFormat()->GetName() != pCharName)) { - if( pDoc ) + auto pCharFormatIt(std::find_if(m_pDoc->GetCharFormats()->begin(), m_pDoc->GetCharFormats()->end(), + [pCharName] (SwCharFormat* pF) { return pF->GetName() == pCharName; })); + if(pCharFormatIt != m_pDoc->GetCharFormats()->end()) + aFormat.SetCharFormat(*pCharFormatIt); + else if(m_pBasePool) { - const SwPageDesc* pOldPageDesc = rBase.GetOldPageDesc(); - SwPageDesc* pPageDesc = pOldPageDesc ? pDoc->FindPageDesc(pOldPageDesc->GetName()) : nullptr; - if (pPageDesc) - { - drawing::TextVerticalAdjust nVA; - rValue >>= nVA; - pPageDesc->SetVerticalAdjustment( nVA ); - } + auto pBase(static_cast<SfxStyleSheetBasePool*>(m_pBasePool)->Find(pCharName, SFX_STYLE_FAMILY_CHAR)); + if(!pBase) + pBase = &m_pBasePool->Make(pCharName, SFX_STYLE_FAMILY_CHAR); + aFormat.SetCharFormat(static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat()); } - bDone = true; - break; + else + aFormat.SetCharFormat(nullptr); } - case FN_UNO_IS_AUTO_UPDATE: + // same for fonts: + const auto pBulletName(pSwXRules->GetBulletFontNames()[i]); + if(!pBulletName.isEmpty() + && !SwXNumberingRules::isInvalidStyle(pBulletName) + && (!pFormat->GetBulletFont() || pFormat->GetBulletFont()->GetName() != pBulletName)) { - bool bAuto = *static_cast<sal_Bool const *>(aValue.getValue()); - if(SFX_STYLE_FAMILY_PARA == eFamily) - rBase.getNewBase()->GetCollection()->SetAutoUpdateFormat(bAuto); - else if(SFX_STYLE_FAMILY_FRAME == eFamily) - rBase.getNewBase()->GetFrameFormat()->SetAutoUpdateFormat(bAuto); - - bDone = true; - break; + const auto pFontListItem(static_cast<const SvxFontListItem*>(m_pDoc->GetDocShell()->GetItem(SID_ATTR_CHAR_FONTLIST))); + const auto pList(pFontListItem->GetFontList()); + FontMetric aFontInfo(pList->Get(pBulletName, WEIGHT_NORMAL, ITALIC_NONE)); + vcl::Font aFont(aFontInfo); + aFormat.SetBulletFont(&aFont); } - case FN_UNO_PARA_STYLE_CONDITIONS: + aSetRule.Set(i, &aFormat); + } + o_rStyleBase.getNewBase()->SetNumRule(aSetRule); +} +template<> +void SwXStyle::SetPropertyValue<RES_PARATR_OUTLINELEVEL>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + if(!rValue.has<sal_Int16>()) + return; + const auto nLevel(rValue.get<sal_Int16>()); + if(0 <= nLevel && nLevel <= MAXLEVEL) + o_rStyleBase.getNewBase()->GetCollection()->SetAttrOutlineLevel(nLevel); +} +template<> +void SwXStyle::SetPropertyValue<FN_UNO_FOLLOW_STYLE>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + if(!rValue.has<OUString>()) + return; + const auto sValue(rValue.get<OUString>()); + OUString aString; + SwStyleNameMapper::FillUIName(sValue, aString, m_rEntry.m_aPoolId, true); + o_rStyleBase.getNewBase()->SetFollow(aString); +} +template<> +void SwXStyle::SetPropertyValue<RES_PAGEDESC>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + if(MID_PAGEDESC_PAGEDESCNAME != rEntry.nMemberId) + { + lcl_SetDefaultWay(rEntry, rPropSet, rValue, o_rStyleBase); + return; + } + if(!rValue.has<OUString>()) + throw lang::IllegalArgumentException(); + // special handling for RES_PAGEDESC + SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet(); + std::unique_ptr<SwFormatPageDesc> pNewDesc; + const SfxPoolItem* pItem; + if(SfxItemState::SET == rStyleSet.GetItemState(RES_PAGEDESC, true, &pItem)) + pNewDesc.reset(new SwFormatPageDesc(*static_cast<const SwFormatPageDesc*>(pItem))); + else + pNewDesc.reset(new SwFormatPageDesc); + const auto sValue(rValue.get<OUString>()); + OUString sDescName; + SwStyleNameMapper::FillUIName(sValue, sDescName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, true); + if(pNewDesc->GetPageDesc() && pNewDesc->GetPageDesc()->GetName() == sDescName) + return; + if(sDescName.isEmpty()) + { + rStyleSet.ClearItem(RES_BREAK); + rStyleSet.Put(SwFormatPageDesc()); + } + else + { + SwPageDesc* pPageDesc(SwPageDesc::GetByName(*m_pDoc, sDescName)); + if(!pPageDesc) + throw lang::IllegalArgumentException(); + pNewDesc->RegisterToPageDesc(*pPageDesc); + rStyleSet.Put(*pNewDesc); + } +} +template<> +void SwXStyle::SetPropertyValue<RES_TEXT_VERT_ADJUST>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + if(!m_pDoc || !rValue.has<drawing::TextVerticalAdjust>() || !o_rStyleBase.GetOldPageDesc()) + return; + SwPageDesc* pPageDesc = m_pDoc->FindPageDesc(o_rStyleBase.GetOldPageDesc()->GetName()); + if(pPageDesc) + pPageDesc->SetVerticalAdjustment(rValue.get<drawing::TextVerticalAdjust>()); +} +template<> +void SwXStyle::SetPropertyValue<FN_UNO_IS_AUTO_UPDATE>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + if(!rValue.has<bool>()) + throw lang::IllegalArgumentException(); + const bool bAuto(rValue.get<bool>()); + if(SFX_STYLE_FAMILY_PARA == m_rEntry.m_eFamily) + o_rStyleBase.getNewBase()->GetCollection()->SetAutoUpdateFormat(bAuto); + else if(SFX_STYLE_FAMILY_FRAME == m_rEntry.m_eFamily) + o_rStyleBase.getNewBase()->GetFrameFormat()->SetAutoUpdateFormat(bAuto); +} +template<> +void SwXStyle::SetPropertyValue<FN_UNO_PARA_STYLE_CONDITIONS>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + static_assert(COND_COMMAND_COUNT == 28, "invalid size of command count?"); + using expectedarg_t = uno::Sequence<beans::NamedValue>; + if(!rValue.has<expectedarg_t>() || !m_pBasePool) + throw lang::IllegalArgumentException(); + SwCondCollItem aCondItem; + for(auto& rNamedValue : rValue.get<expectedarg_t>()) + { + if(!rNamedValue.Value.has<OUString>()) + throw lang::IllegalArgumentException(); + + const OUString sValue(rNamedValue.Value.get<OUString>()); + // get UI style name from programmatic style name + OUString aStyleName; + SwStyleNameMapper::FillUIName(sValue, aStyleName, lcl_GetSwEnumFromSfxEnum(m_rEntry.m_eFamily), true); + + // check for correct context and style name + const auto nIdx(GetCommandContextIndex(rNamedValue.Name)); + if(nIdx == -1) + throw lang::IllegalArgumentException(); + m_pBasePool->SetSearchMask(SFX_STYLE_FAMILY_PARA); + for(auto pBase = m_pBasePool->First(); pBase->GetName() != aStyleName; pBase = m_pBasePool->Next()) { - uno::Sequence< beans::NamedValue > aSeq; - if (!(aValue >>= aSeq)) - throw lang::IllegalArgumentException(); - - OSL_ENSURE(COND_COMMAND_COUNT == 28, - "invalid size of command count?"); - const beans::NamedValue *pSeq = aSeq.getConstArray(); - const sal_Int32 nLen = aSeq.getLength(); - - bool bFailed = false; - SwCondCollItem aCondItem; - for(sal_Int32 i = 0; i < nLen; ++i) - { - OUString aTmp; - if ((pSeq[i].Value >>= aTmp)) - { - // get UI style name from programmatic style name - OUString aStyleName; - SwStyleNameMapper::FillUIName(aTmp, aStyleName, - lcl_GetSwEnumFromSfxEnum(eFamily), true); - - // check for correct context and style name - - sal_Int16 nIdx = GetCommandContextIndex( pSeq[i].Name ); - - bool bStyleFound = false; - if (pBasePool) - { - pBasePool->SetSearchMask( SFX_STYLE_FAMILY_PARA); - const SfxStyleSheetBase* pBase = pBasePool->First(); - while (pBase && !bStyleFound) - { - if(pBase->GetName() == aStyleName) - bStyleFound = true; - pBase = pBasePool->Next(); - } - } - - if (nIdx == -1 || !bStyleFound) - { - bFailed = true; - break; - } - - aCondItem.SetStyle(&aStyleName, nIdx); - } - else - bFailed = true; - } - if (bFailed) + if(!pBase) throw lang::IllegalArgumentException(); - rBase.GetItemSet().Put( aCondItem ); - bDone = true; - break; - } - case FN_UNO_CATEGORY: - { - if(!rBase.getNewBase()->IsUserDefined()) - throw lang::IllegalArgumentException(); - short nSet = 0; - aValue >>= nSet; - - sal_uInt16 nId; - switch( nSet ) - { - case style::ParagraphStyleCategory::TEXT: - nId = SWSTYLEBIT_TEXT; - break; - case style::ParagraphStyleCategory::CHAPTER: - nId = SWSTYLEBIT_CHAPTER; - break; - case style::ParagraphStyleCategory::LIST: - nId = SWSTYLEBIT_LIST; - break; - case style::ParagraphStyleCategory::INDEX: - nId = SWSTYLEBIT_IDX; - break; - case style::ParagraphStyleCategory::EXTRA: - nId = SWSTYLEBIT_EXTRA; - break; - case style::ParagraphStyleCategory::HTML: - nId = SWSTYLEBIT_HTML; - break; - default: throw lang::IllegalArgumentException(); - } - - rBase.getNewBase()->SetMask( nId|SFXSTYLEBIT_USERDEF ); - bDone = true; - break; - } - case SID_SWREGISTER_COLLECTION: - { - OUString sName; - aValue >>= sName; - SwRegisterItem aReg( !sName.isEmpty() ); - aReg.SetWhich(SID_SWREGISTER_MODE); - rBase.GetItemSet().Put(aReg); - OUString aString; - SwStyleNameMapper::FillUIName(sName, aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true); - - rBase.GetItemSet().Put(SfxStringItem(SID_SWREGISTER_COLLECTION, aString ) ); - bDone = true; - break; - } - case RES_TXTATR_CJK_RUBY: - { - if(MID_RUBY_CHARSTYLE == nMemberId ) - { - OUString sTmp; - if(aValue >>= sTmp) - { - SfxItemSet& rStyleSet = rBase.GetItemSet(); - std::unique_ptr<SwFormatRuby> pRuby; - const SfxPoolItem* pItem; - if(SfxItemState::SET == rStyleSet.GetItemState( RES_TXTATR_CJK_RUBY, true, &pItem ) ) - pRuby.reset(new SwFormatRuby(*static_cast<const SwFormatRuby*>(pItem))); - else - pRuby.reset(new SwFormatRuby(OUString())); - OUString sStyle; - SwStyleNameMapper::FillUIName(sTmp, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true ); - pRuby->SetCharFormatName( sTmp ); - pRuby->SetCharFormatId( 0 ); - if(!sTmp.isEmpty()) - { - sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( sTmp, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); - pRuby->SetCharFormatId(nId); - } - rStyleSet.Put(*pRuby); - } - else - throw lang::IllegalArgumentException(); - } - break; - } - case RES_PARATR_DROP: - { - if( MID_DROPCAP_CHAR_STYLE_NAME == nMemberId) - { - if(aValue.getValueType() == ::cppu::UnoType<OUString>::get()) - { - SfxItemSet& rStyleSet = rBase.GetItemSet(); - - std::unique_ptr<SwFormatDrop> pDrop; - const SfxPoolItem* pItem; - if(SfxItemState::SET == rStyleSet.GetItemState( RES_PARATR_DROP, true, &pItem ) ) - pDrop.reset(new SwFormatDrop(*static_cast<const SwFormatDrop*>(pItem))); - else - pDrop.reset( new SwFormatDrop ); - OUString uStyle; - aValue >>= uStyle; - OUString sStyle; - SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true ); - SwDocStyleSheet* pStyle = - static_cast<SwDocStyleSheet*>(pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR)); - if(pStyle) - pDrop->SetCharFormat(pStyle->GetCharFormat()); - else - throw lang::IllegalArgumentException(); - rStyleSet.Put(*pDrop); - } - else - throw lang::IllegalArgumentException(); - - bDone = true; - } - break; - } - default: - { - // nothing to do - break; } + aCondItem.SetStyle(&aStyleName, nIdx); + } + o_rStyleBase.GetItemSet().Put(aCondItem); +} +template<> +void SwXStyle::SetPropertyValue<FN_UNO_CATEGORY>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + using paragraphstyle_t = std::remove_const<decltype(style::ParagraphStyleCategory::TEXT)>::type; + using paragraphcorestyle_t = sal_uInt16; + if(!o_rStyleBase.getNewBase()->IsUserDefined() || !rValue.has<paragraphstyle_t>()) + throw lang::IllegalArgumentException(); + static std::unique_ptr<std::map<paragraphstyle_t, paragraphcorestyle_t>> pUnoToCore; + if(!pUnoToCore) + { + pUnoToCore.reset(new std::map<paragraphstyle_t, paragraphcorestyle_t> { + { style::ParagraphStyleCategory::TEXT, SWSTYLEBIT_TEXT }, + { style::ParagraphStyleCategory::CHAPTER, SWSTYLEBIT_CHAPTER }, + { style::ParagraphStyleCategory::LIST, SWSTYLEBIT_LIST }, + { style::ParagraphStyleCategory::INDEX, SWSTYLEBIT_IDX }, + { style::ParagraphStyleCategory::EXTRA, SWSTYLEBIT_EXTRA }, + { style::ParagraphStyleCategory::HTML, SWSTYLEBIT_HTML } + }); + } + const auto pUnoToCoreIt(pUnoToCore->find(rValue.get<paragraphstyle_t>())); + if(pUnoToCoreIt == pUnoToCore->end()) + throw lang::IllegalArgumentException(); + o_rStyleBase.getNewBase()->SetMask( pUnoToCoreIt->second|SFXSTYLEBIT_USERDEF ); +} +template<> +void SwXStyle::SetPropertyValue<SID_SWREGISTER_COLLECTION>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + OUString sName; + rValue >>= sName; + SwRegisterItem aReg(!sName.isEmpty()); + aReg.SetWhich(SID_SWREGISTER_MODE); + o_rStyleBase.GetItemSet().Put(aReg); + OUString aString; + SwStyleNameMapper::FillUIName(sName, aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true); + o_rStyleBase.GetItemSet().Put(SfxStringItem(SID_SWREGISTER_COLLECTION, aString ) ); +} +template<> +void SwXStyle::SetPropertyValue<RES_TXTATR_CJK_RUBY>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + if(MID_RUBY_CHARSTYLE != rEntry.nMemberId) + return; + if(!rValue.has<OUString>()) + throw lang::IllegalArgumentException(); + const auto sValue(rValue.get<OUString>()); + SfxItemSet& rStyleSet(o_rStyleBase.GetItemSet()); + std::unique_ptr<SwFormatRuby> pRuby; + const SfxPoolItem* pItem; + if(SfxItemState::SET == rStyleSet.GetItemState(RES_TXTATR_CJK_RUBY, true, &pItem)) + pRuby.reset(new SwFormatRuby(*static_cast<const SwFormatRuby*>(pItem))); + else + pRuby.reset(new SwFormatRuby(OUString())); + OUString sStyle; + SwStyleNameMapper::FillUIName(sValue, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true); + pRuby->SetCharFormatName(sValue); + pRuby->SetCharFormatId(0); + if(!sValue.isEmpty()) + { + const sal_uInt16 nId(SwStyleNameMapper::GetPoolIdFromUIName(sValue, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT)); + pRuby->SetCharFormatId(nId); + } + rStyleSet.Put(*pRuby); + lcl_SetDefaultWay(rEntry, rPropSet, rValue, o_rStyleBase); +} +template<> +void SwXStyle::SetPropertyValue<RES_PARATR_DROP>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + if(MID_DROPCAP_CHAR_STYLE_NAME != rEntry.nMemberId) + return; + if(!rValue.has<OUString>()) + throw lang::IllegalArgumentException(); + SfxItemSet& rStyleSet(o_rStyleBase.GetItemSet()); + std::unique_ptr<SwFormatDrop> pDrop; + const SfxPoolItem* pItem; + if(SfxItemState::SET == rStyleSet.GetItemState(RES_PARATR_DROP, true, &pItem)) + pDrop.reset(new SwFormatDrop(*static_cast<const SwFormatDrop*>(pItem))); + else + pDrop.reset(new SwFormatDrop); + const auto sValue(rValue.get<OUString>()); + OUString sStyle; + SwStyleNameMapper::FillUIName(sValue, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true); + auto pStyle(static_cast<SwDocStyleSheet*>(m_pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR))); + if(!pStyle) + throw lang::IllegalArgumentException(); + pDrop->SetCharFormat(pStyle->GetCharFormat()); + rStyleSet.Put(*pDrop); +} +template<> +void SwXStyle::SetPropertyValue<RES_PARATR_NUMRULE>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + uno::Any aValue(rValue); + lcl_TranslateMetric(rEntry, m_pDoc, aValue); + lcl_SetDefaultWay(rEntry, rPropSet, aValue, o_rStyleBase); + // --> OD 2006-10-18 #i70223# + if(SFX_STYLE_FAMILY_PARA == m_rEntry.m_eFamily && + o_rStyleBase.getNewBase().is() && o_rStyleBase.getNewBase()->GetCollection() && + //rBase.getNewBase()->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */) //#outline level,removed by zhaojianwei + o_rStyleBase.getNewBase()->GetCollection()->IsAssignedToListLevelOfOutlineStyle()) ////<-end,add by zhaojianwei + { + OUString sNewNumberingRuleName; + aValue >>= sNewNumberingRuleName; + if(sNewNumberingRuleName.isEmpty() || sNewNumberingRuleName != m_pDoc->GetOutlineNumRule()->GetName()) + o_rStyleBase.getNewBase()->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle(); } +} - if(!bDone) +void SwXStyle::SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& rBase) throw(beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception) +{ + using propertytype_t = decltype(rEntry.nWID); + using coresetter_t = std::function<void(SwXStyle&, const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any&, SwStyleBase_Impl&)>; + static std::unique_ptr<std::map<propertytype_t, coresetter_t>> pUnoToCore; + if(!pUnoToCore) { - // default ItemSet handling - SfxItemSet& rStyleSet = rBase.GetItemSet(); - SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID); - aSet.SetParent(&rStyleSet); - rPropSet.setPropertyValue(rEntry, aValue, aSet); - rStyleSet.Put(aSet); - - // --> OD 2006-10-18 #i70223# - if ( SFX_STYLE_FAMILY_PARA == eFamily && - rEntry.nWID == RES_PARATR_NUMRULE && - rBase.getNewBase().is() && rBase.getNewBase()->GetCollection() && - //rBase.getNewBase()->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */) //#outline level,removed by zhaojianwei - rBase.getNewBase()->GetCollection()->IsAssignedToListLevelOfOutlineStyle() ) ////<-end,add by zhaojianwei - { - OUString sNewNumberingRuleName; - aValue >>= sNewNumberingRuleName; - if ( sNewNumberingRuleName.isEmpty() || - sNewNumberingRuleName != pDoc->GetOutlineNumRule()->GetName() ) - { - rBase.getNewBase()->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle(); - } - } + pUnoToCore.reset(new std::map<propertytype_t, coresetter_t> { + // these explicit std::mem_fn() calls shouldnt be needed, but apparently MSVC is currently too stupid for C++11 again + { FN_UNO_HIDDEN, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_HIDDEN>) }, + { FN_UNO_STYLE_INTEROP_GRAB_BAG, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_STYLE_INTEROP_GRAB_BAG>) }, + { XATTR_FILLGRADIENT, std::mem_fn(&SwXStyle::SetPropertyValue<XATTR_FILLGRADIENT>) }, + { XATTR_FILLHATCH, std::mem_fn(&SwXStyle::SetPropertyValue<XATTR_FILLGRADIENT>) }, + { XATTR_FILLBITMAP, std::mem_fn(&SwXStyle::SetPropertyValue<XATTR_FILLGRADIENT>) }, + { XATTR_FILLFLOATTRANSPARENCE, std::mem_fn(&SwXStyle::SetPropertyValue<XATTR_FILLGRADIENT>) }, + { RES_BACKGROUND, std::mem_fn(&SwXStyle::SetPropertyValue<RES_BACKGROUND>) }, + { OWN_ATTR_FILLBMP_MODE, std::mem_fn(&SwXStyle::SetPropertyValue<OWN_ATTR_FILLBMP_MODE>) }, + { RES_PAPER_BIN, std::mem_fn(&SwXStyle::SetPropertyValue<RES_PAPER_BIN>) }, + { FN_UNO_NUM_RULES, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_NUM_RULES>) }, + { RES_PARATR_OUTLINELEVEL, std::mem_fn(&SwXStyle::SetPropertyValue<RES_PARATR_OUTLINELEVEL>) }, + { FN_UNO_FOLLOW_STYLE, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_FOLLOW_STYLE>) }, + { RES_PAGEDESC, std::mem_fn(&SwXStyle::SetPropertyValue<RES_PAGEDESC>) }, + { RES_TEXT_VERT_ADJUST, std::mem_fn(&SwXStyle::SetPropertyValue<RES_TEXT_VERT_ADJUST>) }, + { FN_UNO_IS_AUTO_UPDATE, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_IS_AUTO_UPDATE>) }, + { FN_UNO_PARA_STYLE_CONDITIONS, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_PARA_STYLE_CONDITIONS>) }, + { FN_UNO_CATEGORY, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_CATEGORY>) }, + { SID_SWREGISTER_COLLECTION, std::mem_fn(&SwXStyle::SetPropertyValue<SID_SWREGISTER_COLLECTION>) }, + { RES_TXTATR_CJK_RUBY, std::mem_fn(&SwXStyle::SetPropertyValue<RES_TXTATR_CJK_RUBY>) }, + { RES_PARATR_DROP, std::mem_fn(&SwXStyle::SetPropertyValue<RES_PARATR_DROP>) }, + { RES_PARATR_DROP, std::mem_fn(&SwXStyle::SetPropertyValue<RES_PARATR_DROP>) }, + { RES_PARATR_NUMRULE, std::mem_fn(&SwXStyle::SetPropertyValue<RES_PARATR_NUMRULE>) } + }); + } + const auto pUnoToCoreIt(pUnoToCore->find(rEntry.nWID)); + if(pUnoToCoreIt != pUnoToCore->end()) + pUnoToCoreIt->second(*this, rEntry, rPropSet, rValue, rBase); + else + { + //UUUU adapted switch logic to a more readable state; removed goto's and made + // execution of standard setting of proerty in ItemSet dependent of this variable + uno::Any aValue(rValue); + lcl_TranslateMetric(rEntry, m_pDoc, aValue); + lcl_SetDefaultWay(rEntry, rPropSet, aValue, rBase); } } @@ -2015,7 +1895,7 @@ void SAL_CALL SwXStyle::SetPropertyValues_Impl( throw beans::PropertyVetoException ("Property is read-only: " + pNames[nProp], static_cast<cppu::OWeakObject*>(this)); if(aBaseImpl.getNewBase().is()) { - lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, m_pBasePool, m_pDoc, m_rEntry.m_eFamily); + SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl); } else if(m_bIsDescriptor) { @@ -3053,20 +2933,20 @@ SwXPageStyle::~SwXPageStyle() } -static void lcl_putItemToSet(const SvxSetItem* pSetItem, const SfxItemPropertySet& rPropSet, const SfxItemPropertySimpleEntry& rEntry, const uno::Any& rVal, SwStyleBase_Impl& rBaseImpl, SfxStyleSheetBasePool* pPool, SwDoc *pDoc, SfxStyleFamily eFamily) +void SwXStyle::PutItemToSet(const SvxSetItem* pSetItem, const SfxItemPropertySet& rPropSet, const SfxItemPropertySimpleEntry& rEntry, const uno::Any& rVal, SwStyleBase_Impl& rBaseImpl) { // create a new SvxSetItem and get it's ItemSet as new target SvxSetItem* pNewSetItem = static_cast< SvxSetItem* >(pSetItem->Clone()); SfxItemSet& rSetSet = pNewSetItem->GetItemSet(); // set parent to ItemSet to ensure XFILL_NONE as XFillStyleItem - rSetSet.SetParent(&pDoc->GetDfltFrameFormat()->GetAttrSet()); + rSetSet.SetParent(&m_pDoc->GetDfltFrameFormat()->GetAttrSet()); // replace the used SfxItemSet at the SwStyleBase_Impl temporarily and use the // default method to set the property { SwStyleBase_Impl::ItemSetOverrider o(rBaseImpl, &rSetSet); - lcl_SetStyleProperty(rEntry, rPropSet, rVal, rBaseImpl, pPool, pDoc, eFamily); + SetStyleProperty(rEntry, rPropSet, rVal, rBaseImpl); } // reset paret at ItemSet from SetItem @@ -3155,7 +3035,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( if (lcl_GetHeaderFooterItem(aBaseImpl.GetItemSet(), rPropName, bFooter, pSetItem)) { - lcl_putItemToSet(pSetItem, *pPropSet, *pEntry, pValues[nProp], aBaseImpl, m_pBasePool, GetDoc(), GetFamily()); + PutItemToSet(pSetItem, *pPropSet, *pEntry, pValues[nProp], aBaseImpl); if (pEntry->nWID == SID_ATTR_PAGE_SHARED_FIRST) { @@ -3164,7 +3044,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( bFooter ? SID_ATTR_PAGE_HEADERSET : SID_ATTR_PAGE_FOOTERSET, false, reinterpret_cast<const SfxPoolItem**>(&pSetItem))) { - lcl_putItemToSet(pSetItem, *pPropSet, *pEntry, pValues[nProp], aBaseImpl, m_pBasePool, GetDoc(), GetFamily()); + PutItemToSet(pSetItem, *pPropSet, *pEntry, pValues[nProp], aBaseImpl); } } } @@ -3219,7 +3099,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( default: { // part of PageStyle, fallback to default - lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, m_pBasePool, GetDoc(), GetFamily()); + SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl); } } } @@ -3270,7 +3150,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( // default method to set the property { SwStyleBase_Impl::ItemSetOverrider o(aBaseImpl, &rSetSet); - lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, m_pBasePool, GetDoc(), GetFamily()); + SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl); } // reset paret at ItemSet from SetItem @@ -3284,7 +3164,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( else { // part of PageStyle, fallback to default - lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, m_pBasePool, GetDoc(), GetFamily()); + SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl); } break; @@ -3313,8 +3193,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( } default: { - //UUUU - lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, m_pBasePool, GetDoc(), GetFamily()); + SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl); break; } } diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index aec0ecd8aa3b..5c6f63ecf85d 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -116,7 +116,7 @@ SwASCIIParser::SwASCIIParser(SwDoc* pD, const SwPaM& rCursor, SvStream& rIn, vcl::Font aTextFont( rOpt.GetFontName(), Size( 0, 10 ) ); if( pDoc->getIDocumentDeviceAccess().getPrinter( false ) ) aTextFont = pDoc->getIDocumentDeviceAccess().getPrinter( false )->GetFontMetric( aTextFont ); - SvxFontItem aFont( aTextFont.GetFamily(), aTextFont.GetFamilyName(), + SvxFontItem aFont( aTextFont.GetFamily(), aTextFont.GetName(), OUString(), aTextFont.GetPitch(), aTextFont.GetCharSet(), RES_CHRATR_FONT ); pItemSet->Put( aFont ); pItemSet->Put( aFont, RES_CHRATR_CJK_FONT ); diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 8e6b4a2a3ae7..94794a79faa3 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -612,7 +612,7 @@ static void lcl_html_setFixedFontProperty( DefaultFontType::FIXED, LANGUAGE_ENGLISH_US, GetDefaultFontFlags::OnlyOne ) ); Any aTmp; - aTmp <<= OUString( aFixedFont.GetFamilyName() ); + aTmp <<= OUString( aFixedFont.GetName() ); rPropSet->setPropertyValue("FontName", aTmp ); aTmp <<= OUString( aFixedFont.GetStyleName() ); diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 4479c535cd83..539d77a0522b 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -1078,7 +1078,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, DefaultFontType::FIXED, LANGUAGE_ENGLISH_US, GetDefaultFontFlags::OnlyOne ) ); OUString aFName( *static_cast<OUString const *>(aTmp.getValue()) ); - if( !bEdit || aFName != aFixedFont.GetFamilyName() ) + if( !bEdit || aFName != aFixedFont.GetName() ) { FontFamily eFamily = FAMILY_DONTKNOW; if( xPropSetInfo->hasPropertyByName( "FontFamily" ) ) diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index b696e7f9bcc3..6eff01aecd90 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -332,7 +332,7 @@ void Writer::PutNumFormatFontsInAttrPool() bCheck = true; _AddFontItem( rPool, SvxFontItem( pFont->GetFamily(), - pFont->GetFamilyName(), pFont->GetStyleName(), + pFont->GetName(), pFont->GetStyleName(), pFont->GetPitch(), pFont->GetCharSet(), RES_CHRATR_FONT )); } } diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index 9b58dd38a469..084254fd3599 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -424,7 +424,7 @@ void MSWordExportBase::AbstractNumberingDefinitions() } eChrSet = pBulletFont->GetCharSet(); - sFontName = pBulletFont->GetFamilyName(); + sFontName = pBulletFont->GetName(); eFamily = pBulletFont->GetFamily(); if ( IsStarSymbol(sFontName) ) @@ -498,7 +498,7 @@ void MSWordExportBase::AbstractNumberingDefinitions() aSet.ClearItem( RES_CHRATR_FONT ); if ( sFontName.isEmpty() ) - sFontName = pBulletFont->GetFamilyName(); + sFontName = pBulletFont->GetName(); pPseudoFont = new wwFont( sFontName, pBulletFont->GetPitch(), eFamily, eChrSet); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index b0e95ff18f5f..ed846b052d13 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -692,7 +692,7 @@ void SwWW8ImplReader::SetAnlvStrings(SwNumFormat &rNum, WW8_ANLV const &rAV, ePitch, eCharSet ) ){ vcl::Font aFont; - aFont.SetFamilyName( aName ); + aFont.SetName( aName ); aFont.SetFamily( eFamily ); aFont.SetCharSet( eCharSet ); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 59e4c3debaca..0f457f9821f7 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -1096,11 +1096,11 @@ void WW8ListManager::AdjustLVL( sal_uInt8 nLevel, SwNumRule& rNumRule, else { const SvxFontItem& rFontItem = pFormat->GetFont(); - aFont.SetFamily( rFontItem.GetFamily() ); - aFont.SetFamilyName( rFontItem.GetFamilyName() ); - aFont.SetStyleName( rFontItem.GetStyleName() ); - aFont.SetPitch( rFontItem.GetPitch() ); - aFont.SetCharSet( rFontItem.GetCharSet() ); + aFont.SetFamily( rFontItem.GetFamily() ); + aFont.SetName( rFontItem.GetFamilyName() ); + aFont.SetStyleName( rFontItem.GetStyleName() ); + aFont.SetPitch( rFontItem.GetPitch() ); + aFont.SetCharSet( rFontItem.GetCharSet() ); } aNumFormat.SetBulletFont( &aFont ); } @@ -2350,7 +2350,7 @@ awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString, } aTmp <<= OUString( pFontItem->GetFamilyName()); - aFont.SetFamilyName( pFontItem->GetFamilyName() ); + aFont.SetName( pFontItem->GetFamilyName() ); aFont.SetStyleName( pFontItem->GetStyleName() ); aFont.SetFamily( pFontItem->GetFamily() ); aFont.SetCharSet( pFontItem->GetCharSet() ); diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 3a2afb8b4e22..23779cc11090 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -256,9 +256,9 @@ void SwDropCapsPict::GetFontSettings( const SwDropCapsPage& _rPage, vcl::Font& _ _rPage.rSh.GetCurAttr(aSet); SvxFontItem aFormatFont(static_cast<const SvxFontItem &>( aSet.Get(_nWhich))); - _rFont.SetFamily(aFormatFont.GetFamily()); - _rFont.SetFamilyName(aFormatFont.GetFamilyName()); - _rFont.SetPitch(aFormatFont.GetPitch()); + _rFont.SetFamily (aFormatFont.GetFamily()); + _rFont.SetName (aFormatFont.GetFamilyName()); + _rFont.SetPitch (aFormatFont.GetPitch()); _rFont.SetCharSet(aFormatFont.GetCharSet()); } @@ -304,9 +304,9 @@ void SwDropCapsPict::UpdatePaintSettings() OSL_ENSURE(pFormat, "character style doesn't exist!"); const SvxFontItem &rFormatFont = pFormat->GetFont(); - aFont.SetFamily(rFormatFont.GetFamily()); - aFont.SetFamilyName(rFormatFont.GetFamilyName()); - aFont.SetPitch(rFormatFont.GetPitch()); + aFont.SetFamily (rFormatFont.GetFamily()); + aFont.SetName (rFormatFont.GetFamilyName()); + aFont.SetPitch (rFormatFont.GetPitch()); aFont.SetCharSet(rFormatFont.GetCharSet()); } } diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 016b35b62d23..e3eecbd256d8 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -641,7 +641,7 @@ static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType, if( pPrt ) aFont = pPrt->GetFontMetric( aFont ); SwTextFormatColl *pColl = pWrtShell->GetTextCollFromPool(nType); - pColl->SetFormatAttr(SvxFontItem(aFont.GetFamily(), aFont.GetFamilyName(), + pColl->SetFormatAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(), aEmptyOUStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); } @@ -717,7 +717,7 @@ bool SwStdFontTabPage::FillItemSet( SfxItemSet* ) vcl::Font aFont( sStandard, Size( 0, 10 ) ); if( pPrinter ) aFont = pPrinter->GetFontMetric( aFont ); - m_pWrtShell->SetDefault(SvxFontItem(aFont.GetFamily(), aFont.GetFamilyName(), + m_pWrtShell->SetDefault(SvxFontItem(aFont.GetFamily(), aFont.GetName(), aEmptyOUStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); SwTextFormatColl *pColl = m_pWrtShell->GetTextCollFromPool(RES_POOLCOLL_STANDARD); pColl->ResetFormatAttr(nFontWhich); @@ -829,7 +829,7 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet) for( int i = 0; i < nFontNames; i++ ) { FontMetric aFontMetric( m_pPrt->GetDevFont( i ) ); - aFontNames.insert( aFontMetric.GetFamilyName() ); + aFontNames.insert( aFontMetric.GetName() ); } // insert to listboxes diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx index beb36a6a5359..b0ee67ead375 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -191,7 +191,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh, for( int i = 0; i < nFontNames; i++ ) { FontMetric aFontMetric( pPrt->GetDevFont( i ) ); - aFontNames.insert( aFontMetric.GetFamilyName() ); + aFontNames.insert( aFontMetric.GetName() ); } // insert into listbox @@ -205,7 +205,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh, { LanguageType eLang = aOpt.GetLanguage(); vcl::Font aTmpFont(OutputDevice::GetDefaultFont(DefaultFontType::FIXED, eLang, GetDefaultFontFlags::OnlyOne, pPrt)); - aOpt.SetFontName(aTmpFont.GetFamilyName()); + aOpt.SetFontName(aTmpFont.GetName()); } m_pFontLB->SelectEntry( aOpt.GetFontName() ); diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 20c8d748ba87..5565cb7aa6de 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -239,7 +239,7 @@ void SwInsFootNoteDlg::Init() aFont = m_pNumberCharEdit->GetFont(); m_aFontName = rFont.GetFamilyName(); eCharSet = rFont.GetCharSet(); - aFont.SetFamilyName(m_aFontName); + aFont.SetName(m_aFontName); aFont.SetCharSet(eCharSet); bExtCharAvailable = true; rSh.Left( CRSR_SKIP_CHARS, false, 1, false ); diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 6eae65389b70..89d26ccb7db4 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -566,7 +566,7 @@ static void lcl_SetFontProperties( const SvxPostureItem& rPostureItem ) { rFont.SetFamily ( rFontItem.GetFamily() ); - rFont.SetFamilyName ( rFontItem.GetFamilyName() ); + rFont.SetName ( rFontItem.GetFamilyName() ); rFont.SetStyleName ( rFontItem.GetStyleName() ); rFont.SetCharSet ( rFontItem.GetCharSet() ); rFont.SetPitch ( rFontItem.GetPitch() ); diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx index 448986570fb5..2844b23cde5b 100644 --- a/sw/source/uibase/app/docshini.cxx +++ b/sw/source/uibase/app/docshini.cxx @@ -196,7 +196,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) aFont = pPrt->GetFontMetric( aFont ); } - pFontItem.reset(new SvxFontItem(aFont.GetFamily(), aFont.GetFamilyName(), + pFontItem.reset(new SvxFontItem(aFont.GetFamily(), aFont.GetName(), aEmptyOUStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); } else @@ -213,7 +213,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) nFontTypes[i], eLanguage, GetDefaultFontFlags::OnlyOne ); - pFontItem.reset(new SvxFontItem(aLangDefFont.GetFamily(), aLangDefFont.GetFamilyName(), + pFontItem.reset(new SvxFontItem(aLangDefFont.GetFamily(), aLangDefFont.GetName(), aEmptyOUStr, aLangDefFont.GetPitch(), aLangDefFont.GetCharSet(), nFontWhich)); } m_pDoc->SetDefault(*pFontItem); @@ -281,7 +281,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) SfxItemState::SET != pColl->GetAttrSet().GetItemState( nFontWhich, false ) ) { - pColl->SetFormatAttr(SvxFontItem(aFont.GetFamily(), aFont.GetFamilyName(), + pColl->SetFormatAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(), aEmptyOUStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); } } diff --git a/sw/source/uibase/config/fontcfg.cxx b/sw/source/uibase/config/fontcfg.cxx index 1f30c3920c51..8aa42336a9d5 100644 --- a/sw/source/uibase/config/fontcfg.cxx +++ b/sw/source/uibase/config/fontcfg.cxx @@ -257,7 +257,7 @@ OUString SwStdFontConfig::GetDefaultFor(sal_uInt16 nFontType, LanguageType eLan nFontId = DefaultFontType::LATIN_TEXT; } vcl::Font aFont = OutputDevice::GetDefaultFont(nFontId, eLang, GetDefaultFontFlags::OnlyOne); - return aFont.GetFamilyName(); + return aFont.GetName(); } sal_Int32 SwStdFontConfig::GetDefaultHeightFor(sal_uInt16 nFontType, LanguageType eLang) diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index 353397e2b3d8..3a06617af7fa 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -983,7 +983,7 @@ void SwSrcEditWindow::SetFont() else aFont = OutputDevice::GetDefaultFont(DefaultFontType::SANS_UNICODE, Application::GetSettings().GetLanguageTag().getLanguageType(), GetDefaultFontFlags::NONE, this); - sFontName = aFont.GetFamilyName(); + sFontName = aFont.GetName(); } const SvxFontListItem* pFontListItem = static_cast<const SvxFontListItem* >(pSrcView->GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST )); diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx index 7a9b020743e3..fde324abb0f0 100644 --- a/sw/source/uibase/lingu/hhcwrp.cxx +++ b/sw/source/uibase/lingu/hhcwrp.cxx @@ -151,7 +151,7 @@ SwHHCWrapper::~SwHHCWrapper() const vcl::Font *pFont = GetTargetFont(); if (pFont) { - SvxFontItem aFontItem( pFont->GetFamily(), pFont->GetFamilyName(), + SvxFontItem aFontItem( pFont->GetFamily(), pFont->GetName(), pFont->GetStyleName(), pFont->GetPitch(), pFont->GetCharSet(), RES_CHRATR_CJK_FONT ); pDoc->SetDefault( aFontItem ); @@ -492,7 +492,7 @@ void SwHHCWrapper::ReplaceUnit( if (pTargetFont && pNewUnitLanguage) { SvxFontItem aFontItem(static_cast<const SvxFontItem&>( aSet.Get( RES_CHRATR_CJK_FONT ) )); - aFontItem.SetFamilyName( pTargetFont->GetFamilyName()); + aFontItem.SetFamilyName( pTargetFont->GetName()); aFontItem.SetFamily( pTargetFont->GetFamily()); aFontItem.SetStyleName( pTargetFont->GetStyleName()); aFontItem.SetPitch( pTargetFont->GetPitch()); diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 23fc94c27914..2d46ca8ceda0 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -1714,7 +1714,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) const SvxFontItem* pFontItem = SfxItemSet::GetItem<SvxFontItem>(pDlg->GetOutputItemSet(), SID_ATTR_CHAR_FONT, false); if ( pFontItem ) { - aFont.SetFamilyName( pFontItem->GetFamilyName() ); + aFont.SetName( pFontItem->GetFamilyName() ); aFont.SetStyleName( pFontItem->GetStyleName() ); aFont.SetCharSet( pFontItem->GetCharSet() ); aFont.SetPitch( pFontItem->GetPitch() ); @@ -1723,7 +1723,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) if ( pCItem ) { sSym = pCItem->GetValue(); - aOpt.SetSymbolFont(aFont.GetFamilyName()); + aOpt.SetSymbolFont(aFont.GetName()); SW_MOD()->ApplyUsrPref(aOpt, &rView); } } @@ -1749,7 +1749,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) // Attributing (set font) SfxItemSet aSetFont( *aFontSet.GetPool(), aFontSet.GetRanges() ); - SvxFontItem aFontItem (aFont.GetFamily(), aFont.GetFamilyName(), + SvxFontItem aFontItem (aFont.GetFamily(), aFont.GetName(), aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO ); @@ -1776,8 +1776,8 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) pOLV->ShowCursor(); rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), sSym ) ); - if(!aFont.GetFamilyName().isEmpty()) - rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aFont.GetFamilyName() ) ); + if(!aFont.GetName().isEmpty()) + rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aFont.GetName() ) ); rReq.Done(); } } diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index b11d402ffc32..65785150f0a3 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2111,7 +2111,7 @@ void SwBaseShell::GetTextFontCtrlState( SfxItemSet& rSet ) vcl::Font aFont; if(pI && dynamic_cast< const SvxFontItem *>( pI ) != nullptr) { - aFont.SetFamilyName( static_cast<const SvxFontItem*>(pI)->GetFamilyName()); + aFont.SetName( static_cast<const SvxFontItem*>(pI)->GetFamilyName()); aFont.SetStyleName(static_cast<const SvxFontItem*>(pI)->GetStyleName()); aFont.SetFamily(static_cast<const SvxFontItem*>(pI)->GetFamily()); aFont.SetPitch(static_cast<const SvxFontItem*>(pI)->GetPitch()); diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index e7de13dc4e65..391d0f175f6d 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -751,7 +751,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) const SvxFontItem* pFontItem = SfxItemSet::GetItem<SvxFontItem>(pDlg->GetOutputItemSet(), SID_ATTR_CHAR_FONT, false); if ( pFontItem ) { - aFont.SetFamilyName( pFontItem->GetFamilyName() ); + aFont.SetName( pFontItem->GetFamilyName() ); aFont.SetStyleName( pFontItem->GetStyleName() ); aFont.SetCharSet( pFontItem->GetCharSet() ); aFont.SetPitch( pFontItem->GetPitch() ); @@ -760,7 +760,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) if ( pCItem ) { sSym = pCItem->GetValue(); - aOpt.SetSymbolFont(aFont.GetFamilyName()); + aOpt.SetSymbolFont(aFont.GetName()); SW_MOD()->ApplyUsrPref(aOpt, &rView); } } @@ -786,7 +786,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) // assign attributes (Set font) SfxItemSet aFontAttribSet( *aFontSet.GetPool(), aFontSet.GetRanges() ); - SvxFontItem aFontItem (aFont.GetFamily(), aFont.GetFamilyName(), + SvxFontItem aFontItem (aFont.GetFamily(), aFont.GetName(), aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO ); @@ -813,8 +813,8 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) pOLV->ShowCursor(); rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), sSym ) ); - if(!aFont.GetFamilyName().isEmpty()) - rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aFont.GetFamilyName() ) ); + if(!aFont.GetName().isEmpty()) + rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aFont.GetName() ) ); rReq.Done(); } } diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index d63b8cf1b2b1..3a91e23780e2 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -946,7 +946,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) const SvxFontItem* pFontItem = SfxItemSet::GetItem<SvxFontItem>(pDlg->GetOutputItemSet(), SID_ATTR_CHAR_FONT, false); if ( pFontItem ) { - aNewFont.SetFamilyName( pFontItem->GetFamilyName() ); + aNewFont.SetName( pFontItem->GetFamilyName() ); aNewFont.SetStyleName( pFontItem->GetStyleName() ); aNewFont.SetCharSet( pFontItem->GetCharSet() ); aNewFont.SetPitch( pFontItem->GetPitch() ); @@ -955,7 +955,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) if ( pCItem ) { aChars = pCItem->GetValue(); - aOpt.SetSymbolFont(aNewFont.GetFamilyName()); + aOpt.SetSymbolFont(aNewFont.GetName()); SW_MOD()->ApplyUsrPref(aOpt, &GetView()); } } @@ -991,10 +991,10 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) rSh.Insert( aChars ); // #108876# a font attribute has to be set always due to a guessed script type - if( !aNewFont.GetFamilyName().isEmpty() ) + if( !aNewFont.GetName().isEmpty() ) { SvxFontItem aNewFontItem( aFont ); - aNewFontItem.SetFamilyName( aNewFont.GetFamilyName() ); + aNewFontItem.SetFamilyName( aNewFont.GetName()); aNewFontItem.SetFamily( aNewFont.GetFamily()); aNewFontItem.SetPitch( aNewFont.GetPitch()); aNewFontItem.SetCharSet( aNewFont.GetCharSet() ); @@ -1045,7 +1045,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) if ( !aChars.isEmpty() ) { rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), aChars ) ); - rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aNewFont.GetFamilyName() ) ); + rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aNewFont.GetName() ) ); rReq.Done(); } } diff --git a/test/source/mtfxmldump.cxx b/test/source/mtfxmldump.cxx index 64efc48a3f39..f30e72729327 100644 --- a/test/source/mtfxmldump.cxx +++ b/test/source/mtfxmldump.cxx @@ -350,7 +350,7 @@ void MetafileXmlDump::writeXml(const GDIMetaFile& rMetaFile, XmlWriter& rWriter) rWriter.attribute("color", convertColorToString(aFont.GetColor())); rWriter.attribute("fillcolor", convertColorToString(aFont.GetFillColor())); - rWriter.attribute("name", aFont.GetFamilyName()); + rWriter.attribute("name", aFont.GetName()); rWriter.attribute("stylename", aFont.GetStyleName()); rWriter.attribute("width", aFont.GetSize().Width()); rWriter.attribute("height", aFont.GetSize().Height()); diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx index ee802b41d9f3..20043e6614f3 100644 --- a/toolkit/source/helper/vclunohelper.cxx +++ b/toolkit/source/helper/vclunohelper.cxx @@ -366,7 +366,7 @@ FontItalic VCLUnoHelper::ConvertFontSlant(css::awt::FontSlant eSlant) css::awt::FontDescriptor VCLUnoHelper::CreateFontDescriptor( const vcl::Font& rFont ) { css::awt::FontDescriptor aFD; - aFD.Name = rFont.GetFamilyName(); + aFD.Name = rFont.GetName(); aFD.StyleName = rFont.GetStyleName(); aFD.Height = (sal_Int16)rFont.GetSize().Height(); aFD.Width = (sal_Int16)rFont.GetSize().Width(); @@ -389,7 +389,7 @@ vcl::Font VCLUnoHelper::CreateFont( const css::awt::FontDescriptor& rDescr, cons { vcl::Font aFont( rInitFont ); if ( !rDescr.Name.isEmpty() ) - aFont.SetFamilyName( rDescr.Name ); + aFont.SetName( rDescr.Name ); if ( !rDescr.StyleName.isEmpty() ) aFont.SetStyleName( rDescr.StyleName ); if ( rDescr.Height ) diff --git a/vcl/inc/fontattributes.hxx b/vcl/inc/fontattributes.hxx index cd534008a5f6..17eddc62f54b 100644 --- a/vcl/inc/fontattributes.hxx +++ b/vcl/inc/fontattributes.hxx @@ -35,7 +35,7 @@ public: const OUString& GetStyleName() const { return maStyleName; } FontWeight GetWeight() const { return meWeight; } - FontItalic GetItalic() const { return meItalic; } + FontItalic GetSlantType() const { return meItalic; } FontPitch GetPitch() const { return mePitch; } FontWidth GetWidthType() const { return meWidthType; } rtl_TextEncoding GetCharSet() const { return meCharSet; } diff --git a/vcl/inc/impfontmetric.hxx b/vcl/inc/impfontmetric.hxx index 5c0c8235a7a3..8c021bfb5666 100644 --- a/vcl/inc/impfontmetric.hxx +++ b/vcl/inc/impfontmetric.hxx @@ -34,7 +34,7 @@ public: long GetDescent() const { return mnDescent; } long GetInternalLeading() const { return mnIntLeading; } long GetExternalLeading() const { return mnExtLeading; } - long GetLineHeight() const { return mnLineHeight; } // TODO this is ascent + descnt + long GetLineHeight() const { return mnLineHeight; } long GetSlant() const { return mnSlant; } long GetBulletOffset() const { return mnBulletOffset; } @@ -42,7 +42,7 @@ public: void SetDescent( long nDescent ) { mnDescent = nDescent; } void SetInternalLeading( long nIntLeading ) { mnIntLeading = nIntLeading; } void SetExternalLeading( long nExtLeading ) { mnExtLeading = nExtLeading; } - void SetLineHeight( long nHeight ) { mnLineHeight = nHeight; } // TODO this is ascent + descent + void SetLineHeight( long nHeight ) { mnLineHeight = nHeight; } void SetSlant( long nSlant ) { mnSlant = nSlant; } void SetBulletOffset( long nOffset ) { mnBulletOffset = nOffset; } diff --git a/vcl/qa/cppunit/font.cxx b/vcl/qa/cppunit/font.cxx index a8532a978c37..b5ae8d71325d 100644 --- a/vcl/qa/cppunit/font.cxx +++ b/vcl/qa/cppunit/font.cxx @@ -42,10 +42,10 @@ void VclFontTest::testName() { vcl::Font aFont; - CPPUNIT_ASSERT_MESSAGE( "Family name should be empty", aFont.GetFamilyName().isEmpty()); + CPPUNIT_ASSERT_MESSAGE( "Family name should be empty", aFont.GetName().isEmpty()); CPPUNIT_ASSERT_MESSAGE( "Style name should be empty", aFont.GetStyleName().isEmpty()); - aFont.SetFamilyName("Test family name"); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Family name should not be empty", OUString("Test family name"), aFont.GetFamilyName()); + aFont.SetName("Test family name"); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Family name should not be empty", OUString("Test family name"), aFont.GetName()); aFont.SetStyleName("Test style name"); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Style name should not be empty", OUString("Test style name"), aFont.GetStyleName()); } diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 296684b3dfd9..70a56a340515 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -686,9 +686,9 @@ void ImplStyleData::SetStandardStyles() aStdFont.SetCharSet( osl_getThreadTextEncoding() ); aStdFont.SetWeight( WEIGHT_NORMAL ); if (!utl::ConfigManager::IsAvoidConfig()) - aStdFont.SetFamilyName(utl::DefaultFontConfiguration::get().getUserInterfaceFont(LanguageTag("en"))); + aStdFont.SetName(utl::DefaultFontConfiguration::get().getUserInterfaceFont(LanguageTag("en"))); else - aStdFont.SetFamilyName("Liberation Serif"); + aStdFont.SetName("Liberation Serif"); maAppFont = aStdFont; maHelpFont = aStdFont; maMenuFont = aStdFont; diff --git a/vcl/source/components/fontident.cxx b/vcl/source/components/fontident.cxx index bbf3b5f63624..20aa9d1a705f 100644 --- a/vcl/source/components/fontident.cxx +++ b/vcl/source/components/fontident.cxx @@ -93,7 +93,7 @@ Any SAL_CALL FontIdentificator::getMaterial() throw(RuntimeException, std::excep return Any(); // VCL not initialized FontDescriptor aFD; - aFD.Name = m_aFont.GetFamilyName(); + aFD.Name = m_aFont.GetName(); aFD.Height = 0; aFD.Width = 0; aFD.StyleName = m_aFont.GetStyleName(); diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx index 90070a4bd361..3686e6ec9b9c 100644 --- a/vcl/source/filter/sgvtext.cxx +++ b/vcl/source/filter/sgvtext.cxx @@ -473,7 +473,7 @@ sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, bool Kapt, sal_u if (pSgfFont->Fixd) aFont.SetPitch(PITCH_FIXED); else aFont.SetPitch(PITCH_VARIABLE); aFont.SetFamily(pSgfFont->SVFamil); aFont.SetCharSet(pSgfFont->SVChSet); - aFont.SetFamilyName(FNam); + aFont.SetName(FNam); } else { // if not in Inifile, some fonts are hard coded here @@ -509,7 +509,7 @@ sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, bool Kapt, sal_u } break; default: FNam = "Helvetica"; } - aFont.SetFamilyName(FNam); + aFont.SetName(FNam); //aFont.SetCharSet(CHARSET_SYSTEM); } diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index f583729c0b11..15375dd10394 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -504,7 +504,7 @@ void EMFWriter::ImplCheckTextAttr() if( mbTextChanged && ImplPrepareHandleSelect( mnTextHandle, TEXT_SELECT ) ) { const vcl::Font& rFont = maVDev->GetFont(); - OUString aFontName( rFont.GetFamilyName() ); + OUString aFontName( rFont.GetName() ); sal_Int32 nWeight; sal_uInt16 i; sal_uInt8 nPitchAndFamily; diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index 17db14d14a3e..c19642ad9fb5 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -151,7 +151,7 @@ WinMtfFontStyle::WinMtfFontStyle( LOGFONTW& rFont ) if ( eCharSet == RTL_TEXTENCODING_DONTKNOW ) eCharSet = RTL_TEXTENCODING_MS_1252; aFont.SetCharSet( eCharSet ); - aFont.SetFamilyName( rFont.alfFaceName ); + aFont.SetName( rFont.alfFaceName ); FontFamily eFamily; switch ( rFont.lfPitchAndFamily & 0xf0 ) { @@ -852,14 +852,14 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) : { mbIsMapWinSet = false; mbIsMapDevSet = false; - mpGDIMetaFile->AddAction( new MetaPushAction( PushFlags::CLIPREGION ) ); // The original clipregion has to be on top - // of the stack so it can always be restored - // this is necessary to be able to support - // SetClipRgn( NULL ) and similar ClipRgn actions (SJ) - - maFont.SetFamilyName( "Arial" ); // sj: #i57205#, we do have some scaling problems if using - maFont.SetCharSet( RTL_TEXTENCODING_MS_1252 ); // the default font then most times a x11 font is used, we - maFont.SetHeight( 423 ); // will prevent this defining a font + mpGDIMetaFile->AddAction( new MetaPushAction( PushFlags::CLIPREGION ) ); // The original clipregion has to be on top + // of the stack so it can always be restored + // this is necessary to be able to support + // SetClipRgn( NULL ) and similar ClipRgn actions (SJ) + + maFont.SetName( "Arial" ); // sj: #i57205#, we do have some scaling problems if using + maFont.SetCharSet( RTL_TEXTENCODING_MS_1252 ); // the default font then most times a x11 font is used, we + maFont.SetHeight( 423 ); // will prevent this defining a font maLatestLineStyle.aLineColor = Color( 0x12, 0x34, 0x56 ); maLatestFillStyle.aFillColor = Color( 0x12, 0x34, 0x56 ); diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index 025d367ca5c1..a142f765020a 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -1041,7 +1041,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) case PRIVATE_ESCAPE_UNICODE : { // we will use text instead of polygons only if we have the correct font - if ( Application::GetDefaultDevice()->IsFontAvailable( pOut->GetFont().GetFamilyName() ) ) + if ( Application::GetDefaultDevice()->IsFontAvailable( pOut->GetFont().GetName() ) ) { Point aPt; OUString aString; diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 816e536cab37..90ef1d756ff7 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -359,7 +359,7 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const vcl::Font & rFont) } pWMF->WriteUChar( nPitchFamily ); - OString aFontName(OUStringToOString(rFont.GetFamilyName(), eFontNameEncoding)); + OString aFontName(OUStringToOString(rFont.GetName(), eFontNameEncoding)); for ( i = 0; i < W_LF_FACESIZE; i++ ) { sal_Char nChar = ( i < aFontName.getLength() ) ? aFontName[i] : 0; @@ -491,7 +491,7 @@ bool WMFWriter::WMFRecord_Escape_Unicode( const Point& rPoint, const OUString& r } } - if ( ( i != nStringLen ) || IsStarSymbol( aSrcFont.GetFamilyName() ) ) // after conversion the characters are not original, so we + if ( ( i != nStringLen ) || IsStarSymbol( aSrcFont.GetName() ) ) // after conversion the characters are not original, so we { // will store the unicode string and a polypoly replacement Color aOldFillColor( aSrcFillColor ); Color aOldLineColor( aSrcLineColor ); @@ -946,7 +946,7 @@ void WMFWriter::SetAllAttr() if ( aDstFont != aSrcFont ) { pVirDev->SetFont(aSrcFont); - if ( aDstFont.GetFamilyName() != aSrcFont.GetFamilyName() ) + if ( aDstFont.GetName() != aSrcFont.GetName() ) { FontCharMapPtr xFontCharMap; if ( pVirDev->GetFontCharMap( xFontCharMap ) ) diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index 61a8a9fd3ccd..07723101235a 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -1273,7 +1273,7 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& r PhysicalFontFamily::CalcType( nSearchType, eSearchWeight, eSearchWidth, rFSD.GetFamilyType(), pFontAttr ); PhysicalFontFamily* pFoundData = FindFontFamilyByAttributes( nSearchType, - eSearchWeight, eSearchWidth, rFSD.GetItalic(), aSearchFamilyName ); + eSearchWeight, eSearchWidth, rFSD.GetSlantType(), aSearchFamilyName ); if( pFoundData ) { @@ -1293,8 +1293,8 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& r } if( (nSearchType & ImplFontAttrs::Italic) && - ((rFSD.GetItalic() == ITALIC_DONTKNOW) || - (rFSD.GetItalic() == ITALIC_NONE)) && + ((rFSD.GetSlantType() == ITALIC_DONTKNOW) || + (rFSD.GetSlantType() == ITALIC_NONE)) && (pFoundData->GetTypeFaces() & FONT_FAMILY_ITALIC) ) { rFSD.SetItalic( ITALIC_NORMAL ); diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx index 1e50b0cafece..9540604f137f 100644 --- a/vcl/source/font/PhysicalFontFace.cxx +++ b/vcl/source/font/PhysicalFontFace.cxx @@ -50,9 +50,9 @@ sal_Int32 PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther ) else if( GetWeight() > rOther.GetWeight() ) return 1; - if( GetItalic() < rOther.GetItalic() ) + if( GetSlantType() < rOther.GetSlantType() ) return -1; - else if( GetItalic() > rOther.GetItalic() ) + else if( GetSlantType() > rOther.GetSlantType() ) return 1; sal_Int32 nRet = GetFamilyName().compareTo( rOther.GetFamilyName() ); @@ -143,18 +143,18 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt } // if requiring custom matrix to fake italic, prefer upright font - FontItalic ePatternItalic = rFSD.maItalicMatrix != ItalicMatrix() ? ITALIC_NONE : rFSD.GetItalic(); + FontItalic ePatternItalic = rFSD.maItalicMatrix != ItalicMatrix() ? ITALIC_NONE : rFSD.GetSlantType(); if ( ePatternItalic == ITALIC_NONE ) { - if( GetItalic() == ITALIC_NONE ) + if( GetSlantType() == ITALIC_NONE ) nMatch += 900; } else { - if( ePatternItalic == GetItalic() ) + if( ePatternItalic == GetSlantType() ) nMatch += 900; - else if( GetItalic() != ITALIC_NONE ) + else if( GetSlantType() != ITALIC_NONE ) nMatch += 600; } diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx index 47879976e28d..20a72e068625 100644 --- a/vcl/source/font/PhysicalFontFamily.cxx +++ b/vcl/source/font/PhysicalFontFamily.cxx @@ -150,10 +150,10 @@ bool PhysicalFontFamily::AddFontFace( PhysicalFontFace* pNewFontFace ) mnTypeFaces |= FONT_FAMILY_NORMAL; } - if( pNewFontFace->GetItalic() == ITALIC_NONE ) + if( pNewFontFace->GetSlantType() == ITALIC_NONE ) mnTypeFaces |= FONT_FAMILY_NONEITALIC; - else if( (pNewFontFace->GetItalic() == ITALIC_NORMAL) - || (pNewFontFace->GetItalic() == ITALIC_OBLIQUE) ) + else if( (pNewFontFace->GetSlantType() == ITALIC_NORMAL) + || (pNewFontFace->GetSlantType() == ITALIC_OBLIQUE) ) mnTypeFaces |= FONT_FAMILY_ITALIC; // reassign name (sharing saves memory) diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx index 8cca361e5faf..dfb219a2c893 100644 --- a/vcl/source/font/font.cxx +++ b/vcl/source/font/font.cxx @@ -137,7 +137,7 @@ void Font::SetAlign( FontAlign eAlign ) } } -void Font::SetFamilyName( const OUString& rFamilyName ) +void Font::SetName( const OUString& rFamilyName ) { MakeUnique(); mpImplFont->SetFamilyName( rFamilyName ); @@ -409,9 +409,9 @@ bool Font::operator==( const vcl::Font& rFont ) const void Font::Merge( const vcl::Font& rFont ) { - if ( !rFont.GetFamilyName().isEmpty() ) + if ( !rFont.GetName().isEmpty() ) { - SetFamilyName( rFont.GetFamilyName() ); + SetName( rFont.GetName() ); SetStyleName( rFont.GetStyleName() ); SetCharSet( GetCharSet() ); SetLanguageTag( rFont.GetLanguageTag() ); @@ -573,9 +573,9 @@ namespace GetTTGlobalFontInfo( pTTF, &aInfo ); // most importantly: the family name if( aInfo.ufamily ) - o_rResult.SetFamilyName( aInfo.ufamily ); + o_rResult.SetName( aInfo.ufamily ); else if( aInfo.family ) - o_rResult.SetFamilyName( OStringToOUString( aInfo.family, RTL_TEXTENCODING_ASCII_US ) ); + o_rResult.SetName( OStringToOUString( aInfo.family, RTL_TEXTENCODING_ASCII_US ) ); // set weight if( aInfo.weight ) { @@ -690,7 +690,7 @@ namespace pClose++; if( pClose - pOpen > 1 ) { - o_rResult.SetFamilyName( OStringToOUString( OString( pOpen+1, pClose-pOpen-1 ), RTL_TEXTENCODING_ASCII_US ) ); + o_rResult.SetName( OStringToOUString( OString( pOpen+1, pClose-pOpen-1 ), RTL_TEXTENCODING_ASCII_US ) ); } } @@ -778,7 +778,7 @@ bool Font::IsTransparent() const { return mpImplFont->mbTransparent; } FontAlign Font::GetAlign() const { return mpImplFont->meAlign; } -const OUString& Font::GetFamilyName() const { return mpImplFont->GetFamilyName(); } +const OUString& Font::GetName() const { return mpImplFont->GetFamilyName(); } const OUString& Font::GetStyleName() const { return mpImplFont->maStyleName; } diff --git a/vcl/source/font/fontcache.cxx b/vcl/source/font/fontcache.cxx index 39d436635d84..25fe88910deb 100644 --- a/vcl/source/font/fontcache.cxx +++ b/vcl/source/font/fontcache.cxx @@ -87,7 +87,7 @@ bool ImplFontCache::IFSD_Equal::operator()(const FontSelectPattern& rA, const Fo // check font face attributes if( (rA.GetWeight() != rB.GetWeight()) - || (rA.GetItalic() != rB.GetItalic()) + || (rA.GetSlantType() != rB.GetSlantType()) // || (rA.meFamily != rB.meFamily) // TODO: remove this mostly obsolete member || (rA.GetPitch() != rB.GetPitch()) ) return false; @@ -143,7 +143,7 @@ ImplFontCache::~ImplFontCache() LogicalFontInstance* ImplFontCache::GetFontInstance( PhysicalFontCollection* pFontList, const vcl::Font& rFont, const Size& rSize, float fExactHeight ) { - OUString aSearchName = rFont.GetFamilyName(); + OUString aSearchName = rFont.GetName(); // initialize internal font request object FontSelectPattern aFontSelData( rFont, aSearchName, rSize, fExactHeight ); diff --git a/vcl/source/font/fontselect.cxx b/vcl/source/font/fontselect.cxx index 6f5f42ba05fc..641e3c6ea0b3 100644 --- a/vcl/source/font/fontselect.cxx +++ b/vcl/source/font/fontselect.cxx @@ -155,7 +155,7 @@ size_t FontSelectPatternAttributes::hashCode() const } nHash += 11 * mnHeight; nHash += 19 * GetWeight(); - nHash += 29 * GetItalic(); + nHash += 29 * GetSlantType(); nHash += 37 * mnOrientation; nHash += 41 * meLanguage; if( mbVertical ) diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index c561a3954bfa..07ceea37ac5b 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -206,7 +206,7 @@ void ImplWriteFont( SvStream& rOStm, const vcl::Font& rFont, char aName[33]; short nWeight; - OString aByteName(OUStringToOString(rFont.GetFamilyName(), + OString aByteName(OUStringToOString(rFont.GetName(), rOStm.GetStreamCharSet())); strncpy( aName, aByteName.getStr(), 32 ); aName[32] = 0; @@ -817,7 +817,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) ImplReadColor( rIStm, aActionColor ); aFont.SetColor( aActionColor ); ImplReadColor( rIStm, aActionColor ); aFont.SetFillColor( aActionColor ); rIStm.Read( aName, 32 ); - aFont.SetFamilyName( OUString( aName, strlen(aName), rIStm.GetStreamCharSet() ) ); + aFont.SetName( OUString( aName, strlen(aName), rIStm.GetStreamCharSet() ) ); rIStm.ReadInt32( nWidth ).ReadInt32( nHeight ); rIStm.ReadInt16( nCharOrient ).ReadInt16( nLineOrient ); rIStm.ReadInt16( nCharSet ).ReadInt16( nFamily ).ReadInt16( nPitch ).ReadInt16( nAlign ).ReadInt16( nWeight ).ReadInt16( nUnderline ).ReadInt16( nStrikeout ); diff --git a/vcl/source/gdi/embeddedfontshelper.cxx b/vcl/source/gdi/embeddedfontshelper.cxx index d5c3087cf651..7b08e92bcd75 100644 --- a/vcl/source/gdi/embeddedfontshelper.cxx +++ b/vcl/source/gdi/embeddedfontshelper.cxx @@ -245,7 +245,7 @@ OUString EmbeddedFontsHelper::fontFileUrl( const OUString& familyName, FontFamil // It is possible that it still may be needed to do at least some checks here // for some encodings (can one font have more font files for more encodings?). if(( family == FAMILY_DONTKNOW || f->GetFamilyType() == family ) - && ( italic == ITALIC_DONTKNOW || f->GetItalic() == italic ) + && ( italic == ITALIC_DONTKNOW || f->GetSlantType() == italic ) && ( weight == WEIGHT_DONTKNOW || f->GetWeight() == weight ) && ( pitch == PITCH_DONTKNOW || f->GetPitch() == pitch )) { // Exact match, return it immediately. @@ -253,7 +253,7 @@ OUString EmbeddedFontsHelper::fontFileUrl( const OUString& familyName, FontFamil break; } if(( f->GetFamilyType() == FAMILY_DONTKNOW || family == FAMILY_DONTKNOW || f->GetFamilyType() == family ) - && ( f->GetItalic() == ITALIC_DONTKNOW || italic == ITALIC_DONTKNOW || f->GetItalic() == italic ) + && ( f->GetSlantType() == ITALIC_DONTKNOW || italic == ITALIC_DONTKNOW || f->GetSlantType() == italic ) && ( f->GetWeight() == WEIGHT_DONTKNOW || weight == WEIGHT_DONTKNOW || f->GetWeight() == weight ) && ( f->GetPitch() == PITCH_DONTKNOW || pitch == PITCH_DONTKNOW || f->GetPitch() == pitch )) { // Some fonts specify 'DONTKNOW' for some things, still a good match, if we don't find a better one. diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 2643b9bc14e5..ed742770a51d 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -2775,7 +2775,7 @@ MetaFontAction::MetaFontAction( const vcl::Font& rFont ) : // we change the textencoding to RTL_TEXTENCODING_UNICODE here, which seems // to be the right way; changing the textencoding at other sources // is too dangerous at the moment - if ( IsStarSymbol( maFont.GetFamilyName() ) + if ( IsStarSymbol( maFont.GetName() ) && ( maFont.GetCharSet() != RTL_TEXTENCODING_UNICODE ) ) { maFont.SetCharSet( RTL_TEXTENCODING_UNICODE ); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 8f9f37151431..69d8b50720f3 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1783,7 +1783,7 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal m_aStructure[0].m_nParentElement = 0; Font aFont; - aFont.SetFamilyName( "Times" ); + aFont.SetName( "Times" ); aFont.SetSize( Size( 0, 12 ) ); GraphicsState aState; @@ -2316,7 +2316,7 @@ void PDFWriterImpl::endPage() // reset the default font Font aFont; - aFont.SetFamilyName( "Times" ); + aFont.SetName( "Times" ); aFont.SetSize( Size( 0, 12 ) ); m_aCurrentPDFState = m_aGraphicsStack.front(); @@ -3532,9 +3532,9 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical aErrorComment.append( "GetEmbedFontData failed for font \"" ); aErrorComment.append( OUStringToOString( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 ) ); aErrorComment.append( '\"' ); - if( pFont->GetItalic() == ITALIC_NORMAL ) + if( pFont->GetSlantType() == ITALIC_NORMAL ) aErrorComment.append( " italic" ); - else if( pFont->GetItalic() == ITALIC_OBLIQUE ) + else if( pFont->GetSlantType() == ITALIC_OBLIQUE ) aErrorComment.append( " oblique" ); aErrorComment.append( " weight=" ); aErrorComment.append( sal_Int32(pFont->GetWeight()) ); @@ -3602,7 +3602,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical pRef->SetMapMode( MapMode( MAP_PIXEL ) ); Font aFont( pFont->GetFamilyName(), pFont->GetStyleName(), Size( 0, 1000 ) ); aFont.SetWeight( pFont->GetWeight() ); - aFont.SetItalic( pFont->GetItalic() ); + aFont.SetItalic( pFont->GetSlantType() ); aFont.SetPitch( pFont->GetPitch() ); pRef->SetFont( aFont ); pRef->ImplNewFont(); @@ -3817,7 +3817,7 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const PhysicalFontFace* pFont, Font // possibly characters outside Adobe standard encoding // so set Symbolic flag sal_Int32 nFontFlags = (1<<2); - if( pFont->GetItalic() == ITALIC_NORMAL || pFont->GetItalic() == ITALIC_OBLIQUE ) + if( pFont->GetSlantType() == ITALIC_NORMAL || pFont->GetSlantType() == ITALIC_OBLIQUE ) nFontFlags |= (1 << 6); if( pFont->GetPitch() == PITCH_FIXED ) nFontFlags |= 1; @@ -3847,7 +3847,7 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const PhysicalFontFace* pFont, Font aLine.append( ' ' ); aLine.append( (sal_Int32)(rInfo.m_aFontBBox.BottomRight().Y()+1) ); aLine.append( "]/ItalicAngle " ); - if( pFont->GetItalic() == ITALIC_OBLIQUE || pFont->GetItalic() == ITALIC_NORMAL ) + if( pFont->GetSlantType() == ITALIC_OBLIQUE || pFont->GetSlantType() == ITALIC_NORMAL ) aLine.append( "-30" ); else aLine.append( "0" ); @@ -4122,9 +4122,9 @@ bool PDFWriterImpl::emitFonts() aErrorComment.append( "CreateFontSubset failed for font \"" ); aErrorComment.append( OUStringToOString( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 ) ); aErrorComment.append( '\"' ); - if( pFont->GetItalic() == ITALIC_NORMAL ) + if( pFont->GetSlantType() == ITALIC_NORMAL ) aErrorComment.append( " italic" ); - else if( pFont->GetItalic() == ITALIC_OBLIQUE ) + else if( pFont->GetSlantType() == ITALIC_OBLIQUE ) aErrorComment.append( " oblique" ); aErrorComment.append( " weight=" ); aErrorComment.append( sal_Int32(pFont->GetWeight()) ); @@ -4691,7 +4691,7 @@ Font PDFWriterImpl::replaceFont( const vcl::Font& rControlFont, const vcl::Font& bool bAdjustSize = false; Font aFont( rControlFont ); - if( aFont.GetFamilyName().isEmpty() ) + if( aFont.GetName().isEmpty() ) { aFont = rAppSetFont; if( rControlFont.GetHeight() ) @@ -4721,7 +4721,7 @@ Font PDFWriterImpl::replaceFont( const vcl::Font& rControlFont, const vcl::Font& sal_Int32 PDFWriterImpl::getBestBuiltinFont( const vcl::Font& rFont ) { sal_Int32 nBest = 4; // default to Helvetica - OUString aFontName( rFont.GetFamilyName() ); + OUString aFontName( rFont.GetName() ); aFontName = aFontName.toAsciiLowerCase(); if( aFontName.indexOf( "times" ) != -1 ) @@ -8870,8 +8870,8 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool // perform artificial italics if necessary if( ( m_aCurrentPDFState.m_aFont.GetItalic() == ITALIC_NORMAL || m_aCurrentPDFState.m_aFont.GetItalic() == ITALIC_OBLIQUE ) && - !( m_pReferenceDevice->mpFontInstance->maFontSelData.mpFontData->GetItalic() == ITALIC_NORMAL || - m_pReferenceDevice->mpFontInstance->maFontSelData.mpFontData->GetItalic() == ITALIC_OBLIQUE ) + !( m_pReferenceDevice->mpFontInstance->maFontSelData.mpFontData->GetSlantType() == ITALIC_NORMAL || + m_pReferenceDevice->mpFontInstance->maFontSelData.mpFontData->GetSlantType() == ITALIC_OBLIQUE ) ) { fSkew = M_PI/12.0; diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 0f7c783dfe4b..7af457e8344a 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -74,13 +74,13 @@ FontMetric OutputDevice::GetDevFont( int nDevFontIndex ) const if( nDevFontIndex < nCount ) { const PhysicalFontFace& rData = *mpDeviceFontList->Get( nDevFontIndex ); - aFontMetric.SetFamilyName( rData.GetFamilyName() ); + aFontMetric.SetName( rData.GetFamilyName() ); aFontMetric.SetStyleName( rData.GetStyleName() ); aFontMetric.SetCharSet( rData.GetCharSet() ); aFontMetric.SetFamily( rData.GetFamilyType() ); aFontMetric.SetPitch( rData.GetPitch() ); aFontMetric.SetWeight( rData.GetWeight() ); - aFontMetric.SetItalic( rData.GetItalic() ); + aFontMetric.SetItalic( rData.GetSlantType() ); aFontMetric.SetWidthType( rData.GetWidthType() ); aFontMetric.SetScalableFlag( rData.IsScalable() ); aFontMetric.SetBuiltInFontFlag( rData.IsBuiltInFont() ); @@ -112,7 +112,7 @@ int OutputDevice::GetDevFontSizeCount( const vcl::Font& rFont ) const delete mpDeviceFontSizeList; ImplInitFontList(); - mpDeviceFontSizeList = mpFontCollection->GetDeviceFontSizeList( rFont.GetFamilyName() ); + mpDeviceFontSizeList = mpFontCollection->GetDeviceFontSizeList( rFont.GetName() ); return mpDeviceFontSizeList->Count(); } @@ -195,14 +195,14 @@ FontMetric OutputDevice::GetFontMetric() const aMetric.Font::operator=( maFont ); // set aMetric with info from font - aMetric.SetFamilyName( maFont.GetFamilyName() ); + aMetric.SetName( maFont.GetName() ); aMetric.SetStyleName( xFontMetric->GetStyleName() ); aMetric.SetSize( PixelToLogic( Size( xFontMetric->GetWidth(), xFontMetric->GetAscent() + xFontMetric->GetDescent() - xFontMetric->GetInternalLeading() ) ) ); aMetric.SetCharSet( xFontMetric->IsSymbolFont() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE ); aMetric.SetFamily( xFontMetric->GetFamilyType() ); aMetric.SetPitch( xFontMetric->GetPitch() ); aMetric.SetWeight( xFontMetric->GetWeight() ); - aMetric.SetItalic( xFontMetric->GetItalic() ); + aMetric.SetItalic( xFontMetric->GetSlantType() ); aMetric.SetWidthType( xFontMetric->GetWidthType() ); if ( pFontInstance->mnOwnOrientation ) aMetric.SetOrientation( pFontInstance->mnOwnOrientation ); @@ -879,11 +879,11 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan } } while ( nIndex != -1 ); - aFont.SetFamilyName( aName ); + aFont.SetName( aName ); } // No Name, than set all names - if ( aFont.GetFamilyName().isEmpty() ) + if ( aFont.GetName().isEmpty() ) { if ( nFlags & GetDefaultFontFlags::OnlyOne ) { @@ -891,13 +891,13 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan { SAL_WARN ("vcl.gdi", "No default window has been set for the application - we really shouldn't be able to get here"); sal_Int32 nIndex = 0; - aFont.SetFamilyName( aSearch.getToken( 0, ';', nIndex ) ); + aFont.SetName( aSearch.getToken( 0, ';', nIndex ) ); } else { pOutDev->ImplInitFontList(); - aFont.SetFamilyName( aSearch ); + aFont.SetName( aSearch ); // convert to pixel height Size aSize = pOutDev->ImplLogicToDevicePixel( aFont.GetSize() ); @@ -920,15 +920,15 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan if (pFontInstance) { if( pFontInstance->maFontSelData.mpFontData ) - aFont.SetFamilyName( pFontInstance->maFontSelData.mpFontData->GetFamilyName() ); + aFont.SetName( pFontInstance->maFontSelData.mpFontData->GetFamilyName() ); else - aFont.SetFamilyName( pFontInstance->maFontSelData.maTargetName ); + aFont.SetName( pFontInstance->maFontSelData.maTargetName ); pOutDev->mpFontCache->Release(pFontInstance); } } } else - aFont.SetFamilyName( aSearch ); + aFont.SetName( aSearch ); } } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index be6a3e4097df..d50871932fd1 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1883,7 +1883,7 @@ void Window::ImplNewInputContext() SalInputContext aNewContext; const vcl::Font& rFont = rInputContext.GetFont(); - const OUString& rFontName = rFont.GetFamilyName(); + const OUString& rFontName = rFont.GetName(); LogicalFontInstance* pFontInstance = nullptr; aNewContext.mpFont = nullptr; if (!rFontName.isEmpty()) diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index d1f0d9948ab0..ff5d496a1da7 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -483,7 +483,7 @@ void Window::SetZoomedPointFont(vcl::RenderContext& rRenderContext, const vcl::F else nType = DefaultFontType::UI_SANS; vcl::Font aTempFont = OutputDevice::GetDefaultFont(nType, rRenderContext.GetSettings().GetLanguageTag().getLanguageType(), GetDefaultFontFlags::NONE); - aFont.SetFamilyName(aTempFont.GetFamilyName()); + aFont.SetName(aTempFont.GetName()); SetPointFont(rRenderContext, aFont); } } diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index cd58d2ef92a9..611a2edf1a16 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -990,7 +990,7 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi if (!aLangAttrib.isEmpty()) FcPatternAddString(pPattern, FC_LANG, reinterpret_cast<FcChar8 const *>(aLangAttrib.getStr())); - addtopattern(pPattern, rPattern.GetItalic(), rPattern.GetWeight(), + addtopattern(pPattern, rPattern.GetSlantType(), rPattern.GetWeight(), rPattern.GetWidthType(), rPattern.GetPitch()); // query fontconfig for a substitute diff --git a/vcl/unx/generic/fontmanager/fontsubst.cxx b/vcl/unx/generic/fontmanager/fontsubst.cxx index aaaaac311269..0072c0972c41 100644 --- a/vcl/unx/generic/fontmanager/fontsubst.cxx +++ b/vcl/unx/generic/fontmanager/fontsubst.cxx @@ -123,7 +123,7 @@ namespace ( rOrig.maTargetName == rNew.maSearchName && rOrig.GetWeight() == rNew.GetWeight() && - rOrig.GetItalic() == rNew.GetItalic() && + rOrig.GetSlantType() == rNew.GetSlantType() && rOrig.GetPitch() == rNew.GetPitch() && rOrig.GetWidthType() == rNew.GetWidthType() ); @@ -186,13 +186,13 @@ bool FcPreMatchSubstitution::FindFontSubstitute( FontSelectPattern &rFontSelData const OString aSubstName(OUStringToOString(aOut.maSearchName, RTL_TEXTENCODING_UTF8)); printf( "FcPreMatchSubstitution \"%s\" bipw=%d%d%d%d -> ", - aOrigName.getStr(), rFontSelData.GetWeight(), rFontSelData.GetItalic(), + aOrigName.getStr(), rFontSelData.GetWeight(), rFontSelData.GetSlantType(), rFontSelData.GetPitch(), rFontSelData.GetWidthType() ); if( !bHaveSubstitute ) printf( "no substitute available\n" ); else printf( "\"%s\" bipw=%d%d%d%d\n", aSubstName.getStr(), - aOut.GetWeight(), aOut.GetItalic(), aOut.GetPitch(), aOut.GetWidthType() ); + aOut.GetWeight(), aOut.GetSlantType(), aOut.GetPitch(), aOut.GetWidthType() ); #endif if( bHaveSubstitute ) @@ -234,13 +234,13 @@ bool FcGlyphFallbackSubstitution::FindFontSubstitute( FontSelectPattern& rFontSe const OString aSubstName(OUStringToOString(aOut.maSearchName, RTL_TEXTENCODING_UTF8)); printf( "FcGFSubstitution \"%s\" bipw=%d%d%d%d ->", - aOrigName.getStr(), rFontSelData.GetWeight(), rFontSelData.GetItalic(), + aOrigName.getStr(), rFontSelData.GetWeight(), rFontSelData.GetSlantType(), rFontSelData.GetPitch(), rFontSelData.GetWidthType() ); if( !bHaveSubstitute ) printf( "no substitute available\n" ); else printf( "\"%s\" bipw=%d%d%d%d\n", aSubstName.getStr(), - aOut.GetWeight(), aOut.GetItalic(), aOut.GetPitch(), aOut.GetWidthType() ); + aOut.GetWeight(), aOut.GetSlantType(), aOut.GetPitch(), aOut.GetWidthType() ); #endif if( bHaveSubstitute ) diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index ab7fa400e5fd..8c76759da585 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -447,7 +447,7 @@ FontConfigFontOptions* GetFCFontOptions( const FontAttributes& rFontAttributes, psp::FastPrintFontInfo aInfo; aInfo.m_aFamilyName = rFontAttributes.GetFamilyName(); - aInfo.m_eItalic = rFontAttributes.GetItalic(); + aInfo.m_eItalic = rFontAttributes.GetSlantType(); aInfo.m_eWeight = rFontAttributes.GetWeight(); aInfo.m_eWidth = rFontAttributes.GetWidthType(); diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx index 5ed4da75f1bc..957450f2b066 100644 --- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx +++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx @@ -516,7 +516,7 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FreetypeFontInfo* pFI ) mnLoadFlags |= FT_LOAD_IGNORE_TRANSFORM; #endif - mbArtItalic = (rFSD.GetItalic() != ITALIC_NONE && pFI->GetFontAttributes().GetItalic() == ITALIC_NONE); + mbArtItalic = (rFSD.GetSlantType() != ITALIC_NONE && pFI->GetFontAttributes().GetSlantType() == ITALIC_NONE); mbArtBold = (rFSD.GetWeight() > WEIGHT_MEDIUM && pFI->GetFontAttributes().GetWeight() <= WEIGHT_MEDIUM); if( mbArtBold ) { diff --git a/vcl/unx/generic/glyphs/glyphcache.cxx b/vcl/unx/generic/glyphs/glyphcache.cxx index f83eb879b43d..33f06df2faab 100644 --- a/vcl/unx/generic/glyphs/glyphcache.cxx +++ b/vcl/unx/generic/glyphs/glyphcache.cxx @@ -86,7 +86,7 @@ size_t GlyphCache::IFSD_Hash::operator()( const FontSelectPattern& rFontSelData nHash += rFontSelData.mnHeight; nHash += rFontSelData.mnOrientation; nHash += size_t(rFontSelData.mbVertical); - nHash += rFontSelData.GetItalic(); + nHash += rFontSelData.GetSlantType(); nHash += rFontSelData.GetWeight(); #if ENABLE_GRAPHITE nHash += rFontSelData.meLanguage; @@ -109,7 +109,7 @@ bool GlyphCache::IFSD_Equal::operator()( const FontSelectPattern& rA, const Font || (rA.mbNonAntialiased != rB.mbNonAntialiased) ) return false; - if( (rA.GetItalic() != rB.GetItalic()) + if( (rA.GetSlantType() != rB.GetSlantType()) || (rA.GetWeight() != rB.GetWeight()) ) return false; diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index 580c0ff3d923..19965a336f67 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -804,7 +804,7 @@ sal_uInt16 GenPspGraphics::SetFont( FontSelectPattern *pEntry, int nFallbackLeve // determine which font attributes need to be emulated bool bArtItalic = false; bool bArtBold = false; - if( pEntry->GetItalic() == ITALIC_OBLIQUE || pEntry->GetItalic() == ITALIC_NORMAL ) + if( pEntry->GetSlantType() == ITALIC_OBLIQUE || pEntry->GetSlantType() == ITALIC_NORMAL ) { FontItalic eItalic = m_pPrinterGfx->GetFontMgr().getFontItalic( nID ); if( eItalic != ITALIC_NORMAL && eItalic != ITALIC_OBLIQUE ) diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 8230ffb916e9..62883261dfe3 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -2787,12 +2787,12 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) // is to wide for the dialogs if ( rSettings.GetLanguageTag().getLanguageType() == LANGUAGE_RUSSIAN ) { - OUString aFontName = aAppFont.GetFamilyName(); + OUString aFontName = aAppFont.GetName(); OUString aFirstName = aFontName.getToken( 0, ';' ); if ( aFirstName.equalsIgnoreAsciiCase( "MS Sans Serif" ) ) { aFontName = "Arial;" + aFontName; - aAppFont.SetFamilyName( aFontName ); + aAppFont.SetName( aFontName ); } } aStyleSettings.SetAppFont( aAppFont ); diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 79601b33157e..12cce7bf85f0 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -41,7 +41,7 @@ awt::Size lcl_getOptimalWidth(StyleSheetTablePtr pStyleSheet, OUString& rDefault vcl::Font aFont(pOut->GetFont()); boost::optional<PropertyMap::Property> aFontName = pDefaultCharProps->getProperty(PROP_CHAR_FONT_NAME); if (aFontName) - aFont.SetFamilyName(aFontName->second.get<OUString>()); + aFont.SetName(aFontName->second.get<OUString>()); boost::optional<PropertyMap::Property> aHeight = pDefaultCharProps->getProperty(PROP_CHAR_HEIGHT); if (aHeight) { |