use more TypedWhichId to avoid casting
Change-Id: I98eb7ce26161ec39ef8f8bd9a08315d58d32d0e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196850 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
558a189c7c
commit
9da54fbc26
@@ -102,13 +102,13 @@ bool SchAlignmentTabPage::FillItemSet(SfxItemSet* rOutAttrs)
|
||||
|
||||
void SchAlignmentTabPage::Reset(const SfxItemSet* rInAttrs)
|
||||
{
|
||||
const SfxPoolItem* pItem = GetItem( *rInAttrs, SCHATTR_TEXT_DEGREES );
|
||||
const SdrAngleItem* pDegreesItem = GetItem( *rInAttrs, SCHATTR_TEXT_DEGREES );
|
||||
|
||||
Degree100 nDegrees = pItem ? static_cast<const SdrAngleItem*>(pItem)->GetValue() : 0_deg100;
|
||||
Degree100 nDegrees = pDegreesItem ? pDegreesItem->GetValue() : 0_deg100;
|
||||
m_xCtrlDial->SetRotation( nDegrees );
|
||||
|
||||
pItem = GetItem( *rInAttrs, SCHATTR_TEXT_STACKED );
|
||||
bool bStacked = pItem && static_cast<const SfxBoolItem*>(pItem)->GetValue();
|
||||
const SfxBoolItem* pItem = GetItem( *rInAttrs, SCHATTR_TEXT_STACKED );
|
||||
bool bStacked = pItem && pItem->GetValue();
|
||||
m_xCbStacked->set_active(bStacked);
|
||||
StackedToggleHdl(*m_xCbStacked);
|
||||
|
||||
|
||||
@@ -108,11 +108,9 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(weld::Container* pPage,
|
||||
// has been passed in
|
||||
m_aURLToSelect = GetDefaultToolbar();
|
||||
|
||||
const SfxPoolItem* pItem = rSet.GetItem(SID_CONFIG);
|
||||
|
||||
if (pItem)
|
||||
if (const SfxStringItem* pItem = rSet.GetItem(SID_CONFIG))
|
||||
{
|
||||
OUString text = static_cast<const SfxStringItem*>(pItem)->GetValue();
|
||||
OUString text = pItem->GetValue();
|
||||
if (text.startsWith(ITEM_TOOLBAR_URL))
|
||||
{
|
||||
m_aURLToSelect = text.copy(0);
|
||||
|
||||
@@ -225,9 +225,9 @@ SvxConfigDialog::SvxConfigDialog(weld::Window * pParent, const SfxItemSet* pInSe
|
||||
AddTabPage(u"events"_ustr, TabResId(RID_TAB_EVENTS.aLabel), CreateSvxEventConfigPage,
|
||||
RID_L + RID_TAB_EVENTS.sIconName);
|
||||
|
||||
if (const SfxPoolItem* pItem = pInSet->GetItem(SID_CONFIG))
|
||||
if (const SfxStringItem* pItem = pInSet->GetItem(SID_CONFIG))
|
||||
{
|
||||
OUString text = static_cast<const SfxStringItem*>(pItem)->GetValue();
|
||||
OUString text = pItem->GetValue();
|
||||
if (text.startsWith( ITEM_TOOLBAR_URL ) )
|
||||
SetCurPageId(u"toolbars"_ustr);
|
||||
else if (text.startsWith( ITEM_EVENT_URL) )
|
||||
|
||||
@@ -1143,9 +1143,8 @@ void SvxLinguTabPage::Reset( const SfxItemSet* rSet )
|
||||
int nEntry = 0;
|
||||
|
||||
aLngCfg.GetProperty( UPN_IS_SPELL_AUTO ) >>= bVal;
|
||||
const SfxPoolItem* pItem = GetItem( *rSet, SID_AUTOSPELL_CHECK );
|
||||
if (pItem)
|
||||
bVal = static_cast<const SfxBoolItem *>(pItem)->GetValue();
|
||||
if (const SfxBoolItem* pItem = GetItem( *rSet, SID_AUTOSPELL_CHECK ))
|
||||
bVal = pItem->GetValue();
|
||||
nUserData = OptionsUserData( EID_SPELL_AUTO, false, 0, true, bVal).GetUserData();
|
||||
m_xLinguOptionsCLB->set_toggle(nEntry, bVal ? TRISTATE_TRUE : TRISTATE_FALSE);
|
||||
m_xLinguOptionsCLB->set_text(nEntry, sSpellAuto, 0);
|
||||
|
||||
@@ -336,32 +336,26 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
|
||||
MapUnit eUnit = pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) );
|
||||
|
||||
// adjust margins (right/left)
|
||||
const SfxPoolItem* pItem = GetItem( *rSet, SID_ATTR_LRSPACE );
|
||||
|
||||
if ( pItem )
|
||||
if (const SvxLRSpaceItem* pLRSpace = GetItem( *rSet, SID_ATTR_LRSPACE ))
|
||||
{
|
||||
const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(*pItem);
|
||||
SetMetricValue(*m_xLeftMarginEdit, rLRSpace.ResolveLeft({}), eUnit);
|
||||
SetMetricValue(*m_xGutterMarginEdit, rLRSpace.GetGutterMargin(), eUnit);
|
||||
SetMetricValue(*m_xLeftMarginEdit, pLRSpace->ResolveLeft({}), eUnit);
|
||||
SetMetricValue(*m_xGutterMarginEdit, pLRSpace->GetGutterMargin(), eUnit);
|
||||
m_aBspWin.SetLeft(
|
||||
static_cast<sal_uInt16>(ConvertLong_Impl(rLRSpace.ResolveLeft({}), eUnit)));
|
||||
SetMetricValue(*m_xRightMarginEdit, rLRSpace.ResolveRight({}), eUnit);
|
||||
static_cast<sal_uInt16>(ConvertLong_Impl(pLRSpace->ResolveLeft({}), eUnit)));
|
||||
SetMetricValue(*m_xRightMarginEdit, pLRSpace->ResolveRight({}), eUnit);
|
||||
m_aBspWin.SetRight(
|
||||
static_cast<sal_uInt16>(ConvertLong_Impl(rLRSpace.ResolveRight({}), eUnit)));
|
||||
static_cast<sal_uInt16>(ConvertLong_Impl(pLRSpace->ResolveRight({}), eUnit)));
|
||||
}
|
||||
|
||||
// adjust margins (top/bottom)
|
||||
pItem = GetItem( *rSet, SID_ATTR_ULSPACE );
|
||||
|
||||
if ( pItem )
|
||||
if (const SvxULSpaceItem* pULSpace = GetItem( *rSet, SID_ATTR_ULSPACE ))
|
||||
{
|
||||
const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(*pItem);
|
||||
SetMetricValue( *m_xTopMarginEdit, rULSpace.GetUpper(), eUnit );
|
||||
SetMetricValue( *m_xTopMarginEdit, pULSpace->GetUpper(), eUnit );
|
||||
m_aBspWin.SetTop(
|
||||
static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<tools::Long>(rULSpace.GetUpper()), eUnit )) );
|
||||
SetMetricValue( *m_xBottomMarginEdit, rULSpace.GetLower(), eUnit );
|
||||
static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<tools::Long>(pULSpace->GetUpper()), eUnit )) );
|
||||
SetMetricValue( *m_xBottomMarginEdit, pULSpace->GetLower(), eUnit );
|
||||
m_aBspWin.SetBottom(
|
||||
static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<tools::Long>(rULSpace.GetLower()), eUnit )) );
|
||||
static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<tools::Long>(pULSpace->GetLower()), eUnit )) );
|
||||
}
|
||||
|
||||
if (const SfxGrabBagItem* pGragbagItem = rSet->GetItemIfSet(SID_ATTR_CHAR_GRABBAG))
|
||||
@@ -410,14 +404,11 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
|
||||
SvxNumType eNumType = SVX_NUM_ARABIC;
|
||||
bLandscape = ( mpDefPrinter->GetOrientation() == Orientation::Landscape );
|
||||
SvxPageUsage nUse = SvxPageUsage::All;
|
||||
pItem = GetItem( *rSet, SID_ATTR_PAGE );
|
||||
|
||||
if ( pItem )
|
||||
if (const SvxPageItem* pItem = GetItem( *rSet, SID_ATTR_PAGE ))
|
||||
{
|
||||
const SvxPageItem& rItem = static_cast<const SvxPageItem&>(*pItem);
|
||||
eNumType = rItem.GetNumType();
|
||||
nUse = rItem.GetPageUsage();
|
||||
bLandscape = rItem.IsLandscape();
|
||||
eNumType = pItem->GetNumType();
|
||||
nUse = pItem->GetPageUsage();
|
||||
bLandscape = pItem->IsLandscape();
|
||||
}
|
||||
|
||||
// alignment
|
||||
@@ -430,11 +421,9 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
|
||||
|
||||
m_xPaperTrayBox->clear();
|
||||
sal_uInt8 nPaperBin = PAPERBIN_PRINTER_SETTINGS;
|
||||
pItem = GetItem( *rSet, SID_ATTR_PAGE_PAPERBIN );
|
||||
|
||||
if ( pItem )
|
||||
if (const SvxPaperBinItem* pItem = GetItem( *rSet, SID_ATTR_PAGE_PAPERBIN ))
|
||||
{
|
||||
nPaperBin = static_cast<const SvxPaperBinItem*>(pItem)->GetValue();
|
||||
nPaperBin = pItem->GetValue();
|
||||
|
||||
if ( nPaperBin >= mpDefPrinter->GetPaperBinCount() )
|
||||
nPaperBin = PAPERBIN_PRINTER_SETTINGS;
|
||||
@@ -455,10 +444,8 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
|
||||
m_xPaperTrayBox->connect_focus_in(LINK(this, SvxPageDescPage, PaperBinHdl_Impl));
|
||||
|
||||
Size aPaperSize = SvxPaperInfo::GetPaperSize( mpDefPrinter );
|
||||
pItem = GetItem( *rSet, SID_ATTR_PAGE_SIZE );
|
||||
|
||||
if ( pItem )
|
||||
aPaperSize = static_cast<const SvxSizeItem*>(pItem)->GetSize();
|
||||
if (const SvxSizeItem* pItem = GetItem( *rSet, SID_ATTR_PAGE_SIZE ))
|
||||
aPaperSize = pItem->GetSize();
|
||||
|
||||
bool bOrientationSupport =
|
||||
mpDefPrinter->HasSupport( PrinterSupport::SetOrientation );
|
||||
@@ -514,7 +501,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
|
||||
DisableVerticalPageDir();
|
||||
|
||||
// horizontal alignment
|
||||
pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT1 );
|
||||
const SfxPoolItem* pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT1 );
|
||||
m_xHorzBox->set_active(pItem && static_cast<const SfxBoolItem*>(pItem)->GetValue());
|
||||
|
||||
// vertical alignment
|
||||
@@ -538,7 +525,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
|
||||
{
|
||||
DisableVerticalPageDir();
|
||||
m_xAdaptBox->show();
|
||||
pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT1 );
|
||||
const SfxPoolItem* pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT1 );
|
||||
m_xAdaptBox->set_active( pItem &&
|
||||
static_cast<const SfxBoolItem*>(pItem)->GetValue() );
|
||||
|
||||
@@ -605,12 +592,13 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
|
||||
m_xRegisterLB->save_value();
|
||||
}
|
||||
|
||||
const SvxFrameDirectionItem* pItem = nullptr;
|
||||
SfxItemState eState = rSet->GetItemState( GetWhich( SID_ATTR_FRAMEDIRECTION ),
|
||||
true, &pItem );
|
||||
if( SfxItemState::UNKNOWN != eState )
|
||||
{
|
||||
SvxFrameDirection nVal = SfxItemState::SET == eState
|
||||
? static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue()
|
||||
? pItem->GetValue()
|
||||
: SvxFrameDirection::Horizontal_LR_TB;
|
||||
m_xTextFlowBox->set_active_id(nVal);
|
||||
|
||||
@@ -1250,10 +1238,9 @@ void SvxPageDescPage::ResetBackground_Impl(const SfxItemSet& rSet)
|
||||
void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
|
||||
{
|
||||
bLandscape = m_xLandscapeBtn->get_active();
|
||||
const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE );
|
||||
|
||||
if ( pItem )
|
||||
m_aBspWin.SetSize( static_cast<const SvxSizeItem*>(pItem)->GetSize() );
|
||||
if (const SvxSizeItem* pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE ))
|
||||
m_aBspWin.SetSize( pItem->GetSize() );
|
||||
|
||||
const SvxSetItem* pSetItem = nullptr;
|
||||
|
||||
@@ -1261,7 +1248,7 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
|
||||
|
||||
if ( SfxItemState::SET ==
|
||||
rSet.GetItemState( GetWhich( SID_ATTR_PAGE_HEADERSET ),
|
||||
false, reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
|
||||
false, &pSetItem ) )
|
||||
{
|
||||
const SfxItemSet& rHeaderSet = pSetItem->GetItemSet();
|
||||
const SfxBoolItem& rHeaderOn =
|
||||
|
||||
@@ -856,8 +856,7 @@ bool callColumnFormatDialog(weld::Widget* _pParent,
|
||||
const SfxItemSet* pResult = aDlg.GetOutputItemSet();
|
||||
if (pResult)
|
||||
{
|
||||
const SfxPoolItem* pItem = pResult->GetItem( SID_ATTR_NUMBERFORMAT_INFO );
|
||||
const SvxNumberInfoItem* pInfoItem = static_cast<const SvxNumberInfoItem*>(pItem);
|
||||
const SvxNumberInfoItem* pInfoItem = pResult->GetItem( SID_ATTR_NUMBERFORMAT_INFO );
|
||||
if (pInfoItem)
|
||||
{
|
||||
for (sal_uInt32 key : pInfoItem->GetDelFormats())
|
||||
|
||||
@@ -725,8 +725,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf107572)
|
||||
for (SCCOL i = 0; i < 5; ++i)
|
||||
{
|
||||
const ScPatternAttr* pAttr = pDoc->GetPattern(i, 0, 0);
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
|
||||
const SvxBrushItem& rBackground = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const Color& rColor = rBackground.GetColor();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(COL_BLUE, rColor);
|
||||
@@ -735,15 +734,13 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf107572)
|
||||
for (SCROW i = 1; i < 13; ++i)
|
||||
{
|
||||
const ScPatternAttr* pAttr = pDoc->GetPattern(0, i, 0);
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
|
||||
const SvxBrushItem& rBackground = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const Color& rColor = rBackground.GetColor();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(Color(0x4d, 0x4d, 0x4d), rColor);
|
||||
|
||||
const ScPatternAttr* pAttr2 = pDoc->GetPattern(5, i, 0);
|
||||
const SfxPoolItem& rItem2 = pAttr2->GetItem(ATTR_BACKGROUND);
|
||||
const SvxBrushItem& rBackground2 = static_cast<const SvxBrushItem&>(rItem2);
|
||||
const SvxBrushItem& rBackground2 = pAttr2->GetItem(ATTR_BACKGROUND);
|
||||
const Color& rColor2 = rBackground2.GetColor();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(COL_GRAY3, rColor2);
|
||||
|
||||
@@ -554,8 +554,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testCondFormatParentXLSX)
|
||||
ScDocument* pDoc = getScDoc();
|
||||
const SfxItemSet* pCondSet = pDoc->GetCondResult(2, 5, 0);
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(2, 5, 0);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_VER_JUSTIFY, pCondSet);
|
||||
const SvxVerJustifyItem& rVerJustify = static_cast<const SvxVerJustifyItem&>(rPoolItem);
|
||||
const SvxVerJustifyItem& rVerJustify = pPattern->GetItem(ATTR_VER_JUSTIFY, pCondSet);
|
||||
CPPUNIT_ASSERT_EQUAL(SvxCellVerJustify::Top, rVerJustify.GetValue());
|
||||
}
|
||||
|
||||
|
||||
@@ -274,15 +274,13 @@ void ScCopyPasteTest::testTdf107394()
|
||||
|
||||
static ScMF lcl_getMergeFlagOfCell(const ScDocument& rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab)
|
||||
{
|
||||
const SfxPoolItem& rPoolItem = rDoc.GetPattern(nCol, nRow, nTab)->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = rDoc.GetPattern(nCol, nRow, nTab)->GetItem(ATTR_MERGE_FLAG);
|
||||
return rMergeFlag.GetValue();
|
||||
}
|
||||
|
||||
static ScAddress lcl_getMergeSizeOfCell(const ScDocument& rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab)
|
||||
{
|
||||
const SfxPoolItem& rPoolItem = rDoc.GetPattern(nCol, nRow, nTab)->GetItem(ATTR_MERGE);
|
||||
const ScMergeAttr& rMerge = static_cast<const ScMergeAttr&>(rPoolItem);
|
||||
const ScMergeAttr& rMerge = rDoc.GetPattern(nCol, nRow, nTab)->GetItem(ATTR_MERGE);
|
||||
return ScAddress(rMerge.GetColMerge(), rMerge.GetRowMerge(), nTab);
|
||||
}
|
||||
|
||||
|
||||
@@ -487,16 +487,14 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableNoColumnsLayout)
|
||||
// Check first pivot table's popup button (headerlayout flag)
|
||||
{
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(0, 1, 1);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
|
||||
}
|
||||
|
||||
// Check second pivot table's popup button
|
||||
{
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(3, 0, 1);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
|
||||
}
|
||||
}
|
||||
@@ -518,22 +516,19 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf112501)
|
||||
// Row button
|
||||
{
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(0, 3, 0);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
|
||||
}
|
||||
// Column button
|
||||
{
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(1, 2, 0);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
|
||||
}
|
||||
// Check also C3 to make sure column button is not placed there
|
||||
{
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(2, 2, 0);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(!(rMergeFlag.GetValue() & ScMF::ButtonPopup));
|
||||
}
|
||||
}
|
||||
@@ -546,21 +541,18 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf112501)
|
||||
// Two row buttons
|
||||
{
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(7, 3, 0);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
|
||||
}
|
||||
{
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(8, 3, 0);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
|
||||
}
|
||||
// Column button
|
||||
{
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(9, 2, 0);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
|
||||
}
|
||||
}
|
||||
@@ -1178,8 +1170,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowHeaderXLS)
|
||||
CPPUNIT_ASSERT(pDPObj->GetHeaderLayout());
|
||||
// Check whether the row header has the right popupbutton flag
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(3, 3, 0);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
|
||||
}
|
||||
|
||||
@@ -1190,8 +1181,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowHeaderXLS)
|
||||
CPPUNIT_ASSERT(!pDPObj->GetHeaderLayout());
|
||||
// Check whether the row header has the right popupbutton flag
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(0, 2, 0);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
|
||||
}
|
||||
|
||||
@@ -1210,8 +1200,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowHeaderXLS)
|
||||
CPPUNIT_ASSERT(pDPObj->GetHeaderLayout());
|
||||
// Check whether the row header has the right popupbutton flag
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(3, 3, 0);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
|
||||
}
|
||||
|
||||
@@ -1222,8 +1211,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowHeaderXLS)
|
||||
CPPUNIT_ASSERT(!pDPObj->GetHeaderLayout());
|
||||
// Check whether the row header has the right popupbutton flag
|
||||
const ScPatternAttr* pPattern = pDoc->GetPattern(0, 2, 0);
|
||||
const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
|
||||
const ScMergeFlagAttr& rMergeFlag = pPattern->GetItem(ATTR_MERGE_FLAG);
|
||||
CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,8 +598,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf123139XLSX)
|
||||
pAttr = pDoc->GetPattern(0, 1, 0); //A2
|
||||
|
||||
{
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_HOR_JUSTIFY);
|
||||
const SvxHorJustifyItem& rJustify = static_cast<const SvxHorJustifyItem&>(rItem);
|
||||
const SvxHorJustifyItem& rJustify = pAttr->GetItem(ATTR_HOR_JUSTIFY);
|
||||
CPPUNIT_ASSERT_EQUAL(SvxCellHorJustify::Center, rJustify.GetValue());
|
||||
}
|
||||
|
||||
@@ -612,8 +611,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf123139XLSX)
|
||||
pAttr = pDoc->GetPattern(2, 0, 0); //C1
|
||||
|
||||
{
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_HOR_JUSTIFY);
|
||||
const SvxHorJustifyItem& rJustify = static_cast<const SvxHorJustifyItem&>(rItem);
|
||||
const SvxHorJustifyItem& rJustify = pAttr->GetItem(ATTR_HOR_JUSTIFY);
|
||||
CPPUNIT_ASSERT_EQUAL(SvxCellHorJustify::Standard, rJustify.GetValue());
|
||||
}
|
||||
|
||||
@@ -626,8 +624,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf123139XLSX)
|
||||
pAttr = pDoc->GetPattern(2, 1, 0); //C2
|
||||
|
||||
{
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_HOR_JUSTIFY);
|
||||
const SvxHorJustifyItem& rJustify = static_cast<const SvxHorJustifyItem&>(rItem);
|
||||
const SvxHorJustifyItem& rJustify = pAttr->GetItem(ATTR_HOR_JUSTIFY);
|
||||
CPPUNIT_ASSERT_EQUAL(SvxCellHorJustify::Block, rJustify.GetValue());
|
||||
}
|
||||
|
||||
|
||||
@@ -871,8 +871,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf130132)
|
||||
const ScPatternAttr* pAttr = pDoc->GetPattern(434, 0, 0);
|
||||
|
||||
{
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
|
||||
const SvxBrushItem& rBackground = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const Color& rColor = rBackground.GetColor();
|
||||
// background colour is yellow
|
||||
CPPUNIT_ASSERT_EQUAL(COL_YELLOW, rColor);
|
||||
@@ -887,8 +886,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf166445)
|
||||
|
||||
const ScPatternAttr* pAttr = pDoc->GetPattern(0, 0, 0);
|
||||
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
|
||||
const SvxBrushItem& rBackground = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const Color& rColor = rBackground.GetColor();
|
||||
|
||||
// Without the fix in place, this test would have failed with
|
||||
@@ -905,8 +903,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf165080)
|
||||
|
||||
const ScPatternAttr* pAttr = pDoc->GetPattern(0, 0, 0);
|
||||
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
|
||||
const SvxBrushItem& rBackground = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const Color& rColor = rBackground.GetColor();
|
||||
|
||||
// Without the fix in place, this test would have failed with
|
||||
@@ -923,8 +920,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf133327)
|
||||
|
||||
const ScPatternAttr* pAttr = pDoc->GetPattern(250, 1, 0);
|
||||
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
|
||||
const SvxBrushItem& rBackground = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const Color& rColor = rBackground.GetColor();
|
||||
|
||||
// Without the fix in place, this test would have failed with
|
||||
@@ -941,28 +937,24 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testColumnStyle2XLSX)
|
||||
const ScPatternAttr* pAttr = pDoc->GetPattern(1, 1, 0);
|
||||
|
||||
{
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
|
||||
const SvxBrushItem& rBackground = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const Color& rColor = rBackground.GetColor();
|
||||
CPPUNIT_ASSERT_EQUAL(Color(255, 51, 51), rColor);
|
||||
}
|
||||
|
||||
{
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_HOR_JUSTIFY);
|
||||
const SvxHorJustifyItem& rJustify = static_cast<const SvxHorJustifyItem&>(rItem);
|
||||
const SvxHorJustifyItem& rJustify = pAttr->GetItem(ATTR_HOR_JUSTIFY);
|
||||
CPPUNIT_ASSERT_EQUAL(SvxCellHorJustify::Center, rJustify.GetValue());
|
||||
}
|
||||
|
||||
{
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_FONT_HEIGHT);
|
||||
const SvxFontHeightItem& rFontHeight = static_cast<const SvxFontHeightItem&>(rItem);
|
||||
const SvxFontHeightItem& rFontHeight = pAttr->GetItem(ATTR_FONT_HEIGHT);
|
||||
sal_uInt16 nHeight = rFontHeight.GetHeight();
|
||||
CPPUNIT_ASSERT_EQUAL(sal_uInt16(240), nHeight);
|
||||
}
|
||||
|
||||
{
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_FONT);
|
||||
const SvxFontItem& rFont = static_cast<const SvxFontItem&>(rItem);
|
||||
const SvxFontItem& rFont = pAttr->GetItem(ATTR_FONT);
|
||||
OUString aName = rFont.GetFamilyName();
|
||||
CPPUNIT_ASSERT_EQUAL(u"Linux Biolinum G"_ustr, aName);
|
||||
}
|
||||
|
||||
@@ -1701,16 +1701,14 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRowImportCellStyleIssue)
|
||||
// Check cell A6 - should have no background color set
|
||||
{
|
||||
const ScPatternAttr* pAttr = pDoc->GetPattern(0, 5, 0); // A6
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
|
||||
const SvxBrushItem& rBackground = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
CPPUNIT_ASSERT_EQUAL(false, rBackground.isUsed());
|
||||
}
|
||||
|
||||
// Check cell A7 - should have light2 (background2) theme color set
|
||||
{
|
||||
const ScPatternAttr* pAttr = pDoc->GetPattern(0, 6, 0); // A7
|
||||
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
|
||||
const SvxBrushItem& rBackground = pAttr->GetItem(ATTR_BACKGROUND);
|
||||
CPPUNIT_ASSERT_EQUAL(true, rBackground.isUsed());
|
||||
CPPUNIT_ASSERT_EQUAL(Color(0xe7e6e6), rBackground.GetColor());
|
||||
auto const& rComplexColor = rBackground.getComplexColor();
|
||||
|
||||
@@ -1218,8 +1218,8 @@ std::unique_ptr<ScIconSetInfo> ScIconSetFormat::GetIconSetInfo(const ScAddress&
|
||||
|
||||
std::unique_ptr<ScIconSetInfo> pInfo(new ScIconSetInfo);
|
||||
|
||||
const SfxPoolItem& rPoolItem = mrDoc.GetPattern(rAddr)->GetItem(ATTR_FONT_HEIGHT);
|
||||
tools::Long aFontHeight = static_cast<const SvxFontHeightItem&>(rPoolItem).GetHeight();
|
||||
const SvxFontHeightItem& rPoolItem = mrDoc.GetPattern(rAddr)->GetItem(ATTR_FONT_HEIGHT);
|
||||
tools::Long aFontHeight = rPoolItem.GetHeight();
|
||||
pInfo->mnHeight = aFontHeight;
|
||||
|
||||
if(mpFormatData->mbReverse)
|
||||
|
||||
@@ -997,7 +997,7 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
|
||||
if( !rEscherFmt.mxItemSet )
|
||||
return;
|
||||
|
||||
const XFillStyleItem* pStyleItem = rEscherFmt.mxItemSet->GetItem<XFillStyleItem>( XATTR_FILLSTYLE, false );
|
||||
const XFillStyleItem* pStyleItem = rEscherFmt.mxItemSet->GetItem( XATTR_FILLSTYLE, false );
|
||||
if( !pStyleItem )
|
||||
return;
|
||||
|
||||
@@ -1005,10 +1005,10 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
|
||||
{
|
||||
case drawing::FillStyle_SOLID:
|
||||
// #i84812# Excel 2007 writes Escher properties for solid fill
|
||||
if( const XFillColorItem* pColorItem = rEscherFmt.mxItemSet->GetItem<XFillColorItem>( XATTR_FILLCOLOR, false ) )
|
||||
if( const XFillColorItem* pColorItem = rEscherFmt.mxItemSet->GetItem( XATTR_FILLCOLOR, false ) )
|
||||
{
|
||||
// get solid transparence too
|
||||
const XFillTransparenceItem* pTranspItem = rEscherFmt.mxItemSet->GetItem<XFillTransparenceItem>( XATTR_FILLTRANSPARENCE, false );
|
||||
const XFillTransparenceItem* pTranspItem = rEscherFmt.mxItemSet->GetItem( XATTR_FILLTRANSPARENCE, false );
|
||||
sal_uInt16 nTransp = pTranspItem ? pTranspItem->GetValue() : 0;
|
||||
ScfPropSetHelper& rAreaHlp = GetAreaHelper( ePropMode );
|
||||
rAreaHlp.InitializeWrite();
|
||||
|
||||
@@ -121,12 +121,12 @@ void ScStyleDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage)
|
||||
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
|
||||
if (rPageId == "numbers")
|
||||
{
|
||||
const SfxPoolItem* pInfoItem
|
||||
const SvxNumberInfoItem* pInfoItem
|
||||
= pDocSh->GetItem( SID_ATTR_NUMBERFORMAT_INFO );
|
||||
|
||||
OSL_ENSURE( pInfoItem, "NumberInfoItem not found!" );
|
||||
|
||||
aSet.Put ( static_cast<const SvxNumberInfoItem&>(*pInfoItem) );
|
||||
aSet.Put ( *pInfoItem );
|
||||
rTabPage.PageCreated(aSet);
|
||||
}
|
||||
else if (rPageId == "font")
|
||||
|
||||
@@ -693,10 +693,10 @@ uno::Any SAL_CALL ScAutoFormatFieldObj::getPropertyValue( const OUString& aPrope
|
||||
case SC_WID_UNO_TBLBORD:
|
||||
case SC_WID_UNO_TBLBORD2:
|
||||
{
|
||||
const SfxPoolItem* pItem = pData->GetItem(nFieldIndex, ATTR_BORDER);
|
||||
const SvxBoxItem* pItem = pData->GetItem(nFieldIndex, ATTR_BORDER);
|
||||
if (pItem)
|
||||
{
|
||||
SvxBoxItem aOuter(*static_cast<const SvxBoxItem*>(pItem));
|
||||
SvxBoxItem aOuter(*pItem);
|
||||
SvxBoxInfoItem aInner(ATTR_BORDER_INNER);
|
||||
|
||||
if (pEntry->nWID == SC_WID_UNO_TBLBORD2)
|
||||
|
||||
@@ -1090,8 +1090,7 @@ static void lcl_sendLOKDocumentBackground(const ScViewData* pViewData)
|
||||
{
|
||||
ScDocShell* pDocSh = pViewData->GetDocShell();
|
||||
ScDocument& rDoc = pDocSh->GetDocument();
|
||||
const SfxPoolItem& rItem(rDoc.getCellAttributeHelper().getDefaultCellAttribute().GetItem(ATTR_BACKGROUND));
|
||||
const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
|
||||
const SvxBrushItem& rBackground(rDoc.getCellAttributeHelper().getDefaultCellAttribute().GetItem(ATTR_BACKGROUND));
|
||||
const Color& rColor = rBackground.GetColor();
|
||||
|
||||
ScTabViewShell* pViewShell = pViewData->GetViewShell();
|
||||
|
||||
@@ -260,9 +260,9 @@ FieldUnit SfxModule::GetFieldUnit() const
|
||||
return MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH;
|
||||
}
|
||||
FieldUnit eUnit = FieldUnit::INCH;
|
||||
const SfxPoolItem* pItem = GetItem( SID_ATTR_METRIC );
|
||||
const SfxUInt16Item* pItem = GetItem( SID_ATTR_METRIC );
|
||||
if ( pItem )
|
||||
eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
|
||||
eUnit = static_cast<FieldUnit>(pItem->GetValue());
|
||||
return eUnit;
|
||||
}
|
||||
|
||||
|
||||
+12
-28
@@ -792,15 +792,11 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet )
|
||||
|
||||
void SvxHFPage::ActivatePage( const SfxItemSet& rSet )
|
||||
{
|
||||
const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_LRSPACE );
|
||||
|
||||
if ( pItem )
|
||||
if (const SvxLRSpaceItem* pItem = GetItem( rSet, SID_ATTR_LRSPACE ))
|
||||
{
|
||||
// Set left and right margins
|
||||
const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(*pItem);
|
||||
|
||||
m_aBspWin.SetLeft(rLRSpace.ResolveLeft({}));
|
||||
m_aBspWin.SetRight(rLRSpace.ResolveRight({}));
|
||||
m_aBspWin.SetLeft(pItem->ResolveLeft({}));
|
||||
m_aBspWin.SetRight(pItem->ResolveRight({}));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -808,15 +804,11 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet )
|
||||
m_aBspWin.SetRight( 0 );
|
||||
}
|
||||
|
||||
pItem = GetItem( rSet, SID_ATTR_ULSPACE );
|
||||
|
||||
if ( pItem )
|
||||
if (const SvxULSpaceItem* pItem = GetItem( rSet, SID_ATTR_ULSPACE ))
|
||||
{
|
||||
// Set top and bottom margins
|
||||
const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(*pItem);
|
||||
|
||||
m_aBspWin.SetTop( rULSpace.GetUpper() );
|
||||
m_aBspWin.SetBottom( rULSpace.GetLower() );
|
||||
m_aBspWin.SetTop( pItem->GetUpper() );
|
||||
m_aBspWin.SetBottom( pItem->GetLower() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -825,10 +817,8 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet )
|
||||
}
|
||||
|
||||
SvxPageUsage nUsage = SvxPageUsage::All;
|
||||
pItem = GetItem( rSet, SID_ATTR_PAGE );
|
||||
|
||||
if ( pItem )
|
||||
nUsage = static_cast<const SvxPageItem*>(pItem)->GetPageUsage();
|
||||
if (const SvxPageItem* pItem = GetItem( rSet, SID_ATTR_PAGE ))
|
||||
nUsage = pItem->GetPageUsage();
|
||||
|
||||
m_aBspWin.SetUsage( nUsage );
|
||||
|
||||
@@ -839,14 +829,12 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet )
|
||||
m_xCntSharedBox->set_sensitive(true);
|
||||
m_xCntSharedFirstBox->set_sensitive(true);
|
||||
}
|
||||
pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE );
|
||||
|
||||
if ( pItem )
|
||||
if (const SvxSizeItem* pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE ))
|
||||
{
|
||||
// Orientation and Size from the PageItem
|
||||
const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(*pItem);
|
||||
// if the size is already swapped (Landscape)
|
||||
m_aBspWin.SetSize( rSize.GetSize() );
|
||||
m_aBspWin.SetSize( pItem->GetSize() );
|
||||
}
|
||||
|
||||
// For Writer, either header OR footer can indicate that first H/F will have different contents.
|
||||
@@ -959,17 +947,13 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet )
|
||||
m_xCntSharedFirstBox->set_active(
|
||||
oNonActivatedFirstShared.has_value() ? *oNonActivatedFirstShared : bActivatedFirstShared);
|
||||
|
||||
pItem = GetItem( rSet, SID_ATTR_PAGE_EXT1 );
|
||||
|
||||
if ( auto pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
|
||||
if (auto pBoolItem = dynamic_cast<const SfxBoolItem*>(GetItem( rSet, SID_ATTR_PAGE_EXT1 )))
|
||||
{
|
||||
m_aBspWin.SetTable( true );
|
||||
m_aBspWin.SetHorz( pBoolItem->GetValue() );
|
||||
}
|
||||
|
||||
pItem = GetItem( rSet, SID_ATTR_PAGE_EXT2 );
|
||||
|
||||
if ( auto pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
|
||||
if (const SfxBoolItem* pBoolItem = GetItem( rSet, SID_ATTR_PAGE_EXT2 ))
|
||||
{
|
||||
m_aBspWin.SetTable( true );
|
||||
m_aBspWin.SetVert( pBoolItem->GetValue() );
|
||||
|
||||
@@ -153,10 +153,9 @@ struct SearchDlg_Impl
|
||||
}
|
||||
};
|
||||
|
||||
static void ListToStrArr_Impl(sal_uInt16 nId, std::vector<OUString>& rStrLst, weld::ComboBox& rCBox, sal_uInt16 nRememberSize)
|
||||
static void ListToStrArr_Impl(TypedWhichId<SfxStringListItem> nId, std::vector<OUString>& rStrLst, weld::ComboBox& rCBox, sal_uInt16 nRememberSize)
|
||||
{
|
||||
const SfxStringListItem* pSrchItem =
|
||||
static_cast<const SfxStringListItem*>(SfxGetpApp()->GetItem( nId ));
|
||||
const SfxStringListItem* pSrchItem = SfxGetpApp()->GetItem( nId );
|
||||
|
||||
if (!pSrchItem)
|
||||
return;
|
||||
|
||||
@@ -113,97 +113,95 @@ bool CommonStylePreviewRenderer::recalculate()
|
||||
SvxFont aCJKFont;
|
||||
SvxFont aCTLFont;
|
||||
|
||||
const SfxPoolItem* pItem;
|
||||
if (const SvxWeightItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_WEIGHT))
|
||||
aFont.SetWeight(pItem->GetWeight());
|
||||
if (const SvxWeightItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_CJK_WEIGHT))
|
||||
aCJKFont.SetWeight(pItem->GetWeight());
|
||||
if (const SvxWeightItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_CTL_WEIGHT))
|
||||
aCTLFont.SetWeight(pItem->GetWeight());
|
||||
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_WEIGHT)) != nullptr)
|
||||
aFont.SetWeight(static_cast<const SvxWeightItem*>(pItem)->GetWeight());
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_CJK_WEIGHT)) != nullptr)
|
||||
aCJKFont.SetWeight(static_cast<const SvxWeightItem*>(pItem)->GetWeight());
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_CTL_WEIGHT)) != nullptr)
|
||||
aCTLFont.SetWeight(static_cast<const SvxWeightItem*>(pItem)->GetWeight());
|
||||
if (const SvxPostureItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_POSTURE))
|
||||
aFont.SetItalic(pItem->GetPosture());
|
||||
if (const SvxPostureItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_CJK_POSTURE))
|
||||
aCJKFont.SetItalic(pItem->GetPosture());
|
||||
if (const SvxPostureItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_CTL_POSTURE))
|
||||
aCTLFont.SetItalic(pItem->GetPosture());
|
||||
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_POSTURE)) != nullptr)
|
||||
aFont.SetItalic(static_cast<const SvxPostureItem*>(pItem)->GetPosture());
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_CJK_POSTURE)) != nullptr)
|
||||
aCJKFont.SetItalic(static_cast<const SvxPostureItem*>(pItem)->GetPosture());
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_CTL_POSTURE)) != nullptr)
|
||||
aCTLFont.SetItalic(static_cast<const SvxPostureItem*>(pItem)->GetPosture());
|
||||
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_CONTOUR)) != nullptr)
|
||||
if (const SvxContourItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_CONTOUR))
|
||||
{
|
||||
auto aVal = static_cast<const SvxContourItem*>(pItem)->GetValue();
|
||||
auto aVal = pItem->GetValue();
|
||||
aFont.SetOutline(aVal);
|
||||
aCJKFont.SetOutline(aVal);
|
||||
aCTLFont.SetOutline(aVal);
|
||||
}
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_SHADOWED)) != nullptr)
|
||||
if (const SvxShadowedItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_SHADOWED))
|
||||
{
|
||||
auto aVal = static_cast<const SvxShadowedItem*>(pItem)->GetValue();
|
||||
auto aVal = pItem->GetValue();
|
||||
aFont.SetShadow(aVal);
|
||||
aCJKFont.SetShadow(aVal);
|
||||
aCTLFont.SetShadow(aVal);
|
||||
}
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_RELIEF)) != nullptr)
|
||||
if (const SvxCharReliefItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_RELIEF))
|
||||
{
|
||||
auto aVal = static_cast<const SvxCharReliefItem*>(pItem)->GetValue();
|
||||
auto aVal = pItem->GetValue();
|
||||
aFont.SetRelief(aVal);
|
||||
aCJKFont.SetRelief(aVal);
|
||||
aCTLFont.SetRelief(aVal);
|
||||
}
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_UNDERLINE)) != nullptr)
|
||||
if (const SvxUnderlineItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_UNDERLINE))
|
||||
{
|
||||
auto aVal = static_cast<const SvxUnderlineItem*>(pItem)->GetLineStyle();
|
||||
auto aVal = pItem->GetLineStyle();
|
||||
aFont.SetUnderline(aVal);
|
||||
aCJKFont.SetUnderline(aVal);
|
||||
aCTLFont.SetUnderline(aVal);
|
||||
}
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_OVERLINE)) != nullptr)
|
||||
if (const SvxOverlineItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_OVERLINE))
|
||||
{
|
||||
auto aVal = static_cast<const SvxOverlineItem*>(pItem)->GetValue();
|
||||
auto aVal = pItem->GetValue();
|
||||
aFont.SetOverline(aVal);
|
||||
aCJKFont.SetOverline(aVal);
|
||||
aCTLFont.SetOverline(aVal);
|
||||
}
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_STRIKEOUT)) != nullptr)
|
||||
if (const SvxCrossedOutItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_STRIKEOUT))
|
||||
{
|
||||
auto aVal = static_cast<const SvxCrossedOutItem*>(pItem)->GetStrikeout();
|
||||
auto aVal = pItem->GetStrikeout();
|
||||
aFont.SetStrikeout(aVal);
|
||||
aCJKFont.SetStrikeout(aVal);
|
||||
aCTLFont.SetStrikeout(aVal);
|
||||
}
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_CASEMAP)) != nullptr)
|
||||
if (const SvxCaseMapItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_CASEMAP))
|
||||
{
|
||||
auto aVal = static_cast<const SvxCaseMapItem*>(pItem)->GetCaseMap();
|
||||
auto aVal = pItem->GetCaseMap();
|
||||
aFont.SetCaseMap(aVal);
|
||||
aCJKFont.SetCaseMap(aVal);
|
||||
aCTLFont.SetCaseMap(aVal);
|
||||
}
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_EMPHASISMARK)) != nullptr)
|
||||
if (const SvxEmphasisMarkItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_EMPHASISMARK))
|
||||
{
|
||||
auto aVal = static_cast<const SvxEmphasisMarkItem*>(pItem)->GetEmphasisMark();
|
||||
auto aVal = pItem->GetEmphasisMark();
|
||||
aFont.SetEmphasisMark(aVal);
|
||||
aCJKFont.SetEmphasisMark(aVal);
|
||||
aCTLFont.SetEmphasisMark(aVal);
|
||||
}
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_COLOR)) != nullptr)
|
||||
if (const SvxColorItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_COLOR))
|
||||
{
|
||||
maFontColor = static_cast<const SvxColorItem*>(pItem)->GetValue();
|
||||
maFontColor = pItem->GetValue();
|
||||
}
|
||||
if ((pItem = pItemSet->GetItem(SID_ATTR_BRUSH_CHAR)) != nullptr)
|
||||
if (const SvxBrushItem* pItem = pItemSet->GetItem(SID_ATTR_BRUSH_CHAR))
|
||||
{
|
||||
maHighlightColor = static_cast<const SvxBrushItem*>(pItem)->GetColor();
|
||||
maHighlightColor = pItem->GetColor();
|
||||
}
|
||||
|
||||
if (mpStyle->GetFamily() == SfxStyleFamily::Para)
|
||||
{
|
||||
if ((pItem = pItemSet->GetItem(XATTR_FILLSTYLE)) != nullptr)
|
||||
if (const XFillStyleItem* pItem = pItemSet->GetItem(XATTR_FILLSTYLE))
|
||||
{
|
||||
css::drawing::FillStyle aFillStyle = static_cast<const XFillStyleItem*>(pItem)->GetValue();
|
||||
css::drawing::FillStyle aFillStyle = pItem->GetValue();
|
||||
if (aFillStyle == drawing::FillStyle_SOLID)
|
||||
{
|
||||
if ((pItem = pItemSet->GetItem(XATTR_FILLCOLOR)) != nullptr)
|
||||
if (const XFillColorItem* pFillColorItem = pItemSet->GetItem(XATTR_FILLCOLOR))
|
||||
{
|
||||
maBackgroundColor = static_cast<const XFillColorItem*>(pItem)->GetColorValue();
|
||||
maBackgroundColor = pFillColorItem->GetColorValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -979,10 +979,10 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con
|
||||
{
|
||||
case XATTR_LINECOLOR:
|
||||
{
|
||||
const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINECOLOR);
|
||||
const XLineColorItem* pItem = rSet.GetItem(XATTR_LINECOLOR);
|
||||
if (pItem)
|
||||
{
|
||||
Color aColor = static_cast<const XLineColorItem*>(pItem)->GetColorValue();
|
||||
Color aColor = pItem->GetColorValue();
|
||||
sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
|
||||
|
||||
sPayload = ".uno:XLineColor=" + sPayload;
|
||||
@@ -992,10 +992,10 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con
|
||||
|
||||
case XATTR_FILLCOLOR:
|
||||
{
|
||||
const SfxPoolItem* pItem = rSet.GetItem(XATTR_FILLCOLOR);
|
||||
const XFillColorItem* pItem = rSet.GetItem(XATTR_FILLCOLOR);
|
||||
if (pItem)
|
||||
{
|
||||
Color aColor = static_cast<const XFillColorItem*>(pItem)->GetColorValue();
|
||||
Color aColor = pItem->GetColorValue();
|
||||
sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
|
||||
|
||||
sPayload = ".uno:FillColor=" + sPayload;
|
||||
@@ -1005,10 +1005,10 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con
|
||||
|
||||
case XATTR_FILLTRANSPARENCE:
|
||||
{
|
||||
const SfxPoolItem* pItem = rSet.GetItem(XATTR_FILLTRANSPARENCE);
|
||||
const XFillTransparenceItem* pItem = rSet.GetItem(XATTR_FILLTRANSPARENCE);
|
||||
if (pItem)
|
||||
{
|
||||
sal_uInt16 nTransparency = static_cast<const XFillTransparenceItem*>(pItem)->GetValue();
|
||||
sal_uInt16 nTransparency = pItem->GetValue();
|
||||
sPayload = OUString::number(nTransparency);
|
||||
|
||||
sPayload = ".uno:FillTransparence=" + sPayload;
|
||||
@@ -1018,10 +1018,10 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con
|
||||
|
||||
case XATTR_LINETRANSPARENCE:
|
||||
{
|
||||
const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINETRANSPARENCE);
|
||||
const SfxUInt16Item* pItem = rSet.GetItem(XATTR_LINETRANSPARENCE);
|
||||
if (pItem)
|
||||
{
|
||||
sal_uInt16 nTransparency = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
|
||||
sal_uInt16 nTransparency = pItem->GetValue();
|
||||
sPayload = OUString::number(nTransparency);
|
||||
|
||||
sPayload = ".uno:LineTransparence=" + sPayload;
|
||||
@@ -1031,10 +1031,10 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con
|
||||
|
||||
case XATTR_LINEWIDTH:
|
||||
{
|
||||
const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINEWIDTH);
|
||||
const XLineWidthItem* pItem = rSet.GetItem(XATTR_LINEWIDTH);
|
||||
if (pItem)
|
||||
{
|
||||
sal_uInt32 nWidth = static_cast<const XLineWidthItem*>(pItem)->GetValue();
|
||||
sal_uInt32 nWidth = pItem->GetValue();
|
||||
sPayload = OUString::number(nWidth);
|
||||
|
||||
sPayload = ".uno:LineWidth=" + sPayload;
|
||||
@@ -1044,10 +1044,10 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con
|
||||
|
||||
case SDRATTR_SHADOWTRANSPARENCE:
|
||||
{
|
||||
const SfxPoolItem* pItem = rSet.GetItem(SDRATTR_SHADOWTRANSPARENCE);
|
||||
const SfxUInt16Item* pItem = rSet.GetItem(SDRATTR_SHADOWTRANSPARENCE);
|
||||
if (pItem)
|
||||
{
|
||||
sal_uInt16 nWidth = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
|
||||
sal_uInt16 nWidth = pItem->GetValue();
|
||||
sPayload = OUString::number(nWidth);
|
||||
|
||||
sPayload = ".uno:FillShadowTransparency=" + sPayload;
|
||||
|
||||
@@ -216,36 +216,32 @@ bool StylesPreviewWindow_Base::Command(const CommandEvent& rEvent)
|
||||
|
||||
static Color GetTextColorFromItemSet(std::optional<SfxItemSet> const& pItemSet)
|
||||
{
|
||||
const SfxPoolItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_COLOR);
|
||||
if (pItem)
|
||||
return static_cast<const SvxColorItem*>(pItem)->GetValue();
|
||||
if (const SvxColorItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_COLOR))
|
||||
return pItem->GetValue();
|
||||
|
||||
return COL_AUTO;
|
||||
}
|
||||
|
||||
static Color GetHighlightColorFromItemSet(std::optional<SfxItemSet> const& pItemSet)
|
||||
{
|
||||
const SfxPoolItem* pItem = pItemSet->GetItem(SID_ATTR_BRUSH_CHAR);
|
||||
if (pItem)
|
||||
return static_cast<const SvxBrushItem*>(pItem)->GetColor();
|
||||
if (const SvxBrushItem* pItem = pItemSet->GetItem(SID_ATTR_BRUSH_CHAR))
|
||||
return pItem->GetColor();
|
||||
|
||||
return COL_AUTO;
|
||||
}
|
||||
|
||||
static Color GetBackgroundColorFromItemSet(std::optional<SfxItemSet> const& pItemSet)
|
||||
{
|
||||
const SfxPoolItem* pItem = pItemSet->GetItem(XATTR_FILLCOLOR);
|
||||
if (pItem)
|
||||
return static_cast<const XFillColorItem*>(pItem)->GetColorValue();
|
||||
if (const XFillColorItem* pItem = pItemSet->GetItem(XATTR_FILLCOLOR))
|
||||
return pItem->GetColorValue();
|
||||
|
||||
return COL_AUTO;
|
||||
}
|
||||
|
||||
static css::drawing::FillStyle GetFillStyleFromItemSet(std::optional<SfxItemSet> const& pItemSet)
|
||||
{
|
||||
const SfxPoolItem* pItem = pItemSet->GetItem(XATTR_FILLSTYLE);
|
||||
if (pItem)
|
||||
return static_cast<const XFillStyleItem*>(pItem)->GetValue();
|
||||
if (const XFillStyleItem* pItem = pItemSet->GetItem(XATTR_FILLSTYLE))
|
||||
return pItem->GetValue();
|
||||
|
||||
return css::drawing::FillStyle_NONE;
|
||||
}
|
||||
@@ -259,45 +255,35 @@ static SvxFont GetFontFromItems(const SvxFontItem* pFontItem, Size aPixelFontSiz
|
||||
aFont.SetStyleName(pFontItem->GetStyleName());
|
||||
aFont.SetFontSize(aPixelFontSize);
|
||||
|
||||
const SfxPoolItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_WEIGHT);
|
||||
if (pItem)
|
||||
aFont.SetWeight(static_cast<const SvxWeightItem*>(pItem)->GetWeight());
|
||||
if (const SvxWeightItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_WEIGHT))
|
||||
aFont.SetWeight(pItem->GetWeight());
|
||||
|
||||
pItem = pItemSet->GetItem(SID_ATTR_CHAR_POSTURE);
|
||||
if (pItem)
|
||||
aFont.SetItalic(static_cast<const SvxPostureItem*>(pItem)->GetPosture());
|
||||
if (const SvxPostureItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_POSTURE))
|
||||
aFont.SetItalic(pItem->GetPosture());
|
||||
|
||||
pItem = pItemSet->GetItem(SID_ATTR_CHAR_CONTOUR);
|
||||
if (pItem)
|
||||
aFont.SetOutline(static_cast<const SvxContourItem*>(pItem)->GetValue());
|
||||
if (const SvxContourItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_CONTOUR))
|
||||
aFont.SetOutline(pItem->GetValue());
|
||||
|
||||
pItem = pItemSet->GetItem(SID_ATTR_CHAR_SHADOWED);
|
||||
if (pItem)
|
||||
aFont.SetShadow(static_cast<const SvxShadowedItem*>(pItem)->GetValue());
|
||||
if (const SvxShadowedItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_SHADOWED))
|
||||
aFont.SetShadow(pItem->GetValue());
|
||||
|
||||
pItem = pItemSet->GetItem(SID_ATTR_CHAR_RELIEF);
|
||||
if (pItem)
|
||||
aFont.SetRelief(static_cast<const SvxCharReliefItem*>(pItem)->GetValue());
|
||||
if (const SvxCharReliefItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_RELIEF))
|
||||
aFont.SetRelief(pItem->GetValue());
|
||||
|
||||
pItem = pItemSet->GetItem(SID_ATTR_CHAR_UNDERLINE);
|
||||
if (pItem)
|
||||
aFont.SetUnderline(static_cast<const SvxUnderlineItem*>(pItem)->GetLineStyle());
|
||||
if (const SvxUnderlineItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_UNDERLINE))
|
||||
aFont.SetUnderline(pItem->GetLineStyle());
|
||||
|
||||
pItem = pItemSet->GetItem(SID_ATTR_CHAR_OVERLINE);
|
||||
if (pItem)
|
||||
aFont.SetOverline(static_cast<const SvxOverlineItem*>(pItem)->GetValue());
|
||||
if (const SvxOverlineItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_OVERLINE))
|
||||
aFont.SetOverline(pItem->GetValue());
|
||||
|
||||
pItem = pItemSet->GetItem(SID_ATTR_CHAR_STRIKEOUT);
|
||||
if (pItem)
|
||||
aFont.SetStrikeout(static_cast<const SvxCrossedOutItem*>(pItem)->GetStrikeout());
|
||||
if (const SvxCrossedOutItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_STRIKEOUT))
|
||||
aFont.SetStrikeout(pItem->GetStrikeout());
|
||||
|
||||
pItem = pItemSet->GetItem(SID_ATTR_CHAR_CASEMAP);
|
||||
if (pItem)
|
||||
aFont.SetCaseMap(static_cast<const SvxCaseMapItem*>(pItem)->GetCaseMap());
|
||||
if (const SvxCaseMapItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_CASEMAP))
|
||||
aFont.SetCaseMap(pItem->GetCaseMap());
|
||||
|
||||
pItem = pItemSet->GetItem(SID_ATTR_CHAR_EMPHASISMARK);
|
||||
if (pItem)
|
||||
aFont.SetEmphasisMark(static_cast<const SvxEmphasisMarkItem*>(pItem)->GetEmphasisMark());
|
||||
if (const SvxEmphasisMarkItem* pEmphasisItem = pItemSet->GetItem(SID_ATTR_CHAR_EMPHASISMARK))
|
||||
aFont.SetEmphasisMark(pEmphasisItem->GetEmphasisMark());
|
||||
|
||||
return aFont;
|
||||
}
|
||||
|
||||
@@ -211,10 +211,9 @@ SvxColorDockingWindow::SvxColorDockingWindow(SfxBindings* _pBindings, SfxChildWi
|
||||
|
||||
if ( pDocSh )
|
||||
{
|
||||
const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
|
||||
if( pItem )
|
||||
if (const SvxColorListItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE ))
|
||||
{
|
||||
pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
|
||||
pColorList = pItem->GetColorList();
|
||||
FillValueSet();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,9 +284,8 @@ SvxLineEndWindow::SvxLineEndWindow(SvxLineEndToolBoxControl* pControl, weld::Wid
|
||||
SfxObjectShell* pDocSh = SfxObjectShell::Current();
|
||||
if ( pDocSh )
|
||||
{
|
||||
const SfxPoolItem* pItem = pDocSh->GetItem( SID_LINEEND_LIST );
|
||||
if( pItem )
|
||||
mpLineEndList = static_cast<const SvxLineEndListItem*>( pItem )->GetLineEndList();
|
||||
if (const SvxLineEndListItem* pItem = pDocSh->GetItem( SID_LINEEND_LIST ))
|
||||
mpLineEndList = pItem->GetLineEndList();
|
||||
}
|
||||
DBG_ASSERT( mpLineEndList.is(), "LineEndList not found" );
|
||||
|
||||
|
||||
@@ -1408,73 +1408,65 @@ void SvxStyleBox_Base::SetupEntry(vcl::RenderContext& rRenderContext, sal_Int32
|
||||
SetFontStyle(*pItemSet, SID_ATTR_CHAR_CJK_POSTURE, SID_ATTR_CHAR_CJK_WEIGHT, aCJKFont);
|
||||
SetFontStyle(*pItemSet, SID_ATTR_CHAR_CTL_POSTURE, SID_ATTR_CHAR_CTL_WEIGHT, aCTLFont);
|
||||
|
||||
const SfxPoolItem *pItem = pItemSet->GetItem( SID_ATTR_CHAR_CONTOUR );
|
||||
if ( pItem )
|
||||
if (const SvxContourItem *pContourItem = pItemSet->GetItem( SID_ATTR_CHAR_CONTOUR ))
|
||||
{
|
||||
auto aVal = static_cast< const SvxContourItem* >( pItem )->GetValue();
|
||||
auto aVal = pContourItem->GetValue();
|
||||
aFont.SetOutline(aVal);
|
||||
aCJKFont.SetOutline(aVal);
|
||||
aCTLFont.SetOutline(aVal);
|
||||
}
|
||||
|
||||
pItem = pItemSet->GetItem( SID_ATTR_CHAR_SHADOWED );
|
||||
if ( pItem )
|
||||
if (const SvxShadowedItem* pShadowedItem = pItemSet->GetItem( SID_ATTR_CHAR_SHADOWED ))
|
||||
{
|
||||
auto aVal = static_cast< const SvxShadowedItem* >( pItem )->GetValue();
|
||||
auto aVal = pShadowedItem->GetValue();
|
||||
aFont.SetShadow(aVal);
|
||||
aCJKFont.SetShadow(aVal);
|
||||
aCTLFont.SetShadow(aVal);
|
||||
}
|
||||
|
||||
pItem = pItemSet->GetItem( SID_ATTR_CHAR_RELIEF );
|
||||
if ( pItem )
|
||||
if (const SvxCharReliefItem* pCharReliefItem = pItemSet->GetItem( SID_ATTR_CHAR_RELIEF ))
|
||||
{
|
||||
auto aVal = static_cast< const SvxCharReliefItem* >( pItem )->GetValue();
|
||||
auto aVal = pCharReliefItem->GetValue();
|
||||
aFont.SetRelief(aVal);
|
||||
aCJKFont.SetRelief(aVal);
|
||||
aCTLFont.SetRelief(aVal);
|
||||
}
|
||||
|
||||
pItem = pItemSet->GetItem( SID_ATTR_CHAR_UNDERLINE );
|
||||
if ( pItem )
|
||||
if (const SvxUnderlineItem* pUnderlineItem = pItemSet->GetItem( SID_ATTR_CHAR_UNDERLINE ))
|
||||
{
|
||||
auto aVal = static_cast<const SvxUnderlineItem*>(pItem)->GetLineStyle();
|
||||
auto aVal = pUnderlineItem->GetLineStyle();
|
||||
aFont.SetUnderline(aVal);
|
||||
aCJKFont.SetUnderline(aVal);
|
||||
aCTLFont.SetUnderline(aVal);
|
||||
}
|
||||
|
||||
pItem = pItemSet->GetItem( SID_ATTR_CHAR_OVERLINE );
|
||||
if ( pItem )
|
||||
if (const SvxOverlineItem* pOverlineItem = pItemSet->GetItem( SID_ATTR_CHAR_OVERLINE ))
|
||||
{
|
||||
auto aVal = static_cast< const SvxOverlineItem* >( pItem )->GetValue();
|
||||
auto aVal = pOverlineItem->GetValue();
|
||||
aFont.SetOverline(aVal);
|
||||
aCJKFont.SetOverline(aVal);
|
||||
aCTLFont.SetOverline(aVal);
|
||||
}
|
||||
|
||||
pItem = pItemSet->GetItem( SID_ATTR_CHAR_STRIKEOUT );
|
||||
if ( pItem )
|
||||
if (const SvxCrossedOutItem* pCrossedOutItem = pItemSet->GetItem( SID_ATTR_CHAR_STRIKEOUT ))
|
||||
{
|
||||
auto aVal = static_cast< const SvxCrossedOutItem* >( pItem )->GetStrikeout();
|
||||
auto aVal = pCrossedOutItem->GetStrikeout();
|
||||
aFont.SetStrikeout(aVal);
|
||||
aCJKFont.SetStrikeout(aVal);
|
||||
aCTLFont.SetStrikeout(aVal);
|
||||
}
|
||||
|
||||
pItem = pItemSet->GetItem( SID_ATTR_CHAR_CASEMAP );
|
||||
if ( pItem )
|
||||
if (const SvxCaseMapItem* pCaseMapItem = pItemSet->GetItem( SID_ATTR_CHAR_CASEMAP ))
|
||||
{
|
||||
auto aVal = static_cast<const SvxCaseMapItem*>(pItem)->GetCaseMap();
|
||||
auto aVal = pCaseMapItem->GetCaseMap();
|
||||
aFont.SetCaseMap(aVal);
|
||||
aCJKFont.SetCaseMap(aVal);
|
||||
aCTLFont.SetCaseMap(aVal);
|
||||
}
|
||||
|
||||
pItem = pItemSet->GetItem( SID_ATTR_CHAR_EMPHASISMARK );
|
||||
if ( pItem )
|
||||
if (const SvxEmphasisMarkItem* pEmphasisMarkItem = pItemSet->GetItem( SID_ATTR_CHAR_EMPHASISMARK ))
|
||||
{
|
||||
auto aVal = static_cast< const SvxEmphasisMarkItem* >( pItem )->GetEmphasisMark();
|
||||
auto aVal = pEmphasisMarkItem->GetEmphasisMark();
|
||||
aFont.SetEmphasisMark(aVal);
|
||||
aCJKFont.SetEmphasisMark(aVal);
|
||||
aCTLFont.SetEmphasisMark(aVal);
|
||||
@@ -1483,26 +1475,25 @@ void SvxStyleBox_Base::SetupEntry(vcl::RenderContext& rRenderContext, sal_Int32
|
||||
// setup the device & draw
|
||||
Color aFontCol = COL_AUTO, aBackCol = COL_AUTO;
|
||||
|
||||
pItem = pItemSet->GetItem( SID_ATTR_CHAR_COLOR );
|
||||
const SvxColorItem* pColorItem = pItemSet->GetItem( SID_ATTR_CHAR_COLOR );
|
||||
// text color, when nothing is selected
|
||||
if ( (nullptr != pItem) && bIsNotSelected)
|
||||
aFontCol = static_cast< const SvxColorItem* >( pItem )->GetValue();
|
||||
if ( pColorItem && bIsNotSelected)
|
||||
aFontCol = pColorItem->GetValue();
|
||||
|
||||
drawing::FillStyle style = drawing::FillStyle_NONE;
|
||||
// which kind of Fill style is selected
|
||||
pItem = pItemSet->GetItem( XATTR_FILLSTYLE );
|
||||
const XFillStyleItem* pFillStyleItem = pItemSet->GetItem( XATTR_FILLSTYLE );
|
||||
// only when ok and not selected
|
||||
if ( (nullptr != pItem) && bIsNotSelected)
|
||||
style = static_cast< const XFillStyleItem* >( pItem )->GetValue();
|
||||
if ( pFillStyleItem && bIsNotSelected)
|
||||
style = pFillStyleItem->GetValue();
|
||||
|
||||
switch(style)
|
||||
{
|
||||
case drawing::FillStyle_SOLID:
|
||||
{
|
||||
// set background color
|
||||
pItem = pItemSet->GetItem( XATTR_FILLCOLOR );
|
||||
if ( nullptr != pItem )
|
||||
aBackCol = static_cast< const XFillColorItem* >( pItem )->GetColorValue();
|
||||
if (const XFillColorItem* pFillColorItem = pItemSet->GetItem( XATTR_FILLCOLOR ))
|
||||
aBackCol = pFillColorItem->GetColorValue();
|
||||
|
||||
if ( aBackCol != COL_AUTO )
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <com/sun/star/document/XEventsSupplier.hpp>
|
||||
#include <svl/typedwhich.hxx>
|
||||
|
||||
class SfxPoolItem;
|
||||
|
||||
@@ -29,6 +30,10 @@ class ICoreFrameStyle
|
||||
public:
|
||||
virtual void SetItem(sal_uInt16 eAtr, const SfxPoolItem& rItem) = 0;
|
||||
virtual const SfxPoolItem* GetItem(sal_uInt16 eAtr) = 0;
|
||||
template <class T> const T* GetItem(TypedWhichId<T> nWhich)
|
||||
{
|
||||
return static_cast<const T*>(GetItem(sal_uInt16(nWhich)));
|
||||
}
|
||||
virtual css::document::XEventsSupplier& GetEventsSupplier() = 0;
|
||||
virtual ~ICoreFrameStyle(){};
|
||||
};
|
||||
|
||||
@@ -192,12 +192,7 @@ SwRotatedPortion::SwRotatedPortion( const SwMultiCreator& rCreate,
|
||||
if( !pRot )
|
||||
{
|
||||
const SwTextAttr& rAttr = *rCreate.pAttr;
|
||||
const SfxPoolItem *const pItem =
|
||||
CharFormat::GetItem(rAttr, RES_CHRATR_ROTATE);
|
||||
if ( pItem )
|
||||
{
|
||||
pRot = static_cast<const SvxCharRotateItem*>(pItem);
|
||||
}
|
||||
pRot = CharFormat::GetItem(rAttr, RES_CHRATR_ROTATE);
|
||||
}
|
||||
if( pRot )
|
||||
{
|
||||
@@ -313,12 +308,7 @@ SwDoubleLinePortion::SwDoubleLinePortion(
|
||||
const SwTextAttr& rAttr = *rCreate.pAttr;
|
||||
m_pBracket->nStart = rCreate.nStartOfAttr;
|
||||
|
||||
const SfxPoolItem * const pItem =
|
||||
CharFormat::GetItem( rAttr, RES_CHRATR_TWO_LINES );
|
||||
if ( pItem )
|
||||
{
|
||||
pTwo = static_cast<const SvxTwoLinesItem*>(pItem);
|
||||
}
|
||||
pTwo = CharFormat::GetItem( rAttr, RES_CHRATR_TWO_LINES );
|
||||
}
|
||||
if( pTwo )
|
||||
{
|
||||
|
||||
@@ -214,10 +214,8 @@ void SwFrameStyleEventDescriptor::setMacroItem(const SvxMacroItem& rItem)
|
||||
|
||||
const SvxMacroItem& SwFrameStyleEventDescriptor::getMacroItem()
|
||||
{
|
||||
const SfxPoolItem* pItem(m_rStyle.GetItem(RES_FRMMACRO));
|
||||
return pItem ?
|
||||
static_cast<const SvxMacroItem&>(*pItem) :
|
||||
*GetDfltAttr(RES_FRMMACRO);
|
||||
const SvxMacroItem* pItem(m_rStyle.GetItem(RES_FRMMACRO));
|
||||
return pItem ? *pItem : *GetDfltAttr(RES_FRMMACRO);
|
||||
}
|
||||
|
||||
OUString SwFrameStyleEventDescriptor::getImplementationName()
|
||||
|
||||
@@ -606,10 +606,9 @@ sal_Int32 DocxAttributeOutput::StartParagraph(const ww8::WW8TableNodeInfo::Point
|
||||
if (pTextNode && pTextNode->GetpSwAttrSet())
|
||||
{
|
||||
const SfxItemSet* pSet = pTextNode->GetpSwAttrSet();
|
||||
if (const SfxPoolItem* pItem = pSet->GetItem(RES_PARATR_GRABBAG))
|
||||
if (const SfxGrabBagItem* pParaGrabBag = pSet->GetItem(RES_PARATR_GRABBAG))
|
||||
{
|
||||
const SfxGrabBagItem& rParaGrabBag = static_cast<const SfxGrabBagItem&>(*pItem);
|
||||
const std::map<OUString, css::uno::Any>& rMap = rParaGrabBag.GetGrabBag();
|
||||
const std::map<OUString, css::uno::Any>& rMap = pParaGrabBag->GetGrabBag();
|
||||
bEndParaSdt = m_aParagraphSdt.m_bStartedSdt && rMap.contains(u"ParaSdtEndBefore"_ustr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ namespace sw
|
||||
m_DyaTop = m_DyaHdrTop;
|
||||
m_DyaBottom = m_DyaHdrBottom;
|
||||
|
||||
const SwFormatHeader *pHd = rPage.GetItem<SwFormatHeader>(RES_HEADER);
|
||||
const SwFormatHeader *pHd = rPage.GetItem(RES_HEADER);
|
||||
if (pHd && pHd->IsActive() && pHd->GetHeaderFormat())
|
||||
{
|
||||
mbHasHeader = true;
|
||||
@@ -435,7 +435,7 @@ namespace sw
|
||||
else
|
||||
mbHasHeader = false;
|
||||
|
||||
const SwFormatFooter *pFt = rPage.GetItem<SwFormatFooter>(RES_FOOTER);
|
||||
const SwFormatFooter *pFt = rPage.GetItem(RES_FOOTER);
|
||||
if (pFt && pFt->IsActive() && pFt->GetFooterFormat())
|
||||
{
|
||||
mbHasFooter = true;
|
||||
|
||||
@@ -1853,9 +1853,9 @@ OUString SwWW8AttrIter::GetSnippet(const OUString &rStr, sal_Int32 nCurrentPos,
|
||||
aSnippet = comphelper::string::removeAny(aSnippet, aForbidden);
|
||||
|
||||
m_rExport.m_aCurrentCharPropStarts.push( nCurrentPos );
|
||||
const SfxPoolItem &rItem = GetItem(RES_CHRATR_CASEMAP);
|
||||
const SvxCaseMapItem &rItem = GetItem(RES_CHRATR_CASEMAP);
|
||||
|
||||
if (SvxCaseMap::Capitalize == static_cast<const SvxCaseMapItem&>(rItem).GetValue())
|
||||
if (SvxCaseMap::Capitalize == rItem.GetValue())
|
||||
{
|
||||
assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
|
||||
sal_uInt16 nScriptType = g_pBreakIt->GetBreakIter()->getScriptType(aSnippet, 0);
|
||||
@@ -1864,14 +1864,14 @@ OUString SwWW8AttrIter::GetSnippet(const OUString &rStr, sal_Int32 nCurrentPos,
|
||||
switch (nScriptType)
|
||||
{
|
||||
case i18n::ScriptType::ASIAN:
|
||||
nLanguage = static_cast<const SvxLanguageItem&>(GetItem(RES_CHRATR_CJK_LANGUAGE)).GetLanguage();
|
||||
nLanguage = GetItem(RES_CHRATR_CJK_LANGUAGE).GetLanguage();
|
||||
break;
|
||||
case i18n::ScriptType::COMPLEX:
|
||||
nLanguage = static_cast<const SvxLanguageItem&>(GetItem(RES_CHRATR_CTL_LANGUAGE)).GetLanguage();
|
||||
nLanguage = GetItem(RES_CHRATR_CTL_LANGUAGE).GetLanguage();
|
||||
break;
|
||||
case i18n::ScriptType::LATIN:
|
||||
default:
|
||||
nLanguage = static_cast<const SvxLanguageItem&>(GetItem(RES_CHRATR_LANGUAGE)).GetLanguage();
|
||||
nLanguage = GetItem(RES_CHRATR_LANGUAGE).GetLanguage();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2308,13 +2308,9 @@ OUString lcl_GetSymbolFont(SwAttrPool& rPool, const SwTextNode& rTextNode, int n
|
||||
SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet( rPool );
|
||||
if (rTextNode.GetParaAttr(aSet, nStart, nEnd))
|
||||
{
|
||||
SfxPoolItem const* pPoolItem = aSet.GetItem(RES_CHRATR_FONT);
|
||||
if (pPoolItem)
|
||||
{
|
||||
const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(pPoolItem);
|
||||
if (pFontItem->GetCharSet() == RTL_TEXTENCODING_SYMBOL)
|
||||
return pFontItem->GetFamilyName();
|
||||
}
|
||||
SvxFontItem const* pFontItem = aSet.GetItem(RES_CHRATR_FONT);
|
||||
if (pFontItem && pFontItem->GetCharSet() == RTL_TEXTENCODING_SYMBOL)
|
||||
return pFontItem->GetFamilyName();
|
||||
}
|
||||
|
||||
return OUString();
|
||||
|
||||
@@ -1474,6 +1474,10 @@ public:
|
||||
return static_cast<const T*>(HasTextItem(sal_uInt16(nWhich)));
|
||||
}
|
||||
virtual const SfxPoolItem& GetItem( sal_uInt16 nWhich ) const = 0;
|
||||
template<class T> const T& GetItem( TypedWhichId<T> nWhich ) const
|
||||
{
|
||||
return static_cast<const T&>(GetItem(sal_uInt16(nWhich)));
|
||||
}
|
||||
};
|
||||
|
||||
/// Used to export formatted text associated to drawings.
|
||||
@@ -1513,6 +1517,7 @@ public:
|
||||
void OutAttr( sal_Int32 nSwPos );
|
||||
virtual const SfxPoolItem* HasTextItem( sal_uInt16 nWhich ) const override;
|
||||
virtual const SfxPoolItem& GetItem( sal_uInt16 nWhich ) const override;
|
||||
template<class T> const T& GetItem( TypedWhichId<T> nWhich ) const { return MSWordAttrIter::GetItem(nWhich); }
|
||||
sal_Int32 WhereNext() const { return m_nCurrentSwPos; }
|
||||
rtl_TextEncoding GetNextCharSet() const;
|
||||
rtl_TextEncoding GetNodeCharSet() const { return m_eNdChrSet; }
|
||||
@@ -1572,6 +1577,7 @@ public:
|
||||
void OutAttr(sal_Int32 nSwPos, bool bWriteCombinedChars);
|
||||
virtual const SfxPoolItem* HasTextItem( sal_uInt16 nWhich ) const override;
|
||||
virtual const SfxPoolItem& GetItem( sal_uInt16 nWhich ) const override;
|
||||
template<class T> const T& GetItem( TypedWhichId<T> nWhich ) const { return MSWordAttrIter::GetItem(nWhich); }
|
||||
int OutAttrWithRange(const SwTextNode& rNode, sal_Int32 nPos);
|
||||
const SwRedlineData* GetParagraphLevelRedline( );
|
||||
const SwRedlineData* GetRunLevelRedline( sal_Int32 nPos );
|
||||
|
||||
@@ -163,10 +163,10 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet)
|
||||
// if no example exists, otherwise Init here in Activate
|
||||
std::optional<SwPageFootnoteInfo> pDefFootnoteInfo;
|
||||
const SwPageFootnoteInfo* pFootnoteInfo;
|
||||
const SfxPoolItem* pItem = SfxTabPage::GetItem(*rSet, FN_PARAM_FTN_INFO);
|
||||
const SwPageFootnoteInfoItem* pItem = SfxTabPage::GetItem(*rSet, FN_PARAM_FTN_INFO);
|
||||
if( pItem )
|
||||
{
|
||||
pFootnoteInfo = &static_cast<const SwPageFootnoteInfoItem*>(pItem)->GetPageFootnoteInfo();
|
||||
pFootnoteInfo = &pItem->GetPageFootnoteInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user