diff options
author | Daniel Vogelheim <dvo@openoffice.org> | 2001-02-21 19:48:27 +0000 |
---|---|---|
committer | Daniel Vogelheim <dvo@openoffice.org> | 2001-02-21 19:48:27 +0000 |
commit | cd3952c4d9ae60c8cca88edfb66ba7298e5a5183 (patch) | |
tree | bde9ad82e72f1eb1a3f0d422b9c53bbfd4460b19 /sw/source/core/unocore/unoport.cxx | |
parent | f05fb061805699b0cb121562af4d3db7dcb12254 (diff) |
- fixed: ruby property states
Diffstat (limited to 'sw/source/core/unocore/unoport.cxx')
-rw-r--r-- | sw/source/core/unocore/unoport.cxx | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index 58844db56c2b..541953a4afab 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoport.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: os $ $Date: 2001-02-19 10:27:11 $ + * last change: $Author: dvo $ $Date: 2001-02-21 20:48:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -752,3 +752,49 @@ Any SwXRubyPortion::getPropertyValue( const OUString& rPropertyName ) aRet = SwXTextPortion::getPropertyValue(rPropertyName); return aRet; } +/* -----------------------------21.02.01 12:24:30,5--------------------------- + + ---------------------------------------------------------------------------*/ +beans::PropertyState SwXRubyPortion::getPropertyState(const OUString& rPropertyName) + throw( beans::UnknownPropertyException, uno::RuntimeException ) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + beans::PropertyState eRet = beans::PropertyState_DEFAULT_VALUE; + SwUnoCrsr* pUnoCrsr = GetCrsr(); + if(pUnoCrsr) + { + if(GetTextPortionType() == PORTION_RUBY_START && + !rPropertyName.compareToAscii( RTL_CONSTASCII_STRINGPARAM("Ruby") )) + eRet = beans::PropertyState_DIRECT_VALUE; + else + eRet = SwXTextCursor::GetPropertyState(*pUnoCrsr, GetPropSet(), rPropertyName); + } + else + throw RuntimeException(); + return eRet; +} +/* -----------------------------21.02.01 12:24:30,5--------------------------- + + -----------------------------------------------------------------------*/ +uno::Sequence< beans::PropertyState > SwXRubyPortion::getPropertyStates( + const uno::Sequence< OUString >& PropertyNames) + throw( beans::UnknownPropertyException, uno::RuntimeException ) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + SwUnoCrsr* pUnoCrsr = GetCrsr(); + if(!pUnoCrsr) + throw RuntimeException(); + uno::Sequence< beans::PropertyState > aRetSequence; + aRetSequence = SwXTextCursor::GetPropertyStates(*pUnoCrsr, GetPropSet(), PropertyNames); + if(GetTextPortionType() == PORTION_RUBY_START) + { + const OUString* pNames = PropertyNames.getConstArray(); + beans::PropertyState* pStates = aRetSequence.getArray(); + for(sal_Int32 i = 0; i < aRetSequence.getLength(); i++) + { + if (0 == pNames[i].compareToAscii(RTL_CONSTASCII_STRINGPARAM("Ruby"))) + pStates[i] = beans::PropertyState_DIRECT_VALUE; + } + } + return aRetSequence; +} |