[Libreoffice-commits] core.git: cui/source include/sfx2 sfx2/source sw/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Mar 6 07:47:28 UTC 2017
cui/source/dialogs/insdlg.cxx | 12 ++++++------
include/sfx2/frmdescr.hxx | 8 ++++----
sfx2/source/bastyp/frmhtml.cxx | 8 ++++----
sfx2/source/doc/frmdescr.cxx | 2 +-
sfx2/source/doc/iframe.cxx | 8 ++++----
sw/source/filter/html/htmlplug.cxx | 4 ++--
sw/source/filter/xml/xmltexti.cxx | 8 ++++----
sw/source/uibase/shells/textsh.cxx | 8 ++++----
8 files changed, 29 insertions(+), 29 deletions(-)
New commits:
commit 24ae6e86671c0729a6a6ea7da86b262b4fdd1c0f
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Mar 6 08:45:01 2017 +0200
convert ScrollingMode to scoped enum
Change-Id: Ice1628ba09998be455fd6a77a044cb403235d462
Reviewed-on: https://gerrit.libreoffice.org/34914
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index d7e0688..6b0e888 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -545,13 +545,13 @@ short SfxInsertFloatingFrameDialog::Execute()
m_xObj->changeState( embed::EmbedStates::RUNNING );
OUString aName = m_pEDName->GetText();
- ScrollingMode eScroll = ScrollingNo;
+ ScrollingMode eScroll = ScrollingMode::No;
if ( m_pRBScrollingOn->IsChecked() )
- eScroll = ScrollingYes;
+ eScroll = ScrollingMode::Yes;
if ( m_pRBScrollingOff->IsChecked() )
- eScroll = ScrollingNo;
+ eScroll = ScrollingMode::No;
if ( m_pRBScrollingAuto->IsChecked() )
- eScroll = ScrollingAuto;
+ eScroll = ScrollingMode::Auto;
bool bHasBorder = m_pRBFrameBorderOn->IsChecked();
@@ -570,10 +570,10 @@ short SfxInsertFloatingFrameDialog::Execute()
xSet->setPropertyValue( "FrameURL", Any( aURL ) );
xSet->setPropertyValue( "FrameName", Any( aName ) );
- if ( eScroll == ScrollingAuto )
+ if ( eScroll == ScrollingMode::Auto )
xSet->setPropertyValue( "FrameIsAutoScroll", Any( true ) );
else
- xSet->setPropertyValue( "FrameIsScrollingMode", Any( eScroll == ScrollingYes ) );
+ xSet->setPropertyValue( "FrameIsScrollingMode", Any( eScroll == ScrollingMode::Yes ) );
xSet->setPropertyValue( "FrameIsBorder", Any( bHasBorder ) );
xSet->setPropertyValue( "FrameMarginWidth", Any( sal_Int32( lMarginWidth ) ) );
diff --git a/include/sfx2/frmdescr.hxx b/include/sfx2/frmdescr.hxx
index 4f09680..5e8e3d9 100644
--- a/include/sfx2/frmdescr.hxx
+++ b/include/sfx2/frmdescr.hxx
@@ -43,11 +43,11 @@ class Wallpaper;
// aligned, from which also the alignment of the FrameSet is given.
-enum ScrollingMode
+enum class ScrollingMode
{
- ScrollingYes,
- ScrollingNo,
- ScrollingAuto
+ Yes,
+ No,
+ Auto
};
#define SPACING_NOT_SET -1L
diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx
index af567e9..c27201e 100644
--- a/sfx2/source/bastyp/frmhtml.cxx
+++ b/sfx2/source/bastyp/frmhtml.cxx
@@ -40,9 +40,9 @@ static sal_Char const sHTML_SC_auto[] = "AUTO";
static HTMLOptionEnum<ScrollingMode> const aScrollingTable[] =
{
- { sHTML_SC_yes, ScrollingYes },
- { sHTML_SC_no, ScrollingNo },
- { sHTML_SC_auto, ScrollingAuto },
+ { sHTML_SC_yes, ScrollingMode::Yes },
+ { sHTML_SC_no, ScrollingMode::No },
+ { sHTML_SC_auto, ScrollingMode::Auto },
{ nullptr, (ScrollingMode)0 }
};
@@ -93,7 +93,7 @@ void SfxFrameHTMLParser::ParseFrameOptions(
bMarginHeight = true;
break;
case HTML_O_SCROLLING:
- pFrame->SetScrollingMode( rOption.GetEnum( aScrollingTable, ScrollingAuto ) );
+ pFrame->SetScrollingMode( rOption.GetEnum( aScrollingTable, ScrollingMode::Auto ) );
break;
case HTML_O_FRAMEBORDER:
{
diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx
index a23126b..5eb4fc2 100644
--- a/sfx2/source/doc/frmdescr.cxx
+++ b/sfx2/source/doc/frmdescr.cxx
@@ -40,7 +40,7 @@ struct SfxFrameDescriptor_Impl
SfxFrameDescriptor::SfxFrameDescriptor() :
aMargin( -1, -1 ),
- eScroll( ScrollingAuto ),
+ eScroll( ScrollingMode::Auto ),
bHasBorder( true ),
bHasBorderSet( false ),
bResizeHorizontal( true ),
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index 1ca63db..ad44a09 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -262,14 +262,14 @@ void SAL_CALL IFrameObject::setPropertyValue(const OUString& aPropertyName, cons
{
bool bIsAutoScroll;
if ( (aAny >>= bIsAutoScroll) && bIsAutoScroll )
- maFrmDescr.SetScrollingMode( ScrollingAuto );
+ maFrmDescr.SetScrollingMode( ScrollingMode::Auto );
}
break;
case WID_FRAME_IS_SCROLLING_MODE:
{
bool bIsScroll;
if ( aAny >>= bIsScroll )
- maFrmDescr.SetScrollingMode( bIsScroll ? ScrollingYes : ScrollingNo );
+ maFrmDescr.SetScrollingMode( bIsScroll ? ScrollingMode::Yes : ScrollingMode::No );
}
break;
case WID_FRAME_IS_BORDER:
@@ -337,13 +337,13 @@ uno::Any SAL_CALL IFrameObject::getPropertyValue(const OUString& aPropertyName)
break;
case WID_FRAME_IS_AUTO_SCROLL:
{
- bool bIsAutoScroll = ( maFrmDescr.GetScrollingMode() == ScrollingAuto );
+ bool bIsAutoScroll = ( maFrmDescr.GetScrollingMode() == ScrollingMode::Auto );
aAny <<= bIsAutoScroll;
}
break;
case WID_FRAME_IS_SCROLLING_MODE:
{
- bool bIsScroll = ( maFrmDescr.GetScrollingMode() == ScrollingYes );
+ bool bIsScroll = ( maFrmDescr.GetScrollingMode() == ScrollingMode::Yes );
aAny <<= bIsScroll;
}
break;
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index 8279dd2..d5c6cbd 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -888,12 +888,12 @@ void SwHTMLParser::InsertFloatingFrame()
xSet->setPropertyValue("FrameURL", uno::makeAny( OUString( aFrameDesc.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) );
xSet->setPropertyValue("FrameName", uno::makeAny( aName ) );
- if ( eScroll == ScrollingAuto )
+ if ( eScroll == ScrollingMode::Auto )
xSet->setPropertyValue("FrameIsAutoScroll",
uno::makeAny( true ) );
else
xSet->setPropertyValue("FrameIsScrollingMode",
- uno::makeAny( eScroll == ScrollingYes ) );
+ uno::makeAny( eScroll == ScrollingMode::Yes ) );
xSet->setPropertyValue("FrameIsBorder",
uno::makeAny( bHasBorder ) );
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index a6746a4..1b20f32 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -763,7 +763,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
RES_FRMATR_END );
lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
- ScrollingMode eScrollMode = ScrollingAuto;
+ ScrollingMode eScrollMode = ScrollingMode::Auto;
bool bHasBorder = false;
bool bIsBorderSet = false;
Size aMargin( SIZE_NOT_SET, SIZE_NOT_SET );
@@ -795,7 +795,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
case CTF_FRAME_DISPLAY_SCROLLBAR:
{
bool bYes = *o3tl::doAccess<bool>(rProp.maValue);
- eScrollMode = bYes ? ScrollingYes : ScrollingNo;
+ eScrollMode = bYes ? ScrollingMode::Yes : ScrollingMode::No;
}
break;
case CTF_FRAME_DISPLAY_BORDER:
@@ -854,12 +854,12 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
xSet->setPropertyValue("FrameName",
makeAny( OUString( rName ) ) );
- if ( eScrollMode == ScrollingAuto )
+ if ( eScrollMode == ScrollingMode::Auto )
xSet->setPropertyValue("FrameIsAutoScroll",
makeAny( true ) );
else
xSet->setPropertyValue("FrameIsScrollingMode",
- makeAny( eScrollMode == ScrollingYes ) );
+ makeAny( eScrollMode == ScrollingMode::Yes ) );
if ( bIsBorderSet )
xSet->setPropertyValue("FrameIsBorder",
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 29b1298..4af6c0a 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -271,8 +271,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
{
try
{
- ScrollingMode eScroll = ScrollingAuto;
- if( pScrollingItem && pScrollingItem->GetValue() <= ScrollingAuto )
+ ScrollingMode eScroll = ScrollingMode::Auto;
+ if( pScrollingItem && pScrollingItem->GetValue() <= (int)ScrollingMode::Auto )
eScroll = (ScrollingMode) pScrollingItem->GetValue();
Size aMargin;
@@ -284,12 +284,12 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
if ( pNameItem )
xSet->setPropertyValue("FrameName", uno::makeAny( OUString( pNameItem->GetValue() ) ) );
- if ( eScroll == ScrollingAuto )
+ if ( eScroll == ScrollingMode::Auto )
xSet->setPropertyValue("FrameIsAutoScroll",
uno::makeAny( true ) );
else
xSet->setPropertyValue("FrameIsScrollingMode",
- uno::makeAny( eScroll == ScrollingYes ) );
+ uno::makeAny( eScroll == ScrollingMode::Yes ) );
if ( pBorderItem )
xSet->setPropertyValue("FrameIsBorder",
More information about the Libreoffice-commits
mailing list