convert ScrollingMode to scoped enum
Change-Id: Ice1628ba09998be455fd6a77a044cb403235d462 Reviewed-on: https://gerrit.libreoffice.org/34914 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -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 ) ) );
|
||||
|
@@ -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
|
||||
|
@@ -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:
|
||||
{
|
||||
|
@@ -40,7 +40,7 @@ struct SfxFrameDescriptor_Impl
|
||||
|
||||
SfxFrameDescriptor::SfxFrameDescriptor() :
|
||||
aMargin( -1, -1 ),
|
||||
eScroll( ScrollingAuto ),
|
||||
eScroll( ScrollingMode::Auto ),
|
||||
bHasBorder( true ),
|
||||
bHasBorderSet( false ),
|
||||
bResizeHorizontal( true ),
|
||||
|
@@ -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;
|
||||
|
@@ -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 ) );
|
||||
|
@@ -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",
|
||||
|
@@ -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",
|
||||
|
Reference in New Issue
Block a user