summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2016-01-16 12:20:45 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2016-01-16 12:20:45 -0600
commit45654a1d4d96732912e6e4dc254c9612d3f241c0 (patch)
tree19f4ba915a56e53447980ce89fd46710167d7d23 /sw
parent5d4f1f6f630d4382679087a4fb0da364c9c9692b (diff)
revert vcl patch series that brok Mac and Windows
revert: 9bc2f3de8672e812f3a67541c6d7069b434a7e42 vcl: add comment about ImplFontMetric::{Get|Set}LineHeight() 26371f105bc44e04469ec03fc5bb12505e651c6b vcl: FontAttributes::GetSlantType() -> FontAttributes::GetItalic() 2dd0b4317372b8022efe3911b38b4fa02956d8b9 vcl: font.hxx and metric.hxx cleanup, make ctors explicit and the dtor virtual 5ab13bf3ead3539e4ad847656da81e7eb6029652 vcl: tabify font.hxx f99550dae55e40e49bf9c9875053fe2abb4c71ca vcl: change Font::SetName() to Font::SetFamilyName() 2b297116cb6bb1061c43e5714e2609c8ee9f57d2 vcl: rename Font::GetName to Font::GetFamilyName Change-Id: I23f38921187d66b970ca815eb30dda4222a2da62
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/DocumentStylePoolManager.cxx8
-rw-r--r--sw/source/core/doc/notxtfrm.cxx2
-rw-r--r--sw/source/core/edit/autofmt.cxx2
-rw-r--r--sw/source/core/inc/swfont.hxx4
-rw-r--r--sw/source/core/layout/paintfrm.cxx2
-rw-r--r--sw/source/core/text/txtfld.cxx2
-rw-r--r--sw/source/core/txtnode/fntcache.cxx4
-rw-r--r--sw/source/core/txtnode/swfont.cxx12
-rw-r--r--sw/source/core/txtnode/txtedt.cxx2
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx2
-rw-r--r--sw/source/core/unocore/unostyle.cxx995
-rw-r--r--sw/source/filter/ascii/parasc.cxx2
-rw-r--r--sw/source/filter/html/htmlform.cxx2
-rw-r--r--sw/source/filter/html/htmlforw.cxx2
-rw-r--r--sw/source/filter/writer/writer.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx12
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx12
-rw-r--r--sw/source/ui/config/optpage.cxx6
-rw-r--r--sw/source/ui/dialog/ascfldlg.cxx4
-rw-r--r--sw/source/ui/misc/insfnote.cxx2
-rw-r--r--sw/source/ui/table/tautofmt.cxx2
-rw-r--r--sw/source/uibase/app/docshini.cxx6
-rw-r--r--sw/source/uibase/config/fontcfg.cxx2
-rw-r--r--sw/source/uibase/docvw/srcedtw.cxx2
-rw-r--r--sw/source/uibase/lingu/hhcwrp.cxx4
-rw-r--r--sw/source/uibase/shells/annotsh.cxx10
-rw-r--r--sw/source/uibase/shells/basesh.cxx2
-rw-r--r--sw/source/uibase/shells/drwtxtsh.cxx10
-rw-r--r--sw/source/uibase/shells/textsh.cxx10
31 files changed, 506 insertions, 627 deletions
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();
}
}