diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-10-19 16:42:58 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-10-20 05:47:47 +0200 |
commit | fc06de1b23df9c80445c99def36beab6efa755cb (patch) | |
tree | 3b8f7ddf63c96505edf4c8a49efd8a7900722a4f /winaccessibility/source | |
parent | 1e6c1b672b1b93376f3c816e870d956b84e089e7 (diff) |
wina11y: Drop now unused CMAccessible::get_String4Numbering etc.
`CMAccessible::get_String4Numbering` is unused since
commit 2bf88c172c9c9d159344b95fb96073f4891a6c30
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed Oct 18 13:44:42 2023 +0200
tdf#157696 wina11y: Switch from custom to IA2 text attributes
, so drop it.
This means that `CMAccessible::get_StringFromAny` is then
also unused, so drop it as well.
Change-Id: I35abc94b2fc2ecec1789918fbf4ed6707a96c974
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158195
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'winaccessibility/source')
-rw-r--r-- | winaccessibility/source/UAccCOM/MAccessible.cxx | 196 | ||||
-rw-r--r-- | winaccessibility/source/UAccCOM/MAccessible.h | 5 |
2 files changed, 0 insertions, 201 deletions
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index eff02d6ade31..e8f29c8192d2 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -2439,202 +2439,6 @@ IAccessible* CMAccessible::get_IAccessibleFromXAccessible(XAccessible* pXAcc) return nullptr; } -OUString CMAccessible::get_StringFromAny(Any const & pAny) -{ - switch(pAny.getValueTypeClass()) - { - case TypeClass_CHAR: - { - sal_Int8 val; - pAny >>= val; - return OUString::number(val); - } - case TypeClass_BOOLEAN: - { - bool val; - pAny >>= val; - return OUString::number(int(val)); - } - case TypeClass_BYTE: - { - sal_Int8 val; - pAny >>= val; - return OUString::number(val); - } - case TypeClass_SHORT: - { - sal_Int16 val; - pAny >>= val; - return OUString::number(val); - } - case TypeClass_UNSIGNED_SHORT: - { - sal_uInt16 val; - pAny >>= val; - return OUString::number(val); - } - case TypeClass_LONG: - { - sal_Int32 val; - pAny >>= val; - return OUString::number(val); - } - case TypeClass_UNSIGNED_LONG: - { - sal_uInt32 val; - pAny >>= val; - return OUString::number(val); - } - case TypeClass_FLOAT: - { - float val; - pAny >>= val; - return OUString::number(val); - } - case TypeClass_DOUBLE: - { - double val; - pAny >>= val; - return OUString::number(val); - } - case TypeClass_STRING: - { - OUString val; - pAny >>= val; - return val; - } - case TypeClass_SEQUENCE: - { - if(pAny.getValueType() == cppu::UnoType<Sequence< OUString >>::get()) - { - Sequence < OUString > val; - pAny >>= val; - - OUStringBuffer pString; - - for (const OUString& rElem : val) - pString.append(rElem); - - return pString.makeStringAndClear(); - } - else if (pAny.getValueType() == cppu::UnoType<Sequence< css::style::TabStop >>::get()) - { - Sequence < css::style::TabStop > val; - pAny >>= val; - - OUStringBuffer buf; - for (const css::style::TabStop& rSingleVal : val) - { - buf.append( - "Position=" + OUString::number(rSingleVal.Position) + ",TabAlign=" - + OUString::number(sal_Int32(rSingleVal.Alignment)) + ",DecimalChar="); - if (rSingleVal.DecimalChar==';' || rSingleVal.DecimalChar == ':' || rSingleVal.DecimalChar == ',' || - rSingleVal.DecimalChar == '=' || rSingleVal.DecimalChar == '\\') - buf.append('\\'); - buf.append(OUStringChar(rSingleVal.DecimalChar) + ",FillChar="); - if (rSingleVal.FillChar==';' || rSingleVal.FillChar == ':' || rSingleVal.FillChar == ',' || - rSingleVal.FillChar == '=' || rSingleVal.FillChar == '\\') - buf.append('\\'); - buf.append(OUStringChar(rSingleVal.FillChar) + ","); - } - return buf.makeStringAndClear(); - } - break; - } - case TypeClass_ENUM: - { - if (pAny.getValueType() == cppu::UnoType<css::awt::FontSlant>::get()) - { - css::awt::FontSlant val; - pAny >>= val; - return OUString::number(sal_Int32(val)); - } - break; - } - case TypeClass_STRUCT: - { - if (pAny.getValueType() == cppu::UnoType<css::style::LineSpacing>::get()) - { - css::style::LineSpacing val; - pAny >>= val; - return "Mode=" + OUString::number(val.Mode) + ",Height=" - + OUString::number(val.Height) + ","; - } - else if (pAny.getValueType() == cppu::UnoType<css::accessibility::TextSegment>::get()) - { - css::accessibility::TextSegment val; - pAny >>= val; - return val.SegmentText; - } - break; - } - case TypeClass_VOID: - case TypeClass_HYPER: - case TypeClass_UNSIGNED_HYPER: - case TypeClass_TYPE: - case TypeClass_ANY: - case TypeClass_TYPEDEF: - case TypeClass_EXCEPTION: - case TypeClass_INTERFACE: - case TypeClass_SERVICE: - case TypeClass_MODULE: - case TypeClass_INTERFACE_METHOD: - case TypeClass_INTERFACE_ATTRIBUTE: - case TypeClass_UNKNOWN: - case TypeClass_PROPERTY: - case TypeClass_CONSTANT: - case TypeClass_CONSTANTS: - case TypeClass_SINGLETON: - break; - default: - break; - } - return OUString(); -} - -OUString CMAccessible::get_String4Numbering(const Any& pAny, sal_Int16 numberingLevel,std::u16string_view numberingPrefix) -{ - Reference< css::container::XIndexReplace > pXIndex; - if((pAny>>=pXIndex) && (numberingLevel !=-1))//numbering level is -1,means invalid value - { - Any aAny = pXIndex->getByIndex(numberingLevel); - Sequence< css::beans::PropertyValue > aProps; - aAny >>= aProps; - OUStringBuffer buf("Numbering:NumberingLevel=" + OUString::number(numberingLevel) + ","); - for (const css::beans::PropertyValue& rProp : aProps) - { - if( (rProp.Name == "BulletChar" ) || - (rProp.Name == "NumberingType" )) - { - buf.append(rProp.Name + "="); - auto const pTemp = CMAccessible::get_StringFromAny(rProp.Value); - buf.append(pTemp + ","); - - if (rProp.Name == "NumberingType" && !numberingPrefix.empty()) - { - buf.append(OUString::Concat("NumberingPrefix=") + numberingPrefix); - } - } - } - return buf.makeStringAndClear(); - } - - //Because now have three types numbering level: - //1.real numbering list,numbering level>=0 and numbering Rule !=NULL; - //2.common paragraph, numbering level >=0, and numbering Rule == NULL; - //3.TOC paragraph, numbering level >0, and numbering Rule ==NULL; - // IAText:numberinglevel base on 0, but TOC's level base on 1, - // so NumberingLevel value will be decreased 1 in bridge code. - else if(numberingLevel >0) - { - return "Numbering:NumberingLevel=" + OUString::number(numberingLevel-1) + ",NumberingType=4,NumberingPrefix=,"; - } - else - { - return "Numbering:"; - } -} - void CMAccessible::ConvertAnyToVariant(const css::uno::Any &rAnyVal, VARIANT *pvData) { if(rAnyVal.hasValue()) diff --git a/winaccessibility/source/UAccCOM/MAccessible.h b/winaccessibility/source/UAccCOM/MAccessible.h index d807258e4060..b0196267b7f3 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.h +++ b/winaccessibility/source/UAccCOM/MAccessible.h @@ -215,11 +215,6 @@ public: return static_cast<CMAccessible*>(pv)->SmartQI(pv,iid,ppvObject); } - static OUString get_StringFromAny(css::uno::Any const & pAny); - - static OUString get_String4Numbering(const css::uno::Any& pAny, - sal_Int16 numberingLevel, std::u16string_view numberingPrefix); - // Helper function for data conversion. static void ConvertAnyToVariant(const css::uno::Any &rAnyVal, VARIANT *pvData); |