summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-06-04 07:48:15 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-06-10 18:25:21 +0200
commitd4029e62e7e3e7f58840753b368b20ef87cb3c11 (patch)
tree08c98d2bb58327c94078592e521655427a97ee59 /svtools
parent191969ccaa65ee1e934cb3ebab9ef9a4aa3bcd5a (diff)
avoid problems with poppler's and vcl's FontInfo during runtime
Change-Id: I1dbd256812cccae1e6ed0ad8bb34ce427e5e5be8 Conflicts: include/vcl/metric.hxx svtools/source/control/ctrlbox.cxx svtools/source/control/ctrltool.cxx svtools/source/control/stdmenu.cxx svx/source/sidebar/nbdtmg.cxx Conflicts: include/svtools/ctrltool.hxx include/vcl/metric.hxx include/vcl/outdev.hxx svtools/source/control/ctrlbox.cxx svtools/source/control/ctrltool.cxx svtools/source/control/stdmenu.cxx svx/source/sidebar/nbdtmg.cxx sw/source/core/uibase/docvw/srcedtw.cxx vcl/source/gdi/metric.cxx vcl/source/outdev/font.cxx
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/ctrlbox.cxx12
-rw-r--r--svtools/source/control/ctrltool.cxx58
-rw-r--r--svtools/source/control/stdmenu.cxx4
3 files changed, 24 insertions, 50 deletions
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 9250f3070e34..1b7441e4caac 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1128,7 +1128,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 )
{
@@ -1208,13 +1208,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();
@@ -1515,7 +1513,7 @@ void FontStyleBox::Fill( const OUString& rName, const FontList* pList )
sal_Bool bBold = sal_False;
sal_Bool bBoldItalic = sal_False;
sal_Bool bInsert = sal_False;
- FontInfo aInfo;
+ vcl::FontInfo aInfo;
while ( hFontInfo )
{
aInfo = pList->GetFontInfo( hFontInfo );
@@ -1751,9 +1749,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 4f8fc91e5d6c..a4488769a9ca 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -68,13 +68,7 @@ static const sal_IntPtr aStdSizeAry[] =
0
};
-// =======================================================================
-
-// -----------------------------
-// - class ImplFontListFonInfo -
-// -----------------------------
-
-class ImplFontListFontInfo : public FontInfo
+class ImplFontListFontInfo : public vcl::FontInfo
{
friend class FontList;
@@ -83,9 +77,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;
}
@@ -258,7 +252,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
sal_uInt16 i;
for( i = 0; i < n; i++ )
{
- FontInfo aFontInfo = pDevice->GetDevFont( i );
+ vcl::FontInfo aFontInfo = pDevice->GetDevFont( i );
// Wenn keine Raster-Schriften angezeigt werden sollen,
// dann diese ignorieren
@@ -307,7 +301,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_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();
@@ -496,9 +488,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() )
{
@@ -573,11 +563,11 @@ 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;
- // Falls der Fontname stimmt, uebernehmen wir soviel wie moeglich
+ vcl::FontInfo aInfo;
+ // if the fontname matches, we copy as much as possible
if (pFontNameInfo)
{
aInfo = *pFontNameInfo;
@@ -596,7 +586,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;
@@ -618,9 +608,8 @@ FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const
}
}
- // Konnten die Daten nicht gefunden werden, dann muessen bestimmte
- // Attribute nachgebildet werden
- FontInfo aInfo;
+ // reproduce attributes if data could not be found
+ vcl::FontInfo aInfo;
if ( !pFontInfo )
{
FontWeight eWeight = WEIGHT_DONTKNOW;
@@ -678,9 +667,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 );
@@ -703,9 +690,8 @@ FontInfo FontList::Get(const OUString& rName,
}
}
- // Konnten die Daten nicht gefunden werden, dann muessen bestimmte
- // Attribute nachgebildet werden
- FontInfo aInfo;
+ // reproduce attributes if data could not be found
+ vcl::FontInfo aInfo;
if ( !pFontInfo )
aInfo = makeMissing(pFontNameInfo, rName, eWeight, eItalic);
else
@@ -724,9 +710,7 @@ sal_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" );
@@ -752,17 +736,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
{
// Size-Array vorher loeschen
if ( mpSizeAry )
diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx
index f579dc2bd83d..d8a73f94a488 100644
--- a/svtools/source/control/stdmenu.cxx
+++ b/svtools/source/control/stdmenu.cxx
@@ -157,9 +157,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();