diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-06-04 07:48:15 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-06-04 07:49:15 +0200 |
commit | f634cda2a26aba91277738f2c6f09405a2bf915c (patch) | |
tree | a9fc64974c8d1a20b02d69d0b4aeb84bb619dbf8 | |
parent | 75ea03d8423bdcce241149540a636d6156027d65 (diff) |
avoid problems with poppler's and vcl's FontInfo during runtime
Change-Id: I1dbd256812cccae1e6ed0ad8bb34ce427e5e5be8
31 files changed, 104 insertions, 91 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 d206a91609e2..5d728141791e 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 ) @@ -457,7 +457,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; @@ -483,7 +483,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 b55419dcc9e4..a28ff1d398a4 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 ea73bc6cfd16..7f4e9af822ca 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; +} /************************************************************************* @@ -137,7 +139,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 10a61fbf4dcf..160b9b377d69 100644 --- a/include/vcl/metric.hxx +++ b/include/vcl/metric.hxx @@ -22,18 +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 { + +// avoid problems where poppler's FontInfo is picked up class VCL_DLLPUBLIC FontInfo : public Font { friend class OutputDevice; protected: - ImplFontMetric* mpImplMetric; // Implementation public: FontInfo(); @@ -46,9 +49,12 @@ public: bool operator==( const FontInfo& ) const; bool operator!=( const FontInfo& rInfo ) const { return !operator==( rInfo ); } + ImplFontMetric* mpImplMetric; // Implementation }; -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 de51dc49deaa..1a8c67623282 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -81,7 +81,6 @@ class BitmapReadAccess; class BitmapEx; class Image; class TextRectInfo; -class FontInfo; class FontMetric; class GDIMetaFile; class GfxLink; @@ -230,6 +229,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 ); @@ -1124,7 +1127,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 8b44e85c314d..412715514b1e 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1062,7 +1062,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 ) { @@ -1138,13 +1138,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(); @@ -1425,7 +1423,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 ); @@ -1649,7 +1647,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 431738ceb935..4308379d6012 100644 --- a/svtools/source/control/ctrltool.cxx +++ b/svtools/source/control/ctrltool.cxx @@ -67,7 +67,7 @@ static const sal_IntPtr aStdSizeAry[] = 0 }; -class ImplFontListFontInfo : public FontInfo +class ImplFontListFontInfo : public vcl::FontInfo { friend class FontList; @@ -76,9 +76,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; } @@ -241,7 +241,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) ) @@ -289,7 +289,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; @@ -418,7 +418,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(); @@ -469,7 +469,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() ) { @@ -539,10 +539,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) { @@ -562,7 +562,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; @@ -585,7 +585,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; @@ -643,7 +643,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 ); @@ -667,7 +667,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 @@ -684,7 +684,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" ); @@ -706,13 +706,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 d3104099af55..860550ae9179 100644 --- a/svtools/source/control/stdmenu.cxx +++ b/svtools/source/control/stdmenu.cxx @@ -140,7 +140,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 21b20e72ac06..f1ac7a0cebbb 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -1780,7 +1780,7 @@ bool OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 } if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) ) { - FontInfo aInfo = pList->Get(pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE); + vcl::FontInfo aInfo = pList->Get(pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE); Font aFont(aInfo); aFmt.SetBulletFont(&aFont); } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 0bb8553ca9b4..e0e8eb3abe80 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -934,7 +934,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() ) ); @@ -960,7 +960,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/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 18b0bf687281..7cdfe1214985 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -823,7 +823,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 29d50f94e6f7..30ceae526e18 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1941,7 +1941,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 a103380f7f4f..c3e94f9b999b 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1885,7 +1885,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 f42afc1f2b93..9521a191f721 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -3775,7 +3775,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 eb62da943e58..cf8f4fc4787f 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -790,7 +790,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() ); } @@ -908,7 +908,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 ); @@ -1049,7 +1049,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 66b86ed27047..2e18bf360a19 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -190,7 +190,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/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index 353780925449..5ad3760bac3a 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/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/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 019398a6168e..2ccde8f781d9 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 ); |