summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-04-16 09:14:28 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-04-16 10:15:38 +0100
commitcb7412b8185d6b94ca59b48668ec5e77fa8f7999 (patch)
tree9a0e17cbffb5de39ade4d5aa73184a9db852396c /dbaccess
parentade27059dc2e1c84ab00023c15430ee6645617f7 (diff)
merge duplicated CreateFontDescriptor methods
Change-Id: I33f9df7f17158eedc4a4c0dedfd0fc4cddc6180f
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/inc/UITools.hxx6
-rw-r--r--dbaccess/source/ui/misc/HtmlReader.cxx3
-rw-r--r--dbaccess/source/ui/misc/RtfReader.cxx3
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx78
4 files changed, 4 insertions, 86 deletions
diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx
index 0ee69703ac99..7c4f62401e35 100644
--- a/dbaccess/source/ui/inc/UITools.hxx
+++ b/dbaccess/source/ui/inc/UITools.hxx
@@ -182,12 +182,6 @@ namespace dbaui
*/
SvxCellHorJustify mapTextJustify(const sal_Int32& _nAlignment);
- /** convert Font to ::com::sun::star::awt::FontDescriptor
- @param _rFont Font to be converted
- @return the new FontDescriptor
- */
- ::com::sun::star::awt::FontDescriptor CreateFontDescriptor( const Font& _rFont );
-
/** call the format dialog and set the selected format at the column
@param _xAffectedCol Font to be converted
@param _xField Font to be converted
diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index cc8676d9652e..8ab0ed0a19b3 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -20,6 +20,7 @@
#include "HtmlReader.hxx"
#include <connectivity/dbconversion.hxx>
#include <connectivity/dbtools.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
#include <tools/tenccvt.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/string.hxx>
@@ -439,7 +440,7 @@ sal_Bool OHTMLReader::CreateTable(int nToken)
SvxCellHorJustify eVal;
String aTableName;
- FontDescriptor aFont = ::dbaui::CreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont());
+ FontDescriptor aFont = VCLUnoHelper::CreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont());
sal_Int32 nTextColor = 0;
do
{
diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx
index ba19f265220d..8e85fbe993ba 100644
--- a/dbaccess/source/ui/misc/RtfReader.cxx
+++ b/dbaccess/source/ui/misc/RtfReader.cxx
@@ -33,6 +33,7 @@
#include <com/sun/star/util/XNumberFormatTypes.hpp>
#include "dbustrings.hrc"
#include <svtools/rtftoken.h>
+#include <toolkit/helper/vclunohelper.hxx>
#include "dbu_misc.hrc"
#include <vcl/msgbox.hxx>
#include <connectivity/dbconversion.hxx>
@@ -270,7 +271,7 @@ sal_Bool ORTFReader::CreateTable(int nToken)
int nTmpToken2 = nToken;
String aColumnName;
- FontDescriptor aFont = ::dbaui::CreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont());
+ FontDescriptor aFont = VCLUnoHelper::CreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont());
do
{
switch(nTmpToken2)
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index f71fdcd8b45d..41633e23f4a2 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -753,84 +753,6 @@ SvxCellHorJustify mapTextJustify(const sal_Int32& _nAlignment)
return eJustify;
}
// -----------------------------------------------------------------------------
-float ConvertFontWeight( ::FontWeight eWeight )
-{
- if( eWeight == WEIGHT_DONTKNOW )
- return ::com::sun::star::awt::FontWeight::DONTKNOW;
- else if( eWeight == WEIGHT_THIN )
- return ::com::sun::star::awt::FontWeight::THIN;
- else if( eWeight == WEIGHT_ULTRALIGHT )
- return ::com::sun::star::awt::FontWeight::ULTRALIGHT;
- else if( eWeight == WEIGHT_LIGHT )
- return ::com::sun::star::awt::FontWeight::LIGHT;
- else if( eWeight == WEIGHT_SEMILIGHT )
- return ::com::sun::star::awt::FontWeight::SEMILIGHT;
- else if( ( eWeight == WEIGHT_NORMAL ) || ( eWeight == WEIGHT_MEDIUM ) )
- return ::com::sun::star::awt::FontWeight::NORMAL;
- else if( eWeight == WEIGHT_SEMIBOLD )
- return ::com::sun::star::awt::FontWeight::SEMIBOLD;
- else if( eWeight == WEIGHT_BOLD )
- return ::com::sun::star::awt::FontWeight::BOLD;
- else if( eWeight == WEIGHT_ULTRABOLD )
- return ::com::sun::star::awt::FontWeight::ULTRABOLD;
- else if( eWeight == WEIGHT_BLACK )
- return ::com::sun::star::awt::FontWeight::BLACK;
-
- SAL_WARN("dbaccess.ui", "Unknown FontWeight" );
- return ::com::sun::star::awt::FontWeight::DONTKNOW;
-}
-// -----------------------------------------------------------------------------
-float ConvertFontWidth( ::FontWidth eWidth )
-{
- if( eWidth == WIDTH_DONTKNOW )
- return ::com::sun::star::awt::FontWidth::DONTKNOW;
- else if( eWidth == WIDTH_ULTRA_CONDENSED )
- return ::com::sun::star::awt::FontWidth::ULTRACONDENSED;
- else if( eWidth == WIDTH_EXTRA_CONDENSED )
- return ::com::sun::star::awt::FontWidth::EXTRACONDENSED;
- else if( eWidth == WIDTH_CONDENSED )
- return ::com::sun::star::awt::FontWidth::CONDENSED;
- else if( eWidth == WIDTH_SEMI_CONDENSED )
- return ::com::sun::star::awt::FontWidth::SEMICONDENSED;
- else if( eWidth == WIDTH_NORMAL )
- return ::com::sun::star::awt::FontWidth::NORMAL;
- else if( eWidth == WIDTH_SEMI_EXPANDED )
- return ::com::sun::star::awt::FontWidth::SEMIEXPANDED;
- else if( eWidth == WIDTH_EXPANDED )
- return ::com::sun::star::awt::FontWidth::EXPANDED;
- else if( eWidth == WIDTH_EXTRA_EXPANDED )
- return ::com::sun::star::awt::FontWidth::EXTRAEXPANDED;
- else if( eWidth == WIDTH_ULTRA_EXPANDED )
- return ::com::sun::star::awt::FontWidth::ULTRAEXPANDED;
-
- SAL_WARN("dbaccess.ui", "Unknown FontWidth" );
- return ::com::sun::star::awt::FontWidth::DONTKNOW;
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::awt::FontDescriptor CreateFontDescriptor( const Font& rFont )
-{
- ::com::sun::star::awt::FontDescriptor aFD;
- aFD.Name = rFont.GetName();
- aFD.StyleName = rFont.GetStyleName();
- aFD.Height = (sal_Int16)rFont.GetSize().Height();
- aFD.Width = (sal_Int16)rFont.GetSize().Width();
- aFD.Family = sal::static_int_cast< sal_Int16 >(rFont.GetFamily());
- aFD.CharSet = rFont.GetCharSet();
- aFD.Pitch = sal::static_int_cast< sal_Int16 >(rFont.GetPitch());
- aFD.CharacterWidth = ConvertFontWidth( rFont.GetWidthType() );
- aFD.Weight = ConvertFontWeight( rFont.GetWeight() );
- aFD.Slant = (::com::sun::star::awt::FontSlant)rFont.GetItalic();
- aFD.Underline = sal::static_int_cast< sal_Int16 >(
- rFont.GetUnderline());
- aFD.Strikeout = sal::static_int_cast< sal_Int16 >(
- rFont.GetStrikeout());
- aFD.Orientation = rFont.GetOrientation();
- aFD.Kerning = rFont.IsKerning();
- aFD.WordLineMode = rFont.IsWordLineMode();
- aFD.Type = 0; // ??? => Nur an Metric...
- return aFD;
-}
-// -----------------------------------------------------------------------------
void callColumnFormatDialog(const Reference<XPropertySet>& xAffectedCol,
const Reference<XPropertySet>& xField,
SvNumberFormatter* _pFormatter,