[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source
Chris Sherlock
chris.sherlock79 at gmail.com
Thu Jan 14 16:00:19 PST 2016
vcl/Library_vcl.mk | 1
vcl/source/font/fontmetric.cxx | 218 ++++++++++++++++++++++++++++++++++-------
vcl/source/gdi/metric.cxx | 207 --------------------------------------
3 files changed, 184 insertions(+), 242 deletions(-)
New commits:
commit f0841c6c86c8c8403eb1d78a1bd43a8adac75e3a
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Fri Jan 15 10:59:18 2016 +1100
vcl: move metric.cxx to font/fontmetric.cxx
Change-Id: If8e4a479967a84f7c43c762c55a3a60b7083d6d9
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index df22d62..3c63a77 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -286,7 +286,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/gdi/lineinfo \
vcl/source/gdi/mapmod \
vcl/source/gdi/metaact \
- vcl/source/gdi/metric \
vcl/source/gdi/octree \
vcl/source/gdi/oldprintadaptor \
vcl/source/gdi/pdfextoutdevdata \
diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx
index 3f27d62..728d84f 100644
--- a/vcl/source/font/fontmetric.cxx
+++ b/vcl/source/font/fontmetric.cxx
@@ -17,53 +17,203 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "i18nlangtag/mslangid.hxx"
-
-#include <unotools/configmgr.hxx>
-#include <vcl/virdev.hxx>
-#include <vcl/print.hxx>
-#include <vcl/outdev.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/settings.hxx>
-#include <vcl/sysdata.hxx>
+#include <i18nlangtag/mslangid.hxx>
#include <vcl/fontcharmap.hxx>
+#include <vcl/metric.hxx>
-#include "sallayout.hxx"
-#include "svdata.hxx"
-
-#include "impfont.hxx"
-#include "outdata.hxx"
-#include "fontinstance.hxx"
-#include "fontattributes.hxx"
+#include "impfontmetric.hxx"
#include "impfontmetricdata.hxx"
-
-#include "outdev.h"
-#include "window.h"
-
-#include "PhysicalFontCollection.hxx"
#include "PhysicalFontFace.hxx"
-#include "PhysicalFontFamily.hxx"
-#include "svids.hrc"
-
-#include <config_graphite.h>
-#if ENABLE_GRAPHITE
-#include "graphite_features.hxx"
-#endif
-
-#include "../gdi/pdfwriter_impl.hxx"
+#include <vector>
+#include <set>
+#include <cstdio>
#include <boost/functional/hash.hpp>
-#include <cmath>
-#include <cstring>
-#include <memory>
-#include <algorithm>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::rtl;
using namespace ::utl;
+FontMetric::FontMetric()
+: mpImplMetric( new ImplFontMetric() )
+{}
+
+FontMetric::FontMetric( const FontMetric& rFontMetric )
+ : Font( rFontMetric )
+ , mpImplMetric( rFontMetric.mpImplMetric )
+{}
+
+FontMetric::~FontMetric()
+{
+ mpImplMetric = nullptr;
+}
+
+FontMetric& FontMetric::operator=( const FontMetric& rFontMetric )
+{
+ Font::operator=( rFontMetric );
+
+ if( mpImplMetric != rFontMetric.mpImplMetric )
+ {
+ mpImplMetric = rFontMetric.mpImplMetric;
+ }
+
+ return *this;
+}
+
+bool FontMetric::operator==( const FontMetric& rFontMetric ) const
+{
+ if( !Font::operator==( rFontMetric ) )
+ return false;
+ if( mpImplMetric == rFontMetric.mpImplMetric )
+ return true;
+ if( *mpImplMetric == *rFontMetric.mpImplMetric )
+ return true;
+ return false;
+}
+
+FontType FontMetric::GetType() const
+{
+ return (mpImplMetric->IsScalable() ? TYPE_SCALABLE : TYPE_RASTER);
+}
+
+long FontMetric::GetAscent() const
+{
+ return mpImplMetric->GetAscent();
+}
+
+void FontMetric::SetAscent( long nAscent )
+{
+ mpImplMetric->SetAscent( nAscent );
+}
+
+long FontMetric::GetDescent() const
+{
+ return mpImplMetric->GetDescent();
+}
+
+void FontMetric::SetDescent( long nDescent )
+{
+ mpImplMetric->SetDescent( nDescent );
+}
+
+long FontMetric::GetInternalLeading() const
+{
+ return mpImplMetric->GetInternalLeading();
+}
+
+void FontMetric::SetInternalLeading( long nLeading )
+{
+ mpImplMetric->SetInternalLeading( nLeading );
+}
+
+long FontMetric::GetExternalLeading() const
+{
+ return mpImplMetric->GetExternalLeading();
+}
+
+void FontMetric::SetExternalLeading( long nLeading )
+{
+ mpImplMetric->SetExternalLeading( nLeading );
+}
+
+long FontMetric::GetLineHeight() const
+{
+ return mpImplMetric->GetLineHeight();
+}
+
+void FontMetric::SetLineHeight( long nHeight )
+{
+ mpImplMetric->SetLineHeight( nHeight );
+}
+
+long FontMetric::GetSlant() const
+{
+ return mpImplMetric->GetSlant();
+}
+
+void FontMetric::SetSlant( long nSlant )
+{
+ mpImplMetric->SetSlant( nSlant );
+}
+
+long FontMetric::GetBulletOffset() const
+{
+ return mpImplMetric->GetBulletOffset();
+}
+
+void FontMetric::SetBulletOffset( long nOffset )
+{
+ mpImplMetric->SetBulletOffset( nOffset );
+}
+
+bool FontMetric::IsScalable() const
+{
+ return mpImplMetric->IsScalable();
+}
+
+void FontMetric::SetScalableFlag(bool bScalable)
+{
+ mpImplMetric->SetScalableFlag( bScalable );
+}
+
+bool FontMetric::IsFullstopCentered() const
+{
+ return mpImplMetric->IsFullstopCentered();
+}
+
+void FontMetric::SetFullstopCenteredFlag(bool bScalable)
+{
+ mpImplMetric->SetFullstopCenteredFlag( bScalable );
+}
+
+bool FontMetric::IsBuiltInFont() const
+{
+ return mpImplMetric->IsBuiltInFont();
+}
+
+void FontMetric::SetBuiltInFontFlag( bool bIsBuiltInFont )
+{
+ mpImplMetric->SetBuiltInFontFlag( bIsBuiltInFont );
+}
+
+
+
+ImplFontMetric::ImplFontMetric()
+: mnAscent( 0 ),
+ mnDescent( 0 ),
+ mnIntLeading( 0 ),
+ mnExtLeading( 0 ),
+ mnLineHeight( 0 ),
+ mnSlant( 0 ),
+ mnBulletOffset( 0 ),
+ mnRefCount( 0 ),
+ mbScalableFont( false ),
+ mbFullstopCentered( false ),
+ mbDevice( false )
+{}
+
+bool ImplFontMetric::operator==( const ImplFontMetric& r ) const
+{
+ if( mbScalableFont != r.mbScalableFont
+ || mbFullstopCentered != r.mbFullstopCentered
+ || mbDevice != r.mbDevice) // mbDevice == built-in font flag
+ return false;
+ if( mnAscent != r.mnAscent )
+ return false;
+ if( mnDescent != r.mnDescent )
+ return false;
+ if( mnIntLeading != r.mnIntLeading )
+ return false;
+ if( mnExtLeading != r.mnExtLeading )
+ return false;
+ if( mnSlant != r.mnSlant )
+ return false;
+
+ return true;
+}
+
ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData )
: FontAttributes( rFontSelData )
, mnRefCount ( 0 )
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
deleted file mode 100644
index adbb454..0000000
--- a/vcl/source/gdi/metric.cxx
+++ /dev/null
@@ -1,207 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <vcl/metric.hxx>
-#include "impfontmetric.hxx"
-
-#include <vector>
-#include <set>
-
-#include <cstdio>
-
-FontMetric::FontMetric()
-: mpImplMetric( new ImplFontMetric() )
-{}
-
-FontMetric::FontMetric( const FontMetric& rFontMetric )
- : Font( rFontMetric )
- , mpImplMetric( rFontMetric.mpImplMetric )
-{}
-
-FontMetric::~FontMetric()
-{
- mpImplMetric = nullptr;
-}
-
-FontMetric& FontMetric::operator=( const FontMetric& rFontMetric )
-{
- Font::operator=( rFontMetric );
-
- if( mpImplMetric != rFontMetric.mpImplMetric )
- {
- mpImplMetric = rFontMetric.mpImplMetric;
- }
-
- return *this;
-}
-
-bool FontMetric::operator==( const FontMetric& rFontMetric ) const
-{
- if( !Font::operator==( rFontMetric ) )
- return false;
- if( mpImplMetric == rFontMetric.mpImplMetric )
- return true;
- if( *mpImplMetric == *rFontMetric.mpImplMetric )
- return true;
- return false;
-}
-
-FontType FontMetric::GetType() const
-{
- return (mpImplMetric->IsScalable() ? TYPE_SCALABLE : TYPE_RASTER);
-}
-
-long FontMetric::GetAscent() const
-{
- return mpImplMetric->GetAscent();
-}
-
-void FontMetric::SetAscent( long nAscent )
-{
- mpImplMetric->SetAscent( nAscent );
-}
-
-long FontMetric::GetDescent() const
-{
- return mpImplMetric->GetDescent();
-}
-
-void FontMetric::SetDescent( long nDescent )
-{
- mpImplMetric->SetDescent( nDescent );
-}
-
-long FontMetric::GetInternalLeading() const
-{
- return mpImplMetric->GetInternalLeading();
-}
-
-void FontMetric::SetInternalLeading( long nLeading )
-{
- mpImplMetric->SetInternalLeading( nLeading );
-}
-
-long FontMetric::GetExternalLeading() const
-{
- return mpImplMetric->GetExternalLeading();
-}
-
-void FontMetric::SetExternalLeading( long nLeading )
-{
- mpImplMetric->SetExternalLeading( nLeading );
-}
-
-long FontMetric::GetLineHeight() const
-{
- return mpImplMetric->GetLineHeight();
-}
-
-void FontMetric::SetLineHeight( long nHeight )
-{
- mpImplMetric->SetLineHeight( nHeight );
-}
-
-long FontMetric::GetSlant() const
-{
- return mpImplMetric->GetSlant();
-}
-
-void FontMetric::SetSlant( long nSlant )
-{
- mpImplMetric->SetSlant( nSlant );
-}
-
-long FontMetric::GetBulletOffset() const
-{
- return mpImplMetric->GetBulletOffset();
-}
-
-void FontMetric::SetBulletOffset( long nOffset )
-{
- mpImplMetric->SetBulletOffset( nOffset );
-}
-
-bool FontMetric::IsScalable() const
-{
- return mpImplMetric->IsScalable();
-}
-
-void FontMetric::SetScalableFlag(bool bScalable)
-{
- mpImplMetric->SetScalableFlag( bScalable );
-}
-
-bool FontMetric::IsFullstopCentered() const
-{
- return mpImplMetric->IsFullstopCentered();
-}
-
-void FontMetric::SetFullstopCenteredFlag(bool bScalable)
-{
- mpImplMetric->SetFullstopCenteredFlag( bScalable );
-}
-
-bool FontMetric::IsBuiltInFont() const
-{
- return mpImplMetric->IsBuiltInFont();
-}
-
-void FontMetric::SetBuiltInFontFlag( bool bIsBuiltInFont )
-{
- mpImplMetric->SetBuiltInFontFlag( bIsBuiltInFont );
-}
-
-
-
-ImplFontMetric::ImplFontMetric()
-: mnAscent( 0 ),
- mnDescent( 0 ),
- mnIntLeading( 0 ),
- mnExtLeading( 0 ),
- mnLineHeight( 0 ),
- mnSlant( 0 ),
- mnBulletOffset( 0 ),
- mnRefCount( 0 ),
- mbScalableFont( false ),
- mbFullstopCentered( false ),
- mbDevice( false )
-{}
-
-bool ImplFontMetric::operator==( const ImplFontMetric& r ) const
-{
- if( mbScalableFont != r.mbScalableFont
- || mbFullstopCentered != r.mbFullstopCentered
- || mbDevice != r.mbDevice) // mbDevice == built-in font flag
- return false;
- if( mnAscent != r.mnAscent )
- return false;
- if( mnDescent != r.mnDescent )
- return false;
- if( mnIntLeading != r.mnIntLeading )
- return false;
- if( mnExtLeading != r.mnExtLeading )
- return false;
- if( mnSlant != r.mnSlant )
- return false;
-
- return true;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list