diff options
-rw-r--r-- | dbaccess/source/ui/inc/UITools.hxx | 11 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 27 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/FieldDescriptions.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 6 |
4 files changed, 35 insertions, 18 deletions
diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index 0bea6b717098..69ed06c852c1 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -2,9 +2,9 @@ * * $RCSfile: UITools.hxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: oj $ $Date: 2002-08-26 07:50:55 $ + * last change: $Author: oj $ $Date: 2002-09-24 09:48:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -191,6 +191,13 @@ namespace dbaui @return the corresponding com::sun::star::awt::TextAlign */ sal_Int32 mapTextAllign(const SvxCellHorJustify& _eAlignment); + + /** maps com::sun::star::awt::TextAlign to SvxCellHorJustify + @param com::sun::star::awt::TextAlign& _nAlignment + @return the corresponding SvxCellHorJustify + */ + SvxCellHorJustify mapTextJustify(const sal_Int32& _nAlignment); + /** fill a column with ui data of a field description @param _rxColumn the column which should be filled @param _pFieldDesc the source of the data diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 872bdea56afb..ec14636daa27 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -2,9 +2,9 @@ * * $RCSfile: UITools.cxx,v $ * - * $Revision: 1.38 $ + * $Revision: 1.39 $ * - * last change: $Author: oj $ $Date: 2002-09-24 09:18:58 $ + * last change: $Author: oj $ $Date: 2002-09-24 09:48:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -724,6 +724,20 @@ sal_Int32 mapTextAllign(const SvxCellHorJustify& _eAlignment) return nAlignment; } // ----------------------------------------------------------------------------- +SvxCellHorJustify mapTextJustify(const sal_Int32& _nAlignment) +{ + SvxCellHorJustify eJustify = SVX_HOR_JUSTIFY_LEFT; + switch (_nAlignment) + { + case ::com::sun::star::awt::TextAlign::LEFT : eJustify = SVX_HOR_JUSTIFY_LEFT; break; + case ::com::sun::star::awt::TextAlign::CENTER : eJustify = SVX_HOR_JUSTIFY_CENTER; break; + case ::com::sun::star::awt::TextAlign::RIGHT : eJustify = SVX_HOR_JUSTIFY_RIGHT; break; + default: + OSL_ENSURE(0,"Invalid TextAlign!"); + } + return eJustify; +} +// ----------------------------------------------------------------------------- void setColumnUiProperties( const Reference< XPropertySet>& _rxColumn,const OFieldDescription* _pFieldDesc) { if ( _pFieldDesc->GetFormatKey() != NumberFormat::UNDEFINED && _rxColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_FORMATKEY) ) @@ -828,14 +842,7 @@ void callColumnFormatDialog(const Reference<XPropertySet>& xAffectedCol, SvxCellHorJustify eJustify(SVX_HOR_JUSTIFY_STANDARD); Any aAlignment = xAffectedCol->getPropertyValue(PROPERTY_ALIGN); if (aAlignment.hasValue()) - switch (::comphelper::getINT16(aAlignment)) - { - case ::com::sun::star::awt::TextAlign::LEFT : eJustify = SVX_HOR_JUSTIFY_LEFT; break; - case ::com::sun::star::awt::TextAlign::CENTER : eJustify = SVX_HOR_JUSTIFY_CENTER; break; - case ::com::sun::star::awt::TextAlign::RIGHT : eJustify = SVX_HOR_JUSTIFY_RIGHT; break; - default: - OSL_ENSURE(0,"Invalid TextAlign!"); - } + eJustify = dbaui::mapTextJustify(::comphelper::getINT16(aAlignment)); sal_Int32 nFormatKey = 0; if ( bHasFormat ) nFormatKey = ::comphelper::getINT32(xAffectedCol->getPropertyValue(PROPERTY_FORMATKEY)); diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx index 57392e1c6098..88b0d891a3e3 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FieldDescriptions.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: oj $ $Date: 2002-09-24 09:19:02 $ + * last change: $Author: oj $ $Date: 2002-09-24 09:48:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,6 +83,9 @@ #ifndef _COMPHELPER_EXTRACT_HXX_ #include <comphelper/extract.hxx> #endif +#ifndef DBAUI_TOOLS_HXX +#include "UITools.hxx" +#endif using namespace dbaui; using namespace ::com::sun::star::sdbc; @@ -210,7 +213,7 @@ OFieldDescription::OFieldDescription(const Reference< XPropertySet >& xAffectedC if(xPropSetInfo->hasPropertyByName(PROPERTY_FORMATKEY)) SetFormatKey(::comphelper::getINT32(xAffectedCol->getPropertyValue(PROPERTY_FORMATKEY))); if(xPropSetInfo->hasPropertyByName(PROPERTY_ALIGN)) - SetHorJustify((SvxCellHorJustify)::comphelper::getINT32(xAffectedCol->getPropertyValue(PROPERTY_ALIGN))); + SetHorJustify( ::dbaui::mapTextJustify(::comphelper::getINT16(xAffectedCol->getPropertyValue(PROPERTY_ALIGN)))); if(xPropSetInfo->hasPropertyByName(PROPERTY_ISAUTOINCREMENT)) SetAutoIncrement(::cppu::any2bool(xAffectedCol->getPropertyValue(PROPERTY_ISAUTOINCREMENT))); } diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index d459fa26dbdc..f1f8287ead35 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -2,9 +2,9 @@ * * $RCSfile: TableController.cxx,v $ * - * $Revision: 1.81 $ + * $Revision: 1.82 $ * - * last change: $Author: oj $ $Date: 2002-09-24 09:19:05 $ + * last change: $Author: oj $ $Date: 2002-09-24 09:48:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1068,7 +1068,7 @@ void OTableController::loadData() // pActFieldDescr->SetPrimaryKey(pPrimary->GetValue()); pActFieldDescr->SetDescription(sDescription); pActFieldDescr->SetAutoIncrement(bIsAutoIncrement); - pActFieldDescr->SetHorJustify((SvxCellHorJustify)nAlign); + pActFieldDescr->SetHorJustify(dbaui::mapTextJustify(nAlign)); pActFieldDescr->SetCurrency(bIsCurrency); ////////////////////////////////////////////////////////////////////// |