[Libreoffice-commits] core.git: cui/source filter/source include/svx reportdesign/source sc/source sd/source svx/source sw/source

Stephan Bergmann sbergman at redhat.com
Tue Sep 20 14:56:28 UTC 2016


 cui/source/tabpages/page.cxx                       |    6 ++--
 filter/source/svg/svgexport.cxx                    |   30 ++++++++++-----------
 include/svx/pageitem.hxx                           |   12 --------
 reportdesign/source/core/sdr/RptModel.cxx          |    4 +-
 reportdesign/source/ui/report/ReportController.cxx |    2 -
 sc/source/core/tool/editutil.cxx                   |   16 +++++------
 sc/source/filter/starcalc/scflt.cxx                |    3 +-
 sd/source/core/drawdoc.cxx                         |    2 -
 sd/source/core/drawdoc4.cxx                        |   10 +++----
 sd/source/core/sdpage.cxx                          |    2 -
 sd/source/ui/unoidl/UnoDocumentSettings.cxx        |    2 -
 svx/source/items/pageitem.cxx                      |    7 ++--
 svx/source/svdraw/svdmodel.cxx                     |    2 -
 svx/source/unodraw/UnoGraphicExporter.cxx          |   10 +++----
 sw/source/core/fields/dbfld.cxx                    |    2 -
 sw/source/core/fields/expfld.cxx                   |    2 -
 sw/source/uibase/sidebar/PageStylesPanel.cxx       |    4 +-
 sw/source/uibase/utlui/uitool.cxx                  |    2 -
 18 files changed, 55 insertions(+), 63 deletions(-)

New commits:
commit 5e0edd5fafbc8696fe75d9518a93b59969418c43
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Sep 20 16:45:47 2016 +0200

    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

diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 7b54e08..d025d5b 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -466,7 +466,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
     }
 
     // general page data
-    SvxNumType eNumType = SVX_ARABIC;
+    SvxNumType eNumType = css::style::NumberingType::ARABIC;
     bLandscape = ( mpDefPrinter->GetOrientation() == Orientation::Landscape );
     sal_uInt16 nUse = (sal_uInt16)SVX_PAGE_ALL;
     pItem = GetItem( *rSet, SID_ATTR_PAGE );
@@ -805,10 +805,10 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
 
     //Get the NumType value
     nPos = m_pNumberFormatBox->GetSelectEntryPos();
-    sal_uInt16 nEntryData = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pNumberFormatBox->GetEntryData(nPos));
+    SvxNumType nEntryData = static_cast<SvxNumType>(reinterpret_cast<sal_uLong>(m_pNumberFormatBox->GetEntryData(nPos)));
     if ( m_pNumberFormatBox->IsValueChangedFromSaved() )
     {
-        aPage.SetNumType( (SvxNumType)nEntryData );
+        aPage.SetNumType( nEntryData );
         bMod = true;
     }
 
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 77964a8..363bc06 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";
diff --git a/include/svx/pageitem.hxx b/include/svx/pageitem.hxx
index e8580cb..227cc39 100644
--- a/include/svx/pageitem.hxx
+++ b/include/svx/pageitem.hxx
@@ -21,18 +21,8 @@
 
 #include <svl/poolitem.hxx>
 #include <svx/svxdllapi.h>
-#include <com/sun/star/style/NumberingType.hpp>
 
