sfx2/qa/uitest/doc/objserv.py | 2 + vcl/source/gdi/pdfwriter_impl.cxx | 54 ++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 30 deletions(-)
New commits: commit f8b3edb5a597a923684becb2ea92c9253dae380c Author: Miklos Vajna <[email protected]> AuthorDate: Tue Jun 16 18:05:50 2020 +0200 Commit: Miklos Vajna <[email protected]> CommitDate: Mon Jun 29 09:08:24 2020 +0200 vcl: namespace PDFWriterImpl consistently We had a mix of 'using namespace vcl;' and 'namespace vcl {', standardize on the later. (cherry picked from commit c43e62f26f8d51c2ad97f6c93877ce9d3ae9639e) Conflicts: vcl/source/gdi/pdfwriter_impl.cxx Change-Id: I088bb0e0c03f712242427bf6a0b31dd17755b9dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97245 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sfx2/qa/uitest/doc/objserv.py b/sfx2/qa/uitest/doc/objserv.py index af00590736ea..692d0fb88e17 100644 --- a/sfx2/qa/uitest/doc/objserv.py +++ b/sfx2/qa/uitest/doc/objserv.py @@ -8,9 +8,11 @@ from uitest.framework import UITestCase import org.libreoffice.unotest import pathlib + def get_url_for_data_file(file_name): return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() + # Test for sfx2/source/doc/objserv.cxx. class Test(UITestCase): diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index b966ef0ed15c..bba48ab61347 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -91,7 +91,6 @@ #include <libeot/libeot.h> #endif -using namespace vcl; using namespace::com::sun::star; static bool g_bDebugDisableCompression = getenv("VCL_DEBUG_DISABLE_PDFCOMPRESSION"); @@ -119,12 +118,6 @@ static const double fDivisor = 1000.0; static double pixelToPoint( double px ) { return px/fDivisor; } static sal_Int32 pointToPixel( double pt ) { return sal_Int32(pt*fDivisor); } -const sal_uInt8 PDFWriterImpl::s_nPadString[32] = -{ - 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08, - 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A -}; - static void appendHex( sal_Int8 nInt, OStringBuffer& rBuffer ) { static const sal_Char pHexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', @@ -268,6 +261,29 @@ static void appendDestinationName( const OUString& rString, OStringBuffer& rBuff } } +namespace vcl +{ +const sal_uInt8 PDFWriterImpl::s_nPadString[32] = +{ + 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08, + 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A +}; + +template < class GEOMETRY > +static GEOMETRY lcl_convert( const MapMode& _rSource, const MapMode& _rDest, OutputDevice* _pPixelConversion, const GEOMETRY& _rObject ) +{ + GEOMETRY aPoint; + if ( MapUnit::MapPixel == _rSource.GetMapUnit() ) + { + aPoint = _pPixelConversion->PixelToLogic( _rObject, _rDest ); + } + else + { + aPoint = OutputDevice::LogicToLogic( _rObject, _rSource, _rDest ); + } + return aPoint; +} + void PDFWriter::AppendUnicodeTextString(const OUString& rString, OStringBuffer& rBuffer) { rBuffer.append( "FEFF" ); @@ -544,8 +560,6 @@ void PDFWriterImpl::appendNonStrokingColor( const Color& rColor, OStringBuffer& // matrix helper class // TODO: use basegfx matrix class instead or derive from it -namespace vcl // TODO: use anonymous namespace to keep this class local -{ /* for sparse matrices of the form (2D linear transformations) * f[0] f[1] 0 * f[2] f[3] 0 @@ -569,7 +583,6 @@ public: Point transform( const Point& rPoint ) const; }; -} Matrix3::Matrix3() { @@ -957,24 +970,6 @@ bool PDFWriterImpl::PDFPage::emit(sal_Int32 nParentObject ) return m_pWriter->writeBuffer( aLine.getStr(), aLine.getLength() ); } -namespace vcl -{ -template < class GEOMETRY > -static GEOMETRY lcl_convert( const MapMode& _rSource, const MapMode& _rDest, OutputDevice* _pPixelConversion, const GEOMETRY& _rObject ) -{ - GEOMETRY aPoint; - if ( MapUnit::MapPixel == _rSource.GetMapUnit() ) - { - aPoint = _pPixelConversion->PixelToLogic( _rObject, _rDest ); - } - else - { - aPoint = OutputDevice::LogicToLogic( _rObject, _rSource, _rDest ); - } - return aPoint; -} -} - void PDFWriterImpl::PDFPage::appendPoint( const Point& rPoint, OStringBuffer& rBuffer ) const { Point aPoint( lcl_convert( m_pWriter->m_aGraphicsStack.front().m_aMapMode, @@ -5673,7 +5668,6 @@ void PDFWriterImpl::sortWidgets() // FIXME: implement tab order in structure tree for PDF 1.5 } -namespace vcl { class PDFStreamIf : public cppu::WeakImplHelper< css::io::XOutputStream > { @@ -5686,7 +5680,6 @@ class PDFStreamIf : virtual void SAL_CALL flush() override; virtual void SAL_CALL closeOutput() override; }; -} void SAL_CALL PDFStreamIf::writeBytes( const css::uno::Sequence< sal_Int8 >& aData ) { @@ -11442,5 +11435,6 @@ sal_Int32 PDFWriterImpl::ReferenceXObjectEmit::getObject() const else return m_nBitmapObject; } +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
