Related tdf#140226: use StaticWhichCast in fupage.cxx + 2 hrc (sd+include/svx)
+ remove dynamic_cast<const SfxBoolItem*> Change-Id: I252a901218bef56a3b9cd9234387bfb7d4e36871 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204364 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
This commit is contained in:
@@ -231,7 +231,7 @@ class XFillGradientItem;
|
||||
#define SID_ATTR_PAGE_ORIENTATION TypedWhichId<SvxPageItem>( SID_SVX_START + 53 )
|
||||
#define SID_ATTR_PAGE_PAPERBIN TypedWhichId<SvxPaperBinItem>( SID_SVX_START + 54 )
|
||||
// this is used both as a SfxBoolItem(sd/source/ui/func/fupage.cxx) and as a SfxStringItem(sw/source/uibase/utlui/uitool.cxx)
|
||||
#define SID_ATTR_PAGE_EXT1 ( SID_SVX_START + 55 )
|
||||
#define SID_ATTR_PAGE_EXT1 TypedWhichId<SfxBoolItem>( SID_SVX_START + 55 )
|
||||
#define SID_ATTR_PAGE_EXT2 TypedWhichId<SfxBoolItem>( SID_SVX_START + 56 )
|
||||
#define SID_ATTR_PAGE_HEADERSET TypedWhichId<SvxSetItem>( SID_SVX_START + 57 )
|
||||
#define SID_ATTR_PAGE_FOOTERSET TypedWhichId<SvxSetItem>( SID_SVX_START + 58 )
|
||||
|
||||
+1
-1
@@ -400,7 +400,7 @@
|
||||
#define SID_NORMAL_MULTI_PANE_GUI TypedWhichId<SfxBoolItem>(SID_SD_START+420)
|
||||
#define SID_SLIDE_SORTER_MULTI_PANE_GUI (SID_SD_START+421)
|
||||
|
||||
#define SID_SELECT_BACKGROUND (SID_SD_START+422)
|
||||
#define SID_SELECT_BACKGROUND TypedWhichId<SfxStringItem>(SID_SD_START+422)
|
||||
#define SID_SAVE_BACKGROUND (SID_SD_START+423)
|
||||
// FREE
|
||||
// Slots for the tool pane popup
|
||||
|
||||
@@ -311,7 +311,7 @@ void FuPage::ExecuteAsyncDialog(weld::Window* pParent, const SfxRequest& rReq)
|
||||
|
||||
if (pArgs && pArgs->GetItemState(SID_SELECT_BACKGROUND, true, &pItem) == SfxItemState::SET)
|
||||
{
|
||||
OUString aFileName(static_cast<const SfxStringItem*>(pItem)->GetValue());
|
||||
OUString aFileName(pItem->StaticWhichCast(SID_SELECT_BACKGROUND).GetValue());
|
||||
OUString aFilterName;
|
||||
|
||||
if (const SfxStringItem* pFilterItem = pArgs->GetItemIfSet(FN_PARAM_FILTER))
|
||||
@@ -506,9 +506,9 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
|
||||
|
||||
if( pArgs->GetItemState(SID_ATTR_PAGE, true, &pPoolItem) == SfxItemState::SET )
|
||||
{
|
||||
mrDoc.SetPageNumType(static_cast<const SvxPageItem*>(pPoolItem)->GetNumType());
|
||||
mrDoc.SetPageNumType(pPoolItem->StaticWhichCast(SID_ATTR_PAGE).GetNumType());
|
||||
|
||||
eOrientation = static_cast<const SvxPageItem*>(pPoolItem)->IsLandscape() ?
|
||||
eOrientation = pPoolItem->StaticWhichCast(SID_ATTR_PAGE).IsLandscape() ?
|
||||
Orientation::Landscape : Orientation::Portrait;
|
||||
|
||||
if( mpPage->GetOrientation() != eOrientation )
|
||||
@@ -520,12 +520,12 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
|
||||
if ( pArgs->GetItemState(SID_ATTR_RESIZE_ALL_PAGES, true, &pPoolItem) == SfxItemState::SET)
|
||||
{
|
||||
SdDrawDocument* pDrawDoc = mpDrawViewShell->GetDoc();
|
||||
pDrawDoc->SetResizeAllPages(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
|
||||
pDrawDoc->SetResizeAllPages(pPoolItem->StaticWhichCast(SID_ATTR_RESIZE_ALL_PAGES).GetValue());
|
||||
}
|
||||
|
||||
if( pArgs->GetItemState(SID_ATTR_PAGE_SIZE, true, &pPoolItem) == SfxItemState::SET )
|
||||
{
|
||||
aNewSize = static_cast<const SvxSizeItem*>(pPoolItem)->GetSize();
|
||||
aNewSize = pPoolItem->StaticWhichCast(SID_ATTR_PAGE_SIZE).GetSize();
|
||||
|
||||
if( mpPage->GetSize() != aNewSize )
|
||||
bSetPageSizeAndBorder = true;
|
||||
@@ -534,6 +534,8 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
|
||||
if( pArgs->GetItemState(mrDoc.GetPool().GetWhichIDFromSlotID(SID_ATTR_LRSPACE),
|
||||
true, &pPoolItem) == SfxItemState::SET )
|
||||
{
|
||||
// FIXME for tdf#140226: using static_cast<const SvxULSpaceItem*>(pPoolItem)
|
||||
// makes UITest_impress_tests fail
|
||||
nLeft = static_cast<const SvxLRSpaceItem*>(pPoolItem)->ResolveLeft();
|
||||
nRight = static_cast<const SvxLRSpaceItem*>(pPoolItem)->ResolveRight({});
|
||||
|
||||
@@ -545,6 +547,8 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
|
||||
if( pArgs->GetItemState(mrDoc.GetPool().GetWhichIDFromSlotID(SID_ATTR_ULSPACE),
|
||||
true, &pPoolItem) == SfxItemState::SET )
|
||||
{
|
||||
// FIXME for tdf#140226: using static_cast<const SvxULSpaceItem*>(pPoolItem)
|
||||
// makes UITest_impress_tests fail
|
||||
nUpper = static_cast<const SvxULSpaceItem*>(pPoolItem)->GetUpper();
|
||||
nLower = static_cast<const SvxULSpaceItem*>(pPoolItem)->GetLower();
|
||||
|
||||
@@ -554,13 +558,13 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
|
||||
|
||||
if( pArgs->GetItemState(mrDoc.GetPool().GetWhichIDFromSlotID(SID_ATTR_PAGE_EXT1), true, &pPoolItem) == SfxItemState::SET )
|
||||
{
|
||||
bScaleAll = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
|
||||
bScaleAll = pPoolItem->StaticWhichCast(SID_ATTR_PAGE_EXT1).GetValue();
|
||||
}
|
||||
|
||||
if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_CHAR_GRABBAG, true, &pPoolItem))
|
||||
{
|
||||
SfxGrabBagItem const*const pGrabBag(static_cast<SfxGrabBagItem const*>(pPoolItem));
|
||||
const auto& rGrabBagInner = pGrabBag->GetGrabBag();
|
||||
SfxGrabBagItem const pGrabBag(pPoolItem->StaticWhichCast(SID_ATTR_CHAR_GRABBAG));
|
||||
const auto& rGrabBagInner = pGrabBag.GetGrabBag();
|
||||
const auto iter = rGrabBagInner.find(u"BackgroundFullSize"_ustr);
|
||||
assert(iter != rGrabBagInner.end());
|
||||
if (iter->second >>= bFullSize)
|
||||
@@ -575,7 +579,7 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
|
||||
// Paper Bin
|
||||
if( pArgs->GetItemState(mrDoc.GetPool().GetWhichIDFromSlotID(SID_ATTR_PAGE_PAPERBIN), true, &pPoolItem) == SfxItemState::SET )
|
||||
{
|
||||
nPaperBin = static_cast<const SvxPaperBinItem*>(pPoolItem)->GetValue();
|
||||
nPaperBin = pPoolItem->StaticWhichCast(SID_ATTR_PAGE_PAPERBIN).GetValue();
|
||||
|
||||
if( mpPage->GetPaperBin() != nPaperBin )
|
||||
bSetPageSizeAndBorder = true;
|
||||
|
||||
@@ -947,7 +947,7 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet )
|
||||
m_xCntSharedFirstBox->set_active(
|
||||
oNonActivatedFirstShared.has_value() ? *oNonActivatedFirstShared : bActivatedFirstShared);
|
||||
|
||||
if (auto pBoolItem = dynamic_cast<const SfxBoolItem*>(GetItem( rSet, SID_ATTR_PAGE_EXT1 )))
|
||||
if (const SfxBoolItem* pBoolItem = GetItem( rSet, SID_ATTR_PAGE_EXT1 ))
|
||||
{
|
||||
m_aBspWin.SetTable( true );
|
||||
m_aBspWin.SetHorz( pBoolItem->GetValue() );
|
||||
|
||||
Reference in New Issue
Block a user