[Libreoffice-commits] core.git: vcl/inc vcl/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Sun Dec 29 20:41:29 UTC 2019
vcl/inc/pdf/ResourceDict.hxx | 10 +++++-----
vcl/source/gdi/pdfwriter_impl.cxx | 24 ++++++++++++------------
2 files changed, 17 insertions(+), 17 deletions(-)
New commits:
commit 0483b2462685d455baa8d10b35116467f77d29cb
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Dec 29 20:02:33 2019 +0100
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sun Dec 29 21:40:55 2019 +0100
pdf: convert ResourceKind enum to enum class
Change-Id: Ie7833826648209d4c12f7d7473bd4f9ceb4bd092
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85959
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/inc/pdf/ResourceDict.hxx b/vcl/inc/pdf/ResourceDict.hxx
index 8334e1f52c39..488a821db79c 100644
--- a/vcl/inc/pdf/ResourceDict.hxx
+++ b/vcl/inc/pdf/ResourceDict.hxx
@@ -17,12 +17,12 @@
namespace vcl::pdf
{
-enum ResourceKind
+enum class ResourceKind
{
- ResXObject,
- ResExtGState,
- ResShading,
- ResPattern
+ XObject,
+ ExtGState,
+ Shading,
+ Pattern
};
struct ResourceDict
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 3d500ce15e99..1e5490fa9f58 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -7295,8 +7295,8 @@ void PDFWriterImpl::drawTransparent( const tools::PolyPolygon& rPolyPoly, sal_uI
" Do Q\n";
writeBuffer( aLine.getStr(), aLine.getLength() );
- pushResource( ResXObject, aTrName, m_aTransparentObjects.back().m_nObject );
- pushResource( ResExtGState, aExtName, m_aTransparentObjects.back().m_nExtGStateObject );
+ pushResource( ResourceKind::XObject, aTrName, m_aTransparentObjects.back().m_nObject );
+ pushResource( ResourceKind::ExtGState, aExtName, m_aTransparentObjects.back().m_nExtGStateObject );
}
void PDFWriterImpl::pushResource( ResourceKind eKind, const OString& rResource, sal_Int32 nObject )
@@ -7305,22 +7305,22 @@ void PDFWriterImpl::pushResource( ResourceKind eKind, const OString& rResource,
{
switch( eKind )
{
- case ResXObject:
+ case ResourceKind::XObject:
m_aGlobalResourceDict.m_aXObjects[ rResource ] = nObject;
if( ! m_aOutputStreams.empty() )
m_aOutputStreams.front().m_aResourceDict.m_aXObjects[ rResource ] = nObject;
break;
- case ResExtGState:
+ case ResourceKind::ExtGState:
m_aGlobalResourceDict.m_aExtGStates[ rResource ] = nObject;
if( ! m_aOutputStreams.empty() )
m_aOutputStreams.front().m_aResourceDict.m_aExtGStates[ rResource ] = nObject;
break;
- case ResShading:
+ case ResourceKind::Shading:
m_aGlobalResourceDict.m_aShadings[ rResource ] = nObject;
if( ! m_aOutputStreams.empty() )
m_aOutputStreams.front().m_aResourceDict.m_aShadings[ rResource ] = nObject;
break;
- case ResPattern:
+ case ResourceKind::Pattern:
m_aGlobalResourceDict.m_aPatterns[ rResource ] = nObject;
if( ! m_aOutputStreams.empty() )
m_aOutputStreams.front().m_aResourceDict.m_aPatterns[ rResource ] = nObject;
@@ -7428,8 +7428,8 @@ void PDFWriterImpl::endTransparencyGroup( const tools::Rectangle& rBoundingBox,
" Do Q\n";
writeBuffer( aLine.getStr(), aLine.getLength() );
- pushResource( ResXObject, aTrName, m_aTransparentObjects.back().m_nObject );
- pushResource( ResExtGState, aExtName, m_aTransparentObjects.back().m_nExtGStateObject );
+ pushResource( ResourceKind::XObject, aTrName, m_aTransparentObjects.back().m_nObject );
+ pushResource( ResourceKind::ExtGState, aExtName, m_aTransparentObjects.back().m_nExtGStateObject );
}
@@ -9350,7 +9350,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
writeBuffer( aLine.getStr(), aLine.getLength() );
OString aObjName = "Im" + OString::number(nObject);
- pushResource( ResXObject, aObjName, nObject );
+ pushResource( ResourceKind::XObject, aObjName, nObject );
}
@@ -9427,7 +9427,7 @@ const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx
sal_Int32 nObject = it->m_aReferenceXObject.getObject();
OString aObjName = "Im" + OString::number(nObject);
- pushResource( ResXObject, aObjName, nObject );
+ pushResource( ResourceKind::XObject, aObjName, nObject );
return *it;
}
@@ -9482,7 +9482,7 @@ sal_Int32 PDFWriterImpl::createGradient( const Gradient& rGradient, const Size&
OStringBuffer aObjName( 16 );
aObjName.append( 'P' );
aObjName.append( it->m_nObject );
- pushResource( ResShading, aObjName.makeStringAndClear(), it->m_nObject );
+ pushResource( ResourceKind::Shading, aObjName.makeStringAndClear(), it->m_nObject );
return it->m_nObject;
}
@@ -9659,7 +9659,7 @@ void PDFWriterImpl::drawWallpaper( const tools::Rectangle& rRect, const Wallpape
aObjName.append( 'P' );
aObjName.append( m_aTilings.back().m_nObject );
OString aPatternName( aObjName.makeStringAndClear() );
- pushResource( ResPattern, aPatternName, m_aTilings.back().m_nObject );
+ pushResource( ResourceKind::Pattern, aPatternName, m_aTilings.back().m_nObject );
// fill a rRect with the pattern
OStringBuffer aLine( 100 );
More information about the Libreoffice-commits
mailing list