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 );
|
m_xObj->changeState( embed::EmbedStates::RUNNING );
|
||||||
|
|
||||||
OUString aName = m_pEDName->GetText();
|
OUString aName = m_pEDName->GetText();
|
||||||
ScrollingMode eScroll = ScrollingNo;
|
ScrollingMode eScroll = ScrollingMode::No;
|
||||||
if ( m_pRBScrollingOn->IsChecked() )
|
if ( m_pRBScrollingOn->IsChecked() )
|
||||||
eScroll = ScrollingYes;
|
eScroll = ScrollingMode::Yes;
|
||||||
if ( m_pRBScrollingOff->IsChecked() )
|
if ( m_pRBScrollingOff->IsChecked() )
|
||||||
eScroll = ScrollingNo;
|
eScroll = ScrollingMode::No;
|
||||||
if ( m_pRBScrollingAuto->IsChecked() )
|
if ( m_pRBScrollingAuto->IsChecked() )
|
||||||
eScroll = ScrollingAuto;
|
eScroll = ScrollingMode::Auto;
|
||||||
|
|
||||||
bool bHasBorder = m_pRBFrameBorderOn->IsChecked();
|
bool bHasBorder = m_pRBFrameBorderOn->IsChecked();
|
||||||
|
|
||||||
@@ -570,10 +570,10 @@ short SfxInsertFloatingFrameDialog::Execute()
|
|||||||
xSet->setPropertyValue( "FrameURL", Any( aURL ) );
|
xSet->setPropertyValue( "FrameURL", Any( aURL ) );
|
||||||
xSet->setPropertyValue( "FrameName", Any( aName ) );
|
xSet->setPropertyValue( "FrameName", Any( aName ) );
|
||||||
|
|
||||||
if ( eScroll == ScrollingAuto )
|
if ( eScroll == ScrollingMode::Auto )
|
||||||
xSet->setPropertyValue( "FrameIsAutoScroll", Any( true ) );
|
xSet->setPropertyValue( "FrameIsAutoScroll", Any( true ) );
|
||||||
else
|
else
|
||||||
xSet->setPropertyValue( "FrameIsScrollingMode", Any( eScroll == ScrollingYes ) );
|
xSet->setPropertyValue( "FrameIsScrollingMode", Any( eScroll == ScrollingMode::Yes ) );
|
||||||
|
|
||||||
xSet->setPropertyValue( "FrameIsBorder", Any( bHasBorder ) );
|
xSet->setPropertyValue( "FrameIsBorder", Any( bHasBorder ) );
|
||||||
xSet->setPropertyValue( "FrameMarginWidth", Any( sal_Int32( lMarginWidth ) ) );
|
xSet->setPropertyValue( "FrameMarginWidth", Any( sal_Int32( lMarginWidth ) ) );
|
||||||
|
@@ -43,11 +43,11 @@ class Wallpaper;
|
|||||||
// aligned, from which also the alignment of the FrameSet is given.
|
// aligned, from which also the alignment of the FrameSet is given.
|
||||||
|
|
||||||
|
|
||||||
enum ScrollingMode
|
enum class ScrollingMode
|
||||||
{
|
{
|
||||||
ScrollingYes,
|
Yes,
|
||||||
ScrollingNo,
|
No,
|
||||||
ScrollingAuto
|
Auto
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SPACING_NOT_SET -1L
|
#define SPACING_NOT_SET -1L
|
||||||
|
@@ -40,9 +40,9 @@ static sal_Char const sHTML_SC_auto[] = "AUTO";
|
|||||||
|
|
||||||
static HTMLOptionEnum<ScrollingMode> const aScrollingTable[] =
|
static HTMLOptionEnum<ScrollingMode> const aScrollingTable[] =
|
||||||
{
|
{
|
||||||
{ sHTML_SC_yes, ScrollingYes },
|
{ sHTML_SC_yes, ScrollingMode::Yes },
|
||||||
{ sHTML_SC_no, ScrollingNo },
|
{ sHTML_SC_no, ScrollingMode::No },
|
||||||
{ sHTML_SC_auto, ScrollingAuto },
|
{ sHTML_SC_auto, ScrollingMode::Auto },
|
||||||
{ nullptr, (ScrollingMode)0 }
|
{ nullptr, (ScrollingMode)0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ void SfxFrameHTMLParser::ParseFrameOptions(
|
|||||||
bMarginHeight = true;
|
bMarginHeight = true;
|
||||||
break;
|
break;
|
||||||
case HTML_O_SCROLLING:
|
case HTML_O_SCROLLING:
|
||||||
pFrame->SetScrollingMode( rOption.GetEnum( aScrollingTable, ScrollingAuto ) );
|
pFrame->SetScrollingMode( rOption.GetEnum( aScrollingTable, ScrollingMode::Auto ) );
|
||||||
break;
|
break;
|
||||||
case HTML_O_FRAMEBORDER:
|
case HTML_O_FRAMEBORDER:
|
||||||
{
|
{
|
||||||
|
@@ -40,7 +40,7 @@ struct SfxFrameDescriptor_Impl
|
|||||||
|
|
||||||
SfxFrameDescriptor::SfxFrameDescriptor() :
|
SfxFrameDescriptor::SfxFrameDescriptor() :
|
||||||
aMargin( -1, -1 ),
|
aMargin( -1, -1 ),
|
||||||
eScroll( ScrollingAuto ),
|
eScroll( ScrollingMode::Auto ),
|
||||||
bHasBorder( true ),
|
bHasBorder( true ),
|
||||||
bHasBorderSet( false ),
|
bHasBorderSet( false ),
|
||||||
bResizeHorizontal( true ),
|
bResizeHorizontal( true ),
|
||||||
|
@@ -262,14 +262,14 @@ void SAL_CALL IFrameObject::setPropertyValue(const OUString& aPropertyName, cons
|
|||||||
{
|
{
|
||||||
bool bIsAutoScroll;
|
bool bIsAutoScroll;
|
||||||
if ( (aAny >>= bIsAutoScroll) && bIsAutoScroll )
|
if ( (aAny >>= bIsAutoScroll) && bIsAutoScroll )
|
||||||
maFrmDescr.SetScrollingMode( ScrollingAuto );
|
maFrmDescr.SetScrollingMode( ScrollingMode::Auto );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WID_FRAME_IS_SCROLLING_MODE:
|
case WID_FRAME_IS_SCROLLING_MODE:
|
||||||
{
|
{
|
||||||
bool bIsScroll;
|
bool bIsScroll;
|
||||||
if ( aAny >>= bIsScroll )
|
if ( aAny >>= bIsScroll )
|
||||||
maFrmDescr.SetScrollingMode( bIsScroll ? ScrollingYes : ScrollingNo );
|
maFrmDescr.SetScrollingMode( bIsScroll ? ScrollingMode::Yes : ScrollingMode::No );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WID_FRAME_IS_BORDER:
|
case WID_FRAME_IS_BORDER:
|
||||||
@@ -337,13 +337,13 @@ uno::Any SAL_CALL IFrameObject::getPropertyValue(const OUString& aPropertyName)
|
|||||||
break;
|
break;
|
||||||
case WID_FRAME_IS_AUTO_SCROLL:
|
case WID_FRAME_IS_AUTO_SCROLL:
|
||||||
{
|
{
|
||||||
bool bIsAutoScroll = ( maFrmDescr.GetScrollingMode() == ScrollingAuto );
|
bool bIsAutoScroll = ( maFrmDescr.GetScrollingMode() == ScrollingMode::Auto );
|
||||||
aAny <<= bIsAutoScroll;
|
aAny <<= bIsAutoScroll;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WID_FRAME_IS_SCROLLING_MODE:
|
case WID_FRAME_IS_SCROLLING_MODE:
|
||||||
{
|
{
|
||||||
bool bIsScroll = ( maFrmDescr.GetScrollingMode() == ScrollingYes );
|
bool bIsScroll = ( maFrmDescr.GetScrollingMode() == ScrollingMode::Yes );
|
||||||
aAny <<= bIsScroll;
|
aAny <<= bIsScroll;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -888,12 +888,12 @@ void SwHTMLParser::InsertFloatingFrame()
|
|||||||
xSet->setPropertyValue("FrameURL", uno::makeAny( OUString( aFrameDesc.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) );
|
xSet->setPropertyValue("FrameURL", uno::makeAny( OUString( aFrameDesc.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) );
|
||||||
xSet->setPropertyValue("FrameName", uno::makeAny( aName ) );
|
xSet->setPropertyValue("FrameName", uno::makeAny( aName ) );
|
||||||
|
|
||||||
if ( eScroll == ScrollingAuto )
|
if ( eScroll == ScrollingMode::Auto )
|
||||||
xSet->setPropertyValue("FrameIsAutoScroll",
|
xSet->setPropertyValue("FrameIsAutoScroll",
|
||||||
uno::makeAny( true ) );
|
uno::makeAny( true ) );
|
||||||
else
|
else
|
||||||
xSet->setPropertyValue("FrameIsScrollingMode",
|
xSet->setPropertyValue("FrameIsScrollingMode",
|
||||||
uno::makeAny( eScroll == ScrollingYes ) );
|
uno::makeAny( eScroll == ScrollingMode::Yes ) );
|
||||||
|
|
||||||
xSet->setPropertyValue("FrameIsBorder",
|
xSet->setPropertyValue("FrameIsBorder",
|
||||||
uno::makeAny( bHasBorder ) );
|
uno::makeAny( bHasBorder ) );
|
||||||
|
@@ -763,7 +763,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
|
|||||||
RES_FRMATR_END );
|
RES_FRMATR_END );
|
||||||
lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
|
lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
|
||||||
|
|
||||||
ScrollingMode eScrollMode = ScrollingAuto;
|
ScrollingMode eScrollMode = ScrollingMode::Auto;
|
||||||
bool bHasBorder = false;
|
bool bHasBorder = false;
|
||||||
bool bIsBorderSet = false;
|
bool bIsBorderSet = false;
|
||||||
Size aMargin( SIZE_NOT_SET, SIZE_NOT_SET );
|
Size aMargin( SIZE_NOT_SET, SIZE_NOT_SET );
|
||||||
@@ -795,7 +795,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
|
|||||||
case CTF_FRAME_DISPLAY_SCROLLBAR:
|
case CTF_FRAME_DISPLAY_SCROLLBAR:
|
||||||
{
|
{
|
||||||
bool bYes = *o3tl::doAccess<bool>(rProp.maValue);
|
bool bYes = *o3tl::doAccess<bool>(rProp.maValue);
|
||||||
eScrollMode = bYes ? ScrollingYes : ScrollingNo;
|
eScrollMode = bYes ? ScrollingMode::Yes : ScrollingMode::No;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CTF_FRAME_DISPLAY_BORDER:
|
case CTF_FRAME_DISPLAY_BORDER:
|
||||||
@@ -854,12 +854,12 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
|
|||||||
xSet->setPropertyValue("FrameName",
|
xSet->setPropertyValue("FrameName",
|
||||||
makeAny( OUString( rName ) ) );
|
makeAny( OUString( rName ) ) );
|
||||||
|
|
||||||
if ( eScrollMode == ScrollingAuto )
|
if ( eScrollMode == ScrollingMode::Auto )
|
||||||
xSet->setPropertyValue("FrameIsAutoScroll",
|
xSet->setPropertyValue("FrameIsAutoScroll",
|
||||||
makeAny( true ) );
|
makeAny( true ) );
|
||||||
else
|
else
|
||||||
xSet->setPropertyValue("FrameIsScrollingMode",
|
xSet->setPropertyValue("FrameIsScrollingMode",
|
||||||
makeAny( eScrollMode == ScrollingYes ) );
|
makeAny( eScrollMode == ScrollingMode::Yes ) );
|
||||||
|
|
||||||
if ( bIsBorderSet )
|
if ( bIsBorderSet )
|
||||||
xSet->setPropertyValue("FrameIsBorder",
|
xSet->setPropertyValue("FrameIsBorder",
|
||||||
|
@@ -271,8 +271,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ScrollingMode eScroll = ScrollingAuto;
|
ScrollingMode eScroll = ScrollingMode::Auto;
|
||||||
if( pScrollingItem && pScrollingItem->GetValue() <= ScrollingAuto )
|
if( pScrollingItem && pScrollingItem->GetValue() <= (int)ScrollingMode::Auto )
|
||||||
eScroll = (ScrollingMode) pScrollingItem->GetValue();
|
eScroll = (ScrollingMode) pScrollingItem->GetValue();
|
||||||
|
|
||||||
Size aMargin;
|
Size aMargin;
|
||||||
@@ -284,12 +284,12 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
|
|||||||
if ( pNameItem )
|
if ( pNameItem )
|
||||||
xSet->setPropertyValue("FrameName", uno::makeAny( OUString( pNameItem->GetValue() ) ) );
|
xSet->setPropertyValue("FrameName", uno::makeAny( OUString( pNameItem->GetValue() ) ) );
|
||||||
|
|
||||||
if ( eScroll == ScrollingAuto )
|
if ( eScroll == ScrollingMode::Auto )
|
||||||
xSet->setPropertyValue("FrameIsAutoScroll",
|
xSet->setPropertyValue("FrameIsAutoScroll",
|
||||||
uno::makeAny( true ) );
|
uno::makeAny( true ) );
|
||||||
else
|
else
|
||||||
xSet->setPropertyValue("FrameIsScrollingMode",
|
xSet->setPropertyValue("FrameIsScrollingMode",
|
||||||
uno::makeAny( eScroll == ScrollingYes ) );
|
uno::makeAny( eScroll == ScrollingMode::Yes ) );
|
||||||
|
|
||||||
if ( pBorderItem )
|
if ( pBorderItem )
|
||||||
xSet->setPropertyValue("FrameIsBorder",
|
xSet->setPropertyValue("FrameIsBorder",
|
||||||
|
Reference in New Issue
Block a user