[Libreoffice-commits] core.git: include/vcl vcl/headless vcl/inc vcl/quartz vcl/source vcl/unx vcl/win
Noel Grandin
noel at peralex.com
Wed May 11 06:52:17 UTC 2016
include/vcl/outdev.hxx | 2 +-
vcl/headless/svptext.cxx | 4 ++--
vcl/inc/fontinstance.hxx | 1 -
vcl/inc/headless/svpgdi.hxx | 2 +-
vcl/inc/quartz/salgdi.h | 2 +-
vcl/inc/salgdi.hxx | 5 +----
vcl/inc/textrender.hxx | 2 +-
vcl/inc/unx/cairotextrender.hxx | 2 +-
vcl/inc/unx/genpspgraphics.h | 2 +-
vcl/inc/unx/salgdi.h | 2 +-
vcl/inc/win/salgdi.h | 2 +-
vcl/quartz/salgdi.cxx | 6 ++----
vcl/source/font/fontinstance.cxx | 1 -
vcl/source/gdi/print.cxx | 2 +-
vcl/source/outdev/font.cxx | 8 ++++----
vcl/unx/generic/gdi/cairotextrender.cxx | 9 ++-------
vcl/unx/generic/gdi/font.cxx | 4 ++--
vcl/unx/generic/print/genpspgraphics.cxx | 20 ++++++++++----------
vcl/win/gdi/salfont.cxx | 12 ++----------
19 files changed, 34 insertions(+), 54 deletions(-)
New commits:
commit 6104a9807500c59196ff007d24cfe111f0b2754a
Author: Noel Grandin <noel at peralex.com>
Date: Tue May 10 12:11:59 2016 +0200
remove unused return type from SalGraphics::SetFont
Change-Id: I0ca41130f5e1028a70f1242f7af3366b7c57c572
Reviewed-on: https://gerrit.libreoffice.org/24833
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 720c45c..f381f2e 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1373,7 +1373,7 @@ public:
vcl::TextLayoutCache const* = nullptr) const;
SAL_DLLPRIVATE SalLayout* ImplGlyphFallbackLayout( SalLayout*, ImplLayoutArgs& ) const;
// tells whether this output device is RTL in an LTR UI or LTR in a RTL UI
- SAL_DLLPRIVATE SalLayout* getFallbackFont(LogicalFontInstance &rFallbackFont,
+ SAL_DLLPRIVATE SalLayout* getFallbackFont(
FontSelectPattern &rFontSelData, int nFallbackLevel,
ImplLayoutArgs& rLayoutArgs) const;
diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx
index 4346713..e8fd525 100644
--- a/vcl/headless/svptext.cxx
+++ b/vcl/headless/svptext.cxx
@@ -24,9 +24,9 @@
#include <config_cairo_canvas.h>
#include "impfontmetricdata.hxx"
-sal_uInt16 SvpSalGraphics::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel )
+void SvpSalGraphics::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel )
{
- return m_aTextRenderImpl.SetFont(pIFSD, nFallbackLevel);
+ m_aTextRenderImpl.SetFont(pIFSD, nFallbackLevel);
}
void SvpSalGraphics::GetFontMetric( ImplFontMetricDataPtr& xFontMetric, int nFallbackLevel )
diff --git a/vcl/inc/fontinstance.hxx b/vcl/inc/fontinstance.hxx
index db5c6c1..7bc5a73 100644
--- a/vcl/inc/fontinstance.hxx
+++ b/vcl/inc/fontinstance.hxx
@@ -44,7 +44,6 @@ public: // TODO: make data members private
long mnLineHeight;
sal_uInt32 mnRefCount;
- sal_uInt16 mnSetFontFlags; // Flags returned by SalGraphics::SetFont()
short mnOwnOrientation; // text angle if lower layers don't rotate text themselves
short mnOrientation; // text angle in 3600 system
bool mbInit; // true if maFontMetric member is valid
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 7be69f9..f93e1c7 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -122,7 +122,7 @@ public:
virtual void SetROPFillColor( SalROPColor nROPColor ) override;
virtual void SetTextColor( SalColor nSalColor ) override;
- virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override;
+ virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override;
virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override;
virtual const FontCharMapPtr GetFontCharMap() const override;
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index e4c9ca1..0f183ab 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -336,7 +336,7 @@ public:
// set the text color to a specific color
virtual void SetTextColor( SalColor nSalColor ) override;
// set the font
- virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override;
+ virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override;
// get the current font's metrics
virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override;
// get the repertoire of the current font
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index feecc851..11bbe91 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -56,9 +56,6 @@ namespace basegfx {
class B2DPolyPolygon;
}
-#define SAL_SETFONT_USEDRAWTEXTARRAY ((sal_uInt16)0x0004)
-#define SAL_SETFONT_BADFONT ((sal_uInt16)0x1000)
-
#define SAL_COPYAREA_WINDOWINVALIDATE ((sal_uInt16)0x0001)
typedef sal_Unicode sal_Ucs; // TODO: use sal_UCS4 instead of sal_Unicode
@@ -131,7 +128,7 @@ public:
virtual void SetTextColor( SalColor nSalColor ) = 0;
// set the font
- virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) = 0;
+ virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) = 0;
// release the fonts
void ReleaseFonts() { SetFont( nullptr, 0 ); }
diff --git a/vcl/inc/textrender.hxx b/vcl/inc/textrender.hxx
index 483eff0..e08274e 100644
--- a/vcl/inc/textrender.hxx
+++ b/vcl/inc/textrender.hxx
@@ -36,7 +36,7 @@ public:
virtual ~TextRenderImpl() {}
virtual void SetTextColor( SalColor nSalColor ) = 0;
- virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) = 0;
+ virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) = 0;
virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) = 0;
virtual const FontCharMapPtr GetFontCharMap() const = 0;
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0;
diff --git a/vcl/inc/unx/cairotextrender.hxx b/vcl/inc/unx/cairotextrender.hxx
index 2de9b11..14b3503 100644
--- a/vcl/inc/unx/cairotextrender.hxx
+++ b/vcl/inc/unx/cairotextrender.hxx
@@ -85,7 +85,7 @@ public:
virtual void SetTextColor( SalColor nSalColor ) override;
- virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override;
+ virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override;
virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override;
virtual const FontCharMapPtr GetFontCharMap() const override;
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override;
diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h
index e609c12..1978083 100644
--- a/vcl/inc/unx/genpspgraphics.h
+++ b/vcl/inc/unx/genpspgraphics.h
@@ -92,7 +92,7 @@ public:
virtual void SetROPFillColor( SalROPColor nROPColor ) override;
virtual void SetTextColor( SalColor nSalColor ) override;
- virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override;
+ virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override;
virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override;
virtual const FontCharMapPtr GetFontCharMap() const override;
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override;
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index 2952282..cea6284 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -116,7 +116,7 @@ public:
virtual void SetROPFillColor( SalROPColor nROPColor ) override;
virtual void SetTextColor( SalColor nSalColor ) override;
- virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override;
+ virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override;
virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override;
virtual const FontCharMapPtr GetFontCharMap() const override;
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override;
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 2c89393..4c4cbca 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -378,7 +378,7 @@ public:
// set the text color to a specific color
virtual void SetTextColor( SalColor nSalColor ) override;
// set the font
- virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override;
+ virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override;
// get the current font's metrics
virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override;
// get the repertoire of the current font
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index f35e895..57036da 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -417,7 +417,7 @@ void AquaSalGraphics::DrawServerFontLayout( const ServerFontLayout& )
{
}
-sal_uInt16 AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbackLevel*/ )
+void AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbackLevel*/ )
{
// release the text style
delete mpTextStyle;
@@ -427,7 +427,7 @@ sal_uInt16 AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbac
if( !pReqFont )
{
mpFontData = nullptr;
- return 0;
+ return;
}
// update the text style
@@ -446,8 +446,6 @@ sal_uInt16 AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbac
<< " size=" << pReqFont->mnHeight << "x" << pReqFont->mnWidth
<< " orientation=" << pReqFont->mnOrientation
);
-
- return 0;
}
SalLayout* AquaSalGraphics::GetTextLayout( ImplLayoutArgs& /*rArgs*/, int /*nFallbackLevel*/ )
diff --git a/vcl/source/font/fontinstance.cxx b/vcl/source/font/fontinstance.cxx
index 908f51b..04d1061 100644
--- a/vcl/source/font/fontinstance.cxx
+++ b/vcl/source/font/fontinstance.cxx
@@ -44,7 +44,6 @@ LogicalFontInstance::LogicalFontInstance( const FontSelectPattern& rFontSelData
, mpConversion( nullptr )
, mnLineHeight( 0 )
, mnRefCount( 1 )
- , mnSetFontFlags( 0 )
, mnOwnOrientation( 0 )
, mnOrientation( 0 )
, mbInit( false )
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 8e07fd0..4c45181 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1782,7 +1782,7 @@ void Printer::InitFont() const
if ( mbInitFont )
{
// select font in the device layers
- mpFontInstance->mnSetFontFlags = mpGraphics->SetFont( &(mpFontInstance->maFontSelData), 0 );
+ mpGraphics->SetFont( &(mpFontInstance->maFontSelData), 0 );
mbInitFont = false;
}
}
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 0d04de4..c6c4f4f 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -1006,7 +1006,7 @@ void OutputDevice::InitFont() const
mpFontInstance->maFontSelData.mbNonAntialiased = bNonAntialiased;
// select font in the device layers
- mpFontInstance->mnSetFontFlags = mpGraphics->SetFont( &(mpFontInstance->maFontSelData), 0 );
+ mpGraphics->SetFont( &(mpFontInstance->maFontSelData), 0 );
mbInitFont = false;
}
}
@@ -1323,7 +1323,7 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout )
mpMetaFile = pOldMetaFile;
}
-SalLayout* OutputDevice::getFallbackFont(LogicalFontInstance &rFallbackFont,
+SalLayout* OutputDevice::getFallbackFont(
FontSelectPattern &rFontSelData, int nFallbackLevel,
ImplLayoutArgs& rLayoutArgs) const
{
@@ -1332,7 +1332,7 @@ SalLayout* OutputDevice::getFallbackFont(LogicalFontInstance &rFallbackFont,
return nullptr;
assert(mpGraphics != nullptr);
- rFallbackFont.mnSetFontFlags = mpGraphics->SetFont( &rFontSelData, nFallbackLevel );
+ mpGraphics->SetFont( &rFontSelData, nFallbackLevel );
rLayoutArgs.ResetPos();
SalLayout* pFallback = mpGraphics->GetTextLayout( rLayoutArgs, nFallbackLevel );
@@ -1410,7 +1410,7 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
}
// create and add glyph fallback layout to multilayout
- SalLayout* pFallback = getFallbackFont(*pFallbackFont, aFontSelData,
+ SalLayout* pFallback = getFallbackFont(aFontSelData,
nFallbackLevel, rLayoutArgs);
if (pFallback)
{
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 747791d..f8873d9 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -365,14 +365,9 @@ bool CairoTextRender::GetFontCapabilities(vcl::FontCapabilities &rGetImplFontCap
// SalGraphics
-sal_uInt16 CairoTextRender::SetFont( FontSelectPattern *pEntry, int nFallbackLevel )
+void CairoTextRender::SetFont( FontSelectPattern *pEntry, int nFallbackLevel )
{
- sal_uInt16 nRetVal = 0;
- if (!setFont(pEntry, nFallbackLevel))
- nRetVal |= SAL_SETFONT_BADFONT;
- if (mpServerFont[nFallbackLevel])
- nRetVal |= SAL_SETFONT_USEDRAWTEXTARRAY;
- return nRetVal;
+ setFont(pEntry, nFallbackLevel);
}
void
diff --git a/vcl/unx/generic/gdi/font.cxx b/vcl/unx/generic/gdi/font.cxx
index e0ca042..1669465 100644
--- a/vcl/unx/generic/gdi/font.cxx
+++ b/vcl/unx/generic/gdi/font.cxx
@@ -69,9 +69,9 @@ bool X11SalGraphics::GetFontCapabilities(vcl::FontCapabilities &rGetImplFontCapa
// SalGraphics
-sal_uInt16 X11SalGraphics::SetFont( FontSelectPattern *pEntry, int nFallbackLevel )
+void X11SalGraphics::SetFont( FontSelectPattern *pEntry, int nFallbackLevel )
{
- return mxTextRenderImpl->SetFont(pEntry, nFallbackLevel);
+ mxTextRenderImpl->SetFont(pEntry, nFallbackLevel);
}
void
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index c81b274..b58cde1 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -783,7 +783,7 @@ bool GenPspGraphics::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilitie
return m_pServerFont[0]->GetFontCapabilities(rFontCapabilities);
}
-sal_uInt16 GenPspGraphics::SetFont( FontSelectPattern *pEntry, int nFallbackLevel )
+void GenPspGraphics::SetFont( FontSelectPattern *pEntry, int nFallbackLevel )
{
// release all fonts that are to be overridden
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
@@ -798,7 +798,7 @@ sal_uInt16 GenPspGraphics::SetFont( FontSelectPattern *pEntry, int nFallbackLeve
// return early if there is no new font
if( !pEntry )
- return 0;
+ return;
sal_IntPtr nID = pEntry->mpFontData ? pEntry->mpFontData->GetFontId() : 0;
@@ -834,14 +834,14 @@ sal_uInt16 GenPspGraphics::SetFont( FontSelectPattern *pEntry, int nFallbackLeve
}
// set the printer font
- return m_pPrinterGfx->SetFont( nID,
- pEntry->mnHeight,
- pEntry->mnWidth,
- pEntry->mnOrientation,
- pEntry->mbVertical,
- bArtItalic,
- bArtBold
- );
+ m_pPrinterGfx->SetFont( nID,
+ pEntry->mnHeight,
+ pEntry->mnWidth,
+ pEntry->mnOrientation,
+ pEntry->mbVertical,
+ bArtItalic,
+ bArtBold
+ );
}
void GenPspGraphics::SetTextColor( SalColor nSalColor )
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index d7c9627..d198dc6 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -1426,7 +1426,7 @@ HFONT WinSalGraphics::ImplDoSetFont( FontSelectPattern* i_pFont, float& o_rFontS
return hNewFont;
}
-sal_uInt16 WinSalGraphics::SetFont( FontSelectPattern* pFont, int nFallbackLevel )
+void WinSalGraphics::SetFont( FontSelectPattern* pFont, int nFallbackLevel )
{
// return early if there is no new font
if( !pFont )
@@ -1449,7 +1449,7 @@ sal_uInt16 WinSalGraphics::SetFont( FontSelectPattern* pFont, int nFallbackLevel
mpWinFontData[i] = nullptr;
}
mhDefFont = 0;
- return 0;
+ return;
}
assert(pFont->mpFontData);
@@ -1505,14 +1505,6 @@ sal_uInt16 WinSalGraphics::SetFont( FontSelectPattern* pFont, int nFallbackLevel
}
mnFontKernPairCount = 0;
}
-
- // some printers have higher internal resolution, so their
- // text output would be different from what we calculated
- // => suggest DrawTextArray to workaround this problem
- if ( mbPrinter )
- return SAL_SETFONT_USEDRAWTEXTARRAY;
- else
- return 0;
}
void WinSalGraphics::GetFontMetric( ImplFontMetricDataPtr& rxFontMetric, int nFallbackLevel )
More information about the Libreoffice-commits
mailing list