diff options
author | Frank Schönheit <fs@openoffice.org> | 2001-06-15 07:39:22 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2001-06-15 07:39:22 +0000 |
commit | ec7eb5e903839bbd8c4a10ebb38dbd60189bbb3b (patch) | |
tree | e89597a4ee2fcc4d707b49276e9d67f6c3bc8cfc /dbaccess/source | |
parent | 3b6296216983fb4f302cffcfb37a7c982cb32712 (diff) |
#86096# added CJK font properties
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/core/api/TableDeco.cxx | 13 | ||||
-rw-r--r-- | dbaccess/source/core/api/datasettings.cxx | 98 | ||||
-rw-r--r-- | dbaccess/source/core/inc/datasettings.hxx | 9 | ||||
-rw-r--r-- | dbaccess/source/inc/stringconstants.hrc | 10 | ||||
-rw-r--r-- | dbaccess/source/shared/stringconstants.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/unodatbr.cxx | 120 |
6 files changed, 135 insertions, 122 deletions
diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx index 865d3c79c872..f6745687b267 100644 --- a/dbaccess/source/core/api/TableDeco.cxx +++ b/dbaccess/source/core/api/TableDeco.cxx @@ -2,9 +2,9 @@ * * $RCSfile: TableDeco.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: fs $ $Date: 2001-06-12 13:39:12 $ + * last change: $Author: fs $ $Date: 2001-06-15 08:38:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -231,6 +231,9 @@ sal_Bool SAL_CALL ODBTableDecorator::convertFastPropertyValue( case PROPERTY_ID_FONT: case PROPERTY_ID_ROW_HEIGHT: case PROPERTY_ID_TEXTCOLOR: + case PROPERTY_ID_TEXTLINECOLOR: + case PROPERTY_ID_TEXTEMPHASIS: + case PROPERTY_ID_TEXTRELIEF: bRet = ODataSettings::convertFastPropertyValue(rConvertedValue, rOldValue,nHandle,rValue); break; @@ -257,6 +260,9 @@ void ODBTableDecorator::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, con case PROPERTY_ID_FONT: case PROPERTY_ID_ROW_HEIGHT: case PROPERTY_ID_TEXTCOLOR: + case PROPERTY_ID_TEXTLINECOLOR: + case PROPERTY_ID_TEXTEMPHASIS: + case PROPERTY_ID_TEXTRELIEF: ODataSettings::setFastPropertyValue_NoBroadcast(_nHandle, _rValue); break; case PROPERTY_ID_CATALOGNAME: @@ -306,6 +312,9 @@ void ODBTableDecorator::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) c case PROPERTY_ID_FONT: case PROPERTY_ID_ROW_HEIGHT: case PROPERTY_ID_TEXTCOLOR: + case PROPERTY_ID_TEXTLINECOLOR: + case PROPERTY_ID_TEXTEMPHASIS: + case PROPERTY_ID_TEXTRELIEF: ODataSettings::getFastPropertyValue(_rValue, _nHandle); break; case PROPERTY_ID_CATALOGNAME: diff --git a/dbaccess/source/core/api/datasettings.cxx b/dbaccess/source/core/api/datasettings.cxx index 0ff3d27ed7c8..aea96d3cd629 100644 --- a/dbaccess/source/core/api/datasettings.cxx +++ b/dbaccess/source/core/api/datasettings.cxx @@ -2,9 +2,9 @@ * * $RCSfile: datasettings.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: oj $ $Date: 2001-05-21 09:20:13 $ + * last change: $Author: fs $ $Date: 2001-06-15 08:38:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,6 +96,12 @@ #ifndef _COM_SUN_STAR_AWT_FONTWEIGHT_HPP_ #include <com/sun/star/awt/FontWeight.hpp> #endif +#ifndef _COM_SUN_STAR_AWT_FONTEMPHASISMARK_HPP_ +#include <com/sun/star/awt/FontEmphasisMark.hpp> +#endif +#ifndef _COM_SUN_STAR_AWT_FONTRELIEF_HPP_ +#include <com/sun/star/awt/FontRelief.hpp> +#endif #ifndef _COM_SUN_STAR_AWT_FONTWIDTH_HPP_ #include <com/sun/star/awt/FontWidth.hpp> @@ -215,12 +221,22 @@ void ODataSettings::registerProperties() registerMayBeVoidProperty(PROPERTY_TEXTCOLOR, PROPERTY_ID_TEXTCOLOR, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID, &m_aTextColor, ::getCppuType(static_cast<sal_Int32*>(NULL))); + + registerMayBeVoidProperty(PROPERTY_TEXTLINECOLOR, PROPERTY_ID_TEXTLINECOLOR, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID, + &m_aTextLineColor, ::getCppuType(static_cast<sal_Int32*>(NULL))); + + registerProperty(PROPERTY_TEXTEMPHASIS, PROPERTY_ID_TEXTEMPHASIS, PropertyAttribute::BOUND, + &m_nFontEmphasis, ::getCppuType(&m_nFontEmphasis)); + + registerProperty(PROPERTY_TEXTRELIEF, PROPERTY_ID_TEXTRELIEF, PropertyAttribute::BOUND, + &m_nFontRelief, ::getCppuType(&m_nFontRelief)); } + //-------------------------------------------------------------------------- ODataSettings::ODataSettings(OBroadcastHelper& _rBHelper) :OPropertyContainer(_rBHelper) + ,ODataSettings_Base() { - m_aAppFont = ImplCreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont()); registerProperties(); } @@ -229,23 +245,25 @@ ODataSettings::ODataSettings(const ODataSettings& _rSource, ::cppu::OBroadcastHe :OPropertyContainer(_rBHelper) ,ODataSettings_Base(_rSource) { - m_aAppFont = ImplCreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont()); registerProperties(); } //-------------------------------------------------------------------------- ODataSettings_Base::ODataSettings_Base() - : m_bApplyFilter(sal_False) - ,m_aFont(::comphelper::getDefaultFont()) + :m_aFont(::comphelper::getDefaultFont()) + ,m_bApplyFilter(sal_False) + ,m_nFontEmphasis(::com::sun::star::awt::FontEmphasisMark::NONE) + ,m_nFontRelief(::com::sun::star::awt::FontRelief::NONE) { - m_aAppFont = ImplCreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont()); - // registerProperties(); + if (0 == m_aAppFont.Name.getLength()) + m_aAppFont = ImplCreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont()); } //-------------------------------------------------------------------------- ODataSettings_Base::ODataSettings_Base(const ODataSettings_Base& _rSource) { - // registerProperties(); + if (0 == m_aAppFont.Name.getLength()) + m_aAppFont = ImplCreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont()); m_sFilter = _rSource.m_sFilter; m_sOrder = _rSource.m_sOrder; @@ -253,6 +271,9 @@ ODataSettings_Base::ODataSettings_Base(const ODataSettings_Base& _rSource) m_aFont = _rSource.m_aFont; m_aRowHeight = _rSource.m_aRowHeight; m_aTextColor = _rSource.m_aTextColor; + m_aTextLineColor= _rSource.m_aTextLineColor; + m_nFontEmphasis = _rSource.m_nFontEmphasis; + m_nFontRelief = _rSource.m_nFontRelief; } //-------------------------------------------------------------------------- @@ -269,41 +290,29 @@ void ODataSettings_Base::storeTo(const OConfigurationNode& _rConfigLocation) con _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_APPLYFILTER, ::cppu::bool2any(m_bApplyFilter)); _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_ROW_HEIGHT, m_aRowHeight); - if(m_aAppFont.Name != m_aFont.Name) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_NAME, makeAny(m_aFont.Name)); - - if(m_aAppFont.Height != m_aFont.Height) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_HEIGHT, makeAny(m_aFont.Height)); - if(m_aAppFont.Width != m_aFont.Width) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_WIDTH, makeAny(m_aFont.Width)); - if(m_aAppFont.StyleName != m_aFont.StyleName) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_STYLENAME, makeAny(m_aFont.StyleName)); - if(m_aAppFont.Family != m_aFont.Family) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_FAMILY, makeAny(m_aFont.Family)); - if(m_aAppFont.CharSet != m_aFont.CharSet) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_CHARSET, makeAny(m_aFont.CharSet)); - if(m_aAppFont.Pitch != m_aFont.Pitch) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_PITCH, makeAny(m_aFont.Pitch)); - if(m_aAppFont.CharacterWidth != m_aFont.CharacterWidth) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_CHARACTERWIDTH, makeAny(m_aFont.CharacterWidth)); - if(m_aAppFont.Weight != m_aFont.Weight) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_WEIGHT, makeAny(m_aFont.Weight)); - if(m_aAppFont.Slant != m_aFont.Slant) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_SLANT, makeAny((sal_Int16)m_aFont.Slant)); - if(m_aAppFont.Underline != m_aFont.Underline) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_UNDERLINE, makeAny(m_aFont.Underline)); - if(m_aAppFont.Strikeout != m_aFont.Strikeout) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_STRIKEOUT, makeAny(m_aFont.Strikeout)); - if(m_aAppFont.Orientation != m_aFont.Orientation) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_ORIENTATION, makeAny(m_aFont.Orientation)); - if(m_aAppFont.Kerning != m_aFont.Kerning) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_KERNING, makeAny(m_aFont.Kerning)); - if(m_aAppFont.WordLineMode != m_aFont.WordLineMode) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_WORDLINEMODE, makeAny(m_aFont.WordLineMode)); - if(m_aAppFont.Type != m_aFont.Type) - _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_TYPE, makeAny(m_aFont.Type)); + Any aNullAny; + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_NAME, makeAny(m_aFont.Name)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_HEIGHT, makeAny(m_aFont.Height)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_WIDTH, makeAny(m_aFont.Width)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_STYLENAME, makeAny(m_aFont.StyleName)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_FAMILY, makeAny(m_aFont.Family)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_CHARSET, makeAny(m_aFont.CharSet)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_PITCH, makeAny(m_aFont.Pitch)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_CHARACTERWIDTH, makeAny(m_aFont.CharacterWidth)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_WEIGHT, makeAny(m_aFont.Weight)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_SLANT, makeAny((sal_Int16)m_aFont.Slant)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_UNDERLINE, makeAny(m_aFont.Underline)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_STRIKEOUT, makeAny(m_aFont.Strikeout)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_ORIENTATION, makeAny(m_aFont.Orientation)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_KERNING, makeAny(m_aFont.Kerning)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_WORDLINEMODE, makeAny(m_aFont.WordLineMode)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_TYPE, makeAny(m_aFont.Type)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_TEXTCOLOR, m_aTextColor); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_UNDERLINECOLOR, m_aTextLineColor); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_CHARACTEREMPHASIS, makeAny(m_nFontEmphasis)); + _rConfigLocation.setNodeValue(CONFIGKEY_DEFSET_FONT_CHARACTERRELIEF, makeAny(m_nFontRelief)); } //-------------------------------------------------------------------------- @@ -356,9 +365,12 @@ void ODataSettings_Base::loadFrom(const OConfigurationNode& _rConfigLocation) m_aFont.Slant = (FontSlant)nTemp; - m_aRowHeight = _rConfigLocation.getNodeValue(CONFIGKEY_DEFSET_ROW_HEIGHT); m_aTextColor = _rConfigLocation.getNodeValue(CONFIGKEY_DEFSET_TEXTCOLOR); + + m_aTextLineColor = _rConfigLocation.getNodeValue(CONFIGKEY_DEFSET_FONT_UNDERLINECOLOR); + _rConfigLocation.getNodeValue(CONFIGKEY_DEFSET_FONT_CHARACTEREMPHASIS) >>= m_nFontEmphasis; + _rConfigLocation.getNodeValue(CONFIGKEY_DEFSET_FONT_CHARACTERRELIEF) >>= m_nFontRelief; } //........................................................................ diff --git a/dbaccess/source/core/inc/datasettings.hxx b/dbaccess/source/core/inc/datasettings.hxx index 7e02d7e43b0c..1094e1444d94 100644 --- a/dbaccess/source/core/inc/datasettings.hxx +++ b/dbaccess/source/core/inc/datasettings.hxx @@ -2,9 +2,9 @@ * * $RCSfile: datasettings.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: oj $ $Date: 2001-02-16 16:05:22 $ + * last change: $Author: fs $ $Date: 2001-06-15 08:37:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -101,14 +101,17 @@ class OConfigurationNode; class ODataSettings_Base { protected: -// <properties> static ::com::sun::star::awt::FontDescriptor m_aAppFont; +// <properties> ::rtl::OUString m_sFilter; ::rtl::OUString m_sOrder; sal_Bool m_bApplyFilter; // no BitField ! the base class needs a pointer to this member ! ::com::sun::star::awt::FontDescriptor m_aFont; ::com::sun::star::uno::Any m_aRowHeight; ::com::sun::star::uno::Any m_aTextColor; + ::com::sun::star::uno::Any m_aTextLineColor; + sal_Int16 m_nFontEmphasis; + sal_Int16 m_nFontRelief; // </properties> protected: diff --git a/dbaccess/source/inc/stringconstants.hrc b/dbaccess/source/inc/stringconstants.hrc index 29dc90ae6988..9836bfe4ff49 100644 --- a/dbaccess/source/inc/stringconstants.hrc +++ b/dbaccess/source/inc/stringconstants.hrc @@ -2,9 +2,9 @@ * * $RCSfile: stringconstants.hrc,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: fs $ $Date: 2001-06-08 08:38:21 $ + * last change: $Author: fs $ $Date: 2001-06-15 08:36:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -165,6 +165,9 @@ #define PROPERTY_ID_ISHIDDEN 91 #define PROPERTY_ID_SUPPRESSVERSIONCL 92 #define PROPERTY_ID_LAYOUTINFORMATION 93 +#define PROPERTY_ID_TEXTLINECOLOR 94 +#define PROPERTY_ID_TEXTEMPHASIS 95 +#define PROPERTY_ID_TEXTRELIEF 96 //============================================================ //= property names @@ -279,6 +282,9 @@ DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLUSER); DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLPASSWORD); DECLARE_CONSTASCII_USTRING(PROPERTY_CACHESIZE); DECLARE_CONSTASCII_USTRING(PROPERTY_CREATEVIEW); +DECLARE_CONSTASCII_USTRING(PROPERTY_TEXTLINECOLOR); +DECLARE_CONSTASCII_USTRING(PROPERTY_TEXTEMPHASIS); +DECLARE_CONSTASCII_USTRING(PROPERTY_TEXTRELIEF); //============================================================ //= service names diff --git a/dbaccess/source/shared/stringconstants.cxx b/dbaccess/source/shared/stringconstants.cxx index d46ff5818f12..69461c93533f 100644 --- a/dbaccess/source/shared/stringconstants.cxx +++ b/dbaccess/source/shared/stringconstants.cxx @@ -2,9 +2,9 @@ * * $RCSfile: stringconstants.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: fs $ $Date: 2001-06-08 08:40:35 $ + * last change: $Author: fs $ $Date: 2001-06-15 08:37:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -171,6 +171,9 @@ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLUSER, "ControlUser"); IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLPASSWORD, "ControlPassword"); IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CACHESIZE, "CacheSize"); IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CREATEVIEW, "CreateView"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TEXTLINECOLOR, "TextLineColor"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TEXTEMPHASIS, "FontEmphasisMark"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TEXTRELIEF, "FontRelief"); //============================================================ diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 3b076e3db6e7..d4e0779cada5 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unodatbr.cxx,v $ * - * $Revision: 1.75 $ + * $Revision: 1.76 $ * - * last change: $Author: fs $ $Date: 2001-06-13 17:00:37 $ + * last change: $Author: fs $ $Date: 2001-06-15 08:39:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -585,19 +585,25 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: // set the formats from the table if(m_pCurrentlyDisplayed) { - Sequence< ::rtl::OUString> aProperties(3); - Sequence< Any> aValues(3); + Sequence< ::rtl::OUString> aProperties(6); + Sequence< Any> aValues(6); DBTreeListModel::DBTreeListUserData* pData = static_cast<DBTreeListModel::DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); Reference<XPropertySet> xTableProp(pData->xObject,UNO_QUERY); - OSL_ENSURE(xTableProp.is(),"No table available!"); + OSL_ENSURE(xTableProp.is(),"SbaTableQueryBrowser::InitializeGridModel: No table available!"); aProperties.getArray()[0] = PROPERTY_FONT; aValues.getArray()[0] = xTableProp->getPropertyValue(PROPERTY_FONT); - aProperties.getArray()[1] = PROPERTY_ROW_HEIGHT; - aValues.getArray()[1] = xTableProp->getPropertyValue(PROPERTY_ROW_HEIGHT); - aProperties.getArray()[2] = PROPERTY_TEXTCOLOR; - aValues.getArray()[2] = xTableProp->getPropertyValue(PROPERTY_TEXTCOLOR); + aProperties.getArray()[1] = PROPERTY_TEXTEMPHASIS; + aValues.getArray()[1] = xTableProp->getPropertyValue(PROPERTY_TEXTEMPHASIS); + aProperties.getArray()[2] = PROPERTY_TEXTRELIEF; + aValues.getArray()[2] = xTableProp->getPropertyValue(PROPERTY_TEXTRELIEF); + aProperties.getArray()[3] = PROPERTY_ROW_HEIGHT; + aValues.getArray()[3] = xTableProp->getPropertyValue(PROPERTY_ROW_HEIGHT); + aProperties.getArray()[4] = PROPERTY_TEXTCOLOR; + aValues.getArray()[4] = xTableProp->getPropertyValue(PROPERTY_TEXTCOLOR); + aProperties.getArray()[5] = PROPERTY_TEXTLINECOLOR; + aValues.getArray()[5] = xTableProp->getPropertyValue(PROPERTY_TEXTLINECOLOR); Reference< XMultiPropertySet > xFormMultiSet(xGrid, UNO_QUERY); xFormMultiSet->setPropertyValues(aProperties, aValues); @@ -754,6 +760,20 @@ Reference<XPropertySet> getColumnHelper(SvLBoxEntry* _pCurrentlyDisplayed,const } return xRet; } + +// ----------------------------------------------------------------------- +void SbaTableQueryBrowser::transferChangedControlProperty(const ::rtl::OUString& _rProperty, const Any& _rNewValue) +{ + if(m_pCurrentlyDisplayed) + { + DBTreeListModel::DBTreeListUserData* pData = static_cast<DBTreeListModel::DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); + Reference< XPropertySet > xProp(pData->xObject, UNO_QUERY); + OSL_ENSURE(xProp.is(),"SbaTableQueryBrowser::transferChangedControlProperty: no table/query object!"); + if (xProp.is()) + xProp->setPropertyValue(_rProperty, _rNewValue); + } +} + // ----------------------------------------------------------------------- void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt) { @@ -843,63 +863,17 @@ void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt) } } - // // the font of the grid ? - else if (evt.PropertyName.equals(PROPERTY_FONT)) - { - if(m_pCurrentlyDisplayed) - { - DBTreeListModel::DBTreeListUserData* pData = static_cast<DBTreeListModel::DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); - Reference<XPropertySet> xProp(pData->xObject,UNO_QUERY); - OSL_ENSURE(xProp.is(),"No table available!"); - xProp->setPropertyValue(PROPERTY_FONT,evt.NewValue); - } - } - - // // the text color of the grid ? - else if (evt.PropertyName.equals(PROPERTY_TEXTCOLOR)) - { - if(m_pCurrentlyDisplayed) - { - DBTreeListModel::DBTreeListUserData* pData = static_cast<DBTreeListModel::DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); - Reference<XPropertySet> xProp(pData->xObject,UNO_QUERY); - OSL_ENSURE(xProp.is(),"No table available!"); - xProp->setPropertyValue(PROPERTY_TEXTCOLOR,evt.NewValue); - } - } - - // // the filter ? - else if (evt.PropertyName.equals(PROPERTY_FILTER)) - { - if(m_pCurrentlyDisplayed) - { - DBTreeListModel::DBTreeListUserData* pData = static_cast<DBTreeListModel::DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); - Reference<XPropertySet> xProp(pData->xObject,UNO_QUERY); - OSL_ENSURE(xProp.is(),"No table available!"); - xProp->setPropertyValue(PROPERTY_FILTER,evt.NewValue); - } - } - - // the sort ? - else if (evt.PropertyName.equals(PROPERTY_ORDER)) - { - if(m_pCurrentlyDisplayed) - { - DBTreeListModel::DBTreeListUserData* pData = static_cast<DBTreeListModel::DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); - Reference<XPropertySet> xProp(pData->xObject,UNO_QUERY); - OSL_ENSURE(xProp.is(),"No table available!"); - xProp->setPropertyValue(PROPERTY_ORDER,evt.NewValue); - } - } - // the appliance of the filter ? - else if (evt.PropertyName.equals(PROPERTY_APPLYFILTER)) + else if ( evt.PropertyName.equals(PROPERTY_FONT) // the font ? + || evt.PropertyName.equals(PROPERTY_TEXTCOLOR) // the text color ? + || evt.PropertyName.equals(PROPERTY_FILTER) // the filter ? + || evt.PropertyName.equals(PROPERTY_ORDER) // the sort ? + || evt.PropertyName.equals(PROPERTY_APPLYFILTER) // the appliance of the filter ? + || evt.PropertyName.equals(PROPERTY_TEXTLINECOLOR) // the text line color ? + || evt.PropertyName.equals(PROPERTY_TEXTEMPHASIS) // the text emphasis ? + || evt.PropertyName.equals(PROPERTY_TEXTRELIEF) // the text relief ? + ) { - if(m_pCurrentlyDisplayed) - { - DBTreeListModel::DBTreeListUserData* pData = static_cast<DBTreeListModel::DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); - Reference<XPropertySet> xProp(pData->xObject,UNO_QUERY); - OSL_ENSURE(xProp.is(),"No table available!"); - xProp->setPropertyValue(PROPERTY_APPLYFILTER,evt.NewValue); - } + transferChangedControlProperty(evt.PropertyName, evt.NewValue); } } catch(Exception&) @@ -1106,12 +1080,15 @@ void SbaTableQueryBrowser::attachFrame(const Reference< ::com::sun::star::frame: void SbaTableQueryBrowser::addModelListeners(const Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel) { SbaXDataBrowserController::addModelListeners(_xGridControlModel); - Reference< XPropertySet > xCols(_xGridControlModel, UNO_QUERY); - if (xCols.is()) + Reference< XPropertySet > xSourceSet(_xGridControlModel, UNO_QUERY); + if (xSourceSet.is()) { - xCols->addPropertyChangeListener(PROPERTY_ROW_HEIGHT, (XPropertyChangeListener*)this); - xCols->addPropertyChangeListener(PROPERTY_FONT, (XPropertyChangeListener*)this); - xCols->addPropertyChangeListener(PROPERTY_TEXTCOLOR, (XPropertyChangeListener*)this); + xSourceSet->addPropertyChangeListener(PROPERTY_ROW_HEIGHT, (XPropertyChangeListener*)this); + xSourceSet->addPropertyChangeListener(PROPERTY_FONT, (XPropertyChangeListener*)this); + xSourceSet->addPropertyChangeListener(PROPERTY_TEXTCOLOR, (XPropertyChangeListener*)this); + xSourceSet->addPropertyChangeListener(PROPERTY_TEXTLINECOLOR, (XPropertyChangeListener*)this); + xSourceSet->addPropertyChangeListener(PROPERTY_TEXTEMPHASIS, (XPropertyChangeListener*)this); + xSourceSet->addPropertyChangeListener(PROPERTY_TEXTRELIEF, (XPropertyChangeListener*)this); } } @@ -1126,6 +1103,9 @@ void SbaTableQueryBrowser::removeModelListeners(const Reference< ::com::sun::sta xSourceSet->removePropertyChangeListener(PROPERTY_ROW_HEIGHT, (XPropertyChangeListener*)this); xSourceSet->removePropertyChangeListener(PROPERTY_FONT, (XPropertyChangeListener*)this); xSourceSet->removePropertyChangeListener(PROPERTY_TEXTCOLOR, (XPropertyChangeListener*)this); + xSourceSet->removePropertyChangeListener(PROPERTY_TEXTLINECOLOR, (XPropertyChangeListener*)this); + xSourceSet->removePropertyChangeListener(PROPERTY_TEXTEMPHASIS, (XPropertyChangeListener*)this); + xSourceSet->removePropertyChangeListener(PROPERTY_TEXTRELIEF, (XPropertyChangeListener*)this); } } // ------------------------------------------------------------------------- |