cui/source/tabpages/align.cxx | 56 ++++++++++++++++++++++---- sc/inc/attrib.hxx | 12 +++++ sc/inc/globstr.hrc | 1 sc/inc/scitems.hxx | 2 sc/source/core/data/attarray.cxx | 2 sc/source/core/data/attrib.cxx | 33 +++++++++++++++ sc/source/core/data/column2.cxx | 2 sc/source/core/data/docpool.cxx | 2 sc/source/filter/excel/xistyle.cxx | 2 sc/source/filter/oox/stylesbuffer.cxx | 2 sc/source/ui/Accessibility/AccessibleText.cxx | 2 sc/source/ui/unoobj/cellsuno.cxx | 6 +- sc/source/ui/unoobj/styleuno.cxx | 7 +-- sc/source/ui/view/output2.cxx | 2 sc/source/ui/view/viewfunc.cxx | 2 15 files changed, 109 insertions(+), 24 deletions(-)
New commits: commit 5d44be6c13e6da2d50c0b75d0794a69e796072b5 Author: Caolán McNamara <[email protected]> AuthorDate: Wed Dec 11 14:05:45 2019 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Wed Dec 11 17:09:53 2019 +0100 Related: tdf#129300 clear properties that are set back to their original state Change-Id: Ic957afbdcf6decef07d15fa10a560e560de5795a Reviewed-on: https://gerrit.libreoffice.org/84951 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index 48ee07764cd5..d0dbae16e685 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -174,8 +174,11 @@ std::unique_ptr<SfxTabPage> AlignmentTabPage::Create(weld::Container* pPage, wel bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) { + const SfxItemSet& rOldSet = GetItemSet(); + bool bChanged = SfxTabPage::FillItemSet(rSet); + sal_uInt16 nWhich = GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY); if (m_xLbHorAlign->get_value_changed_from_saved()) { SvxCellHorJustify eJustify(SvxCellHorJustify::Standard); @@ -201,10 +204,13 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) eJustify = SvxCellHorJustify::Repeat; break; } - rSet->Put(SvxHorJustifyItem(eJustify, GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY))); + rSet->Put(SvxHorJustifyItem(eJustify, nWhich)); bChanged = true; } + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) + rSet->InvalidateItem(nWhich); + nWhich = GetWhich(SID_ATTR_ALIGN_INDENT); if (m_xEdIndent->get_value_changed_from_saved()) { const SfxUInt16Item* pIndentItem = static_cast<const SfxUInt16Item*>(GetOldItem( @@ -215,7 +221,10 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) rSet->Put(*pNewIndentItem); bChanged = true; } + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) + rSet->InvalidateItem(nWhich); + nWhich = GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY); if (m_xLbVerAlign->get_value_changed_from_saved()) { SvxCellVerJustify eJustify(SvxCellVerJustify::Standard); @@ -238,10 +247,13 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) eJustify = SvxCellVerJustify::Block; break; } - rSet->Put(SvxVerJustifyItem(eJustify, GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY))); + rSet->Put(SvxVerJustifyItem(eJustify, nWhich)); bChanged = true; } + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) + rSet->InvalidateItem(nWhich); + nWhich = GetWhich(SID_ATTR_ALIGN_DEGREES); if (m_xNfRotate->get_value_changed_from_saved()) { const SdrAngleItem* pAngleItem = static_cast<const SdrAngleItem*>(GetOldItem( @@ -252,19 +264,22 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) rSet->Put(*pNewAngleItem); bChanged = true; } + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) + rSet->InvalidateItem(nWhich); + nWhich = GetWhich(SID_ATTR_ALIGN_LOCKPOS); if (m_aVsRefEdge.IsValueChangedFromSaved()) { switch (m_aVsRefEdge.GetSelectedItemId()) { case IID_CELLLOCK: - rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_STANDARD, GetWhich(SID_ATTR_ALIGN_LOCKPOS))); + rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_STANDARD, nWhich)); break; case IID_TOPLOCK: - rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_TOP, GetWhich(SID_ATTR_ALIGN_LOCKPOS))); + rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_TOP, nWhich)); break; case IID_BOTTOMLOCK: - rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_BOTTOM, GetWhich(SID_ATTR_ALIGN_LOCKPOS))); + rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_BOTTOM, nWhich)); break; default: m_aVsRefEdge.SetNoSelection(); @@ -272,7 +287,10 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) } bChanged = true; } + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) + rSet->InvalidateItem(nWhich); + nWhich = GetWhich(SID_ATTR_ALIGN_STACKED); if (m_xCbStacked->get_state_changed_from_saved()) { const SfxBoolItem* pStackItem = static_cast<const SfxBoolItem*>(GetOldItem( @@ -283,13 +301,19 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) rSet->Put(*pNewStackItem); bChanged = true; } + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) + rSet->InvalidateItem(nWhich); + nWhich = GetWhich(SID_ATTR_ALIGN_ASIANVERTICAL); if (m_xCbAsianMode->get_state_changed_from_saved()) { - rSet->Put(SfxBoolItem(GetWhich(SID_ATTR_ALIGN_ASIANVERTICAL), m_xCbAsianMode->get_active())); + rSet->Put(SfxBoolItem(nWhich, m_xCbAsianMode->get_active())); bChanged = true; } + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) + rSet->InvalidateItem(nWhich); + nWhich = GetWhich(SID_ATTR_ALIGN_LINEBREAK); if (m_xBtnWrap->get_state_changed_from_saved()) { const SfxBoolItem* pWrapItem = static_cast<const SfxBoolItem*>(GetOldItem( @@ -300,7 +324,10 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) rSet->Put(*pNewWrapItem); bChanged = true; } + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) + rSet->InvalidateItem(nWhich); + nWhich = GetWhich(SID_ATTR_ALIGN_HYPHENATION); if (m_xBtnHyphen->get_state_changed_from_saved()) { const SfxBoolItem* pHyphItem = static_cast<const SfxBoolItem*>(GetOldItem( @@ -311,7 +338,10 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) rSet->Put(*pNewHyphItem); bChanged = true; } + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) + rSet->InvalidateItem(nWhich); + nWhich = GetWhich(SID_ATTR_ALIGN_SHRINKTOFIT); if (m_xBtnShrink->get_state_changed_from_saved()) { const SfxBoolItem* pShrinkItem = static_cast<const SfxBoolItem*>(GetOldItem( @@ -322,15 +352,20 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) rSet->Put(*pNewShrinkItem); bChanged = true; } + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) + rSet->InvalidateItem(nWhich); if (m_xLbFrameDir->get_visible()) { + nWhich = GetWhich(SID_ATTR_FRAMEDIRECTION); if (m_xLbFrameDir->get_value_changed_from_saved()) { SvxFrameDirection eDir = m_xLbFrameDir->get_active_id(); - rSet->Put(SvxFrameDirectionItem(eDir, GetWhich(SID_ATTR_FRAMEDIRECTION))); + rSet->Put(SvxFrameDirectionItem(eDir, nWhich)); bChanged = true; } + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) + rSet->InvalidateItem(nWhich); } // Special treatment for distributed alignment; we need to set the justify commit 1219650c9676e9914c610d96908e6813c4a07ee5 Author: Caolán McNamara <[email protected]> AuthorDate: Wed Dec 11 11:57:14 2019 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Wed Dec 11 17:09:23 2019 +0100 Related: tdf#129300 add ScIndentItem to provide a description Change-Id: Ieb1a12f35cf8974c557c6e52eac0cd9fb7f80914 Reviewed-on: https://gerrit.libreoffice.org/84945 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index ead7d7d4f014..48ee07764cd5 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -207,7 +207,12 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) if (m_xEdIndent->get_value_changed_from_saved()) { - rSet->Put(SfxUInt16Item(GetWhich(SID_ATTR_ALIGN_INDENT), m_xEdIndent->get_value(FieldUnit::TWIP))); + const SfxUInt16Item* pIndentItem = static_cast<const SfxUInt16Item*>(GetOldItem( + *rSet, SID_ATTR_ALIGN_INDENT)); + assert(pIndentItem); + std::unique_ptr<SfxUInt16Item> pNewIndentItem(static_cast<SfxUInt16Item*>(pIndentItem->Clone())); + pNewIndentItem->SetValue(m_xEdIndent->get_value(FieldUnit::TWIP)); + rSet->Put(*pNewIndentItem); bChanged = true; } diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx index 59be64fb243d..5227a361834d 100644 --- a/sc/inc/attrib.hxx +++ b/sc/inc/attrib.hxx @@ -345,6 +345,18 @@ public: const IntlWrapper& rIntl) const override; }; +class SC_DLLPUBLIC ScIndentItem final : public SfxUInt16Item +{ +public: + ScIndentItem(sal_uInt16 nIndent = 0); + virtual ScIndentItem* Clone(SfxItemPool* pPool=nullptr) const override; + + virtual bool GetPresentation( SfxItemPresentation ePresentation, + MapUnit, MapUnit, + OUString& rText, + const IntlWrapper& rIntl) const override; +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 4f13865ca778..acb159d4605f 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -523,6 +523,7 @@ #define STR_LINEBREAKCELL_OFF NC_("STR_LINEBREAKCELL_OFF", "Wrap text automatically: Off") #define STR_HYPHENATECELL_ON NC_("STR_HYPHENATECELL_ON", "Hyphenate: On") #define STR_HYPHENATECELL_OFF NC_("STR_HYPHENATECELL_OFF", "Hyphenate: Off") +#define STR_INDENTCELL NC_("STR_INDENTCELL", "Indent: ") #endif diff --git a/sc/inc/scitems.hxx b/sc/inc/scitems.hxx index 674bf07fa3e9..6e5054d7757d 100644 --- a/sc/inc/scitems.hxx +++ b/sc/inc/scitems.hxx @@ -117,7 +117,7 @@ class SvxSizeItem; #define ATTR_FORBIDDEN_RULES TypedWhichId<SvxForbiddenRuleItem>(128) #define ATTR_HOR_JUSTIFY TypedWhichId<SvxHorJustifyItem>(129) #define ATTR_HOR_JUSTIFY_METHOD TypedWhichId<SvxJustifyMethodItem>(130) -#define ATTR_INDENT TypedWhichId<SfxUInt16Item>(131) +#define ATTR_INDENT TypedWhichId<ScIndentItem>(131) #define ATTR_VER_JUSTIFY TypedWhichId<SvxVerJustifyItem>(132) #define ATTR_VER_JUSTIFY_METHOD TypedWhichId<SvxJustifyMethodItem>(133) #define ATTR_STACKED TypedWhichId<ScShrinkToFitCell>(134) diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 42a0e9fd464a..e7be9ee52394 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1758,7 +1758,7 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, bool bIncrement SCROW nThisEnd = mvData[nIndex].nEndRow; SCROW nAttrRow = std::min( nThisEnd, nEndRow ); auto pNewPattern = std::make_unique<ScPatternAttr>(*pOldPattern); - pNewPattern->GetItemSet().Put( SfxUInt16Item( ATTR_INDENT, nNewValue ) ); + pNewPattern->GetItemSet().Put( ScIndentItem( nNewValue ) ); if ( bNeedJust ) pNewPattern->GetItemSet().Put( SvxHorJustifyItem( SvxCellHorJustify::Left, ATTR_HOR_JUSTIFY ) ); diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 4ed61887a67a..04a607bf7a10 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -23,7 +23,9 @@ #include <editeng/editeng.hxx> #include <editeng/editobj.hxx> +#include <editeng/eerdll.hxx> #include <editeng/borderline.hxx> +#include <editeng/itemtype.hxx> #include <libxml/xmlwriter.h> @@ -828,4 +830,35 @@ bool ScHyphenateCell::GetPresentation(SfxItemPresentation, return true; } +ScIndentItem::ScIndentItem(sal_uInt16 nIndent) + : SfxUInt16Item(ATTR_INDENT, nIndent) +{ +} + +ScIndentItem* ScIndentItem::Clone(SfxItemPool*) const +{ + return new ScIndentItem(GetValue()); +} + +bool ScIndentItem::GetPresentation(SfxItemPresentation ePres, + MapUnit eCoreUnit, MapUnit, + OUString& rText, + const IntlWrapper& rIntl) const +{ + auto nValue = GetValue(); + + switch (ePres) + { + case SfxItemPresentation::Complete: + rText = ScResId(STR_INDENTCELL); + [[fallthrough]]; + case SfxItemPresentation::Nameless: + rText += GetMetricText( nValue, eCoreUnit, MapUnit::MapPoint, &rIntl ) + + " " + EditResId(GetMetricId(MapUnit::MapPoint)); + return true; + default: ; //prevent warning + } + return false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 6120e719271f..e64da24de5c1 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -242,7 +242,7 @@ long ScColumn::GetNeededSize( { if (pCondSet && pCondSet->GetItemState(ATTR_INDENT, true, &pCondItem) == SfxItemState::SET) - nIndent = static_cast<const SfxUInt16Item*>(pCondItem)->GetValue(); + nIndent = static_cast<const ScIndentItem*>(pCondItem)->GetValue(); else nIndent = pPattern->GetItem(ATTR_INDENT).GetValue(); } diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 148438da76a9..d229654de2fe 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -246,7 +246,7 @@ ScDocumentPool::ScDocumentPool() mvPoolDefaults[ ATTR_FORBIDDEN_RULES - ATTR_STARTINDEX ] = new SvxForbiddenRuleItem( false, ATTR_FORBIDDEN_RULES); mvPoolDefaults[ ATTR_HOR_JUSTIFY - ATTR_STARTINDEX ] = new SvxHorJustifyItem( SvxCellHorJustify::Standard, ATTR_HOR_JUSTIFY); mvPoolDefaults[ ATTR_HOR_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, ATTR_HOR_JUSTIFY_METHOD); - mvPoolDefaults[ ATTR_INDENT - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_INDENT, 0 ); + mvPoolDefaults[ ATTR_INDENT - ATTR_STARTINDEX ] = new ScIndentItem( 0 ); mvPoolDefaults[ ATTR_VER_JUSTIFY - ATTR_STARTINDEX ] = new SvxVerJustifyItem( SvxCellVerJustify::Standard, ATTR_VER_JUSTIFY); mvPoolDefaults[ ATTR_VER_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, ATTR_VER_JUSTIFY_METHOD); mvPoolDefaults[ ATTR_STACKED - ATTR_STARTINDEX ] = new ScVerticalStackCell(false); diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 89c5406629f3..3a2cd52c03cf 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -822,7 +822,7 @@ void XclImpCellAlign::FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFo // indent sal_uInt16 nScIndent = mnIndent * 200; // 1 Excel unit == 10 pt == 200 twips - ScfTools::PutItem( rItemSet, SfxUInt16Item( ATTR_INDENT, nScIndent ), bSkipPoolDefs ); + ScfTools::PutItem( rItemSet, ScIndentItem( nScIndent ), bSkipPoolDefs ); // shrink to fit ScfTools::PutItem( rItemSet, ScShrinkToFitCell( mbShrink ), bSkipPoolDefs ); diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index f373f0a1a175..009faee536f9 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -1299,7 +1299,7 @@ void Alignment::fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs ) const // Orientation ScfTools::PutItem( rItemSet, ScVerticalStackCell( maApiData.meOrientation == css::table::CellOrientation_STACKED ), bSkipPoolDefs ); // indent - ScfTools::PutItem( rItemSet, SfxUInt16Item( ATTR_INDENT, maApiData.mnIndent ), bSkipPoolDefs ); + ScfTools::PutItem( rItemSet, ScIndentItem( maApiData.mnIndent ), bSkipPoolDefs ); // line wrap ScfTools::PutItem( rItemSet, ScLineBreakCell( maApiData.mbWrapText ), bSkipPoolDefs ); ScfTools::PutItem( rItemSet, ScShrinkToFitCell( maApiData.mbShrink ), bSkipPoolDefs ); diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index e0a7b72a0cc1..60c4928ef5e1 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -500,7 +500,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder() SvxCellHorJustify eHorJust = pHorJustifyItem ? pHorJustifyItem->GetValue() : SvxCellHorJustify::Standard; if ( eHorJust == SvxCellHorJustify::Left ) { - const SfxUInt16Item* pIndentItem = rDoc.GetAttr( aCellPos, ATTR_INDENT ); + const ScIndentItem* pIndentItem = rDoc.GetAttr( aCellPos, ATTR_INDENT ); if ( pIndentItem ) { nIndent = static_cast< long >( pIndentItem->GetValue() ); diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index a5ffd152b5e0..f65b7fcf6032 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -1959,7 +1959,7 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const OUString& aPropert aAny <<= static_cast<sal_Int32>( static_cast<const SfxUInt32Item&>(rSet.Get(pEntry->nWID)).GetValue() ); break; case ATTR_INDENT: - aAny <<= static_cast<sal_Int16>( TwipsToHMM(static_cast<const SfxUInt16Item&>( + aAny <<= static_cast<sal_Int16>( TwipsToHMM(static_cast<const ScIndentItem&>( rSet.Get(pEntry->nWID)).GetValue()) ); break; default: @@ -2097,7 +2097,7 @@ static void lcl_SetCellProperty( const SfxItemPropertySimpleEntry& rEntry, const if ( !(rValue >>= nIntVal) ) throw lang::IllegalArgumentException(); - rSet.Put( SfxUInt16Item( rEntry.nWID, static_cast<sal_uInt16>(HMMToTwips(nIntVal)) ) ); + rSet.Put( ScIndentItem( static_cast<sal_uInt16>(HMMToTwips(nIntVal)) ) ); } break; @@ -2409,7 +2409,7 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE } break; case ATTR_INDENT: - rAny <<= static_cast<sal_Int16>( TwipsToHMM(static_cast<const SfxUInt16Item&>( + rAny <<= static_cast<sal_Int16>( TwipsToHMM(static_cast<const ScIndentItem&>( pDataSet->Get(pEntry->nWID)).GetValue()) ); break; case ATTR_STACKED: diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 37af7b737f8b..aed15b31427e 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -1238,7 +1238,7 @@ uno::Any ScStyleObj::getPropertyDefault_Impl( const OUString& aPropertyName ) aAny <<= sal_Int32( static_cast<const SfxUInt32Item&>(pItemSet->Get(nWhich)).GetValue() ); break; case ATTR_INDENT: - aAny <<= sal_Int16( TwipsToHMM(static_cast<const SfxUInt16Item&>( + aAny <<= sal_Int16( TwipsToHMM(static_cast<const ScIndentItem&>( pItemSet->Get(nWhich)).GetValue()) ); break; case ATTR_PAGE_SCALE: @@ -1520,8 +1520,7 @@ void ScStyleObj::setPropertyValue_Impl( const OUString& rPropertyName, const Sfx { sal_Int16 nVal = 0; *pValue >>= nVal; - rSet.Put(SfxUInt16Item(pEntry->nWID, - static_cast<sal_uInt16>(HMMToTwips(nVal)))); + rSet.Put(ScIndentItem(static_cast<sal_uInt16>(HMMToTwips(nVal)))); } break; case ATTR_ROTATE_VALUE: @@ -1789,7 +1788,7 @@ uno::Any ScStyleObj::getPropertyValue_Impl( const OUString& aPropertyName ) } break; case ATTR_INDENT: - aAny <<= sal_Int16( TwipsToHMM(static_cast<const SfxUInt16Item&>( + aAny <<= sal_Int16( TwipsToHMM(static_cast<const ScIndentItem&>( pItemSet->Get(nWhich)).GetValue()) ); break; case ATTR_STACKED: diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 8a057dcfd5f1..947bda3d1875 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -2447,7 +2447,7 @@ void ScOutputData::DrawEditParam::calcMargins(long& rTopM, long& rLeftM, long& r sal_uInt16 nIndent = 0; if (meHorJustAttr == SvxCellHorJustify::Left || meHorJustAttr == SvxCellHorJustify::Right) - nIndent = lcl_GetValue<SfxUInt16Item, sal_uInt16>(*mpPattern, ATTR_INDENT, mpCondSet); + nIndent = lcl_GetValue<ScIndentItem, sal_uInt16>(*mpPattern, ATTR_INDENT, mpCondSet); rLeftM = static_cast<long>(((rMargin.GetLeftMargin() + nIndent) * nPPTX)); rTopM = static_cast<long>((rMargin.GetTopMargin() * nPPTY)); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 344a43a644a9..1dbb1c17221e 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1015,7 +1015,7 @@ void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem, bool bAdjustBlockHeigh aNewAttrs.GetItemSet().Put( rAttrItem ); // if justify is set (with Buttons), always indentation 0 if ( rAttrItem.Which() == ATTR_HOR_JUSTIFY ) - aNewAttrs.GetItemSet().Put( SfxUInt16Item( ATTR_INDENT, 0 ) ); + aNewAttrs.GetItemSet().Put( ScIndentItem( 0 ) ); ApplySelectionPattern( aNewAttrs ); // Prevent useless compute _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
