diff options
31 files changed, 123 insertions, 140 deletions
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 868c6e146cb1..efe9f7163483 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -326,7 +326,7 @@ IMPL_LINK(SvxFontSubstTabPage, NonPropFontsHdl, CheckBox*, pBox) sal_uInt16 nFontCount = aFntLst.GetFontNameCount(); for(sal_uInt16 nFont = 0; nFont < nFontCount; nFont++) { - const FontInfo& rInfo = aFntLst.GetFontName( nFont ); + const vcl::FontInfo& rInfo = aFntLst.GetFontName( nFont ); if(!bNonPropOnly || rInfo.GetPitch() == PITCH_FIXED) m_pFontNameLB->InsertEntry(rInfo.GetName()); } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index f36ae8e323cd..85e6d765ed73 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -435,7 +435,7 @@ const FontList* SvxCharNamePage::GetFontList() const namespace { - FontInfo calcFontInfo( SvxFont& _rFont, + vcl::FontInfo calcFontInfo( SvxFont& _rFont, SvxCharNamePage* _pPage, const FontNameBox* _pFontNameLB, const FontStyleBox* _pFontStyleLB, @@ -447,7 +447,7 @@ namespace { Size aSize = _rFont.GetSize(); aSize.Width() = 0; - FontInfo aFontInfo; + vcl::FontInfo aFontInfo; OUString sFontName(_pFontNameLB->GetText()); bool bFontAvailable = _pFontList->IsAvailable( sFontName ); if (bFontAvailable || _pFontNameLB->IsValueChangedFromSaved()) @@ -520,19 +520,19 @@ void SvxCharNamePage::UpdatePreview_Impl() // Font const FontList* pFontList = GetFontList(); - FontInfo aWestFontInfo = calcFontInfo(rFont, this, m_pWestFontNameLB, + vcl::FontInfo aWestFontInfo = calcFontInfo(rFont, this, m_pWestFontNameLB, m_pWestFontStyleLB, m_pWestFontSizeLB, m_pWestFontLanguageLB, pFontList, GetWhich(SID_ATTR_CHAR_FONT), GetWhich(SID_ATTR_CHAR_FONTHEIGHT)); m_pWestFontTypeFT->SetText(pFontList->GetFontMapText(aWestFontInfo)); - FontInfo aEastFontInfo = calcFontInfo(rCJKFont, this, m_pEastFontNameLB, + vcl::FontInfo aEastFontInfo = calcFontInfo(rCJKFont, this, m_pEastFontNameLB, m_pEastFontStyleLB, m_pEastFontSizeLB, m_pEastFontLanguageLB, pFontList, GetWhich(SID_ATTR_CHAR_CJK_FONT), GetWhich(SID_ATTR_CHAR_CJK_FONTHEIGHT)); m_pEastFontTypeFT->SetText(pFontList->GetFontMapText(aEastFontInfo)); - FontInfo aCTLFontInfo = calcFontInfo(rCTLFont, + vcl::FontInfo aCTLFontInfo = calcFontInfo(rCTLFont, this, m_pCTLFontNameLB, m_pCTLFontStyleLB, m_pCTLFontSizeLB, m_pCTLFontLanguageLB, pFontList, GetWhich(SID_ATTR_CHAR_CTL_FONT), GetWhich(SID_ATTR_CHAR_CTL_FONTHEIGHT)); @@ -609,7 +609,7 @@ void SvxCharNamePage::FillSizeBox_Impl( const FontNameBox* pNameBox ) return; } - FontInfo _aFontInfo( pFontList->Get( pNameBox->GetText(), pStyleBox->GetText() ) ); + vcl::FontInfo _aFontInfo( pFontList->Get( pNameBox->GetText(), pStyleBox->GetText() ) ); pSizeBox->Fill( &_aFontInfo, pFontList ); } @@ -720,7 +720,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp // currently chosen font if ( bStyle && pFontItem ) { - FontInfo aInfo = pFontList->Get( pFontItem->GetFamilyName(), eWeight, eItalic ); + vcl::FontInfo aInfo = pFontList->Get( pFontItem->GetFamilyName(), eWeight, eItalic ); pStyleBox->SetText( pFontList->GetStyleName( aInfo ) ); } else if ( !m_pImpl->m_bInSearchMode || !bStyle ) @@ -729,7 +729,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp } else if ( bStyle ) { - FontInfo aInfo = pFontList->Get( OUString(), eWeight, eItalic ); + vcl::FontInfo aInfo = pFontList->Get( OUString(), eWeight, eItalic ); pStyleBox->SetText( pFontList->GetStyleName( aInfo ) ); } if (!bStyleAvailable) @@ -891,7 +891,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp sal_Int32 nEntryPos = pStyleBox->GetEntryPos( aStyleBoxText ); if ( nEntryPos >= m_pImpl->m_nExtraEntryPos ) aStyleBoxText = ""; - FontInfo aInfo( pFontList->Get( rFontName, aStyleBoxText ) ); + vcl::FontInfo aInfo( pFontList->Get( rFontName, aStyleBoxText ) ); 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 70911201f7d5..c57db72b6468 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -710,7 +710,7 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl) } if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) ) { - FontInfo aInfo = pList->Get( + vcl::FontInfo aInfo = pList->Get( pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE); Font aFont(aInfo); aFmt.SetBulletFont(&aFont); diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index b363d1f98f95..97212176d939 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1184,7 +1184,7 @@ bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFo const SfxMapUnit eUnit = rSet.GetPool()->GetMetric( *pWhich ); nHeight = OutputDevice::LogicToLogic( nHeight * 10, (MapUnit)eUnit, MAP_POINT ); - FontInfo aFontInfo = pFontList->Get( pFontItem->GetFamilyName(), pFontItem->GetStyleName() ); + vcl::FontInfo aFontInfo = pFontList->Get( pFontItem->GetFamilyName(), pFontItem->GetStyleName() ); const sal_IntPtr* pAry = pFontList->GetSizeAry( aFontInfo ); if( bGrow ) diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx index d5309310d322..63cb6ad5ae5e 100644 --- a/framework/source/uielement/fontsizemenucontroller.cxx +++ b/framework/source/uielement/fontsizemenucontroller.cxx @@ -152,7 +152,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r if ( !pFontList ) pFontList.reset(new FontList( Application::GetDefaultDevice() )); - FontInfo aFntInfo = pFontList->Get( m_aFontDescriptor.Name, m_aFontDescriptor.StyleName ); + vcl::FontInfo aFntInfo = pFontList->Get( m_aFontDescriptor.Name, m_aFontDescriptor.StyleName ); // setup font size array if ( m_pHeightArray ) diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 78986bdae3ca..c068285206a3 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -37,7 +37,7 @@ class ImpLineListData; typedef ::std::vector< ImplColorListData* > ImpColorList; typedef ::std::vector< ImpLineListData* > ImpLineList; -typedef ::std::vector< FontInfo > ImplFontList; +typedef ::std::vector< vcl::FontInfo > ImplFontList; #define CHANGE_LINE1 ( ( sal_uInt16 ) 1 ) #define CHANGE_LINE2 ( ( sal_uInt16 ) 2 ) @@ -480,7 +480,7 @@ inline void FontStyleBox::SetText( const OUString& rText ) class SVT_DLLPUBLIC FontSizeBox : public MetricBox { - FontInfo aFontInfo; + vcl::FontInfo aFontInfo; const FontList* pFontList; sal_uInt16 nRelMin; sal_uInt16 nRelMax; @@ -506,7 +506,7 @@ public: void Reformat() SAL_OVERRIDE; void Modify() SAL_OVERRIDE; - void Fill( const FontInfo* pInfo, const FontList* pList ); + void Fill( const vcl::FontInfo* pInfo, const FontList* pList ); void EnableRelativeMode( sal_uInt16 nMin = 50, sal_uInt16 nMax = 150, sal_uInt16 nStep = 5 ); diff --git a/include/svtools/ctrltool.hxx b/include/svtools/ctrltool.hxx index 39e248fc798e..a5d60772d609 100644 --- a/include/svtools/ctrltool.hxx +++ b/include/svtools/ctrltool.hxx @@ -71,28 +71,28 @@ With sal_False vectorized and scalable fonts will be queried. -------------------------------------------------------------------------- -String FontList::GetStyleName( const FontInfo& rInfo ) const; +String FontList::GetStyleName( const vcl::FontInfo& rInfo ) const; -This method returns the StyleName of a FontInfo. +This method returns the StyleName of a vcl::FontInfo. If no StyleName is set, a name will be generated from the set attributes. -------------------------------------------------------------------------- -OUString FontList::GetFontMapText( const FontInfo& rInfo ) const; +OUString FontList::GetFontMapText( const vcl::FontInfo& rInfo ) const; This method returns a Matchstring which indicates the problem that could arise when using a font. This string should be displayed to the user. -------------------------------------------------------------------------- -FontInfo FontList::Get( const String& rName, const String& rStyleName ) const; +vcl::FontInfo FontList::Get( const String& rName, const String& rStyleName ) const; -This method search a FontInfo for the given name and the given style name. +This method search a vcl::FontInfo for the given name and the given style name. The Stylename can also be a synthetic one. -In that case the relevant FontInfo fields will be set. -If a StyleName is provived, a FontInfo structure without a Stylename can be +In that case the relevant vcl::FontInfo fields will be set. +If a StyleName is provived, a vcl::FontInfo structure without a Stylename can be returned. To get a representation of the StyleName for displaying it to the user, -call GetStyleName() on this FontInfo structure. +call GetStyleName() on this vcl::FontInfo structure. Links: @@ -100,13 +100,13 @@ FontList::GetStyleName() -------------------------------------------------------------------------- -FontInfo FontList::Get( const String& rName, FontWeight eWeight, +vcl::FontInfo FontList::Get( const String& rName, FontWeight eWeight, FontItalic eItalic ) const; -This method search a FontInfo structure for a provided name and styles. -This method can also return a FontInfo without a Stylename. +This method search a vcl::FontInfo structure for a provided name and styles. +This method can also return a vcl::FontInfo without a Stylename. To get a representation of the StyleName to be presented to the user -call GetStyleName() with this FontInfo. +call GetStyleName() with this vcl::FontInfo. Links: @@ -114,7 +114,7 @@ FontList::GetStyleName() -------------------------------------------------------------------------- -const sal_IntPtr* FontList::GetSizeAry( const FontInfo& rInfo ) const; +const sal_IntPtr* FontList::GetSizeAry( const vcl::FontInfo& rInfo ) const; This method returns the available sizes for the given font. If it is a scalable font, standard sizes are returned. @@ -168,18 +168,18 @@ public: OutputDevice* GetDevice() const { return mpDev; } OutputDevice* GetDevice2() const { return mpDev2; } - OUString GetFontMapText( const FontInfo& rInfo ) const; + OUString GetFontMapText( const vcl::FontInfo& rInfo ) const; const OUString& GetNormalStr() const { return maNormal; } const OUString& GetItalicStr() const { return maNormalItalic; } const OUString& GetBoldStr() const { return maBold; } const OUString& GetBoldItalicStr() const { return maBoldItalic; } const OUString& GetStyleName( FontWeight eWeight, FontItalic eItalic ) const; - OUString GetStyleName( const FontInfo& rInfo ) const; + OUString GetStyleName( const vcl::FontInfo& rInfo ) const; - FontInfo Get( const OUString& rName, + vcl::FontInfo Get( const OUString& rName, const OUString& rStyleName ) const; - FontInfo Get( const OUString& rName, + vcl::FontInfo Get( const OUString& rName, FontWeight eWeight, FontItalic eItalic ) const; @@ -188,12 +188,12 @@ public: { return (sal_uInt16)maEntries.size(); } - const FontInfo& GetFontName( sal_uInt16 nFont ) const; + const vcl::FontInfo& GetFontName( sal_uInt16 nFont ) const; sal_Handle GetFirstFontInfo( const OUString& rName ) const; sal_Handle GetNextFontInfo( sal_Handle hFontInfo ) const; - const FontInfo& GetFontInfo( sal_Handle hFontInfo ) const; + const vcl::FontInfo& GetFontInfo( sal_Handle hFontInfo ) const; - const sal_IntPtr* GetSizeAry( const FontInfo& rInfo ) const; + const sal_IntPtr* GetSizeAry( const vcl::FontInfo& rInfo ) const; static const sal_IntPtr* GetStdSizeAry(); private: diff --git a/include/svtools/stdmenu.hxx b/include/svtools/stdmenu.hxx index 78062fd891b0..0b7b7f2178e4 100644 --- a/include/svtools/stdmenu.hxx +++ b/include/svtools/stdmenu.hxx @@ -25,7 +25,9 @@ #include <vcl/menu.hxx> class FontList; -class FontInfo; +namespace vcl { + class FontInfo; +} /************************************************************************* @@ -145,7 +147,7 @@ public: virtual void Select() SAL_OVERRIDE; virtual void Highlight() SAL_OVERRIDE; - void Fill( const FontInfo& rInfo, const FontList* pList ); + void Fill( const vcl::FontInfo& rInfo, const FontList* pList ); void SetCurHeight( long nHeight ); long GetCurHeight() const { return mnCurHeight; } diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx index 8e0957ac9924..c452edf13d07 100644 --- a/include/vcl/metric.hxx +++ b/include/vcl/metric.hxx @@ -22,22 +22,21 @@ #include <vcl/dllapi.h> #include <vcl/font.hxx> +#include <vcl/outdev.hxx> class ImplFontMetric; class ImplFontCharMap; typedef sal_uInt32 sal_UCS4; +namespace vcl { -// - FontInfo - - - +// avoid problems where poppler's FontInfo is picked up class VCL_DLLPUBLIC FontInfo : public Font { friend class OutputDevice; protected: - ImplFontMetric* mpImplMetric; // Implementation public: FontInfo(); @@ -50,13 +49,12 @@ public: bool operator==( const FontInfo& ) const; bool operator!=( const FontInfo& rInfo ) const { return !operator==( rInfo ); } + ImplFontMetric* mpImplMetric; // Implementation }; +} -// - FontMetric - - - -class VCL_DLLPUBLIC FontMetric : public FontInfo +class VCL_DLLPUBLIC FontMetric : public vcl::FontInfo { public: FontMetric() {} diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 0c185253e461..25bf4cf63472 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -83,7 +83,6 @@ class BitmapReadAccess; class BitmapEx; class Image; class TextRectInfo; -class FontInfo; class FontMetric; class GDIMetaFile; class GfxLink; @@ -232,6 +231,10 @@ class FontSelectPattern; class ImplFontMetricData; class VCLXGraphics; +namespace vcl { + class FontInfo; +} + typedef ::std::vector< VCLXGraphics* > VCLXGraphicsList_impl; sal_uLong AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix ); @@ -1069,7 +1072,7 @@ private: public: - FontInfo GetDevFont( int nDevFontIndex ) const; + vcl::FontInfo GetDevFont( int nDevFontIndex ) const; int GetDevFontCount() const; bool IsFontAvailable( const OUString& rFontName ) const; diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index b59c987bdd39..add62f74d175 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -740,7 +740,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico aParaText = "&\"" + OUString(aNewData.maName); if( pFontList ) { - FontInfo aFontInfo( pFontList->Get( + vcl::FontInfo aFontInfo( pFontList->Get( aNewData.maName, (aNewData.mnWeight > EXC_FONTWGHT_NORMAL) ? WEIGHT_BOLD : WEIGHT_NORMAL, aNewData.mbItalic ? ITALIC_NORMAL : ITALIC_NONE ) ); diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 59ce92e072ab..6fc2651f2cad 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -200,7 +200,7 @@ void XclImpFont::SetFontData( const XclFontData& rFontData, bool bHasCharSet ) { if( const FontList* pFontList = pInfoItem->GetFontList() ) { - FontInfo aFontInfo( pFontList->Get( maData.maName, maData.maStyle ) ); + vcl::FontInfo aFontInfo( pFontList->Get( maData.maName, maData.maStyle ) ); maData.SetScWeight( aFontInfo.GetWeight() ); maData.SetScPosture( aFontInfo.GetItalic() ); } diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 6e9dfde15492..c329140f3275 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2268,7 +2268,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, void SmSymDefineDialog::SetFont(const OUString &rFontName, const OUString &rStyleName) { // get Font (FontInfo) matching name and style - FontInfo aFI; + vcl::FontInfo aFI; if (pFontList) aFI = pFontList->Get(rFontName, WEIGHT_NORMAL, ITALIC_NONE); SetFontStyle(rStyleName, aFI); diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 3bd3eba30885..d54dcb43598e 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1148,7 +1148,7 @@ void FontNameBox::Fill( const FontList* pList ) sal_uInt16 nFontCount = pList->GetFontNameCount(); for ( sal_uInt16 i = 0; i < nFontCount; i++ ) { - const FontInfo& rFontInfo = pList->GetFontName( i ); + const vcl::FontInfo& rFontInfo = pList->GetFontName( i ); sal_uLong nIndex = InsertEntry( rFontInfo.GetName() ); if ( nIndex != LISTBOX_ERROR ) { @@ -1228,13 +1228,11 @@ namespace } } - - void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) { assert( mpFontList ); - FontInfo& rInfo = (*mpFontList)[ rUDEvt.GetItemId() ]; + vcl::FontInfo& rInfo = (*mpFontList)[ rUDEvt.GetItemId() ]; Point aTopLeft = rUDEvt.GetRect().TopLeft(); long nX = aTopLeft.X(); long nH = rUDEvt.GetRect().GetHeight(); @@ -1525,7 +1523,7 @@ void FontStyleBox::Fill( const OUString& rName, const FontList* pList ) bool bBold = false; bool bBoldItalic = false; bool bInsert = false; - FontInfo aInfo; + vcl::FontInfo aInfo; while ( hFontInfo ) { aInfo = pList->GetFontInfo( hFontInfo ); @@ -1761,9 +1759,7 @@ void FontSizeBox::Modify() } } - - -void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList ) +void FontSizeBox::Fill( const vcl::FontInfo* pInfo, const FontList* pList ) { // remember for relative mode pFontList = pList; diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx index 4818928231cd..e973e63a1970 100644 --- a/svtools/source/control/ctrltool.cxx +++ b/svtools/source/control/ctrltool.cxx @@ -69,13 +69,7 @@ static const sal_IntPtr aStdSizeAry[] = 0 }; - - - -// - class ImplFontListFonInfo - - - -class ImplFontListFontInfo : public FontInfo +class ImplFontListFontInfo : public vcl::FontInfo { friend class FontList; @@ -84,9 +78,9 @@ private: ImplFontListFontInfo* mpNext; public: - ImplFontListFontInfo( const FontInfo& rInfo, + ImplFontListFontInfo( const vcl::FontInfo& rInfo, OutputDevice* pDev ) : - FontInfo( rInfo ), mpNext(NULL) + vcl::FontInfo( rInfo ), mpNext(NULL) { mpDevice = pDev; } @@ -259,7 +253,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, bool bAll, sal_uInt16 i; for( i = 0; i < n; i++ ) { - FontInfo aFontInfo = pDevice->GetDevFont( i ); + vcl::FontInfo aFontInfo = pDevice->GetDevFont( i ); // ignore raster-fonts if they are not to be displayed if ( !bAll && (aFontInfo.GetType() == TYPE_RASTER) ) @@ -307,7 +301,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, bool bAll, (pNewInfo->GetCharSet() == eSystemEncoding) ) { ImplFontListFontInfo* pTemp2 = pTemp->mpNext; - *((FontInfo*)pTemp) = *((FontInfo*)pNewInfo); + *((vcl::FontInfo*)pTemp) = *((vcl::FontInfo*)pNewInfo); pTemp->mpNext = pTemp2; } delete pNewInfo; @@ -442,9 +436,7 @@ const OUString& FontList::GetStyleName(FontWeight eWeight, FontItalic eItalic) c } } - - -OUString FontList::GetStyleName(const FontInfo& rInfo) const +OUString FontList::GetStyleName(const vcl::FontInfo& rInfo) const { OUString aStyleName = rInfo.GetStyleName(); FontWeight eWeight = rInfo.GetWeight(); @@ -495,9 +487,7 @@ OUString FontList::GetStyleName(const FontInfo& rInfo) const return aStyleName; } - - -OUString FontList::GetFontMapText( const FontInfo& rInfo ) const +OUString FontList::GetFontMapText( const vcl::FontInfo& rInfo ) const { if ( rInfo.GetName().isEmpty() ) { @@ -567,10 +557,10 @@ OUString FontList::GetFontMapText( const FontInfo& rInfo ) const namespace { - FontInfo makeMissing(ImplFontListFontInfo* pFontNameInfo, const OUString &rName, + vcl::FontInfo makeMissing(ImplFontListFontInfo* pFontNameInfo, const OUString &rName, FontWeight eWeight, FontItalic eItalic) { - FontInfo aInfo; + vcl::FontInfo aInfo; // if the fontname matches, we copy as much as possible if (pFontNameInfo) { @@ -590,7 +580,7 @@ namespace } } -FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const +vcl::FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const { ImplFontListNameInfo* pData = ImplFindByName( rName ); ImplFontListFontInfo* pFontInfo = NULL; @@ -613,7 +603,7 @@ FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const } // reproduce attributes if data could not be found - FontInfo aInfo; + vcl::FontInfo aInfo; if ( !pFontInfo ) { FontWeight eWeight = WEIGHT_DONTKNOW; @@ -671,9 +661,7 @@ FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const return aInfo; } - - -FontInfo FontList::Get(const OUString& rName, +vcl::FontInfo FontList::Get(const OUString& rName, FontWeight eWeight, FontItalic eItalic) const { ImplFontListNameInfo* pData = ImplFindByName( rName ); @@ -697,7 +685,7 @@ FontInfo FontList::Get(const OUString& rName, } // reproduce attributes if data could not be found - FontInfo aInfo; + vcl::FontInfo aInfo; if ( !pFontInfo ) aInfo = makeMissing(pFontNameInfo, rName, eWeight, eItalic); else @@ -716,9 +704,7 @@ bool FontList::IsAvailable(const OUString& rName) const return (ImplFindByName( rName ) != 0); } - - -const FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const +const vcl::FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const { DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontName(): nFont >= Count" ); @@ -744,17 +730,13 @@ sal_Handle FontList::GetNextFontInfo( sal_Handle hFontInfo ) const return (sal_Handle)(pInfo->mpNext); } - - -const FontInfo& FontList::GetFontInfo( sal_Handle hFontInfo ) const +const vcl::FontInfo& FontList::GetFontInfo( sal_Handle hFontInfo ) const { ImplFontListFontInfo* pInfo = (ImplFontListFontInfo*)(void*)hFontInfo; return *pInfo; } - - -const sal_IntPtr* FontList::GetSizeAry( const FontInfo& rInfo ) const +const sal_IntPtr* FontList::GetSizeAry( const vcl::FontInfo& rInfo ) const { // first delete Size-Array if ( mpSizeAry ) diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx index af3546af00c9..b07e81beae75 100644 --- a/svtools/source/control/stdmenu.cxx +++ b/svtools/source/control/stdmenu.cxx @@ -161,9 +161,7 @@ void FontSizeMenu::Highlight() mnCurHeight = nTempHeight; } - - -void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList ) +void FontSizeMenu::Fill( const vcl::FontInfo& rInfo, const FontList* pList ) { Clear(); diff --git a/svx/source/mnuctrls/fntszctl.cxx b/svx/source/mnuctrls/fntszctl.cxx index a5a9c09c3223..2ec67f07fd0a 100644 --- a/svx/source/mnuctrls/fntszctl.cxx +++ b/svx/source/mnuctrls/fntszctl.cxx @@ -123,7 +123,7 @@ void SvxFontSizeMenuControl::StateChanged( if ( pList ) { - FontInfo aFntInf = pList->Get( pItem->GetFamilyName(), + vcl::FontInfo aFntInf = pList->Get( pItem->GetFamilyName(), pItem->GetStyleName() ); pMenu->Fill( aFntInf, pList ); } diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index d052708db75a..c2fbe6c0ef26 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -1771,30 +1771,30 @@ bool OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 if( pLevelSettings->sBulletFont.getLength() && pLevelSettings->sBulletFont.compareTo(rActBulletFont.GetName())) { - //search for the font - if(!pList) - { - SfxObjectShell* pCurDocShell = SfxObjectShell::Current(); - const SvxFontListItem* pFontListItem = (const SvxFontListItem* )pCurDocShell->GetItem( SID_ATTR_CHAR_FONTLIST ); - pList = pFontListItem ? pFontListItem->GetFontList() : 0; - } - if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) ) - { - FontInfo aInfo = pList->Get(pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE); + //search for the font + if(!pList) + { + SfxObjectShell* pCurDocShell = SfxObjectShell::Current(); + const SvxFontListItem* pFontListItem = (const SvxFontListItem* )pCurDocShell->GetItem( SID_ATTR_CHAR_FONTLIST ); + pList = pFontListItem ? pFontListItem->GetFontList() : 0; + } + if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) ) + { + vcl::FontInfo aInfo = pList->Get(pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE); Font aFont(aInfo); aFmt.SetBulletFont(&aFont); - } - else - { - //if it cannot be found then create a new one - Font aCreateFont( pLevelSettings->sBulletFont, OUString(), Size( 0, 14 ) ); - aCreateFont.SetCharSet( RTL_TEXTENCODING_DONTKNOW ); - aCreateFont.SetFamily( FAMILY_DONTKNOW ); - aCreateFont.SetPitch( PITCH_DONTKNOW ); - aCreateFont.SetWeight( WEIGHT_DONTKNOW ); - aCreateFont.SetTransparent( true ); - aFmt.SetBulletFont( &aCreateFont ); - } + } + else + { + //if it cannot be found then create a new one + Font aCreateFont( pLevelSettings->sBulletFont, OUString(), Size( 0, 14 ) ); + aCreateFont.SetCharSet( RTL_TEXTENCODING_DONTKNOW ); + aCreateFont.SetFamily( FAMILY_DONTKNOW ); + aCreateFont.SetPitch( PITCH_DONTKNOW ); + aCreateFont.SetWeight( WEIGHT_DONTKNOW ); + aCreateFont.SetTransparent( true ); + aFmt.SetBulletFont( &aCreateFont ); + } }else aFmt.SetBulletFont( &rActBulletFont ); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index d1771f2f5dc5..bf18eca941f3 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -994,7 +994,7 @@ void SvxFontNameBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) if ( rUDEvt.GetItemId() == rUDEvt.GetStyle() ) { Sequence< PropertyValue > aArgs( 1 ); - FontInfo aInfo( pFontList->Get( GetEntry( rUDEvt.GetItemId() ), + vcl::FontInfo aInfo( pFontList->Get( GetEntry( rUDEvt.GetItemId() ), aCurFont.GetWeight(), aCurFont.GetItalic() ) ); @@ -1020,7 +1020,7 @@ void SvxFontNameBox_Impl::Select() std::auto_ptr<SvxFontItem> pFontItem; if ( pFontList ) { - FontInfo aInfo( pFontList->Get( GetText(), + vcl::FontInfo aInfo( pFontList->Get( GetText(), aCurFont.GetWeight(), aCurFont.GetItalic() ) ); aCurFont = aInfo; diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index 3b3a9b0eeb52..02f7da9695ab 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -207,7 +207,7 @@ void SvxFontSizeBox_Impl::UpdateFont( const ::com::sun::star::awt::FontDescripto if ( !rCurrentFont.Name.isEmpty() ) { - FontInfo _aFontInfo; + vcl::FontInfo _aFontInfo; _aFontInfo.SetName( rCurrentFont.Name ); _aFontInfo.SetStyleName( rCurrentFont.StyleName ); _aFontInfo.SetHeight( rCurrentFont.Height ); diff --git a/sw/source/core/uibase/docvw/srcedtw.cxx b/sw/source/core/uibase/docvw/srcedtw.cxx index 353780925449..5ad3760bac3a 100644 --- a/sw/source/core/uibase/docvw/srcedtw.cxx +++ b/sw/source/core/uibase/docvw/srcedtw.cxx @@ -971,7 +971,7 @@ void SwSrcEditWindow::SetFont() const SvxFontListItem* pFontListItem = (const SvxFontListItem* )pSrcView->GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pList = pFontListItem->GetFontList(); - FontInfo aInfo = pList->Get(sFontName,WEIGHT_NORMAL, ITALIC_NONE); + vcl::FontInfo aInfo = pList->Get(sFontName,WEIGHT_NORMAL, ITALIC_NONE); const Font& rFont = GetTextEngine()->GetFont(); Font aFont(aInfo); diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 292f6d1612df..683f2e216419 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -827,7 +827,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam) ->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pList = pFontListItem->GetFontList(); - FontInfo aInfo = pList->Get( + vcl::FontInfo aInfo = pList->Get( pBulletFontNames[i],WEIGHT_NORMAL, ITALIC_NONE); Font aFont(aInfo); aFmt.SetBulletFont(&aFont); diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 958f510a7991..bf1a11bb521b 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1936,7 +1936,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex( (const SvxFontListItem* )pLclDocShell ->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pList = pFontListItem->GetFontList(); - FontInfo aInfo = pList->Get( + vcl::FontInfo aInfo = pList->Get( sBulletFontName, WEIGHT_NORMAL, ITALIC_NONE); Font aFont(aInfo); aFmt.SetBulletFont(&aFont); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 5359ada1c32c..15a463995f61 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1887,7 +1887,7 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, (const SvxFontListItem* )pDoc->GetDocShell() ->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pList = pFontListItem->GetFontList(); - FontInfo aInfo = pList->Get( + vcl::FontInfo aInfo = pList->Get( pBulletFontNames[i],WEIGHT_NORMAL, ITALIC_NONE); Font aFont(aInfo); aFmt.SetBulletFont(&aFont); diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index c1d3db5614a2..68826222762a 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -1097,7 +1097,7 @@ static void ParseCSS1_font_family( const CSS1Expression *pExpr, sal_Handle hFont = pFList->GetFirstFontInfo( aIdent ); if( 0 != hFont ) { - const FontInfo& rFInfo = pFList->GetFontInfo( hFont ); + const vcl::FontInfo& rFInfo = pFList->GetFontInfo( hFont ); if( RTL_TEXTENCODING_DONTKNOW != rFInfo.GetCharSet() ) { bFound = true; diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 2fb457c14a66..0e77bf078136 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -3771,7 +3771,7 @@ void SwHTMLParser::NewFontAttr( int nToken ) sal_Handle hFont = pFList->GetFirstFontInfo( aFName ); if( 0 != hFont ) { - const FontInfo& rFInfo = pFList->GetFontInfo( hFont ); + const vcl::FontInfo& rFInfo = pFList->GetFontInfo( hFont ); if( RTL_TEXTENCODING_DONTKNOW != rFInfo.GetCharSet() ) { bFound = true; diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 097e31aa53b1..a0963509f4d9 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -794,7 +794,7 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet) int nFontNames = pPrt->GetDevFontCount(); for( int i = 0; i < nFontNames; i++ ) { - FontInfo aInf( pPrt->GetDevFont( i ) ); + vcl::FontInfo aInf( pPrt->GetDevFont( i ) ); aFontNames.insert( aInf.GetName() ); } @@ -912,7 +912,7 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet) pLabelBox->SetText(sCapBackup ); pIdxBox->SetText(sIdxBackup ); - FontInfo aFontInfo( pFontList->Get(sStdBackup, sStdBackup) ); + vcl::FontInfo aFontInfo( pFontList->Get(sStdBackup, sStdBackup) ); pStandardHeightLB->Fill( &aFontInfo, pFontList ); aFontInfo = pFontList->Get(sOutBackup, sOutBackup ); pTitleHeightLB->Fill( &aFontInfo, pFontList ); @@ -1053,7 +1053,7 @@ IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, ComboBox*, pBox ) { pHeightLB = pIndexHeightLB; } - FontInfo aFontInfo( pFontList->Get(sEntry, sEntry) ); + vcl::FontInfo aFontInfo( pFontList->Get(sEntry, sEntry) ); pHeightLB->Fill( &aFontInfo, pFontList ); return 0; } diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx index f21149547458..828870057a3c 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -189,7 +189,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, int nFontNames = pPrt->GetDevFontCount(); for( int i = 0; i < nFontNames; i++ ) { - FontInfo aInf( pPrt->GetDevFont( i ) ); + vcl::FontInfo aInf( pPrt->GetDevFont( i ) ); aFontNames.insert( aInf.GetName() ); } diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx index f4b786c044b9..5ed467ef912e 100644 --- a/vcl/source/gdi/metric.cxx +++ b/vcl/source/gdi/metric.cxx @@ -67,6 +67,8 @@ bool ImplFontMetric::operator==( const ImplFontMetric& r ) const return true; } +namespace vcl { + FontInfo::FontInfo() : mpImplMetric( new ImplFontMetric ) {} @@ -113,8 +115,10 @@ FontType FontInfo::GetType() const return (mpImplMetric->IsScalable() ? TYPE_SCALABLE : TYPE_RASTER); } -FontMetric::FontMetric( const FontMetric& rMetric ) -: FontInfo( rMetric ) +} + +FontMetric::FontMetric( const FontMetric& rMetric ): + vcl::FontInfo( rMetric ) {} long FontMetric::GetAscent() const @@ -149,13 +153,13 @@ long FontMetric::GetSlant() const FontMetric& FontMetric::operator =( const FontMetric& rMetric ) { - FontInfo::operator=( rMetric ); + vcl::FontInfo::operator=( rMetric ); return *this; } bool FontMetric::operator==( const FontMetric& rMetric ) const { - return FontInfo::operator==( rMetric ); + return vcl::FontInfo::operator==( rMetric ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 6de4765e7093..7104caa95a13 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -58,12 +58,12 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::rtl; -using namespace ::vcl; using namespace ::utl; +using namespace ::vcl; -FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const +vcl::FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const { - FontInfo aFontInfo; + vcl::FontInfo aFontInfo; ImplInitFontList(); diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index 8ba8277f51b4..84466adefa0e 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -241,7 +241,7 @@ void MyWin::Paint( const Rectangle& rRect ) for( int i = 0; i < nFontSamples; ++i ) { - FontInfo aFont = GetDevFont( (i*nFontCount) / nFontSamples ); + vcl::FontInfo aFont = GetDevFont( (i*nFontCount) / nFontSamples ); aFont.SetHeight( 400 + (i%7) * 100 ); aFont.SetOrientation( i * (3600 / nFontSamples) ); SetFont( aFont ); |