[Libreoffice-commits] core.git: 10 commits - chart2/source cui/source editeng/source filter/source forms/source include/editeng include/svx reportdesign/source sc/source sd/source svx/source sw/inc sw/sdi sw/source
Noel Grandin
noel at peralex.com
Wed Aug 17 06:45:49 UTC 2016
chart2/source/controller/main/ShapeController.cxx | 2
cui/source/inc/chardlg.hxx | 2
cui/source/tabpages/align.cxx | 10 -
cui/source/tabpages/chardlg.cxx | 16 -
cui/source/tabpages/paragrph.cxx | 66 +++----
cui/source/tabpages/tabstpge.cxx | 32 +--
cui/source/tabpages/tpcolor.cxx | 6
cui/source/tabpages/tplnedef.cxx | 2
cui/source/tabpages/tplneend.cxx | 2
editeng/source/editeng/editdbg.cxx | 4
editeng/source/editeng/editdoc.cxx | 2
editeng/source/editeng/editobj.cxx | 2
editeng/source/editeng/eerdll.cxx | 4
editeng/source/editeng/impedit2.cxx | 12 -
editeng/source/editeng/impedit3.cxx | 38 ++--
editeng/source/editeng/impedit4.cxx | 2
editeng/source/items/frmitems.cxx | 36 ++--
editeng/source/items/justifyitem.cxx | 12 -
editeng/source/items/paraitem.cxx | 134 ++++++++--------
editeng/source/items/textitem.cxx | 10 -
editeng/source/rtf/rtfitem.cxx | 28 +--
filter/source/msfilter/svdfppt.cxx | 16 -
forms/source/richtext/rtattributehandler.cxx | 12 -
include/editeng/escapementitem.hxx | 4
include/editeng/formatbreakitem.hxx | 13 -
include/editeng/lspcitem.hxx | 28 +--
include/editeng/svxenum.hxx | 77 ++++-----
include/editeng/tstpitem.hxx | 4
include/svx/svdmodel.hxx | 17 +-
include/svx/xmlgrhlp.hxx | 5
include/svx/xpoly.hxx | 10 -
include/svx/xtable.hxx | 26 +--
reportdesign/source/core/api/ReportDefinition.cxx | 6
sc/source/core/data/docpool.cxx | 4
sc/source/core/data/table4.cxx | 2
sc/source/filter/excel/xestream.cxx | 6
sc/source/filter/excel/xestyle.cxx | 4
sc/source/filter/excel/xlstyle.cxx | 12 -
sc/source/filter/oox/stylesbuffer.cxx | 10 -
sc/source/filter/rtf/eeimpars.cxx | 2
sc/source/filter/xml/xmlwrap.cxx | 4
sc/source/ui/app/inputwin.cxx | 2
sc/source/ui/drawfunc/drtxtob.cxx | 22 +-
sc/source/ui/drawfunc/drtxtob1.cxx | 2
sc/source/ui/unoobj/cellsuno.cxx | 4
sc/source/ui/unoobj/servuno.cxx | 4
sc/source/ui/view/editsh.cxx | 12 -
sc/source/ui/view/output2.cxx | 6
sd/source/filter/xml/sdxmlwrp.cxx | 4
sd/source/ui/func/fucon3d.cxx | 16 -
sd/source/ui/unoidl/UnoDocumentSettings.cxx | 42 ++---
sd/source/ui/unoidl/unomodel.cxx | 4
sd/source/ui/view/drtxtob.cxx | 4
sd/source/ui/view/drtxtob1.cxx | 30 +--
sd/source/ui/view/drviews2.cxx | 12 -
sd/source/ui/view/drviewsf.cxx | 4
svx/source/dialog/svxruler.cxx | 24 +-
svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx | 34 ++--
svx/source/svdraw/svdmodel.cxx | 7
svx/source/svdraw/svdoedge.cxx | 36 ++--
svx/source/svdraw/svdopath.cxx | 62 +++----
svx/source/tbxctrls/Palette.cxx | 2
svx/source/tbxctrls/PaletteManager.cxx | 2
svx/source/tbxctrls/fillctrl.cxx | 2
svx/source/unodraw/unoctabl.cxx | 2
svx/source/unodraw/unomod.cxx | 2
svx/source/xml/xmlexport.cxx | 4
svx/source/xml/xmlgrhlp.cxx | 28 +--
svx/source/xml/xmlxtexp.cxx | 2
svx/source/xml/xmlxtimp.cxx | 2
svx/source/xoutdev/_xpoly.cxx | 26 +--
svx/source/xoutdev/xattr.cxx | 6
svx/source/xoutdev/xattrbmp.cxx | 4
svx/source/xoutdev/xtabcolr.cxx | 2
svx/source/xoutdev/xtabdash.cxx | 2
svx/source/xoutdev/xtabgrdt.cxx | 2
svx/source/xoutdev/xtabhtch.cxx | 2
svx/source/xoutdev/xtable.cxx | 28 +--
svx/source/xoutdev/xtablend.cxx | 2
sw/inc/tox.hxx | 2
sw/sdi/_textsh.sdi | 8
sw/source/core/bastyp/init.cxx | 4
sw/source/core/crsr/crstrvl.cxx | 2
sw/source/core/doc/DocumentStylePoolManager.cxx | 10 -
sw/source/core/doc/doc.cxx | 2
sw/source/core/doc/docfmt.cxx | 4
sw/source/core/doc/doctxm.cxx | 4
sw/source/core/doc/tblafmt.cxx | 2
sw/source/core/edit/autofmt.cxx | 2
sw/source/core/layout/flowfrm.cxx | 34 ++--
sw/source/core/layout/frmtool.cxx | 2
sw/source/core/layout/laycache.cxx | 8
sw/source/core/text/frmcrsr.cxx | 2
sw/source/core/text/frmform.cxx | 10 -
sw/source/core/text/inftxt.cxx | 6
sw/source/core/text/itrcrsr.cxx | 12 -
sw/source/core/text/itrform2.cxx | 16 -
sw/source/core/text/porrst.cxx | 16 -
sw/source/core/text/txtfrm.cxx | 4
sw/source/core/text/txttab.cxx | 18 +-
sw/source/core/tox/ToxTabStopTokenHandler.cxx | 4
sw/source/core/tox/ToxTextGenerator.cxx | 2
sw/source/core/tox/tox.cxx | 8
sw/source/core/txtnode/ndtxt.cxx | 3
sw/source/core/undo/rolbck.cxx | 12 -
sw/source/core/unocore/unoidx.cxx | 4
sw/source/filter/ascii/parasc.cxx | 2
sw/source/filter/html/css1atr.cxx | 20 +-
sw/source/filter/html/htmlatr.cxx | 16 -
sw/source/filter/html/htmlcss1.cxx | 6
sw/source/filter/html/htmlsect.cxx | 6
sw/source/filter/html/htmltab.cxx | 6
sw/source/filter/html/svxcss1.cxx | 8
sw/source/filter/html/swhtml.cxx | 8
sw/source/filter/ww8/docxattributeoutput.cxx | 18 +-
sw/source/filter/ww8/rtfattributeoutput.cxx | 8
sw/source/filter/ww8/writerhelper.cxx | 2
sw/source/filter/ww8/wrtw8esh.cxx | 2
sw/source/filter/ww8/wrtw8nds.cxx | 8
sw/source/filter/ww8/ww8atr.cxx | 50 ++---
sw/source/filter/ww8/ww8par.cxx | 20 +-
sw/source/filter/ww8/ww8par5.cxx | 2
sw/source/filter/ww8/ww8par6.cxx | 10 -
sw/source/filter/xml/swxml.cxx | 2
sw/source/filter/xml/wrtxml.cxx | 2
sw/source/filter/xml/xmlexp.cxx | 2
sw/source/filter/xml/xmlexpit.cxx | 16 -
sw/source/filter/xml/xmlimp.cxx | 2
sw/source/filter/xml/xmlimpit.cxx | 14 -
sw/source/ui/envelp/envfmt.cxx | 2
sw/source/ui/index/cntex.cxx | 2
sw/source/ui/index/cnttab.cxx | 4
sw/source/ui/table/tabledlg.cxx | 22 +-
sw/source/uibase/app/appopt.cxx | 2
sw/source/uibase/app/docshini.cxx | 2
sw/source/uibase/docvw/PageBreakWin.cxx | 2
sw/source/uibase/shells/annotsh.cxx | 28 +--
sw/source/uibase/shells/drwtxtex.cxx | 29 +--
sw/source/uibase/shells/textsh1.cxx | 2
sw/source/uibase/shells/txtattr.cxx | 26 +--
sw/source/uibase/uiview/view2.cxx | 2
sw/source/uibase/uiview/viewtab.cxx | 6
sw/source/uibase/utlui/uitool.cxx | 2
sw/source/uibase/wrtsh/wrtsh1.cxx | 4
144 files changed, 852 insertions(+), 849 deletions(-)
New commits:
commit fa8121a08f8ca86864184b7922793209f978f3d9
Author: Noel Grandin <noel at peralex.com>
Date: Tue Aug 16 16:33:31 2016 +0200
convert SvXMLGraphicHelperMode to scoped enum
Change-Id: Ib0360b395fafe3c8123a0cc0fd0cbfd581fa5414
diff --git a/include/svx/xmlgrhlp.hxx b/include/svx/xmlgrhlp.hxx
index f71549a..631d91a 100644
--- a/include/svx/xmlgrhlp.hxx
+++ b/include/svx/xmlgrhlp.hxx
@@ -31,10 +31,9 @@
#include <com/sun/star/embed/XStorage.hpp>
#include <svx/svxdllapi.h>
-enum SvXMLGraphicHelperMode
+enum class SvXMLGraphicHelperMode
{
- GRAPHICHELPER_MODE_READ = 0,
- GRAPHICHELPER_MODE_WRITE = 1
+ Read, Write
};
struct SvxGraphicHelperStream_Impl
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index f2a686d..bcddf79 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -1342,7 +1342,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS
uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
uno::Reference< document::XGraphicObjectResolver > xGrfResolver;
- SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create(_xStorageToSaveTo,GRAPHICHELPER_MODE_WRITE);
+ SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create(_xStorageToSaveTo,SvXMLGraphicHelperMode::Write);
xGrfResolver = pGraphicHelper;
pGraphicHelper->release();
SvXMLEmbeddedObjectHelper* pEmbeddedObjectHelper = SvXMLEmbeddedObjectHelper::Create( _xStorageToSaveTo,*this, EMBEDDEDOBJECTHELPER_MODE_WRITE );
@@ -2160,14 +2160,14 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( co
return static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( m_pImpl->m_xStorage,*this, EMBEDDEDOBJECTHELPER_MODE_WRITE ));
else if ( aServiceSpecifier == "com.sun.star.document.ImportGraphicObjectResolver" )
{
- SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,GRAPHICHELPER_MODE_WRITE);
+ SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,SvXMLGraphicHelperMode::Write);
uno::Reference< uno::XInterface> xRet(static_cast< ::cppu::OWeakObject* >(pGraphicHelper));
pGraphicHelper->release();
return xRet;
}
else if ( aServiceSpecifier == "com.sun.star.document.ExportGraphicObjectResolver" )
{
- SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,GRAPHICHELPER_MODE_WRITE);
+ SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,SvXMLGraphicHelperMode::Write);
uno::Reference< uno::XInterface> xRet(static_cast< ::cppu::OWeakObject* >(pGraphicHelper));
pGraphicHelper->release();
return xRet;
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 239e643..2fad242 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -440,7 +440,7 @@ bool ScXMLImportWrapper::Import( sal_uInt8 nMode, ErrCode& rError )
if( xStorage.is() )
{
- pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, GRAPHICHELPER_MODE_READ );
+ pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Read );
xGrfContainer = pGraphicHelper;
pObjectHelper = SvXMLEmbeddedObjectHelper::Create(xStorage, mrDocShell, EMBEDDEDOBJECTHELPER_MODE_READ, false);
@@ -857,7 +857,7 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
if( xStorage.is() )
{
- pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, GRAPHICHELPER_MODE_WRITE, false );
+ pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Write, false );
xGrfContainer = pGraphicHelper;
}
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx
index 6fb931b..62e9c3d 100644
--- a/sc/source/ui/unoobj/servuno.cxx
+++ b/sc/source/ui/unoobj/servuno.cxx
@@ -485,10 +485,10 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
// Support creation of GraphicObjectResolver and EmbeddedObjectResolver
case Type::EXPORT_GOR:
- xRet.set(static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( GRAPHICHELPER_MODE_WRITE )));
+ xRet.set(static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Write )));
break;
case Type::IMPORT_GOR:
- xRet.set(static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( GRAPHICHELPER_MODE_READ )));
+ xRet.set(static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Read )));
break;
case Type::EXPORT_EOR:
if (pDocShell)
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 535b51f..4a8c755 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -558,7 +558,7 @@ bool SdXMLFilter::Import( ErrCode& nError )
if( 0 == nRet )
{
pGraphicHelper = SvXMLGraphicHelper::Create( xStorage,
- GRAPHICHELPER_MODE_READ,
+ SvXMLGraphicHelperMode::Read,
false );
xGraphicResolver = pGraphicHelper;
pObjectHelper = SvXMLEmbeddedObjectHelper::Create(
@@ -889,7 +889,7 @@ bool SdXMLFilter::Export()
pObjectHelper = SvXMLEmbeddedObjectHelper::Create( xStorage, *mrDocShell.GetDoc()->GetPersist(), EMBEDDEDOBJECTHELPER_MODE_WRITE, false );
xObjectResolver = pObjectHelper;
- pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, GRAPHICHELPER_MODE_WRITE, false );
+ pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Write, false );
xGrfResolver = pGraphicHelper;
}
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index da17846..d3e409f 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -946,12 +946,12 @@ css::uno::Reference<css::uno::XInterface> SdXImpressDocument::create(
// Support creation of GraphicObjectResolver and EmbeddedObjectResolver
if( aServiceSpecifier == "com.sun.star.document.ExportGraphicObjectResolver" )
{
- return static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( GRAPHICHELPER_MODE_WRITE ));
+ return static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Write ));
}
if( aServiceSpecifier == "com.sun.star.document.ImportGraphicObjectResolver" )
{
- return static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( GRAPHICHELPER_MODE_READ ));
+ return static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Read ));
}
if( aServiceSpecifier == "com.sun.star.document.ExportEmbeddedObjectResolver" )
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index 7aa9253..a2504fa 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -181,7 +181,7 @@ css::uno::Reference<css::uno::XInterface> create(
}
else if ( rServiceSpecifier == "com.sun.star.document.ImportGraphicObjectResolver" )
{
- SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create( GRAPHICHELPER_MODE_READ );
+ SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Read );
uno::Reference< uno::XInterface> xRet( static_cast< ::cppu::OWeakObject* >( pGraphicHelper ) );
pGraphicHelper->release();
return xRet;
diff --git a/svx/source/xml/xmlexport.cxx b/svx/source/xml/xmlexport.cxx
index fda59d3..820b545 100644
--- a/svx/source/xml/xmlexport.cxx
+++ b/svx/source/xml/xmlexport.cxx
@@ -80,7 +80,7 @@ bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputSt
xObjectResolver = pObjectHelper;
}
- pGraphicHelper = SvXMLGraphicHelper::Create( GRAPHICHELPER_MODE_WRITE );
+ pGraphicHelper = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Write );
xGraphicResolver = pGraphicHelper;
if( bDocRet )
@@ -176,7 +176,7 @@ bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStr
xTargetModel->lockControllers();
- pGraphicHelper = SvXMLGraphicHelper::Create( GRAPHICHELPER_MODE_READ );
+ pGraphicHelper = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Read );
xGraphicResolver = pGraphicHelper;
::comphelper::IEmbeddedHelper *pPersist = pModel->GetPersist();
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 66f2a18..cc8bb48 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -359,7 +359,7 @@ SvXMLGraphicHelper::SvXMLGraphicHelper( SvXMLGraphicHelperMode eCreateMode ) :
SvXMLGraphicHelper::SvXMLGraphicHelper()
: ::cppu::WeakComponentImplHelper2< css::document::XGraphicObjectResolver,
css::document::XBinaryStreamResolver >( maMutex )
- , meCreateMode(GRAPHICHELPER_MODE_READ)
+ , meCreateMode(SvXMLGraphicHelperMode::Read)
, mbDirect(false)
{
}
@@ -409,7 +409,7 @@ uno::Reference < embed::XStorage > SvXMLGraphicHelper::ImplGetGraphicStorage( co
{
xRetStorage = mxRootStorage->openStorageElement(
maCurStorageName = rStorageName,
- ( GRAPHICHELPER_MODE_WRITE == meCreateMode )
+ ( SvXMLGraphicHelperMode::Write == meCreateMode )
? embed::ElementModes::READWRITE
: embed::ElementModes::READ );
}
@@ -441,13 +441,13 @@ SvxGraphicHelperStream_Impl SvXMLGraphicHelper::ImplGetGraphicStream( const OUSt
if( aRet.xStorage.is() )
{
sal_Int32 nMode = embed::ElementModes::READ;
- if ( GRAPHICHELPER_MODE_WRITE == meCreateMode )
+ if ( SvXMLGraphicHelperMode::Write == meCreateMode )
{
nMode = embed::ElementModes::READWRITE;
}
aRet.xStream = aRet.xStorage->openStreamElement( rPictureStreamName, nMode );
- if( aRet.xStream.is() && ( GRAPHICHELPER_MODE_WRITE == meCreateMode ) )
+ if( aRet.xStream.is() && ( SvXMLGraphicHelperMode::Write == meCreateMode ) )
{
OUString aPropName( "UseCommonStoragePasswordEncryption" );
uno::Reference < beans::XPropertySet > xProps( aRet.xStream, uno::UNO_QUERY );
@@ -636,7 +636,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt
{
URLPair& rURLPair = maGrfURLs[ nInsertPos ];
- if( GRAPHICHELPER_MODE_READ == meCreateMode )
+ if( SvXMLGraphicHelperMode::Read == meCreateMode )
{
const GraphicObject aObj( ImplReadGraphic( aPictureStorageName, aPictureStreamName ) );
@@ -767,7 +767,7 @@ void SvXMLGraphicHelper::Init( const uno::Reference < embed::XStorage >& rXMLSto
{
mxRootStorage = rXMLStorage;
meCreateMode = eCreateMode;
- mbDirect = meCreateMode != GRAPHICHELPER_MODE_READ || bDirect;
+ mbDirect = meCreateMode != SvXMLGraphicHelperMode::Read || bDirect;
}
SvXMLGraphicHelper* SvXMLGraphicHelper::Create( const uno::Reference < embed::XStorage >& rXMLStorage,
@@ -853,7 +853,7 @@ Reference< XInputStream > SAL_CALL SvXMLGraphicHelper::getInputStream( const OUS
OUString aPictureStorageName, aGraphicId;
- if( ( GRAPHICHELPER_MODE_WRITE == meCreateMode ) &&
+ if( ( SvXMLGraphicHelperMode::Write == meCreateMode ) &&
ImplGetStreamNames( rURL, aPictureStorageName, aGraphicId ) )
{
SvXMLGraphicInputStream* pInputStream = new SvXMLGraphicInputStream( aGraphicId );
@@ -872,7 +872,7 @@ Reference< XOutputStream > SAL_CALL SvXMLGraphicHelper::createOutputStream()
{
Reference< XOutputStream > xRet;
- if( GRAPHICHELPER_MODE_READ == meCreateMode )
+ if( SvXMLGraphicHelperMode::Read == meCreateMode )
{
SvXMLGraphicOutputStream* pOutputStream = new SvXMLGraphicOutputStream;
@@ -890,7 +890,7 @@ OUString SAL_CALL SvXMLGraphicHelper::resolveOutputStream( const Reference< XOut
{
OUString aRet;
- if( ( GRAPHICHELPER_MODE_READ == meCreateMode ) && rxBinaryStream.is() )
+ if( ( SvXMLGraphicHelperMode::Read == meCreateMode ) && rxBinaryStream.is() )
{
if( ::std::find( maGrfStms.begin(), maGrfStms.end(), rxBinaryStream ) != maGrfStms.end() )
{
@@ -1042,7 +1042,7 @@ OUString SAL_CALL SvXMLGraphicImportExportHelper::resolveOutputStream( const Ref
OUString SAL_CALL SvXMLGraphicImportExportHelper::getImplementationName()
throw (uno::RuntimeException, std::exception)
{
- if( m_eGraphicHelperMode == GRAPHICHELPER_MODE_READ )
+ if( m_eGraphicHelperMode == SvXMLGraphicHelperMode::Read )
return OUString("com.sun.star.comp.Svx.GraphicImportHelper");
return OUString("com.sun.star.comp.Svx.GraphicExportHelper");
}
@@ -1073,7 +1073,7 @@ Sequence< OUString > SAL_CALL SvXMLGraphicImportExportHelper::getSupportedServic
You should call dispose after you no longer need this component.
- uses eCreateMode == GRAPHICHELPER_MODE_READ, bDirect == sal_True in
+ uses eCreateMode == SvXMLGraphicHelperMode::Read, bDirect == sal_True in
SvXMLGraphicHelper
*/
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1081,7 +1081,7 @@ com_sun_star_comp_Svx_GraphicImportHelper_get_implementation(
css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- return cppu::acquire(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_READ));
+ return cppu::acquire(new SvXMLGraphicImportExportHelper(SvXMLGraphicHelperMode::Read));
}
/** Create this with createInstanceWithArguments. service name
@@ -1093,7 +1093,7 @@ com_sun_star_comp_Svx_GraphicImportHelper_get_implementation(
To write the Pictures stream, you have to call dispose at this component.
Make sure you call dispose before you commit the parent storage.
- uses eCreateMode == GRAPHICHELPER_MODE_WRITE, bDirect == sal_True in
+ uses eCreateMode == SvXMLGraphicHelperMode::Write, bDirect == sal_True in
SvXMLGraphicHelper
*/
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1101,7 +1101,7 @@ com_sun_star_comp_Svx_GraphicExportHelper_get_implementation(
css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- return cppu::acquire(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_WRITE));
+ return cppu::acquire(new SvXMLGraphicImportExportHelper(SvXMLGraphicHelperMode::Write));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx
index d5998b3..1e2192d 100644
--- a/svx/source/xml/xmlxtexp.cxx
+++ b/svx/source/xml/xmlxtexp.cxx
@@ -194,7 +194,7 @@ static void createStorageStream( uno::Reference < io::XOutputStream > *xOut,
xStream = xSubStorage->openStreamElement(
"Content.xml",
embed::ElementModes::WRITE );
- *ppGraphicHelper = SvXMLGraphicHelper::Create( xSubStorage, GRAPHICHELPER_MODE_WRITE );
+ *ppGraphicHelper = SvXMLGraphicHelper::Create( xSubStorage, SvXMLGraphicHelperMode::Write );
initializeStreamMetadata( xStream );
*xOut = xStream->getOutputStream();
}
diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx
index e2c35de..874d37c3 100644
--- a/svx/source/xml/xmlxtimp.cxx
+++ b/svx/source/xml/xmlxtimp.cxx
@@ -349,7 +349,7 @@ static void openStorageStream( xml::sax::InputSource *pParserInput,
return;
}
pParserInput->aInputStream = xIStm->getInputStream();
- *ppGraphicHelper = SvXMLGraphicHelper::Create( xStorage, GRAPHICHELPER_MODE_READ );
+ *ppGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Read );
}
bool SvxXMLXTableImport::load( const OUString &rPath, const OUString &rReferer,
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index aa13477..b13cc9b 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -520,7 +520,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c
return ERR_SWG_READ_ERROR;
pGraphicHelper = SvXMLGraphicHelper::Create( xStorage,
- GRAPHICHELPER_MODE_READ,
+ SvXMLGraphicHelperMode::Read,
false );
xGraphicResolver = pGraphicHelper;
SfxObjectShell *pPersist = rDoc.GetPersist();
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index d628802..97a1141 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -87,7 +87,7 @@ sal_uInt32 SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >&
OSL_ENSURE( xStg.is(), "Where is my storage?" );
pGraphicHelper = SvXMLGraphicHelper::Create( xStg,
- GRAPHICHELPER_MODE_WRITE,
+ SvXMLGraphicHelperMode::Write,
false );
xGraphicResolver = pGraphicHelper;
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index e631a98..2a6d460 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -249,7 +249,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
SvXMLGraphicHelper *pGraphicResolver = nullptr;
if( !GetGraphicResolver().is() )
{
- pGraphicResolver = SvXMLGraphicHelper::Create( GRAPHICHELPER_MODE_WRITE );
+ pGraphicResolver = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Write );
Reference< XGraphicObjectResolver > xGraphicResolver( pGraphicResolver );
SetGraphicResolver( xGraphicResolver );
}
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index c2b9474..1d5f5fb 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -688,7 +688,7 @@ void SwXMLImport::startDocument()
if( !GetGraphicResolver().is() )
{
- m_pGraphicResolver = SvXMLGraphicHelper::Create( GRAPHICHELPER_MODE_READ );
+ m_pGraphicResolver = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Read );
Reference< document::XGraphicObjectResolver > xGraphicResolver( m_pGraphicResolver );
SetGraphicResolver( xGraphicResolver );
}
commit 36d02d78061889ac20f9484672100e92cf1cc0c1
Author: Noel Grandin <noel at peralex.com>
Date: Tue Aug 16 16:20:48 2016 +0200
convert XPolyFlags to scoped enum
Change-Id: Ic2a6fad90a0f8c8516469db240ec9910824c1286
diff --git a/include/svx/xpoly.hxx b/include/svx/xpoly.hxx
index 9400ce5..2a5cba5 100644
--- a/include/svx/xpoly.hxx
+++ b/include/svx/xpoly.hxx
@@ -37,12 +37,12 @@ class OutputDevice;
// point-styles in XPolygon:
-// NORMAL : start-/endpoint of a curve or a line
-// SMOOTH : smooth transition between curves
-// SYMMTR : smooth and symmetrical transition between curves
-// CONTROL: control handles of a Bezier curve
+// Normal : start-/endpoint of a curve or a line
+// Smooth : smooth transition between curves
+// Control: control handles of a Bezier curve
+// Symmetric : smooth and symmetrical transition between curves
-enum XPolyFlags { XPOLY_NORMAL, XPOLY_SMOOTH, XPOLY_CONTROL, XPOLY_SYMMTR };
+enum class XPolyFlags { Normal, Smooth, Control, Symmetric };
// Class XPolygon;has a point-array and a flag-array, which contains information about a particular point
diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx
index 5661a46..0d96e60 100644
--- a/sd/source/ui/func/fucon3d.cxx
+++ b/sd/source/ui/func/fucon3d.cxx
@@ -128,14 +128,14 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
XPolygon aXPoly(Point (0, 1250), 2500, 2500, 0, 900, false);
aXPoly.Scale(5.0, 5.0);
- aXPoly.Insert(0, Point (2400*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (2000*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (1500*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (1000*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (500*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (250*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (50*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (0*5, 1250*5), XPOLY_NORMAL);
+ aXPoly.Insert(0, Point (2400*5, 1250*5), XPolyFlags::Normal);
+ aXPoly.Insert(0, Point (2000*5, 1250*5), XPolyFlags::Normal);
+ aXPoly.Insert(0, Point (1500*5, 1250*5), XPolyFlags::Normal);
+ aXPoly.Insert(0, Point (1000*5, 1250*5), XPolyFlags::Normal);
+ aXPoly.Insert(0, Point (500*5, 1250*5), XPolyFlags::Normal);
+ aXPoly.Insert(0, Point (250*5, 1250*5), XPolyFlags::Normal);
+ aXPoly.Insert(0, Point (50*5, 1250*5), XPolyFlags::Normal);
+ aXPoly.Insert(0, Point (0*5, 1250*5), XPolyFlags::Normal);
::basegfx::B2DPolygon aB2DPolygon(aXPoly.getB2DPolygon());
if(aB2DPolygon.areControlPointsUsed())
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index a1f15f6..f71180c 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -628,7 +628,7 @@ SdrEscapeDirection SdrEdgeObj::ImpCalcEscAngle(SdrObject* pObj, const Point& rPt
XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, const Rectangle& rRect, const Point& rMeeting)
{
XPolygon aXP;
- aXP.Insert(XPOLY_APPEND,rStPt,XPOLY_NORMAL);
+ aXP.Insert(XPOLY_APPEND,rStPt,XPolyFlags::Normal);
bool bRts=nEscAngle==0;
bool bObn=nEscAngle==9000;
bool bLks=nEscAngle==18000;
@@ -645,7 +645,7 @@ XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, cons
if (bRts && rMeeting.X()>=aP2.X()) aP2.X()=rMeeting.X();
if (bObn && rMeeting.Y()<=aP2.Y()) aP2.Y()=rMeeting.Y();
if (bUnt && rMeeting.Y()>=aP2.Y()) aP2.Y()=rMeeting.Y();
- aXP.Insert(XPOLY_APPEND,aP2,XPOLY_NORMAL);
+ aXP.Insert(XPOLY_APPEND,aP2,XPolyFlags::Normal);
Point aP3(aP2);
if ((bLks && rMeeting.X()>aP2.X()) || (bRts && rMeeting.X()<aP2.X())) { // around
@@ -656,10 +656,10 @@ XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, cons
aP3.Y()=rRect.Bottom();
if (rMeeting.Y()>aP3.Y()) aP3.Y()=rMeeting.Y();
}
- aXP.Insert(XPOLY_APPEND,aP3,XPOLY_NORMAL);
+ aXP.Insert(XPOLY_APPEND,aP3,XPolyFlags::Normal);
if (aP3.Y()!=rMeeting.Y()) {
aP3.X()=rMeeting.X();
- aXP.Insert(XPOLY_APPEND,aP3,XPOLY_NORMAL);
+ aXP.Insert(XPOLY_APPEND,aP3,XPolyFlags::Normal);
}
}
if ((bObn && rMeeting.Y()>aP2.Y()) || (bUnt && rMeeting.Y()<aP2.Y())) { // around
@@ -670,10 +670,10 @@ XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, cons
aP3.X()=rRect.Right();
if (rMeeting.X()>aP3.X()) aP3.X()=rMeeting.X();
}
- aXP.Insert(XPOLY_APPEND,aP3,XPOLY_NORMAL);
+ aXP.Insert(XPOLY_APPEND,aP3,XPolyFlags::Normal);
if (aP3.X()!=rMeeting.X()) {
aP3.Y()=rMeeting.Y();
- aXP.Insert(XPOLY_APPEND,aP3,XPOLY_NORMAL);
+ aXP.Insert(XPOLY_APPEND,aP3,XPolyFlags::Normal);
}
}
#ifdef DBG_UTIL
@@ -1227,7 +1227,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
nXP2Anz--; aXP2.Remove(nXP2Anz,1);
}
if (bInsMeetingPoint) {
- aXP1.Insert(XPOLY_APPEND,aMeeting,XPOLY_NORMAL);
+ aXP1.Insert(XPOLY_APPEND,aMeeting,XPolyFlags::Normal);
if (bInfo) {
// Inserting a MeetingPoint adds 2 new lines,
// either might become the center line.
@@ -1252,7 +1252,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
if (aXP1[nXP1Anz-1]==aXP2[nXP2Anz-1] && nXP1Anz>1 && nXP2Anz>1) nNum--;
while (nNum>0) {
nNum--;
- aXP1.Insert(XPOLY_APPEND,aXP2[nNum],XPOLY_NORMAL);
+ aXP1.Insert(XPOLY_APPEND,aXP2[nNum],XPolyFlags::Normal);
}
sal_uInt16 nPointCount=aXP1.GetPointCount();
char cForm;
@@ -1458,9 +1458,9 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
long dx2=pPt3->X()-pPt4->X();
long dy2=pPt3->Y()-pPt4->Y();
if (cForm=='L') { // nPointCount==3
- aXP1.SetFlags(1,XPOLY_CONTROL);
+ aXP1.SetFlags(1,XPolyFlags::Control);
Point aPt3(*pPt2);
- aXP1.Insert(2,aPt3,XPOLY_CONTROL);
+ aXP1.Insert(2,aPt3,XPolyFlags::Control);
nPointCount=aXP1.GetPointCount();
pPt2=&aXP1[1];
pPt3=&aXP1[nPointCount-2];
@@ -1471,8 +1471,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
} else if (nPointCount>=4 && nPointCount<=6) { // Z or U or ...
// To all others, the end points of the original lines become control
// points for now. Thus, we need to do some more work for nPointCount>4!
- aXP1.SetFlags(1,XPOLY_CONTROL);
- aXP1.SetFlags(nPointCount-2,XPOLY_CONTROL);
+ aXP1.SetFlags(1,XPolyFlags::Control);
+ aXP1.SetFlags(nPointCount-2,XPolyFlags::Control);
// distance x1.5
pPt2->X()+=dx1/2;
pPt2->Y()+=dy1/2;
@@ -1485,9 +1485,9 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
long dy1b=aCenter.Y()-aXP1[1].Y();
long dx2b=aCenter.X()-aXP1[3].X();
long dy2b=aCenter.Y()-aXP1[3].Y();
- aXP1.Insert(2,aCenter,XPOLY_CONTROL);
- aXP1.SetFlags(3,XPOLY_SYMMTR);
- aXP1.Insert(4,aCenter,XPOLY_CONTROL);
+ aXP1.Insert(2,aCenter,XPolyFlags::Control);
+ aXP1.SetFlags(3,XPolyFlags::Symmetric);
+ aXP1.Insert(4,aCenter,XPolyFlags::Control);
aXP1[2].X()-=dx1b/2;
aXP1[2].Y()-=dy1b/2;
aXP1[3].X()-=(dx1b+dx2b)/4;
@@ -1498,13 +1498,13 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
if (nPointCount==6) {
Point aPt1b(aXP1[2]);
Point aPt2b(aXP1[3]);
- aXP1.Insert(2,aPt1b,XPOLY_CONTROL);
- aXP1.Insert(5,aPt2b,XPOLY_CONTROL);
+ aXP1.Insert(2,aPt1b,XPolyFlags::Control);
+ aXP1.Insert(5,aPt2b,XPolyFlags::Control);
long dx=aPt1b.X()-aPt2b.X();
long dy=aPt1b.Y()-aPt2b.Y();
aXP1[3].X()-=dx/2;
aXP1[3].Y()-=dy/2;
- aXP1.SetFlags(3,XPOLY_SYMMTR);
+ aXP1.SetFlags(3,XPolyFlags::Symmetric);
aXP1.Remove(4,1); // because it's identical with aXP1[3]
}
}
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index d7b1343..8029ac4 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -199,8 +199,8 @@ ImpSdrPathDragData::ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl
bIsPrevControl=aTmpXP.IsControl(nPrevPnt);
bIsNextControl=!bIsPrevControl;
} else {
- bPrevIsControl=!bBegPnt && !bPrevIsBegPnt && aTmpXP.GetFlags(nPrevPnt)==XPOLY_CONTROL;
- bNextIsControl=!bEndPnt && !bNextIsEndPnt && aTmpXP.GetFlags(nNextPnt)==XPOLY_CONTROL;
+ bPrevIsControl=!bBegPnt && !bPrevIsBegPnt && aTmpXP.GetFlags(nPrevPnt)==XPolyFlags::Control;
+ bNextIsControl=!bEndPnt && !bNextIsEndPnt && aTmpXP.GetFlags(nNextPnt)==XPolyFlags::Control;
}
nPrevPrevPnt0=nPrevPrevPnt;
nPrevPnt0 =nPrevPnt;
@@ -303,9 +303,9 @@ void ImpPathCreateUser::CalcBezier(const Point& rP1, const Point& rP2, const Poi
XPolygon ImpPathCreateUser::GetBezierPoly() const
{
XPolygon aXP(4);
- aXP[0]=aBezStart; aXP.SetFlags(0,XPOLY_SMOOTH);
- aXP[1]=aBezCtrl1; aXP.SetFlags(1,XPOLY_CONTROL);
- aXP[2]=aBezCtrl2; aXP.SetFlags(2,XPOLY_CONTROL);
+ aXP[0]=aBezStart; aXP.SetFlags(0,XPolyFlags::Smooth);
+ aXP[1]=aBezCtrl1; aXP.SetFlags(1,XPolyFlags::Control);
+ aXP[2]=aBezCtrl2; aXP.SetFlags(2,XPolyFlags::Control);
aXP[3]=aBezEnd;
return aXP;
}
@@ -362,7 +362,7 @@ XPolygon ImpPathCreateUser::GetCirclePoly() const
if (nCircRelAngle>=0) {
XPolygon aXP(aCircCenter,nCircRadius,nCircRadius,
sal_uInt16((nCircStAngle+5)/10),sal_uInt16((nCircStAngle+nCircRelAngle+5)/10),false);
- aXP[0]=aCircStart; aXP.SetFlags(0,XPOLY_SMOOTH);
+ aXP[0]=aCircStart; aXP.SetFlags(0,XPolyFlags::Smooth);
if (!bAngleSnap) aXP[aXP.GetPointCount()-1]=aCircEnd;
return aXP;
} else {
@@ -376,7 +376,7 @@ XPolygon ImpPathCreateUser::GetCirclePoly() const
aXP[nNum]=aXP[n2];
aXP[n2]=aPt;
}
- aXP[0]=aCircStart; aXP.SetFlags(0,XPOLY_SMOOTH);
+ aXP[0]=aCircStart; aXP.SetFlags(0,XPolyFlags::Smooth);
if (!bAngleSnap) aXP[aXP.GetPointCount()-1]=aCircEnd;
return aXP;
}
@@ -430,7 +430,7 @@ void ImpPathCreateUser::CalcLine(const Point& rP1, const Point& rP2, const Point
XPolygon ImpPathCreateUser::GetLinePoly() const
{
XPolygon aXP(2);
- aXP[0]=aLineStart; if (!bLine90) aXP.SetFlags(0,XPOLY_SMOOTH);
+ aXP[0]=aLineStart; if (!bLine90) aXP.SetFlags(0,XPolyFlags::Smooth);
aXP[1]=aLineEnd;
return aXP;
}
@@ -490,7 +490,7 @@ void ImpPathCreateUser::CalcRect(const Point& rP1, const Point& rP2, const Point
XPolygon ImpPathCreateUser::GetRectPoly() const
{
XPolygon aXP(3);
- aXP[0]=aRectP1; aXP.SetFlags(0,XPOLY_SMOOTH);
+ aXP[0]=aRectP1; aXP.SetFlags(0,XPolyFlags::Smooth);
aXP[1]=aRectP2;
if (aRectP3!=aRectP2) aXP[2]=aRectP3;
return aXP;
@@ -1196,8 +1196,8 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::getSpecialDragPoly(const SdrDra
aLine2[0]=mpSdrPathDragData->aXP[nNextNextPnt];
aLine2[1]=mpSdrPathDragData->aXP[nNextPnt];
if (mpSdrPathDragData->aXP.IsSmooth(nPrevPnt) && !bPrevIsBegPnt && mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt)) {
- aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPOLY_CONTROL);
- aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPOLY_NORMAL);
+ aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPolyFlags::Control);
+ aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPolyFlags::Normal);
// leverage lines for the opposing curve segment
aLine3[0]=mpSdrPathDragData->aXP[nPrevPnt];
aLine3[1]=mpSdrPathDragData->aXP[nPrevPrevPnt];
@@ -1211,8 +1211,8 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::getSpecialDragPoly(const SdrDra
aLine2[0]=mpSdrPathDragData->aXP[nPrevPrevPnt];
aLine2[1]=mpSdrPathDragData->aXP[nPrevPnt];
if (mpSdrPathDragData->aXP.IsSmooth(nNextPnt) && !bNextIsEndPnt && mpSdrPathDragData->aXP.IsControl(nNextNextPnt)) {
- aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPOLY_CONTROL);
- aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPOLY_NORMAL);
+ aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPolyFlags::Control);
+ aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPolyFlags::Normal);
// leverage lines for the opposing curve segment
aLine3[0]=mpSdrPathDragData->aXP[nNextPnt];
aLine3[1]=mpSdrPathDragData->aXP[nNextNextPnt];
@@ -1226,18 +1226,18 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::getSpecialDragPoly(const SdrDra
if (mpSdrPathDragData->bEliminate) {
aXPoly.Remove(2,1);
}
- if (bPrevIsControl) aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPOLY_NORMAL);
+ if (bPrevIsControl) aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPolyFlags::Normal);
else if (!bBegPnt && !bPrevIsBegPnt && mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt)) {
- aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPOLY_CONTROL);
- aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPOLY_NORMAL);
+ aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPolyFlags::Control);
+ aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPolyFlags::Normal);
} else {
aXPoly.Remove(0,1);
if (bBegPnt) aXPoly.Remove(0,1);
}
- if (bNextIsControl) aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPOLY_NORMAL);
+ if (bNextIsControl) aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPolyFlags::Normal);
else if (!bEndPnt && !bNextIsEndPnt && mpSdrPathDragData->aXP.IsControl(nNextNextPnt)) {
- aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPOLY_CONTROL);
- aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPOLY_NORMAL);
+ aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPolyFlags::Control);
+ aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPolyFlags::Normal);
} else {
aXPoly.Remove(aXPoly.GetPointCount()-1,1);
if (bEndPnt) aXPoly.Remove(aXPoly.GetPointCount()-1,1);
@@ -1357,12 +1357,12 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat)
if (nActPoint-pU->nBezierStartPoint>=3 && ((nActPoint-pU->nBezierStartPoint)%3)==0) {
rXPoly.PointsToBezier(nActPoint-3);
- rXPoly.SetFlags(nActPoint-1,XPOLY_CONTROL);
- rXPoly.SetFlags(nActPoint-2,XPOLY_CONTROL);
+ rXPoly.SetFlags(nActPoint-1,XPolyFlags::Control);
+ rXPoly.SetFlags(nActPoint-2,XPolyFlags::Control);
if (nActPoint>=6 && rXPoly.IsControl(nActPoint-4)) {
rXPoly.CalcTangent(nActPoint-3,nActPoint-4,nActPoint-2);
- rXPoly.SetFlags(nActPoint-3,XPOLY_SMOOTH);
+ rXPoly.SetFlags(nActPoint-3,XPolyFlags::Smooth);
}
}
rXPoly[nActPoint+1]=rStat.Now();
@@ -1430,12 +1430,12 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
if (pU->nBezierStartPoint>nActPoint) pU->nBezierStartPoint=nActPoint;
if (IsBezier(pU->eAktKind) && nActPoint-pU->nBezierStartPoint>=3 && ((nActPoint-pU->nBezierStartPoint)%3)==0) {
rXPoly.PointsToBezier(nActPoint-3);
- rXPoly.SetFlags(nActPoint-1,XPOLY_CONTROL);
- rXPoly.SetFlags(nActPoint-2,XPOLY_CONTROL);
+ rXPoly.SetFlags(nActPoint-1,XPolyFlags::Control);
+ rXPoly.SetFlags(nActPoint-2,XPolyFlags::Control);
if (nActPoint>=6 && rXPoly.IsControl(nActPoint-4)) {
rXPoly.CalcTangent(nActPoint-3,nActPoint-4,nActPoint-2);
- rXPoly.SetFlags(nActPoint-3,XPOLY_SMOOTH);
+ rXPoly.SetFlags(nActPoint-3,XPolyFlags::Smooth);
}
}
} else {
@@ -2052,7 +2052,7 @@ void SdrPathObj::AddToHdlList(SdrHdlList& rHdlList) const
if (bClosed && nPntCnt>1) nPntCnt--;
for (sal_uInt16 j=0; j<nPntCnt; j++) {
- if (rXPoly.GetFlags(j)!=XPOLY_CONTROL) {
+ if (rXPoly.GetFlags(j)!=XPolyFlags::Control) {
const Point& rPnt=rXPoly[j];
SdrHdl* pHdl=new SdrHdl(rPnt,HDL_POLY);
pHdl->SetPolyNum(i);
@@ -2083,12 +2083,12 @@ sal_uInt32 SdrPathObj::GetPlusHdlCount(const SdrHdl& rHdl) const
nPntMax--;
if (nPnt<=nPntMax)
{
- if (rXPoly.GetFlags(nPnt)!=XPOLY_CONTROL)
+ if (rXPoly.GetFlags(nPnt)!=XPolyFlags::Control)
{
if (nPnt==0 && IsClosed()) nPnt=nPntMax;
- if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPOLY_CONTROL) nCnt++;
+ if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPolyFlags::Control) nCnt++;
if (nPnt==nPntMax && IsClosed()) nPnt=0;
- if (nPnt<nPntMax && rXPoly.GetFlags(nPnt+1)==XPOLY_CONTROL) nCnt++;
+ if (nPnt<nPntMax && rXPoly.GetFlags(nPnt+1)==XPolyFlags::Control) nCnt++;
}
}
}
@@ -2119,7 +2119,7 @@ SdrHdl* SdrPathObj::GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlusNum) const
pHdl->SetPolyNum(rHdl.GetPolyNum());
if (nPnt==0 && IsClosed()) nPnt=nPntMax;
- if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPOLY_CONTROL && nPlusNum==0)
+ if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPolyFlags::Control && nPlusNum==0)
{
pHdl->SetPos(rXPoly[nPnt-1]);
pHdl->SetPointNum(nPnt-1);
@@ -2127,7 +2127,7 @@ SdrHdl* SdrPathObj::GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlusNum) const
else
{
if (nPnt==nPntMax && IsClosed()) nPnt=0;
- if (nPnt<rXPoly.GetPointCount()-1 && rXPoly.GetFlags(nPnt+1)==XPOLY_CONTROL)
+ if (nPnt<rXPoly.GetPointCount()-1 && rXPoly.GetFlags(nPnt+1)==XPolyFlags::Control)
{
pHdl->SetPos(rXPoly[nPnt+1]);
pHdl->SetPointNum(nPnt+1);
diff --git a/svx/source/xoutdev/_xpoly.cxx b/svx/source/xoutdev/_xpoly.cxx
index 8c3bce5..a51233d 100644
--- a/svx/source/xoutdev/_xpoly.cxx
+++ b/svx/source/xoutdev/_xpoly.cxx
@@ -270,8 +270,8 @@ XPolygon::XPolygon(const Rectangle& rRect, long nRx, long nRy)
break;
}
GenBezArc(aCenter, nRx, nRy, nXHdl, nYHdl, 0, 900, nQuad, nPos);
- pImpXPolygon->pFlagAry[nPos ] = (sal_uInt8) XPOLY_SMOOTH;
- pImpXPolygon->pFlagAry[nPos+3] = (sal_uInt8) XPOLY_SMOOTH;
+ pImpXPolygon->pFlagAry[nPos ] = (sal_uInt8) XPolyFlags::Smooth;
+ pImpXPolygon->pFlagAry[nPos+3] = (sal_uInt8) XPolyFlags::Smooth;
nPos += 4;
}
}
@@ -310,7 +310,7 @@ XPolygon::XPolygon(const Point& rCenter, long nRx, long nRy,
GenBezArc(rCenter, nRx, nRy, nXHdl, nYHdl, nA1, nA2, nQuad, nPos);
nPos += 3;
if ( !bLoopEnd )
- pImpXPolygon->pFlagAry[nPos] = (sal_uInt8) XPOLY_SMOOTH;
+ pImpXPolygon->pFlagAry[nPos] = (sal_uInt8) XPolyFlags::Smooth;
} while ( !bLoopEnd );
@@ -320,8 +320,8 @@ XPolygon::XPolygon(const Point& rCenter, long nRx, long nRy,
if ( bFull )
{
- pImpXPolygon->pFlagAry[0 ] = (sal_uInt8) XPOLY_SMOOTH;
- pImpXPolygon->pFlagAry[nPos] = (sal_uInt8) XPOLY_SMOOTH;
+ pImpXPolygon->pFlagAry[0 ] = (sal_uInt8) XPolyFlags::Smooth;
+ pImpXPolygon->pFlagAry[nPos] = (sal_uInt8) XPolyFlags::Smooth;
}
pImpXPolygon->nPoints = nPos + 1;
}
@@ -476,14 +476,14 @@ void XPolygon::SetFlags( sal_uInt16 nPos, XPolyFlags eFlags )
/// short path to read the CONTROL flag directly (TODO: better explain what the sense behind this flag is!)
bool XPolygon::IsControl(sal_uInt16 nPos) const
{
- return ( (XPolyFlags) pImpXPolygon->pFlagAry[nPos] == XPOLY_CONTROL );
+ return ( (XPolyFlags) pImpXPolygon->pFlagAry[nPos] == XPolyFlags::Control );
}
/// short path to read the SMOOTH and SYMMTR flag directly (TODO: better explain what the sense behind these flags is!)
bool XPolygon::IsSmooth(sal_uInt16 nPos) const
{
XPolyFlags eFlag = (XPolyFlags) pImpXPolygon->pFlagAry[nPos];
- return ( eFlag == XPOLY_SMOOTH || eFlag == XPOLY_SYMMTR );
+ return ( eFlag == XPolyFlags::Smooth || eFlag == XPolyFlags::Symmetric );
}
/** calculate the euclidean distance between two points
@@ -587,8 +587,8 @@ void XPolygon::GenBezArc(const Point& rCenter, long nRx, long nRy,
SubdivideBezier(nFirst, false, (double)nStart / 900);
if ( nEnd < 900 )
SubdivideBezier(nFirst, true, (double)(nEnd-nStart) / (900-nStart));
- SetFlags(nFirst+1, XPOLY_CONTROL);
- SetFlags(nFirst+2, XPOLY_CONTROL);
+ SetFlags(nFirst+1, XPolyFlags::Control);
+ SetFlags(nFirst+2, XPolyFlags::Control);
}
bool XPolygon::CheckAngles(sal_uInt16& nStart, sal_uInt16 nEnd, sal_uInt16& nA1, sal_uInt16& nA2)
@@ -637,7 +637,7 @@ void XPolygon::CalcSmoothJoin(sal_uInt16 nCenter, sal_uInt16 nDrag, sal_uInt16 n
{
double fRatio = CalcDistance(nCenter, nPnt) / fDiv;
// keep the length if SMOOTH
- if ( GetFlags(nCenter) == XPOLY_SMOOTH || !IsControl(nDrag) )
+ if ( GetFlags(nCenter) == XPolyFlags::Smooth || !IsControl(nDrag) )
{
aDiff.X() = (long) (fRatio * aDiff.X());
aDiff.Y() = (long) (fRatio * aDiff.Y());
@@ -666,7 +666,7 @@ void XPolygon::CalcTangent(sal_uInt16 nCenter, sal_uInt16 nPrev, sal_uInt16 nNex
double fPrevLen = CalcDistance(nCenter, nPrev) / fAbsLen;
// same length for both sides if SYMMTR
- if ( GetFlags(nCenter) == XPOLY_SYMMTR )
+ if ( GetFlags(nCenter) == XPolyFlags::Symmetric )
{
fPrevLen = (fNextLen + fPrevLen) / 2;
fNextLen = fPrevLen;
@@ -741,8 +741,8 @@ void XPolygon::PointsToBezier(sal_uInt16 nFirst)
pPoints[nFirst+1] = Point((long) fX1, (long) fY1);
pPoints[nFirst+2] = Point((long) fX2, (long) fY2);
- SetFlags(nFirst+1, XPOLY_CONTROL);
- SetFlags(nFirst+2, XPOLY_CONTROL);
+ SetFlags(nFirst+1, XPolyFlags::Control);
+ SetFlags(nFirst+2, XPolyFlags::Control);
}
/// scale in X- and/or Y-direction
commit 48cb92cb1671bfdef3fcf43978455f19b26ca7bd
Author: Noel Grandin <noel at peralex.com>
Date: Tue Aug 16 15:51:26 2016 +0200
convert XPropertyListType to scoped enum
Change-Id: I071c0d17c7c5982af47bccd92580bbac62bdf7b3
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 634f2f7..912d338 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -75,7 +75,7 @@ struct SvxColorTabPageShadow
SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs)
: SfxTabPage(pParent, "ColorPage", "cui/ui/colorpage.ui", &rInAttrs)
- , meType( XCOLOR_LIST )
+ , meType( XPropertyListType::Color )
, mpTopDlg( GetParentDialog() )
, pShadow ( new SvxColorTabPageShadow() )
, rOutAttrs ( rInAttrs )
@@ -883,13 +883,13 @@ void SvxColorTabPage::SaveToViewFrame( SfxViewFrame *pViewFrame )
void SvxColorTabPage::SetPropertyList( XPropertyListType t, const XPropertyListRef &xRef )
{
(void) t;
- OSL_ASSERT( t == XCOLOR_LIST );
+ OSL_ASSERT( t == XPropertyListType::Color );
pColorList = XColorListRef( static_cast<XColorList *>(xRef.get() ) );
}
void SvxColorTabPage::SetColorList( const XColorListRef& pColList )
{
- SetPropertyList( XCOLOR_LIST, XPropertyListRef( ( pColList.get() ) ) );
+ SetPropertyList( XPropertyListType::Color, XPropertyListRef( ( pColList.get() ) ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 701a43f..b4282df 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -752,7 +752,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ClickLoadHdl_Impl, Button*, void)
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
- XDashListRef pDshLst = XPropertyList::AsDashList(XPropertyList::CreatePropertyList( XDASH_LIST, aPathURL.GetMainURL( INetURLObject::NO_DECODE ), "" ));
+ XDashListRef pDshLst = XPropertyList::AsDashList(XPropertyList::CreatePropertyList( XPropertyListType::Dash, aPathURL.GetMainURL( INetURLObject::NO_DECODE ), "" ));
pDshLst->SetName( aURL.getName() );
if( pDshLst->Load() )
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 8bbe494..c17b18f 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -572,7 +572,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void)
XLineEndListRef pLeList = XPropertyList::AsLineEndList(
XPropertyList::CreatePropertyList(
- XLINE_END_LIST,
+ XPropertyListType::LineEnd,
aPathURL.GetMainURL(INetURLObject::NO_DECODE), ""));
pLeList->SetName( aURL.getName() );
if( pLeList->Load() )
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 3d1c753..ac1f82f 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -33,6 +33,7 @@
#include <tools/fract.hxx>
#include <svl/hint.hxx>
#include <o3tl/typed_flags_set.hxx>
+#include <o3tl/enumarray.hxx>
#include <svl/style.hxx>
#include <svx/xtable.hxx>
@@ -214,7 +215,7 @@ public:
bool mbInDestruction;
// Color, Dash, Line-End, Hatch, Gradient, Bitmap property lists ...
- XPropertyListRef maProperties[XPROPERTY_LIST_COUNT];
+ o3tl::enumarray<XPropertyListType, XPropertyListRef> maProperties;
// New src638: NumberFormatter for drawing layer and
// method for getting it. It is constructed on demand
@@ -505,13 +506,13 @@ public:
void SetPropertyList( XPropertyListRef const & p ) { maProperties[ p->Type() ] = p; }
// friendlier helpers
- XDashListRef GetDashList() const { return XPropertyList::AsDashList(GetPropertyList( XDASH_LIST )); }
- XHatchListRef GetHatchList() const { return XPropertyList::AsHatchList(GetPropertyList( XHATCH_LIST )); }
- XColorListRef GetColorList() const { return XPropertyList::AsColorList(GetPropertyList( XCOLOR_LIST )); }
- XBitmapListRef GetBitmapList() const { return XPropertyList::AsBitmapList(GetPropertyList( XBITMAP_LIST )); }
- XPatternListRef GetPatternList() const { return XPropertyList::AsPatternList(GetPropertyList( XPATTERN_LIST )); }
- XLineEndListRef GetLineEndList() const { return XPropertyList::AsLineEndList(GetPropertyList( XLINE_END_LIST )); }
- XGradientListRef GetGradientList() const { return XPropertyList::AsGradientList(GetPropertyList( XGRADIENT_LIST )); }
+ XDashListRef GetDashList() const { return XPropertyList::AsDashList(GetPropertyList( XPropertyListType::Dash )); }
+ XHatchListRef GetHatchList() const { return XPropertyList::AsHatchList(GetPropertyList( XPropertyListType::Hatch )); }
+ XColorListRef GetColorList() const { return XPropertyList::AsColorList(GetPropertyList( XPropertyListType::Color )); }
+ XBitmapListRef GetBitmapList() const { return XPropertyList::AsBitmapList(GetPropertyList( XPropertyListType::Bitmap )); }
+ XPatternListRef GetPatternList() const { return XPropertyList::AsPatternList(GetPropertyList( XPropertyListType::Pattern )); }
+ XLineEndListRef GetLineEndList() const { return XPropertyList::AsLineEndList(GetPropertyList( XPropertyListType::LineEnd )); }
+ XGradientListRef GetGradientList() const { return XPropertyList::AsGradientList(GetPropertyList( XPropertyListType::Gradient )); }
// The DrawingEngine only references the StyleSheetPool, whoever
// made it needs to delete it.
diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx
index 0216271..1847453 100644
--- a/include/svx/xtable.hxx
+++ b/include/svx/xtable.hxx
@@ -144,16 +144,16 @@ public:
}
};
-enum XPropertyListType {
- UNKNOWN_XPROPERTYLISTTYPE = -1,
- XCOLOR_LIST,
- XLINE_END_LIST,
- XDASH_LIST,
- XHATCH_LIST,
- XGRADIENT_LIST,
- XBITMAP_LIST,
- XPATTERN_LIST,
- XPROPERTY_LIST_COUNT
+enum class XPropertyListType {
+ Unknown = -1,
+ Color,
+ LineEnd,
+ Dash,
+ Hatch,
+ Gradient,
+ Bitmap,
+ Pattern,
+ LAST
};
typedef rtl::Reference< class XPropertyList > XPropertyListRef;
@@ -265,7 +265,7 @@ protected:
public:
XColorList(const OUString& rPath, const OUString& rReferer)
- : XPropertyList(XCOLOR_LIST, rPath, rReferer) {}
+ : XPropertyList(XPropertyListType::Color, rPath, rReferer) {}
void Replace(long nIndex, std::unique_ptr<XColorEntry> pEntry);
XColorEntry* GetColor(long nIndex) const;
@@ -371,7 +371,7 @@ protected:
public:
XBitmapList(const OUString& rPath, const OUString& rReferer)
- : XPropertyList(XBITMAP_LIST, rPath, rReferer) {}
+ : XPropertyList(XPropertyListType::Bitmap, rPath, rReferer) {}
XBitmapEntry* GetBitmap(long nIndex) const;
Bitmap GetBitmapForPreview(long nIndex, const Size& rSize);
@@ -390,7 +390,7 @@ protected:
public:
XPatternList(const OUString& rPath, const OUString& rReferer)
- : XPropertyList(XPATTERN_LIST, rPath, rReferer) {}
+ : XPropertyList(XPropertyListType::Pattern, rPath, rReferer) {}
XBitmapEntry* GetBitmap(long nIndex) const;
Bitmap GetBitmapForPreview(long nIndex, const Size& rSize);
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index ec108a3..b34cdb1 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -268,12 +268,12 @@ static struct {
const char *pName;
XPropertyListType t;
} aURLPropertyNames[] = {
- { "ColorTableURL", XCOLOR_LIST },
- { "DashTableURL", XDASH_LIST },
- { "LineEndTableURL", XLINE_END_LIST },
- { "HatchTableURL", XHATCH_LIST },
- { "GradientTableURL", XGRADIENT_LIST },
- { "BitmapTableURL", XBITMAP_LIST }
+ { "ColorTableURL", XPropertyListType::Color },
+ { "DashTableURL", XPropertyListType::Dash },
+ { "LineEndTableURL", XPropertyListType::LineEnd },
+ { "HatchTableURL", XPropertyListType::Hatch },
+ { "GradientTableURL", XPropertyListType::Gradient },
+ { "BitmapTableURL", XPropertyListType::Bitmap }
};
static XPropertyListType getTypeOfName( const OUString &aName )
@@ -282,7 +282,7 @@ static XPropertyListType getTypeOfName( const OUString &aName )
if( aName.equalsAscii( rURLPropertyName.pName ) )
return rURLPropertyName.t;
}
- return UNKNOWN_XPROPERTYLISTTYPE;
+ return XPropertyListType::Unknown;
}
static OUString getNameOfType( XPropertyListType t )
@@ -307,7 +307,7 @@ uno::Sequence<beans::PropertyValue>
for( sal_Int32 i = 0; i < aConfigProps.getLength(); i++ )
{
XPropertyListType t = getTypeOfName( aConfigProps[i].Name );
- if (t == UNKNOWN_XPROPERTYLISTTYPE)
+ if (t == XPropertyListType::Unknown)
aRet[nRet++] = aConfigProps[i];
else
{
@@ -351,7 +351,7 @@ uno::Sequence<beans::PropertyValue>
{
XPropertyListType t = getTypeOfName( aConfigProps[i].Name );
aRet[i] = aConfigProps[i];
- if (t >= 0) {
+ if (t != XPropertyListType::Unknown) {
XPropertyListRef pList = pDoc->GetPropertyList( t );
if( !pList.is() || !pList->IsEmbedInDocument() )
continue; // no change ...
@@ -434,27 +434,27 @@ throw (UnknownPropertyException, PropertyVetoException,
switch( (*ppEntries)->mnHandle )
{
case HANDLE_COLORTABLEURL:
- AssignURL( XCOLOR_LIST, pValues, &bOk, &bChanged );
+ AssignURL( XPropertyListType::Color, pValues, &bOk, &bChanged );
break;
case HANDLE_DASHTABLEURL:
- AssignURL( XDASH_LIST, pValues, &bOk, &bChanged );
+ AssignURL( XPropertyListType::Dash, pValues, &bOk, &bChanged );
break;
case HANDLE_LINEENDTABLEURL:
- AssignURL( XLINE_END_LIST, pValues, &bOk, &bChanged );
+ AssignURL( XPropertyListType::LineEnd, pValues, &bOk, &bChanged );
break;
case HANDLE_HATCHTABLEURL:
- AssignURL( XHATCH_LIST, pValues, &bOk, &bChanged );
+ AssignURL( XPropertyListType::Hatch, pValues, &bOk, &bChanged );
break;
case HANDLE_GRADIENTTABLEURL:
- AssignURL( XGRADIENT_LIST, pValues, &bOk, &bChanged );
+ AssignURL( XPropertyListType::Gradient, pValues, &bOk, &bChanged );
break;
case HANDLE_BITMAPTABLEURL:
- AssignURL( XBITMAP_LIST, pValues, &bOk, &bChanged );
+ AssignURL( XPropertyListType::Bitmap, pValues, &bOk, &bChanged );
break;
case HANDLE_FORBIDDENCHARS:
@@ -1012,22 +1012,22 @@ throw (UnknownPropertyException, WrappedTargetException, RuntimeException, std::
switch( (*ppEntries)->mnHandle )
{
case HANDLE_COLORTABLEURL:
- ExtractURL( XCOLOR_LIST, pValue );
+ ExtractURL( XPropertyListType::Color, pValue );
break;
case HANDLE_DASHTABLEURL:
- ExtractURL( XDASH_LIST, pValue );
+ ExtractURL( XPropertyListType::Dash, pValue );
break;
case HANDLE_LINEENDTABLEURL:
- ExtractURL( XLINE_END_LIST, pValue );
+ ExtractURL( XPropertyListType::LineEnd, pValue );
break;
case HANDLE_HATCHTABLEURL:
- ExtractURL( XHATCH_LIST, pValue );
+ ExtractURL( XPropertyListType::Hatch, pValue );
break;
case HANDLE_GRADIENTTABLEURL:
- ExtractURL( XGRADIENT_LIST, pValue );
+ ExtractURL( XPropertyListType::Gradient, pValue );
break;
case HANDLE_BITMAPTABLEURL:
- ExtractURL( XBITMAP_LIST, pValue );
+ ExtractURL( XPropertyListType::Bitmap, pValue );
break;
case HANDLE_FORBIDDENCHARS:
*pValue <<= mxModel->getForbiddenCharsTable();
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 27952e4..81ee161 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -94,6 +94,7 @@
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <comphelper/lok.hxx>
#include <sfx2/viewsh.hxx>
+#include <o3tl/enumrange.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -650,11 +651,11 @@ bool SdrModel::IsUndoEnabled() const
void SdrModel::ImpCreateTables()
{
- for( int i = 0; i < XPROPERTY_LIST_COUNT; i++ )
+ for( auto i : o3tl::enumrange<XPropertyListType>() )
{
- if( !bExtColorTable || i != XCOLOR_LIST )
+ if( !bExtColorTable || i != XPropertyListType::Color )
maProperties[i] = XPropertyList::CreatePropertyList (
- (XPropertyListType) i, aTablePath, ""/*TODO?*/ );
+ i, aTablePath, ""/*TODO?*/ );
}
}
diff --git a/svx/source/tbxctrls/Palette.cxx b/svx/source/tbxctrls/Palette.cxx
index 82789e9..aecaf56 100644
--- a/svx/source/tbxctrls/Palette.cxx
+++ b/svx/source/tbxctrls/Palette.cxx
@@ -347,7 +347,7 @@ void PaletteSOC::LoadColorSet( SvxColorValueSet& rColorSet )
if( !mbLoadedPalette )
{
mbLoadedPalette = true;
- mpColorList = XPropertyList::AsColorList(XPropertyList::CreatePropertyListFromURL(XCOLOR_LIST, maFPath));
+ mpColorList = XPropertyList::AsColorList(XPropertyList::CreatePropertyListFromURL(XPropertyListType::Color, maFPath));
(void)mpColorList->Load();
}
rColorSet.Clear();
diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx
index e2dbe42..cccf167 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -189,7 +189,7 @@ void PaletteManager::SetPalette( sal_Int32 nPos )
{
pColorList = XPropertyList::AsColorList(
XPropertyList::CreatePropertyListFromURL(
- XCOLOR_LIST, GetSelectedPalettePath()));
+ XPropertyListType::Color, GetSelectedPalettePath()));
pColorList->SetName(GetPaletteName());
if(pColorList->Load())
{
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index 96f1602..9251ff3 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -499,7 +499,7 @@ void SvxFillToolBoxControl::Update()
XBitmapListRef xBitmapList =
XPropertyList::AsBitmapList(
XPropertyList::CreatePropertyList(
- XBITMAP_LIST, "TmpList", ""/*TODO?*/));
+ XPropertyListType::Bitmap, "TmpList", ""/*TODO?*/));
xBitmapList->Insert(o3tl::make_unique<XBitmapEntry>(mpBitmapItem->GetGraphicObject(), aTmpStr));
xBitmapList->SetDirty( false );
mpLbFillAttr->Fill( xBitmapList );
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 55f0108..11bb724 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -67,7 +67,7 @@ SvxUnoColorTable::SvxUnoColorTable()
{
pList = XPropertyList::AsColorList(
XPropertyList::CreatePropertyList(
- XCOLOR_LIST, SvtPathOptions().GetPalettePath(), ""));
+ XPropertyListType::Color, SvtPathOptions().GetPalettePath(), ""));
}
sal_Bool SAL_CALL SvxUnoColorTable::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException, std::exception)
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index c0884bd..8d1472d 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -1001,7 +1001,7 @@ XLineDashItem* XLineDashItem::checkForUniqueItem( SdrModel* pModel ) const
this, XATTR_LINEDASH, &pModel->GetItemPool(),
pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : nullptr,
XLineDashItem::CompareValueFunc, RID_SVXSTR_DASH11,
- pModel->GetPropertyList( XDASH_LIST ) );
+ pModel->GetPropertyList( XPropertyListType::Dash ) );
// if the given name is not valid, replace it!
if( aUniqueName != GetName() )
@@ -2741,7 +2741,7 @@ XFillGradientItem* XFillGradientItem::checkForUniqueItem( SdrModel* pModel ) con
this, Which(), &pModel->GetItemPool(),
pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : nullptr,
XFillGradientItem::CompareValueFunc, RID_SVXSTR_GRADIENT,
- pModel->GetPropertyList( XGRADIENT_LIST ) );
+ pModel->GetPropertyList( XPropertyListType::Gradient ) );
// if the given name is not valid, replace it!
if( aUniqueName != GetName() )
@@ -3148,7 +3148,7 @@ XFillHatchItem* XFillHatchItem::checkForUniqueItem( SdrModel* pModel ) const
this, XATTR_FILLHATCH, &pModel->GetItemPool(),
pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : nullptr,
XFillHatchItem::CompareValueFunc, RID_SVXSTR_HATCH10,
- pModel->GetPropertyList( XHATCH_LIST ) );
+ pModel->GetPropertyList( XPropertyListType::Hatch ) );
// if the given name is not valid, replace it!
if( aUniqueName != GetName() )
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index 31129f4..86bcf17 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -523,9 +523,9 @@ XFillBitmapItem* XFillBitmapItem::checkForUniqueItem( SdrModel* pModel ) const
{
if( pModel )
{
- XPropertyListType aListType = XBITMAP_LIST;
+ XPropertyListType aListType = XPropertyListType::Bitmap;
if(isPattern())
- aListType = XPATTERN_LIST;
+ aListType = XPropertyListType::Pattern;
const OUString aUniqueName = NameOrIndex::CheckNamedItem(
this, XATTR_FILLBITMAP, &pModel->GetItemPool(),
pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : nullptr,
diff --git a/svx/source/xoutdev/xtabcolr.cxx b/svx/source/xoutdev/xtabcolr.cxx
index 3d16c4d..374f6fc 100644
--- a/svx/source/xoutdev/xtabcolr.cxx
+++ b/svx/source/xoutdev/xtabcolr.cxx
@@ -33,7 +33,7 @@ XColorListRef XColorList::CreateStdColorList()
{
return XPropertyList::AsColorList(
XPropertyList::CreatePropertyList(
- XCOLOR_LIST, SvtPathOptions().GetPalettePath(), ""));
+ XPropertyListType::Color, SvtPathOptions().GetPalettePath(), ""));
}
XColorListRef XColorList::GetStdColorList()
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx
index 817f115..962ff65 100644
--- a/svx/source/xoutdev/xtabdash.cxx
+++ b/svx/source/xoutdev/xtabdash.cxx
@@ -37,7 +37,7 @@
using namespace com::sun::star;
XDashList::XDashList(const OUString& rPath, const OUString& rReferer)
- : XPropertyList(XDASH_LIST, rPath, rReferer)
+ : XPropertyList(XPropertyListType::Dash, rPath, rReferer)
, maBitmapSolidLine()
, maStringSolidLine()
, maStringNoLine()
diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx
index 78c3585..4a21b58 100644
--- a/svx/source/xoutdev/xtabgrdt.cxx
+++ b/svx/source/xoutdev/xtabgrdt.cxx
@@ -38,7 +38,7 @@
using namespace com::sun::star;
XGradientList::XGradientList( const OUString& rPath, const OUString& rReferer )
-: XPropertyList( XGRADIENT_LIST, rPath, rReferer )
+: XPropertyList( XPropertyListType::Gradient, rPath, rReferer )
{
}
diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx
index a5227ba..51b71de 100644
--- a/svx/source/xoutdev/xtabhtch.cxx
+++ b/svx/source/xoutdev/xtabhtch.cxx
@@ -37,7 +37,7 @@
using namespace ::com::sun::star;
XHatchList::XHatchList(const OUString& rPath, const OUString& rReferer)
- : XPropertyList( XHATCH_LIST, rPath, rReferer )
+ : XPropertyList( XPropertyListType::Hatch, rPath, rReferer )
{
}
diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx
index e8c9d82..c088d34 100644
--- a/svx/source/xoutdev/xtable.cxx
+++ b/svx/source/xoutdev/xtable.cxx
@@ -334,25 +334,25 @@ XPropertyListRef XPropertyList::CreatePropertyList( XPropertyListType aType,
XPropertyListRef pRet;
switch (aType) {
- case XCOLOR_LIST:
+ case XPropertyListType::Color:
pRet = XPropertyListRef(new XColorList(rPath, rReferer));
break;
- case XLINE_END_LIST:
+ case XPropertyListType::LineEnd:
pRet = XPropertyListRef(new XLineEndList(rPath, rReferer));
break;
- case XDASH_LIST:
+ case XPropertyListType::Dash:
pRet = XPropertyListRef(new XDashList(rPath, rReferer));
break;
- case XHATCH_LIST:
+ case XPropertyListType::Hatch:
pRet = XPropertyListRef(new XHatchList(rPath, rReferer));
break;
- case XGRADIENT_LIST:
+ case XPropertyListType::Gradient:
pRet = XPropertyListRef(new XGradientList(rPath, rReferer));
break;
- case XBITMAP_LIST:
+ case XPropertyListType::Bitmap:
pRet = XPropertyListRef(new XBitmapList(rPath, rReferer));
break;
- case XPATTERN_LIST:
+ case XPropertyListType::Pattern:
pRet = XPropertyListRef(new XPatternList(rPath, rReferer));
break;
default:
@@ -397,13 +397,13 @@ static struct {
XPropertyListType t;
const char *pExt;
} pExtnMap[] = {
- { XCOLOR_LIST, "soc" },
- { XLINE_END_LIST, "soe" },
- { XDASH_LIST, "sod" },
- { XHATCH_LIST, "soh" },
- { XGRADIENT_LIST, "sog" },
- { XBITMAP_LIST, "sob" },
- { XPATTERN_LIST, "sop"}
+ { XPropertyListType::Color, "soc" },
+ { XPropertyListType::LineEnd, "soe" },
+ { XPropertyListType::Dash, "sod" },
+ { XPropertyListType::Hatch, "soh" },
+ { XPropertyListType::Gradient, "sog" },
+ { XPropertyListType::Bitmap, "sob" },
+ { XPropertyListType::Pattern, "sop"}
};
OUString XPropertyList::GetDefaultExt( XPropertyListType t )
diff --git a/svx/source/xoutdev/xtablend.cxx b/svx/source/xoutdev/xtablend.cxx
index 988bcb8..ec94f17 100644
--- a/svx/source/xoutdev/xtablend.cxx
+++ b/svx/source/xoutdev/xtablend.cxx
@@ -37,7 +37,7 @@
using namespace com::sun::star;
XLineEndList::XLineEndList( const OUString& rPath, const OUString& rReferer )
- : XPropertyList( XLINE_END_LIST, rPath, rReferer )
+ : XPropertyList( XPropertyListType::LineEnd, rPath, rReferer )
{
}
commit 430b93f7f3c9f5aeb89db634447cb554acd125aa
Author: Noel Grandin <noel at peralex.com>
Date: Tue Aug 16 13:39:18 2016 +0200
convert SvxEscapement to scoped enum
and fix a potential bug with footnotes and superscripts in writer in
ndtxt.cxx, where it was passing bad args to the SvxEscapementItem
constructor
Change-Id: I0d2de34c056e7824f3b456a86d502e10ac93a1c1
diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx
index 9600ca6..7610e3e 100644
--- a/cui/source/inc/chardlg.hxx
+++ b/cui/source/inc/chardlg.hxx
@@ -295,7 +295,7 @@ private:
void Initialize();
void UpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc );
- void SetEscapement_Impl( sal_uInt16 nEsc );
+ void SetEscapement_Impl( SvxEscapement nEsc );
DECL_LINK_TYPED( PositionHdl_Impl, Button*, void );
DECL_LINK_TYPED( RotationHdl_Impl, Button*, void );
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 2684039..99563d6 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -2715,16 +2715,16 @@ void SvxCharPositionPage::UpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 nEscPro
}
-void SvxCharPositionPage::SetEscapement_Impl( sal_uInt16 nEsc )
+void SvxCharPositionPage::SetEscapement_Impl( SvxEscapement nEsc )
{
- SvxEscapementItem aEscItm( (SvxEscapement)nEsc, SID_ATTR_CHAR_ESCAPEMENT );
+ SvxEscapementItem aEscItm( nEsc, SID_ATTR_CHAR_ESCAPEMENT );
- if ( SVX_ESCAPEMENT_SUPERSCRIPT == nEsc )
+ if ( SvxEscapement::Superscript == nEsc )
{
aEscItm.GetEsc() = m_nSuperEsc;
aEscItm.GetProportionalHeight() = m_nSuperProp;
}
- else if ( SVX_ESCAPEMENT_SUBSCRIPT == nEsc )
+ else if ( SvxEscapement::Subscript == nEsc )
{
aEscItm.GetEsc() = m_nSubEsc;
aEscItm.GetProportionalHeight() = m_nSubProp;
@@ -2735,7 +2735,7 @@ void SvxCharPositionPage::SetEscapement_Impl( sal_uInt16 nEsc )
m_pHighLowMF->SetValue( aEscItm.GetEsc() * nFac );
m_pFontSizeMF->SetValue( aEscItm.GetProportionalHeight() );
- if ( SVX_ESCAPEMENT_OFF == nEsc )
+ if ( SvxEscapement::Off == nEsc )
{
m_pHighLowFT->Disable();
m_pHighLowMF->Disable();
@@ -2764,12 +2764,12 @@ void SvxCharPositionPage::SetEscapement_Impl( sal_uInt16 nEsc )
IMPL_LINK_TYPED( SvxCharPositionPage, PositionHdl_Impl, Button*, pBtn, void )
{
- sal_uInt16 nEsc = SVX_ESCAPEMENT_OFF; // also when pBtn == NULL
+ SvxEscapement nEsc = SvxEscapement::Off; // also when pBtn == NULL
if ( m_pHighPosBtn == pBtn )
- nEsc = SVX_ESCAPEMENT_SUPERSCRIPT;
+ nEsc = SvxEscapement::Superscript;
else if ( m_pLowPosBtn == pBtn )
- nEsc = SVX_ESCAPEMENT_SUBSCRIPT;
+ nEsc = SvxEscapement::Subscript;
SetEscapement_Impl( nEsc );
}
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index c6ab046..e76b527 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -2238,7 +2238,7 @@ SfxPoolItem* SvxEscapementItem::Create(SvStream& rStrm, sal_uInt16) const
sal_uInt16 SvxEscapementItem::GetValueCount() const
{
- return SVX_ESCAPEMENT_END; // SVX_ESCAPEMENT_SUBSCRIPT + 1
+ return (sal_uInt16)SvxEscapement::End; // SvxEscapement::Subscript + 1
}
@@ -2265,7 +2265,7 @@ bool SvxEscapementItem::GetPresentation
OUString SvxEscapementItem::GetValueTextByPos( sal_uInt16 nPos ) const
{
- DBG_ASSERT( nPos < (sal_uInt16)SVX_ESCAPEMENT_END, "enum overflow!" );
+ DBG_ASSERT( nPos < (sal_uInt16)SvxEscapement::End, "enum overflow!" );
return EE_RESSTR(RID_SVXITEMS_ESCAPEMENT_BEGIN + nPos);
}
@@ -2273,10 +2273,10 @@ OUString SvxEscapementItem::GetValueTextByPos( sal_uInt16 nPos ) const
sal_uInt16 SvxEscapementItem::GetEnumValue() const
{
if ( nEsc < 0 )
- return SVX_ESCAPEMENT_SUBSCRIPT;
+ return (sal_uInt16)SvxEscapement::Subscript;
else if ( nEsc > 0 )
- return SVX_ESCAPEMENT_SUPERSCRIPT;
- return SVX_ESCAPEMENT_OFF;
+ return (sal_uInt16)SvxEscapement::Superscript;
+ return (sal_uInt16)SvxEscapement::Off;
}
diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx
index fce2049..ededc66 100644
--- a/forms/source/richtext/rtattributehandler.cxx
+++ b/forms/source/richtext/rtattributehandler.cxx
@@ -237,12 +237,12 @@ namespace frm
EscapementHandler::EscapementHandler( AttributeId _nAttributeId )
:AttributeHandler( _nAttributeId, EE_CHAR_ESCAPEMENT )
- ,m_eEscapement( SVX_ESCAPEMENT_OFF )
+ ,m_eEscapement( SvxEscapement::Off )
{
switch ( getAttribute() )
{
- case SID_SET_SUPER_SCRIPT : m_eEscapement = SVX_ESCAPEMENT_SUPERSCRIPT; break;
- case SID_SET_SUB_SCRIPT : m_eEscapement = SVX_ESCAPEMENT_SUBSCRIPT; break;
+ case SID_SET_SUPER_SCRIPT : m_eEscapement = SvxEscapement::Superscript; break;
+ case SID_SET_SUB_SCRIPT : m_eEscapement = SvxEscapement::Subscript; break;
default:
OSL_FAIL( "EscapementHandler::EscapementHandler: invalid slot!" );
break;
@@ -264,7 +264,7 @@ namespace frm
(void)_pAdditionalArg;
bool bIsChecked = getCheckState( _rCurrentAttribs ) == eChecked;
- _rNewAttribs.Put( SvxEscapementItem( bIsChecked ? SVX_ESCAPEMENT_OFF : m_eEscapement, getWhich() ) );
+ _rNewAttribs.Put( SvxEscapementItem( bIsChecked ? SvxEscapement::Off : m_eEscapement, getWhich() ) );
}
SlotHandler::SlotHandler( AttributeId _nAttributeId, WhichId _nWhichId )
diff --git a/include/editeng/escapementitem.hxx b/include/editeng/escapementitem.hxx
index 516fd8a..e7aab13 100644
--- a/include/editeng/escapementitem.hxx
+++ b/include/editeng/escapementitem.hxx
@@ -67,13 +67,13 @@ public:
inline void SetEscapement( const SvxEscapement eNew )
{
- if( SVX_ESCAPEMENT_OFF == eNew )
+ if( SvxEscapement::Off == eNew )
{
nEsc = 0;
nProp = 100;
}
else
- if( SVX_ESCAPEMENT_SUPERSCRIPT == eNew )
+ if( SvxEscapement::Superscript == eNew )
{
nEsc = DFLT_ESC_SUPER;
nProp = DFLT_ESC_PROP;
diff --git a/include/editeng/svxenum.hxx b/include/editeng/svxenum.hxx
index e624f57..7c8530c 100644
--- a/include/editeng/svxenum.hxx
+++ b/include/editeng/svxenum.hxx
@@ -30,12 +30,12 @@ enum SvxCaseMap
SVX_CASEMAP_END
};
-enum SvxEscapement
+enum class SvxEscapement
{
- SVX_ESCAPEMENT_OFF,
- SVX_ESCAPEMENT_SUPERSCRIPT,
- SVX_ESCAPEMENT_SUBSCRIPT,
- SVX_ESCAPEMENT_END
+ Off,
+ Superscript,
+ Subscript,
+ End
};
enum SvxShadowLocation
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 016b8e6..bef1af0 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -170,7 +170,7 @@ void setSuffixCell(
aEngine.SetEditTextObjectPool(rDoc.GetEditPool());
SfxItemSet aAttr = aEngine.GetEmptyItemSet();
- aAttr.Put( SvxEscapementItem( SVX_ESCAPEMENT_SUPERSCRIPT, EE_CHAR_ESCAPEMENT));
+ aAttr.Put( SvxEscapementItem( SvxEscapement::Superscript, EE_CHAR_ESCAPEMENT));
aEngine.SetText( aValue );
aEngine.QuickInsertText(
aOrdinalSuffix,
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 933227a..9c4d1c2 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -886,9 +886,9 @@ static const char* lcl_ToVerticalAlignmentRun( SvxEscapement eEscapement, bool&
bHaveAlignment = true;
switch( eEscapement )
{
- case SVX_ESCAPEMENT_SUPERSCRIPT: return "superscript";
- case SVX_ESCAPEMENT_SUBSCRIPT: return "subscript";
- case SVX_ESCAPEMENT_OFF:
+ case SvxEscapement::Superscript: return "superscript";
+ case SvxEscapement::Subscript: return "subscript";
+ case SvxEscapement::Off:
default: bHaveAlignment = false; return "baseline";
}
}
diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx
index d6b0014..90870ec2 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -286,11 +286,11 @@ FontLineStyle XclFontData::GetScUnderline() const
SvxEscapement XclFontData::GetScEscapement() const
{
- SvxEscapement eScEscapem = SVX_ESCAPEMENT_OFF;
+ SvxEscapement eScEscapem = SvxEscapement::Off;
switch( mnEscapem )
{
- case EXC_FONTESC_SUPER: eScEscapem = SVX_ESCAPEMENT_SUPERSCRIPT; break;
- case EXC_FONTESC_SUB: eScEscapem = SVX_ESCAPEMENT_SUBSCRIPT; break;
+ case EXC_FONTESC_SUPER: eScEscapem = SvxEscapement::Superscript; break;
+ case EXC_FONTESC_SUB: eScEscapem = SvxEscapement::Subscript; break;
}
return eScEscapem;
}
@@ -710,7 +710,7 @@ void XclFontPropSetHelper::WriteFontProperties(
lclWriteChartFont( rPropSet, maHlpChCmplx, maHlpChCmplxNoName, rFontData, bHasCmplx );
// font escapement
- if( rFontData.GetScEscapement() != SVX_ESCAPEMENT_OFF )
+ if( rFontData.GetScEscapement() != SvxEscapement::Off )
{
maHlpChEscapement.InitializeWrite();
maHlpChEscapement << rFontData.GetApiEscapement() << EXC_API_ESC_HEIGHT;
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 5729472..456e2a5 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -960,11 +960,11 @@ void Font::fillToItemSet( SfxItemSet& rItemSet, bool bEditEngineText, bool bSkip
}
if( maUsedFlags.mbEscapementUsed )
{
- SvxEscapement eScEscapem = SVX_ESCAPEMENT_OFF;
+ SvxEscapement eScEscapem = SvxEscapement::Off;
if ( maApiData.mnEscapement == API_ESCAPE_SUPERSCRIPT )
- eScEscapem = SVX_ESCAPEMENT_SUPERSCRIPT;
+ eScEscapem = SvxEscapement::Superscript;
else if ( maApiData.mnEscapement == API_ESCAPE_SUBSCRIPT )
- eScEscapem = SVX_ESCAPEMENT_SUBSCRIPT;
+ eScEscapem = SvxEscapement::Subscript;
if( bEditEngineText )
{
// #TODO handle EscapementHeight
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index da9bb2f..d9dd73e 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -183,7 +183,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu
if ( nId == EE_CHAR_ESCAPEMENT ) // Super-/Subscript always via EE
{
if ( (SvxEscapement)static_cast<const SvxEscapementItem*>(pItem)->GetEnumValue()
- != SVX_ESCAPEMENT_OFF )
+ != SvxEscapement::Off )
bSimple = false;
}
}
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 6c6165b..3e42845 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -720,10 +720,10 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Superscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Superscript );
aNewAttr.Put( aItem );
}
break;
@@ -734,10 +734,10 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Subscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Subscript );
aNewAttr.Put( aItem );
}
break;
@@ -1096,9 +1096,9 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>(
aAttrSet.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
+ if( eEsc == SvxEscapement::Superscript )
rDestSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, true ) );
- else if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
+ else if( eEsc == SvxEscapement::Subscript )
rDestSet.Put( SfxBoolItem( SID_SET_SUB_SCRIPT, true ) );
// Unterstreichung
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 182f8ea..63b82da 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -2328,9 +2328,9 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
SfxItemSet aAttr = aEngine.GetEmptyItemSet();
aEngine.SetText(aStr);
if( nValue < 0 ) // Subscript
- aAttr.Put( SvxEscapementItem( SVX_ESCAPEMENT_SUBSCRIPT, EE_CHAR_ESCAPEMENT ) );
+ aAttr.Put( SvxEscapementItem( SvxEscapement::Subscript, EE_CHAR_ESCAPEMENT ) );
else // Superscript
- aAttr.Put( SvxEscapementItem( SVX_ESCAPEMENT_SUPERSCRIPT, EE_CHAR_ESCAPEMENT ) );
+ aAttr.Put( SvxEscapementItem( SvxEscapement::Superscript, EE_CHAR_ESCAPEMENT ) );
aEngine.QuickSetAttribs(aAttr, ESelection(0, 0, 0, aStr.getLength()));
// The cell will own the text object instance.
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 50a8ff7..5782387 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -1035,8 +1035,8 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
{
SvxEscapement eOld = (SvxEscapement) static_cast<const SvxEscapementItem&>(
pEditView->GetAttribs().Get(EE_CHAR_ESCAPEMENT)).GetEnumValue();
- SvxEscapement eNew = (eOld == SVX_ESCAPEMENT_SUPERSCRIPT) ?
- SVX_ESCAPEMENT_OFF : SVX_ESCAPEMENT_SUPERSCRIPT;
+ SvxEscapement eNew = (eOld == SvxEscapement::Superscript) ?
+ SvxEscapement::Off : SvxEscapement::Superscript;
aSet.Put( SvxEscapementItem( eNew, EE_CHAR_ESCAPEMENT ) );
rBindings.Invalidate( nSlot );
}
@@ -1045,8 +1045,8 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
{
SvxEscapement eOld = (SvxEscapement) static_cast<const SvxEscapementItem&>(
pEditView->GetAttribs().Get(EE_CHAR_ESCAPEMENT)).GetEnumValue();
- SvxEscapement eNew = (eOld == SVX_ESCAPEMENT_SUBSCRIPT) ?
- SVX_ESCAPEMENT_OFF : SVX_ESCAPEMENT_SUBSCRIPT;
+ SvxEscapement eNew = (eOld == SvxEscapement::Subscript) ?
+ SvxEscapement::Off : SvxEscapement::Subscript;
aSet.Put( SvxEscapementItem( eNew, EE_CHAR_ESCAPEMENT ) );
rBindings.Invalidate( nSlot );
}
@@ -1158,11 +1158,11 @@ void ScEditShell::GetAttrState(SfxItemSet &rSet)
SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>(
aAttribs.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
+ if( eEsc == SvxEscapement::Superscript )
{
rSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, true ) );
}
- else if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
+ else if( eEsc == SvxEscapement::Subscript )
{
rSet.Put( SfxBoolItem( SID_SET_SUB_SCRIPT, true ) );
}
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 237a451..0a0de09 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -583,9 +583,9 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>(
aAttrSet.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
+ if( eEsc == SvxEscapement::Superscript )
rSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, true ) );
- else if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
+ else if( eEsc == SvxEscapement::Subscript )
rSet.Put( SfxBoolItem( SID_SET_SUB_SCRIPT, true ) );
}
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index 07ef597..d2d3346 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -536,10 +536,10 @@ void TextObjectBar::Execute( SfxRequest &rReq )
SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Superscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Superscript );
aNewAttr.Put( aItem );
}
break;
@@ -549,10 +549,10 @@ void TextObjectBar::Execute( SfxRequest &rReq )
SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Subscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Subscript );
aNewAttr.Put( aItem );
}
break;
@@ -661,10 +661,10 @@ void TextObjectBar::Execute( SfxRequest &rReq )
SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Superscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Superscript );
aNewAttr.Put( aItem );
rReq.Done( aNewAttr );
pArgs = rReq.GetArgs();
@@ -675,10 +675,10 @@ void TextObjectBar::Execute( SfxRequest &rReq )
SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Subscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Subscript );
aNewAttr.Put( aItem );
rReq.Done( aNewAttr );
pArgs = rReq.GetArgs();
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index abe829c..db985f2 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -3039,10 +3039,10 @@ void DrawViewShell::ExecChar( SfxRequest &rReq )
SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Subscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Subscript );
aNewAttr.Put( aItem );
}
break;
@@ -3051,10 +3051,10 @@ void DrawViewShell::ExecChar( SfxRequest &rReq )
SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Superscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Superscript );
aNewAttr.Put( aItem );
}
break;
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 15bb40e..e75001f 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -724,11 +724,11 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>(
pSet->Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
+ if( eEsc == SvxEscapement::Superscript )
{
rSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, true ) );
}
- else if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
+ else if( eEsc == SvxEscapement::Subscript )
{
rSet.Put( SfxBoolItem( SID_SET_SUB_SCRIPT, true ) );
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index da8a62a..8b0c40a 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3139,8 +3139,7 @@ bool SwTextNode::GetExpandText( SwTextNode& rDestNd, const SwIndex* pDestIdx,
if( !sExpand.isEmpty() )
{
++aDestIdx; // insert behind
- SvxEscapementItem aItem(
- SVX_ESCAPEMENT_SUPERSCRIPT );
+ SvxEscapementItem aItem( SvxEscapement::Superscript, RES_CHRATR_ESCAPEMENT );
rDestNd.InsertItem(
aItem,
aDestIdx.GetIndex(),
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index a842c8f..1a116fc8 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -1223,11 +1223,11 @@ HTMLOnOffState HTMLEndPosLst::GetHTMLItemState( const SfxPoolItem& rItem )
switch( (const SvxEscapement)
static_cast<const SvxEscapementItem&>(rItem).GetEnumValue() )
{
- case SVX_ESCAPEMENT_SUPERSCRIPT:
- case SVX_ESCAPEMENT_SUBSCRIPT:
+ case SvxEscapement::Superscript:
+ case SvxEscapement::Subscript:
eState = HTML_ON_VALUE;
break;
- case SVX_ESCAPEMENT_OFF:
+ case SvxEscapement::Off:
eState = HTML_OFF_VALUE;
break;
default:
@@ -2812,8 +2812,8 @@ static Writer& OutHTML_SvxEscapement( Writer& rWrt, const SfxPoolItem& rHt )
const sal_Char *pStr = nullptr;
switch( eEscape )
{
- case SVX_ESCAPEMENT_SUPERSCRIPT: pStr = OOO_STRING_SVTOOLS_HTML_superscript; break;
- case SVX_ESCAPEMENT_SUBSCRIPT: pStr = OOO_STRING_SVTOOLS_HTML_subscript; break;
+ case SvxEscapement::Superscript: pStr = OOO_STRING_SVTOOLS_HTML_superscript; break;
+ case SvxEscapement::Subscript: pStr = OOO_STRING_SVTOOLS_HTML_subscript; break;
default:
;
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 397bead..206d550 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3915,7 +3915,7 @@ void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem& rHt)
bMustWrite = static_cast< const SvxCrossedOutItem& >(rHt).GetStrikeout() != STRIKEOUT_NONE;
break;
case RES_CHRATR_ESCAPEMENT:
- bMustWrite = static_cast< const SvxEscapementItem& >(rHt).GetEscapement() != SVX_ESCAPEMENT_OFF;
+ bMustWrite = static_cast< const SvxEscapementItem& >(rHt).GetEscapement() != SvxEscapement::Off;
break;
case RES_CHRATR_FONT:
bMustWrite = true;
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 8fff09e..0988389 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -362,10 +362,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Superscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Superscript );
aNewAttr.Put( aItem );
}
break;
@@ -375,10 +375,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Subscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Subscript );
aNewAttr.Put( aItem );
}
break;
@@ -726,14 +726,14 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet)
case FN_SET_SUPER_SCRIPT:
case FN_SET_SUB_SCRIPT:
{
- sal_uInt16 nEsc;
+ SvxEscapement nEsc;
if (nWhich==FN_SET_SUPER_SCRIPT)
- nEsc = SVX_ESCAPEMENT_SUPERSCRIPT;
+ nEsc = SvxEscapement::Superscript;
else
- nEsc = SVX_ESCAPEMENT_SUBSCRIPT;
+ nEsc = SvxEscapement::Subscript;
const SfxPoolItem *pEscItem = &aEditAttr.Get( EE_CHAR_ESCAPEMENT );
- if( nEsc == static_cast<const SvxEscapementItem*>(pEscItem)->GetEnumValue() )
+ if( nEsc == static_cast<const SvxEscapementItem*>(pEscItem)->GetEscapement() )
rSet.Put( SfxBoolItem( nWhich, true ));
else
rSet.InvalidateItem( nWhich );
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index a894e3b..08a2ea2 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -293,10 +293,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Superscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Superscript );
aNewAttr.Put( aItem );
}
break;
@@ -306,10 +306,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
- if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
- aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
+ if( eEsc == SvxEscapement::Subscript )
+ aItem.SetEscapement( SvxEscapement::Off );
else
- aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
+ aItem.SetEscapement( SvxEscapement::Subscript );
aNewAttr.Put( aItem );
}
break;
@@ -594,7 +594,8 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet)
SfxItemSet aEditAttr( pOLV->GetAttribs() );
const SfxPoolItem *pAdjust = nullptr, *pLSpace = nullptr, *pEscItem = nullptr;
- int eAdjust, nLSpace, nEsc;
+ int eAdjust, nLSpace;
+ SvxEscapement nEsc;
while(nWhich)
{
@@ -721,9 +722,9 @@ ASK_LINESPACE:
}
break;
- case FN_SET_SUPER_SCRIPT: nEsc = SVX_ESCAPEMENT_SUPERSCRIPT;
+ case FN_SET_SUPER_SCRIPT: nEsc = SvxEscapement::Superscript;
goto ASK_ESCAPE;
- case FN_SET_SUB_SCRIPT: nEsc = SVX_ESCAPEMENT_SUBSCRIPT;
+ case FN_SET_SUB_SCRIPT: nEsc = SvxEscapement::Subscript;
goto ASK_ESCAPE;
ASK_ESCAPE:
{
@@ -731,7 +732,7 @@ ASK_ESCAPE:
pEscItem = &aEditAttr.Get( EE_CHAR_ESCAPEMENT );
if( nEsc == static_cast<const SvxEscapementItem*>(
- pEscItem)->GetEnumValue() )
+ pEscItem)->GetEscapement() )
bFlag = true;
else
nSlotId = 0;
diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx
index bbc78e6..64d6370 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -86,7 +86,7 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq)
case FN_SET_SUB_SCRIPT:
case FN_SET_SUPER_SCRIPT:
{
- SvxEscapement eEscape = SVX_ESCAPEMENT_SUBSCRIPT;
+ SvxEscapement eEscape = SvxEscapement::Subscript;
switch (eState)
{
case STATE_TOGGLE:
@@ -94,11 +94,11 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq)
short nTmpEsc = static_cast<const SvxEscapementItem&>(
aSet.Get( RES_CHRATR_ESCAPEMENT )).GetEsc();
eEscape = nWhich == FN_SET_SUPER_SCRIPT ?
- SVX_ESCAPEMENT_SUPERSCRIPT:
- SVX_ESCAPEMENT_SUBSCRIPT;
+ SvxEscapement::Superscript:
+ SvxEscapement::Subscript;
if( (nWhich == FN_SET_SUB_SCRIPT && nTmpEsc < 0) ||
(nWhich == FN_SET_SUPER_SCRIPT && nTmpEsc > 0) )
- eEscape = SVX_ESCAPEMENT_OFF;
+ eEscape = SvxEscapement::Off;
SfxBindings& rBind = GetView().GetViewFrame()->GetBindings();
if( nWhich == FN_SET_SUB_SCRIPT )
@@ -112,17 +112,17 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq)
break;
case STATE_ON:
eEscape = nWhich == FN_SET_SUPER_SCRIPT ?
- SVX_ESCAPEMENT_SUPERSCRIPT:
- SVX_ESCAPEMENT_SUBSCRIPT;
+ SvxEscapement::Superscript:
+ SvxEscapement::Subscript;
break;
case STATE_OFF:
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list