1*63bba73cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*63bba73cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*63bba73cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*63bba73cSAndrew Rist  * distributed with this work for additional information
6*63bba73cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*63bba73cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*63bba73cSAndrew Rist  * "License"); you may not use this file except in compliance
9*63bba73cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*63bba73cSAndrew Rist  *
11*63bba73cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*63bba73cSAndrew Rist  *
13*63bba73cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*63bba73cSAndrew Rist  * software distributed under the License is distributed on an
15*63bba73cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*63bba73cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*63bba73cSAndrew Rist  * specific language governing permissions and limitations
18*63bba73cSAndrew Rist  * under the License.
19*63bba73cSAndrew Rist  *
20*63bba73cSAndrew Rist  *************************************************************/
21*63bba73cSAndrew Rist 
22*63bba73cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_xmloff.hxx"
26cdf0e10cSrcweir #include "gridcolumnproptranslator.hxx"
27cdf0e10cSrcweir 
28cdf0e10cSrcweir /** === begin UNO includes === **/
29cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySetInfo.hpp>
30cdf0e10cSrcweir #include <com/sun/star/awt/TextAlign.hpp>
31cdf0e10cSrcweir #include <com/sun/star/style/ParagraphAdjust.hpp>
32cdf0e10cSrcweir /** === end UNO includes === **/
33cdf0e10cSrcweir #include <osl/diagnose.h>
34cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #include <algorithm>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir //........................................................................
39cdf0e10cSrcweir namespace xmloff
40cdf0e10cSrcweir {
41cdf0e10cSrcweir //........................................................................
42cdf0e10cSrcweir 
43cdf0e10cSrcweir     using namespace ::com::sun::star::uno;
44cdf0e10cSrcweir     using namespace ::com::sun::star::awt;
45cdf0e10cSrcweir     using namespace ::com::sun::star::lang;
46cdf0e10cSrcweir     using namespace ::com::sun::star::beans;
47cdf0e10cSrcweir     using namespace ::com::sun::star::style;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir     namespace
50cdf0e10cSrcweir     {
51cdf0e10cSrcweir 	    //----------------------------------------------------------------
getParaAlignProperty()52cdf0e10cSrcweir         ::rtl::OUString getParaAlignProperty()
53cdf0e10cSrcweir         {
54cdf0e10cSrcweir             return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParaAdjust" ) );
55cdf0e10cSrcweir         }
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	    //----------------------------------------------------------------
getAlignProperty()58cdf0e10cSrcweir         ::rtl::OUString getAlignProperty()
59cdf0e10cSrcweir         {
60cdf0e10cSrcweir             return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Align" ) );
61cdf0e10cSrcweir         }
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 	    //----------------------------------------------------------------
findStringElement(const Sequence<::rtl::OUString> & _rNames,const::rtl::OUString & _rName)64cdf0e10cSrcweir         sal_Int32 findStringElement( const Sequence< ::rtl::OUString >& _rNames, const ::rtl::OUString& _rName )
65cdf0e10cSrcweir         {
66cdf0e10cSrcweir             const ::rtl::OUString* pStart = _rNames.getConstArray();
67cdf0e10cSrcweir             const ::rtl::OUString* pEnd = _rNames.getConstArray() + _rNames.getLength();
68cdf0e10cSrcweir             const ::rtl::OUString* pPos = ::std::find( pStart, pEnd, _rName );
69cdf0e10cSrcweir             if ( pPos != pEnd )
70cdf0e10cSrcweir                 return pPos - pStart;
71cdf0e10cSrcweir             return -1;
72cdf0e10cSrcweir         }
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	    //----------------------------------------------------------------
75cdf0e10cSrcweir         struct AlignmentTranslationEntry
76cdf0e10cSrcweir         {
77cdf0e10cSrcweir             ParagraphAdjust nParagraphValue;
78cdf0e10cSrcweir             sal_Int16       nControlValue;
79cdf0e10cSrcweir         }
80cdf0e10cSrcweir         AlignmentTranslations[] =
81cdf0e10cSrcweir         {
82cdf0e10cSrcweir             // note that order matters:
83cdf0e10cSrcweir             // valueAlignToParaAdjust and valueParaAdjustToAlign search this map from the _beginning_
84cdf0e10cSrcweir             // and use the first matching entry
85cdf0e10cSrcweir             { ParagraphAdjust_LEFT,             TextAlign::LEFT     },
86cdf0e10cSrcweir             { ParagraphAdjust_CENTER,           TextAlign::CENTER   },
87cdf0e10cSrcweir             { ParagraphAdjust_RIGHT,            TextAlign::RIGHT    },
88cdf0e10cSrcweir             { ParagraphAdjust_BLOCK,            TextAlign::RIGHT    },
89cdf0e10cSrcweir             { ParagraphAdjust_STRETCH,          TextAlign::LEFT     },
90cdf0e10cSrcweir             { ParagraphAdjust_MAKE_FIXED_SIZE,  TextAlign::LEFT     },
91cdf0e10cSrcweir             { ParagraphAdjust_MAKE_FIXED_SIZE,  -1 }
92cdf0e10cSrcweir         };
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	    //----------------------------------------------------------------
valueAlignToParaAdjust(Any & rValue)95cdf0e10cSrcweir         void valueAlignToParaAdjust(Any& rValue)
96cdf0e10cSrcweir         {
97cdf0e10cSrcweir             sal_Int16 nValue = 0;
98cdf0e10cSrcweir             rValue >>= nValue;
99cdf0e10cSrcweir             const AlignmentTranslationEntry* pTranslation = AlignmentTranslations;
100cdf0e10cSrcweir             while (-1 != pTranslation->nControlValue)
101cdf0e10cSrcweir             {
102cdf0e10cSrcweir                 if ( nValue == pTranslation->nControlValue )
103cdf0e10cSrcweir                 {
104cdf0e10cSrcweir                     rValue <<= pTranslation->nParagraphValue;
105cdf0e10cSrcweir                     return;
106cdf0e10cSrcweir                 }
107cdf0e10cSrcweir                 ++pTranslation;
108cdf0e10cSrcweir             }
109cdf0e10cSrcweir             OSL_ENSURE( sal_False, "valueAlignToParaAdjust: unreachable!" );
110cdf0e10cSrcweir         }
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 	    //----------------------------------------------------------------
valueParaAdjustToAlign(Any & rValue)113cdf0e10cSrcweir         void valueParaAdjustToAlign(Any& rValue)
114cdf0e10cSrcweir         {
115cdf0e10cSrcweir             sal_Int32 nValue = 0;
116cdf0e10cSrcweir             rValue >>= nValue;
117cdf0e10cSrcweir             const AlignmentTranslationEntry* pTranslation = AlignmentTranslations;
118cdf0e10cSrcweir             while ( ParagraphAdjust_MAKE_FIXED_SIZE != pTranslation->nParagraphValue)
119cdf0e10cSrcweir             {
120cdf0e10cSrcweir                 if ( nValue == pTranslation->nParagraphValue)
121cdf0e10cSrcweir                 {
122cdf0e10cSrcweir                     rValue <<= pTranslation->nControlValue;
123cdf0e10cSrcweir                     return;
124cdf0e10cSrcweir                 }
125cdf0e10cSrcweir                 ++pTranslation;
126cdf0e10cSrcweir             }
127cdf0e10cSrcweir             OSL_ENSURE( sal_False, "valueParaAdjustToAlign: unreachable!" );
128cdf0e10cSrcweir         }
129cdf0e10cSrcweir 
130cdf0e10cSrcweir         //====================================================================
131cdf0e10cSrcweir 	    //= OMergedPropertySetInfo
132cdf0e10cSrcweir 	    //====================================================================
133cdf0e10cSrcweir         typedef ::cppu::WeakAggImplHelper1  <   XPropertySetInfo
134cdf0e10cSrcweir                                             >   OMergedPropertySetInfo_Base;
135cdf0e10cSrcweir         class OMergedPropertySetInfo : public OMergedPropertySetInfo_Base
136cdf0e10cSrcweir         {
137cdf0e10cSrcweir         private:
138cdf0e10cSrcweir             Reference< XPropertySetInfo >   m_xMasterInfo;
139cdf0e10cSrcweir 
140cdf0e10cSrcweir         public:
141cdf0e10cSrcweir             OMergedPropertySetInfo( const Reference< XPropertySetInfo >& _rxMasterInfo );
142cdf0e10cSrcweir 
143cdf0e10cSrcweir         protected:
144cdf0e10cSrcweir             virtual ~OMergedPropertySetInfo();
145cdf0e10cSrcweir 
146cdf0e10cSrcweir             // XPropertySetInfo
147cdf0e10cSrcweir             virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties(  ) throw (::com::sun::star::uno::RuntimeException);
148cdf0e10cSrcweir             virtual ::com::sun::star::beans::Property SAL_CALL getPropertyByName( const ::rtl::OUString& aName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
149cdf0e10cSrcweir             virtual ::sal_Bool SAL_CALL hasPropertyByName( const ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException);
150cdf0e10cSrcweir         };
151cdf0e10cSrcweir 
152cdf0e10cSrcweir         //----------------------------------------------------------------
OMergedPropertySetInfo(const Reference<XPropertySetInfo> & _rxMasterInfo)153cdf0e10cSrcweir         OMergedPropertySetInfo::OMergedPropertySetInfo( const Reference< XPropertySetInfo >& _rxMasterInfo )
154cdf0e10cSrcweir             :m_xMasterInfo( _rxMasterInfo )
155cdf0e10cSrcweir         {
156cdf0e10cSrcweir             OSL_ENSURE( m_xMasterInfo.is(), "OMergedPropertySetInfo::OMergedPropertySetInfo: hmm?" );
157cdf0e10cSrcweir         }
158cdf0e10cSrcweir 
159cdf0e10cSrcweir         //----------------------------------------------------------------
~OMergedPropertySetInfo()160cdf0e10cSrcweir         OMergedPropertySetInfo::~OMergedPropertySetInfo()
161cdf0e10cSrcweir         {
162cdf0e10cSrcweir         }
163cdf0e10cSrcweir 
164cdf0e10cSrcweir         //----------------------------------------------------------------
getProperties()165cdf0e10cSrcweir         Sequence< Property > SAL_CALL OMergedPropertySetInfo::getProperties(  ) throw (RuntimeException)
166cdf0e10cSrcweir         {
167cdf0e10cSrcweir             // add a "ParaAdjust" property to the master properties
168cdf0e10cSrcweir             Sequence< Property > aProperties;
169cdf0e10cSrcweir             if ( m_xMasterInfo.is() )
170cdf0e10cSrcweir                 aProperties = m_xMasterInfo->getProperties();
171cdf0e10cSrcweir 
172cdf0e10cSrcweir             sal_Int32 nOldLength = aProperties.getLength();
173cdf0e10cSrcweir             aProperties.realloc( nOldLength + 1 );
174cdf0e10cSrcweir             aProperties[ nOldLength ] = getPropertyByName( getParaAlignProperty() );
175cdf0e10cSrcweir 
176cdf0e10cSrcweir             return aProperties;
177cdf0e10cSrcweir         }
178cdf0e10cSrcweir 
179cdf0e10cSrcweir         //----------------------------------------------------------------
getPropertyByName(const::rtl::OUString & aName)180cdf0e10cSrcweir         Property SAL_CALL OMergedPropertySetInfo::getPropertyByName( const ::rtl::OUString& aName ) throw (UnknownPropertyException, RuntimeException)
181cdf0e10cSrcweir         {
182cdf0e10cSrcweir             if ( aName == getParaAlignProperty() )
183cdf0e10cSrcweir                 return Property( getParaAlignProperty(), -1,
184cdf0e10cSrcweir                     ::getCppuType( static_cast< const ParagraphAdjust* >( NULL ) ), 0 );
185cdf0e10cSrcweir 
186cdf0e10cSrcweir             if ( !m_xMasterInfo.is() )
187cdf0e10cSrcweir                 return Property();
188cdf0e10cSrcweir 
189cdf0e10cSrcweir             return m_xMasterInfo->getPropertyByName( aName );
190cdf0e10cSrcweir         }
191cdf0e10cSrcweir 
192cdf0e10cSrcweir         //----------------------------------------------------------------
hasPropertyByName(const::rtl::OUString & Name)193cdf0e10cSrcweir         ::sal_Bool SAL_CALL OMergedPropertySetInfo::hasPropertyByName( const ::rtl::OUString& Name ) throw (RuntimeException)
194cdf0e10cSrcweir         {
195cdf0e10cSrcweir             if ( Name == getParaAlignProperty() )
196cdf0e10cSrcweir                 return sal_True;
197cdf0e10cSrcweir 
198cdf0e10cSrcweir             if ( !m_xMasterInfo.is() )
199cdf0e10cSrcweir                 return sal_False;
200cdf0e10cSrcweir 
201cdf0e10cSrcweir             return m_xMasterInfo->hasPropertyByName( Name );
202cdf0e10cSrcweir         }
203cdf0e10cSrcweir     }
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 
206cdf0e10cSrcweir 	//====================================================================
207cdf0e10cSrcweir 	//= OGridColumnPropertyTranslator
208cdf0e10cSrcweir 	//====================================================================
209cdf0e10cSrcweir 	//--------------------------------------------------------------------
OGridColumnPropertyTranslator(const Reference<XMultiPropertySet> & _rxGridColumn)210cdf0e10cSrcweir     OGridColumnPropertyTranslator::OGridColumnPropertyTranslator( const Reference< XMultiPropertySet >& _rxGridColumn )
211cdf0e10cSrcweir         :m_xGridColumn( _rxGridColumn )
212cdf0e10cSrcweir     {
213cdf0e10cSrcweir         OSL_ENSURE( m_xGridColumn.is(), "OGridColumnPropertyTranslator: invalid grid column!" );
214cdf0e10cSrcweir     }
215cdf0e10cSrcweir 
216cdf0e10cSrcweir 	//--------------------------------------------------------------------
~OGridColumnPropertyTranslator()217cdf0e10cSrcweir     OGridColumnPropertyTranslator::~OGridColumnPropertyTranslator()
218cdf0e10cSrcweir     {
219cdf0e10cSrcweir     }
220cdf0e10cSrcweir 
221cdf0e10cSrcweir     //--------------------------------------------------------------------
getPropertySetInfo()222cdf0e10cSrcweir     Reference< XPropertySetInfo > SAL_CALL OGridColumnPropertyTranslator::getPropertySetInfo(  ) throw (RuntimeException)
223cdf0e10cSrcweir     {
224cdf0e10cSrcweir         Reference< XPropertySetInfo > xColumnPropInfo;
225cdf0e10cSrcweir         if ( m_xGridColumn.is() )
226cdf0e10cSrcweir             xColumnPropInfo = m_xGridColumn->getPropertySetInfo();
227cdf0e10cSrcweir         return new OMergedPropertySetInfo( xColumnPropInfo );
228cdf0e10cSrcweir     }
229cdf0e10cSrcweir 
230cdf0e10cSrcweir     //--------------------------------------------------------------------
setPropertyValue(const::rtl::OUString & _rPropertyName,const Any & aValue)231cdf0e10cSrcweir     void SAL_CALL OGridColumnPropertyTranslator::setPropertyValue( const ::rtl::OUString& _rPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
232cdf0e10cSrcweir     {
233cdf0e10cSrcweir         // we implement this by delegating it to setPropertyValues, which is to ignore unknown properties. On the other hand, our
234cdf0e10cSrcweir         // contract requires us to throw a UnknownPropertyException for unknown properties, so check this first.
235cdf0e10cSrcweir 
236cdf0e10cSrcweir         if ( !getPropertySetInfo()->hasPropertyByName( _rPropertyName ) )
237cdf0e10cSrcweir             throw UnknownPropertyException( _rPropertyName, *this );
238cdf0e10cSrcweir 
239cdf0e10cSrcweir         Sequence< ::rtl::OUString > aNames( &_rPropertyName, 1 );
240cdf0e10cSrcweir         Sequence< Any >             aValues( &aValue, 1 );
241cdf0e10cSrcweir         setPropertyValues( aNames, aValues );
242cdf0e10cSrcweir     }
243cdf0e10cSrcweir 
244cdf0e10cSrcweir     //--------------------------------------------------------------------
getPropertyValue(const::rtl::OUString & PropertyName)245cdf0e10cSrcweir     Any SAL_CALL OGridColumnPropertyTranslator::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
246cdf0e10cSrcweir     {
247cdf0e10cSrcweir         Sequence< ::rtl::OUString > aNames( &PropertyName, 1 );
248cdf0e10cSrcweir         Sequence< Any > aValues = getPropertyValues( aNames );
249cdf0e10cSrcweir         OSL_ENSURE( aValues.getLength() == 1, "OGridColumnPropertyTranslator::getPropertyValue: nonsense!" );
250cdf0e10cSrcweir         if ( aValues.getLength() == 1 )
251cdf0e10cSrcweir             return aValues[0];
252cdf0e10cSrcweir         return Any();
253cdf0e10cSrcweir     }
254cdf0e10cSrcweir 
255cdf0e10cSrcweir     //--------------------------------------------------------------------
addPropertyChangeListener(const::rtl::OUString &,const Reference<XPropertyChangeListener> &)256cdf0e10cSrcweir     void SAL_CALL OGridColumnPropertyTranslator::addPropertyChangeListener( const ::rtl::OUString&, const Reference< XPropertyChangeListener >& ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
257cdf0e10cSrcweir     {
258cdf0e10cSrcweir         OSL_ENSURE( sal_False, "OGridColumnPropertyTranslator::addPropertyChangeListener: not implemented - this should not be needed!" );
259cdf0e10cSrcweir     }
260cdf0e10cSrcweir 
261cdf0e10cSrcweir     //--------------------------------------------------------------------
removePropertyChangeListener(const::rtl::OUString &,const Reference<XPropertyChangeListener> &)262cdf0e10cSrcweir     void SAL_CALL OGridColumnPropertyTranslator::removePropertyChangeListener( const ::rtl::OUString&, const Reference< XPropertyChangeListener >& ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
263cdf0e10cSrcweir     {
264cdf0e10cSrcweir         OSL_ENSURE( sal_False, "OGridColumnPropertyTranslator::removePropertyChangeListener: not implemented - this should not be needed!" );
265cdf0e10cSrcweir     }
266cdf0e10cSrcweir 
267cdf0e10cSrcweir     //--------------------------------------------------------------------
addVetoableChangeListener(const::rtl::OUString &,const Reference<XVetoableChangeListener> &)268cdf0e10cSrcweir     void SAL_CALL OGridColumnPropertyTranslator::addVetoableChangeListener( const ::rtl::OUString&, const Reference< XVetoableChangeListener >& ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
269cdf0e10cSrcweir     {
270cdf0e10cSrcweir         OSL_ENSURE( sal_False, "OGridColumnPropertyTranslator::addVetoableChangeListener: not implemented - this should not be needed!" );
271cdf0e10cSrcweir     }
272cdf0e10cSrcweir 
273cdf0e10cSrcweir     //--------------------------------------------------------------------
removeVetoableChangeListener(const::rtl::OUString &,const Reference<XVetoableChangeListener> &)274cdf0e10cSrcweir     void SAL_CALL OGridColumnPropertyTranslator::removeVetoableChangeListener( const ::rtl::OUString&, const Reference< XVetoableChangeListener >& ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
275cdf0e10cSrcweir     {
276cdf0e10cSrcweir         OSL_ENSURE( sal_False, "OGridColumnPropertyTranslator::removeVetoableChangeListener: not implemented - this should not be needed!" );
277cdf0e10cSrcweir     }
278cdf0e10cSrcweir 
279cdf0e10cSrcweir     //--------------------------------------------------------------------
setPropertyValues(const Sequence<::rtl::OUString> & aPropertyNames,const Sequence<Any> & aValues)280cdf0e10cSrcweir     void SAL_CALL OGridColumnPropertyTranslator::setPropertyValues( const Sequence< ::rtl::OUString >& aPropertyNames, const Sequence< Any >& aValues ) throw (PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
281cdf0e10cSrcweir     {
282cdf0e10cSrcweir         if ( !m_xGridColumn.is() )
283cdf0e10cSrcweir             return;
284cdf0e10cSrcweir 
285cdf0e10cSrcweir         // if there's ever the need for more than one property being translated, then we should
286cdf0e10cSrcweir         // certainly have a more clever implementation than this ...
287cdf0e10cSrcweir 
288cdf0e10cSrcweir         Sequence< ::rtl::OUString > aTranslatedNames( aPropertyNames );
289cdf0e10cSrcweir         Sequence< Any >             aTranslatedValues( aValues );
290cdf0e10cSrcweir 
291cdf0e10cSrcweir         sal_Int32 nParaAlignPos = findStringElement( aTranslatedNames, getParaAlignProperty() );
292cdf0e10cSrcweir         if ( nParaAlignPos != -1 )
293cdf0e10cSrcweir         {
294cdf0e10cSrcweir             aTranslatedNames[ nParaAlignPos ] = getAlignProperty();
295cdf0e10cSrcweir             valueParaAdjustToAlign( aTranslatedValues[ nParaAlignPos ] );
296cdf0e10cSrcweir         }
297cdf0e10cSrcweir 
298cdf0e10cSrcweir         m_xGridColumn->setPropertyValues( aTranslatedNames, aTranslatedValues );
299cdf0e10cSrcweir     }
300cdf0e10cSrcweir 
301cdf0e10cSrcweir     //--------------------------------------------------------------------
getPropertyValues(const Sequence<::rtl::OUString> & aPropertyNames)302cdf0e10cSrcweir     Sequence< Any > SAL_CALL OGridColumnPropertyTranslator::getPropertyValues( const Sequence< ::rtl::OUString >& aPropertyNames ) throw (RuntimeException)
303cdf0e10cSrcweir     {
304cdf0e10cSrcweir         Sequence< Any > aValues( aPropertyNames.getLength() );
305cdf0e10cSrcweir         if ( !m_xGridColumn.is() )
306cdf0e10cSrcweir             return aValues;
307cdf0e10cSrcweir 
308cdf0e10cSrcweir         Sequence< ::rtl::OUString > aTranslatedNames( aPropertyNames );
309cdf0e10cSrcweir         sal_Int32 nAlignPos = findStringElement( aTranslatedNames, getParaAlignProperty() );
310cdf0e10cSrcweir         if ( nAlignPos != -1 )
311cdf0e10cSrcweir             aTranslatedNames[ nAlignPos ] = getAlignProperty();
312cdf0e10cSrcweir 
313cdf0e10cSrcweir         aValues = m_xGridColumn->getPropertyValues( aPropertyNames );
314cdf0e10cSrcweir         if ( nAlignPos != -1 )
315cdf0e10cSrcweir             valueAlignToParaAdjust( aValues[ nAlignPos ] );
316cdf0e10cSrcweir 
317cdf0e10cSrcweir         return aValues;
318cdf0e10cSrcweir     }
319cdf0e10cSrcweir 
320cdf0e10cSrcweir     //--------------------------------------------------------------------
addPropertiesChangeListener(const Sequence<::rtl::OUString> &,const Reference<XPropertiesChangeListener> &)321cdf0e10cSrcweir     void SAL_CALL OGridColumnPropertyTranslator::addPropertiesChangeListener( const Sequence< ::rtl::OUString >&, const Reference< XPropertiesChangeListener >& ) throw (RuntimeException)
322cdf0e10cSrcweir     {
323cdf0e10cSrcweir         OSL_ENSURE( sal_False, "OGridColumnPropertyTranslator::addPropertiesChangeListener: not implemented - this should not be needed!" );
324cdf0e10cSrcweir     }
325cdf0e10cSrcweir 
326cdf0e10cSrcweir     //--------------------------------------------------------------------
removePropertiesChangeListener(const Reference<XPropertiesChangeListener> &)327cdf0e10cSrcweir     void SAL_CALL OGridColumnPropertyTranslator::removePropertiesChangeListener( const Reference< XPropertiesChangeListener >& ) throw (RuntimeException)
328cdf0e10cSrcweir     {
329cdf0e10cSrcweir         OSL_ENSURE( sal_False, "OGridColumnPropertyTranslator::removePropertiesChangeListener: not implemented - this should not be needed!" );
330cdf0e10cSrcweir     }
331cdf0e10cSrcweir 
332cdf0e10cSrcweir     //--------------------------------------------------------------------
firePropertiesChangeEvent(const Sequence<::rtl::OUString> &,const Reference<XPropertiesChangeListener> &)333cdf0e10cSrcweir     void SAL_CALL OGridColumnPropertyTranslator::firePropertiesChangeEvent( const Sequence< ::rtl::OUString >&, const Reference< XPropertiesChangeListener >& ) throw (RuntimeException)
334cdf0e10cSrcweir     {
335cdf0e10cSrcweir         OSL_ENSURE( sal_False, "OGridColumnPropertyTranslator::firePropertiesChangeEvent: not implemented - this should not be needed!" );
336cdf0e10cSrcweir     }
337cdf0e10cSrcweir 
338cdf0e10cSrcweir //........................................................................
339cdf0e10cSrcweir } // namespace xmloff
340cdf0e10cSrcweir //........................................................................
341cdf0e10cSrcweir 
342