-enum SvxNumType
-{
-    SVX_CHARS_UPPER_LETTER = css::style::NumberingType::CHARS_UPPER_LETTER,
-    SVX_CHARS_LOWER_LETTER = css::style::NumberingType::CHARS_LOWER_LETTER,
-    SVX_ROMAN_UPPER = css::style::NumberingType::ROMAN_UPPER,
-    SVX_ROMAN_LOWER = css::style::NumberingType::ROMAN_LOWER,
-    SVX_ARABIC = css::style::NumberingType::ARABIC,
-    SVX_NUMBER_NONE = css::style::NumberingType::NUMBER_NONE,
-    SVX_PAGEDESC = css::style::NumberingType::PAGE_DESCRIPTOR,
-};
+using SvxNumType = sal_Int16; // css::style::NumberingType constants
 
 /*--------------------------------------------------------------------
   usage of the page
diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx
index 0358ecf..aca7a76 100644
--- a/reportdesign/source/core/sdr/RptModel.cxx
+++ b/reportdesign/source/core/sdr/RptModel.cxx
@@ -121,8 +121,8 @@ SvxNumType OReportModel::GetPageNumType() const
 {
     uno::Reference< report::XReportDefinition > xReportDefinition( getReportDefinition() );
     if ( xReportDefinition.is() )
-        return (SvxNumType)getStyleProperty<sal_Int16>(xReportDefinition,PROPERTY_NUMBERINGTYPE);
-    return SVX_ARABIC;
+        return getStyleProperty<sal_Int16>(xReportDefinition,PROPERTY_NUMBERINGTYPE);
+    return css::style::NumberingType::ARABIC;
 }
 
 
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index a62fdad..a2b6ec5 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2446,7 +2446,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
                 uno::Reference<beans::XPropertySet> xProp(xPageStyle,uno::UNO_QUERY_THROW);
                 aPageItem.PutValue(xProp->getPropertyValue(PROPERTY_PAGESTYLELAYOUT),MID_PAGE_LAYOUT);
                 aPageItem.SetLandscape(getStyleProperty<bool>(m_xReportDefinition,PROPERTY_ISLANDSCAPE));
-                aPageItem.SetNumType((SvxNumType)getStyleProperty<sal_Int16>(m_xReportDefinition,PROPERTY_NUMBERINGTYPE));
+                aPageItem.SetNumType(getStyleProperty<sal_Int16>(m_xReportDefinition,PROPERTY_NUMBERINGTYPE));
                 pDescriptor->Put(aPageItem);
                 pDescriptor->Put(SvxBrushItem(::Color(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_BACKCOLOR)),RPTUI_ID_BRUSH));
             }
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index 01c4280..c2d1d72 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -750,20 +750,20 @@ static OUString lcl_GetNumStr(sal_Int32 nNo, SvxNumType eType)
     {
         switch( eType )
         {
-        case SVX_CHARS_UPPER_LETTER:
-        case SVX_CHARS_LOWER_LETTER:
+        case css::style::NumberingType::CHARS_UPPER_LETTER:
+        case css::style::NumberingType::CHARS_LOWER_LETTER:
             aTmpStr = lcl_GetCharStr( nNo );
             break;
 
-        case SVX_ROMAN_UPPER:
-        case SVX_ROMAN_LOWER:
+        case css::style::NumberingType::ROMAN_UPPER:
+        case css::style::NumberingType::ROMAN_LOWER:
             if( nNo < 4000 )
-                aTmpStr = SvxNumberFormat::CreateRomanString( nNo, ( eType == SVX_ROMAN_UPPER ) );
+                aTmpStr = SvxNumberFormat::CreateRomanString( nNo, ( eType == css::style::NumberingType::ROMAN_UPPER ) );
             else
                 aTmpStr.clear();
             break;
 
-        case SVX_NUMBER_NONE:
+        case css::style::NumberingType::NUMBER_NONE:
             aTmpStr.clear();
             break;
 
@@ -776,7 +776,7 @@ static OUString lcl_GetNumStr(sal_Int32 nNo, SvxNumType eType)
             break;
         }
 
-        if( SVX_CHARS_UPPER_LETTER == eType )
+        if( css::style::NumberingType::CHARS_UPPER_LETTER == eType )
             aTmpStr = aTmpStr.toAsciiUpperCase();
     }
     return aTmpStr;
@@ -788,7 +788,7 @@ ScHeaderFieldData::ScHeaderFieldData()
         aTime( tools::Time::EMPTY )
 {
     nPageNo = nTotalPages = 0;
-    eNumType = SVX_ARABIC;
+    eNumType = css::style::NumberingType::ARABIC;
 }
 
 ScHeaderEditEngine::ScHeaderEditEngine( SfxItemPool* pEnginePoolP )
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index 9c98fc4..77e5443 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -20,6 +20,7 @@
 #include "scitems.hxx"
 #include <editeng/eeitem.hxx>
 
+#include <com/sun/star/style/NumberingType.hpp>
 #include <svx/algitem.hxx>
 #include <editeng/boxitem.hxx>
 #include <editeng/brushitem.hxx>
@@ -859,7 +860,7 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc )
         SvxPageItem aPageItem(ATTR_PAGE);
         aPageItem.SetPageUsage( SVX_PAGE_ALL );
         aPageItem.SetLandscape( pPage->Orientation != 1 );
-        aPageItem.SetNumType( SVX_ARABIC );
+        aPageItem.SetNumType( css::style::NumberingType::ARABIC );
         pSet->Put(aPageItem);
 
         pSet->Put(SvxLRSpaceItem( pPage->Left, pPage->Right, 0,0, ATTR_LRSPACE ));
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 809ed3e..d3a4fea 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -170,7 +170,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
 , meLanguage( LANGUAGE_SYSTEM )
 , meLanguageCJK( LANGUAGE_SYSTEM )
 , meLanguageCTL( LANGUAGE_SYSTEM )
-, mePageNumType(SVX_ARABIC)
+, mePageNumType(css::style::NumberingType::ARABIC)
 , mbAllocDocSh(false)
 , meDocType(eType)
 , mpCharClass(nullptr)
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 59a8167..d92c0c7 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -1038,19 +1038,19 @@ OUString SdDrawDocument::CreatePageNumValue(sal_uInt16 nNum) const
 
     switch (mePageNumType)
     {
-        case SVX_CHARS_UPPER_LETTER:
+        case css::style::NumberingType::CHARS_UPPER_LETTER:
             aPageNumValue += OUStringLiteral1( (nNum - 1) % 26 + 'A' );
             break;
-        case SVX_CHARS_LOWER_LETTER:
+        case css::style::NumberingType::CHARS_LOWER_LETTER:
             aPageNumValue += OUStringLiteral1( (nNum - 1) % 26 + 'a' );
             break;
-        case SVX_ROMAN_UPPER:
+        case css::style::NumberingType::ROMAN_UPPER:
             bUpper = true;
             SAL_FALLTHROUGH;
-        case SVX_ROMAN_LOWER:
+        case css::style::NumberingType::ROMAN_LOWER:
             aPageNumValue += SvxNumberFormat::CreateRomanString(nNum, bUpper);
             break;
-        case SVX_NUMBER_NONE:
+        case css::style::NumberingType::NUMBER_NONE:
             aPageNumValue = " ";
             break;
         default:
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index f7e073f..c541afe 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2545,7 +2545,7 @@ const OUString& SdPage::GetName() const
 
             aCreatedPageName = SD_RESSTR(STR_PAGE);
             aCreatedPageName += " ";
-            if( GetModel()->GetPageNumType() == SVX_NUMBER_NONE )
+            if( GetModel()->GetPageNumType() == css::style::NumberingType::NUMBER_NONE )
             {
                 // if the document has number none as a formatting
                 // for page numbers we still default to arabic numbering
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 84fab51..29cd4fc 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -711,7 +711,7 @@ throw (UnknownPropertyException, PropertyVetoException,
             case HANDLE_PAGENUMFMT:
                 {
                     sal_Int32 nValue = 0;
-                    if( (*pValues >>= nValue ) && (nValue >= SVX_CHARS_UPPER_LETTER ) && (nValue <= SVX_PAGEDESC) )
+                    if( (*pValues >>= nValue ) && (nValue >= css::style::NumberingType::CHARS_UPPER_LETTER ) && (nValue <= css::style::NumberingType::PAGE_DESCRIPTOR) )
                     {
                         pDoc->SetPageNumType((SvxNumType)nValue);
                         bOk = true;
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index d30890f..a26de42 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -23,6 +23,7 @@
 #include <svx/pageitem.hxx>
 #include <editeng/itemtype.hxx>
 #include <svx/unomid.hxx>
+#include <com/sun/star/style/NumberingType.hpp>
 #include <com/sun/star/style/PageStyleLayout.hpp>
 #include <com/sun/star/style/BreakType.hpp>
 #include <svl/itemset.hxx>
@@ -36,7 +37,7 @@ SfxPoolItem* SvxPageItem::CreateDefault() { return new   SvxPageItem(0);}
 
 SvxPageItem::SvxPageItem( const sal_uInt16 nId ) : SfxPoolItem( nId ),
 
-    eNumType    ( SVX_ARABIC ),
+    eNumType    ( css::style::NumberingType::ARABIC ),
     bLandscape  ( false ),
     eUse        ( SVX_PAGE_ALL )
 {
@@ -101,7 +102,7 @@ bool SvxPageItem::GetPresentation
             {
                 rText = aDescName + cpDelimTmp;
             }
-            DBG_ASSERT( eNumType <= SVX_NUMBER_NONE, "enum overflow" );
+            DBG_ASSERT( eNumType <= css::style::NumberingType::NUMBER_NONE, "enum overflow" );
             rText += SVX_RESSTR(RID_SVXITEMS_PAGE_NUM_BEGIN + eNumType) + cpDelimTmp;
             if ( bLandscape )
                 rText += SVX_RESSTR(RID_SVXITEMS_PAGE_LAND_TRUE);
@@ -121,7 +122,7 @@ bool SvxPageItem::GetPresentation
             {
                 rText += aDescName + cpDelimTmp;
             }
-            DBG_ASSERT( eNumType <= SVX_NUMBER_NONE, "enum overflow" );
+            DBG_ASSERT( eNumType <= css::style::NumberingType::NUMBER_NONE, "enum overflow" );
             rText += SVX_RESSTR(RID_SVXITEMS_PAGE_NUM_BEGIN + eNumType) + cpDelimTmp;
             if ( bLandscape )
                 rText += SVX_RESSTR(RID_SVXITEMS_PAGE_LAND_TRUE);
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 8361185..95bcaedb2 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1941,7 +1941,7 @@ void SdrModel::disposeOutliner( SdrOutliner* pOutliner )
 
 SvxNumType SdrModel::GetPageNumType() const
 {
-    return SVX_ARABIC;
+    return css::style::NumberingType::ARABIC;
 }
 
 void SdrModel::ReadUserDataSequenceValue(const css::beans::PropertyValue* pValue)
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index ae23c3f..0a25d0a 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -355,19 +355,19 @@ IMPL_LINK_TYPED(GraphicExporter, CalcFieldValueHdl, EditFieldInfo*, pInfo, void)
 
                 switch(mpDoc->GetPageNumType())
                 {
-                    case SVX_CHARS_UPPER_LETTER:
+                    case css::style::NumberingType::CHARS_UPPER_LETTER:
                         aPageNumValue += OUStringLiteral1( (mnPageNumber - 1) % 26 + 'A' );
                         break;
-                    case SVX_CHARS_LOWER_LETTER:
+                    case css::style::NumberingType::CHARS_LOWER_LETTER:
                         aPageNumValue += OUStringLiteral1( (mnPageNumber - 1) % 26 + 'a' );
                         break;
-                    case SVX_ROMAN_UPPER:
+                    case css::style::NumberingType::ROMAN_UPPER:
                         bUpper = true;
                         SAL_FALLTHROUGH;
-                    case SVX_ROMAN_LOWER:
+                    case css::style::NumberingType::ROMAN_LOWER:
                         aPageNumValue += SvxNumberFormat::CreateRomanString(mnPageNumber, bUpper);
                         break;
-                    case SVX_NUMBER_NONE:
+                    case css::style::NumberingType::NUMBER_NONE:
                         aPageNumValue = " ";
                         break;
                     default:
diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
index 85db205..8628be1 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -867,7 +867,7 @@ bool SwDBSetNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
         {
             sal_Int16 nSet = 0;
             rAny >>= nSet;
-            if(nSet < (sal_Int16) SVX_NUMBER_NONE )
+            if(nSet < css::style::NumberingType::NUMBER_NONE )
                 SetFormat(nSet);
             else {
             }
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 68e882a..ce0af72 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -986,7 +986,7 @@ bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
     case FIELD_PROP_USHORT2:
         {
             rAny >>= nTmp16;
-            if(nTmp16 <= SVX_NUMBER_NONE )
+            if(nTmp16 <= css::style::NumberingType::NUMBER_NONE )
                 SetFormat(nTmp16);
             else {
                 //exception(wrong_value)
diff --git a/sw/source/uibase/sidebar/PageStylesPanel.cxx b/sw/source/uibase/sidebar/PageStylesPanel.cxx
index 85b6734..3221eae 100644
--- a/sw/source/uibase/sidebar/PageStylesPanel.cxx
+++ b/sw/source/uibase/sidebar/PageStylesPanel.cxx
@@ -454,8 +454,8 @@ IMPL_LINK_NOARG_TYPED( PageStylesPanel, ModifyColumnCountHdl, ListBox&, void )
 
 IMPL_LINK_NOARG_TYPED( PageStylesPanel, ModifyNumberingHdl, ListBox&, void )
 {
-    sal_uInt16 nEntryData = (sal_uInt16)reinterpret_cast<sal_uLong>(mpNumberSelectLB->GetEntryData(mpNumberSelectLB->GetSelectEntryPos()));
-    mpPageItem->SetNumType((SvxNumType)nEntryData);
+    SvxNumType nEntryData = static_cast<SvxNumType>(reinterpret_cast<sal_uLong>(mpNumberSelectLB->GetEntryData(mpNumberSelectLB->GetSelectEntryPos())));
+    mpPageItem->SetNumType(nEntryData);
     mpBindings->GetDispatcher()->ExecuteList(SID_ATTR_PAGE, SfxCallMode::RECORD, { mpPageItem.get() });
 }
 
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index 514a91a..823e6d5 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -420,7 +420,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
     aPageItem.SetDescName(rPageDesc.GetName());
     aPageItem.SetPageUsage(lcl_convertUseToSvx(rPageDesc.GetUseOn()));
     aPageItem.SetLandscape(rPageDesc.GetLandscape());
-    aPageItem.SetNumType((SvxNumType)rPageDesc.GetNumType().GetNumberingType());
+    aPageItem.SetNumType(rPageDesc.GetNumType().GetNumberingType());
     rSet.Put(aPageItem);
 
     // Size


More information about the Libreoffice-commits mailing list