diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-09-20 16:45:47 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-09-20 16:45:47 +0200 |
commit | 5e0edd5fafbc8696fe75d9518a93b59969418c43 (patch) | |
tree | bf1e9fdbc52bafd4722154ef6d2519875f47dcde /filter | |
parent | d09bfe6bf10fe16e087c7f30268b72f36c33302e (diff) |
Fix "ubsan: 9 is not a valid value for type ´SvxNumType´" once again
...after 1658bd231bc662504a072097dc614c29fe2e116d "loplugin:unusedenumvalues"
broke it again after 992fba98f4d0b6ff0d20c15b0ddff09edd37847c "ubsan: 9 is not a
valid value for type ´SvxNumType´" had fixed it the last time.
This time, acknowledge that SvxNumType can apparently take on rather arbitrary
sal_Int16 values from the css::style::NumberingTypes constants, and make it an
alias for sal_Int16 (whether or not keeping such a trivial alias is good or bad
overall).
Or is the bug elsewhere, and values of type SvxNumType should really only take
on the restricted set of values originally encoded by the enum? At least the
below UBSan backtrace (from CppunitTest_sw_rtfexport) suggests otherwise, but
then again there's also an SvxExtNumType enum (include/editeng/svxenum.hxx),
encompassing more parts of css::style::NumberingTypes. Oh, my.
> svx/source/items/pageitem.cxx:49:25: runtime error: load of value 9, which is not a valid value for type 'SvxNumType'
> #0 0x2aafdaebe669 in SvxPageItem::SvxPageItem(SvxPageItem const&) svx/source/items/pageitem.cxx:49:25
> #1 0x2aafdaebf194 in SvxPageItem::Clone(SfxItemPool*) const svx/source/items/pageitem.cxx:59:16
> #2 0x2aaf7fab9b7c in SfxItemPool::Put(SfxPoolItem const&, unsigned short) svl/source/items/itempool.cxx:632:40
> #3 0x2aaf7fc4794a in SfxItemSet::Put(SfxPoolItem const&, unsigned short) svl/source/items/itemset.cxx:467:56
> #4 0x2aaf7fb96635 in SfxItemSet::Put(SfxPoolItem const&) include/svl/itemset.hxx:131:42
> #5 0x2aaf7fb89539 in SfxItemPropertySet::setPropertyValue(SfxItemPropertySimpleEntry const&, com::sun::star::uno::Any const&, SfxItemSet&) const svl/source/items/itemprop.cxx:256:14
> #6 0x2aaf9ef1a5d4 in void SwXStyle::SetPropertyValue<(unsigned short)1>(SfxItemPropertySimpleEntry const&, SfxItemPropertySet const&, com::sun::star::uno::Any const&, SwStyleBase_Impl&) sw/source/core/unocore/unostyle.cxx:1596:14
> #7 0x2aaf9ef3c72f in SwXStyle::SetStyleProperty(SfxItemPropertySimpleEntry const&, SfxItemPropertySet const&, com::sun::star::uno::Any const&, SwStyleBase_Impl&) sw/source/core/unocore/unostyle.cxx:2013:9
> #8 0x2aaf9ef8103d in SwXPageStyle::SetPropertyValues_Impl(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) sw/source/core/unocore/unostyle.cxx:3025:17
> #9 0x2aaf9ef821ee in SwXPageStyle::setPropertyValues(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) sw/source/core/unocore/unostyle.cxx:3053:9
> #10 0x2ab00730d08b in writerfilter::dmapper::SectionPropertyMap::ApplyProperties_(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const&) writerfilter/source/dmapper/PropertyMap.cxx:1489:24
> #11 0x2ab00731cede in writerfilter::dmapper::SectionPropertyMap::CloseSectionGroup(writerfilter::dmapper::DomainMapper_Impl&) writerfilter/source/dmapper/PropertyMap.cxx:1331:13
> #12 0x2ab006b9ede2 in writerfilter::dmapper::DomainMapper::lcl_endSectionGroup() writerfilter/source/dmapper/DomainMapper.cxx:2823:30
> #13 0x2ab0071db9f9 in writerfilter::LoggedStream::endSectionGroup() writerfilter/source/dmapper/LoggedResources.cxx:101:5
> #14 0x2ab006712a3b in writerfilter::rtftok::RTFDocumentImpl::sectBreak(bool) writerfilter/source/rtftok/rtfdocumentimpl.cxx:633:18
> #15 0x2ab0067a8c13 in writerfilter::rtftok::RTFDocumentImpl::popState() writerfilter/source/rtftok/rtfdocumentimpl.cxx:2789:13
> #16 0x2ab006a26134 in writerfilter::rtftok::RTFTokenizer::resolveParse() writerfilter/source/rtftok/rtftokenizer.cxx:105:33
> #17 0x2ab0067194f9 in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) writerfilter/source/rtftok/rtfdocumentimpl.cxx:740:27
> #18 0x2ab0075ebae7 in RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) writerfilter/source/filter/RtfFilter.cxx:147:20
> #19 0x2aafcf2873a5 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) sfx2/source/doc/objstor.cxx:2261:30
> #20 0x2aafcf22d4d2 in SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:764:23
> #21 0x2aafcf4a4d09 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) sfx2/source/doc/sfxbasemodel.cxx:1841:36
> #22 0x2aafcfde31b3 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) sfx2/source/view/frmload.cxx:698:28
> #23 0x2aaffef07028 in framework::LoadEnv::impl_loadContent() framework/source/loadenv/loadenv.cxx:1110:37
> #24 0x2aaffeeead5a in framework::LoadEnv::startLoading() framework/source/loadenv/loadenv.cxx:379:20
> #25 0x2aaffeee3919 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) framework/source/loadenv/loadenv.cxx:165:14
> #26 0x2aafff10ddac in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) framework/source/services/desktop.cxx:596:12
> #27 0x2aafff10e11a in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) framework/source/services/desktop.cxx:582:64
> #28 0x2aafab4c3938 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) unotest/source/cpp/macros_test.cxx:50:60
> #29 0x2aaf90aee900 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) sw/qa/extras/inc/swmodeltestbase.hxx:621:23
> #30 0x2aaf90aed267 in SwModelTestBase::load(char const*, char const*) sw/qa/extras/inc/swmodeltestbase.hxx:610:16
> #31 0x2aaf90aec404 in SwModelTestBase::executeImportTest(char const*) sw/qa/extras/inc/swmodeltestbase.hxx:222:13
> #32 0x2aaf90cf4d31 in testTdf65642::Import() sw/qa/extras/rtfexport/rtfexport.cxx:1013:1
> #33 0x2aaf90cf62af in CppUnit::TestCaller<testTdf65642>::runTest() workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:166:6
> #34 0x2aaf4ee5d7dd in CppUnit::TestCaseMethodFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5
> #35 0x2aaf680c4cd6 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) test/source/vclbootstrapprotector.cxx:36:14
> #36 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #37 0x2aaf5ea4a8a6 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89:12
> #38 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #39 0x2aaf5abd5ef4 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:65:16
> #40 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #41 0x2aaf4ed8c2ef in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15:12
> #42 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #43 0x2aaf4ee14101 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:77:18
> #44 0x2aaf4eede065 in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:181:28
> #45 0x2aaf4ee5a929 in CppUnit::TestCase::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91:13
> #46 0x2aaf4ee60ad3 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
> #47 0x2aaf4ee5fa3d in CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
> #48 0x2aaf4ee60ad3 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
> #49 0x2aaf4ee5fa3d in CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
> #50 0x2aaf4ef1eeb6 in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47:27
> #51 0x2aaf4eedbe79 in CppUnit::TestResult::runTest(CppUnit::Test*) workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:148:9
> #52 0x2aaf4ef20440 in CppUnit::TestRunner::run(CppUnit::TestResult&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96:14
> #53 0x52b642 in (anonymous namespace)::ProtectedFixtureFunctor::run() const sal/cppunittester/cppunittester.cxx:305:20
> #54 0x52604d in sal_main() sal/cppunittester/cppunittester.cxx:455:20
> #55 0x524192 in main sal/cppunittester/cppunittester.cxx:362:1
> #56 0x2aaf50b3c730 in __libc_start_main (/lib64/libc.so.6+0x20730)
> #57 0x437658 in _start (workdir/LinkTarget/Executable/cppunittester+0x437658)
Change-Id: Id170860cbff9f4cae5c87cb5cfc70ffe3bc8c9c5
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/svg/svgexport.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 77964a862640..363bc068acd7 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -933,9 +933,9 @@ void SVGFilter::implGenerateMetaData() } // Add a (global) Page Numbering Type attribute for the document - // NOTE: at present pSdrModel->GetPageNumType() returns always SVX_ARABIC + // NOTE: at present pSdrModel->GetPageNumType() returns always css::style::NumberingType::ARABIC // so the following code fragment is pretty unuseful - sal_Int32 nPageNumberingType = SVX_ARABIC; + sal_Int32 nPageNumberingType = css::style::NumberingType::ARABIC; SvxDrawPage* pSvxDrawPage = SvxDrawPage::getImplementation( mSelectedPages[0] ); if( pSvxDrawPage ) { @@ -946,24 +946,24 @@ void SVGFilter::implGenerateMetaData() // That is used by CalcFieldHdl method. mVisiblePagePropSet.nPageNumberingType = nPageNumberingType; } - if( nPageNumberingType != SVX_NUMBER_NONE ) + if( nPageNumberingType != css::style::NumberingType::NUMBER_NONE ) { OUString sNumberingType; switch( nPageNumberingType ) { - case SVX_CHARS_UPPER_LETTER: + case css::style::NumberingType::CHARS_UPPER_LETTER: sNumberingType = "alpha-upper"; break; - case SVX_CHARS_LOWER_LETTER: + case css::style::NumberingType::CHARS_LOWER_LETTER: sNumberingType = "alpha-lower"; break; - case SVX_ROMAN_UPPER: + case css::style::NumberingType::ROMAN_UPPER: sNumberingType = "roman-upper"; break; - case SVX_ROMAN_LOWER: + case css::style::NumberingType::ROMAN_LOWER: sNumberingType = "roman-lower"; break; - case SVX_ARABIC: + case css::style::NumberingType::ARABIC: // arabic numbering type is the default, so we do not append any attribute for it default: // in case the numbering type is not handled we fall back on arabic numbering @@ -1033,7 +1033,7 @@ void SVGFilter::implGenerateMetaData() // Page Number Field xPropSet->getPropertyValue( "IsPageNumberVisible" ) >>= bPageNumberVisibility; - bPageNumberVisibility = bPageNumberVisibility && ( nPageNumberingType != SVX_NUMBER_NONE ); + bPageNumberVisibility = bPageNumberVisibility && ( nPageNumberingType != css::style::NumberingType::NUMBER_NONE ); if( bPageNumberVisibility ) // visibility default value: 'hidden' { mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrPageNumberVisibility, "visible" ); @@ -1379,7 +1379,7 @@ void SVGFilter::implGetPagePropSet( const Reference< XDrawPage > & rxPage ) mVisiblePagePropSet.bIsDateTimeFieldVisible = true; mVisiblePagePropSet.bIsDateTimeFieldFixed = true; mVisiblePagePropSet.nDateTimeFormat = SVXDATEFORMAT_B; - mVisiblePagePropSet.nPageNumberingType = SVX_ARABIC; + mVisiblePagePropSet.nPageNumberingType = css::style::NumberingType::ARABIC; // We collect info on master page elements visibility, and placeholder text shape content. Reference< XPropertySet > xPropSet( rxPage, UNO_QUERY ); @@ -2274,20 +2274,20 @@ IMPL_LINK_TYPED( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo, void ) { switch( mVisiblePagePropSet.nPageNumberingType ) { - case SVX_CHARS_UPPER_LETTER: + case css::style::NumberingType::CHARS_UPPER_LETTER: aRepresentation += "QWERTYUIOPASDFGHJKLZXCVBNM"; break; - case SVX_CHARS_LOWER_LETTER: + case css::style::NumberingType::CHARS_LOWER_LETTER: aRepresentation += "qwertyuiopasdfghjklzxcvbnm"; break; - case SVX_ROMAN_UPPER: + case css::style::NumberingType::ROMAN_UPPER: aRepresentation += "IVXLCDM"; break; - case SVX_ROMAN_LOWER: + case css::style::NumberingType::ROMAN_LOWER: aRepresentation += "ivxlcdm"; break; // arabic numbering type is the default - case SVX_ARABIC: + case css::style::NumberingType::ARABIC: // in case the numbering type is not handled we fall back on arabic numbering default: aRepresentation += "0123456789"; |