diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-27 14:56:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-27 20:05:46 +0100 |
commit | 12be8dadfad2167ff4317935d30782626afa3eaf (patch) | |
tree | eb04c03fa883c953e7464fa9f67577611d21ddef /starmath | |
parent | 0e570fafd319c6567d798ff9e5530099c53312ee (diff) |
no need to call GetWhich on these SID_ values
none of them are remapped (via the SfxItemEntryInfo stuff in the pool)
Change-Id: Ic7b5f2c3cc75a65bdf9c45f9522cc53954b4ba38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129040
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/cfgitem.cxx | 24 | ||||
-rw-r--r-- | starmath/source/dialog.cxx | 32 |
2 files changed, 27 insertions, 29 deletions
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index a235446eb279..156b61b8b2d5 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -1415,23 +1415,21 @@ void SmMathConfig::ItemSetToConfig(const SfxItemSet &rSet) void SmMathConfig::ConfigToItemSet(SfxItemSet &rSet) const { - const SfxItemPool *pPool = rSet.GetPool(); - - rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_PRINTSIZE), + rSet.Put(SfxUInt16Item(SID_PRINTSIZE, sal::static_int_cast<sal_uInt16>(GetPrintSize()))); - rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_PRINTZOOM), + rSet.Put(SfxUInt16Item(SID_PRINTZOOM, GetPrintZoomFactor())); - rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_SMEDITWINDOWZOOM), + rSet.Put(SfxUInt16Item(SID_SMEDITWINDOWZOOM, GetSmEditWindowZoomFactor())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTITLE), IsPrintTitle())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTEXT), IsPrintFormulaText())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTFRAME), IsPrintFrame())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_AUTOREDRAW), IsAutoRedraw())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_NO_RIGHT_SPACES), IsIgnoreSpacesRight())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_SAVE_ONLY_USED_SYMBOLS), IsSaveOnlyUsedSymbols())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_AUTO_CLOSE_BRACKETS), IsAutoCloseBrackets())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_DEFAULT_SM_SYNTAX_VERSION), GetDefaultSmSyntaxVersion())); + rSet.Put(SfxBoolItem(SID_PRINTTITLE, IsPrintTitle())); + rSet.Put(SfxBoolItem(SID_PRINTTEXT, IsPrintFormulaText())); + rSet.Put(SfxBoolItem(SID_PRINTFRAME, IsPrintFrame())); + rSet.Put(SfxBoolItem(SID_AUTOREDRAW, IsAutoRedraw())); + rSet.Put(SfxBoolItem(SID_NO_RIGHT_SPACES, IsIgnoreSpacesRight())); + rSet.Put(SfxBoolItem(SID_SAVE_ONLY_USED_SYMBOLS, IsSaveOnlyUsedSymbols())); + rSet.Put(SfxBoolItem(SID_AUTO_CLOSE_BRACKETS, IsAutoCloseBrackets())); + rSet.Put(SfxBoolItem(SID_DEFAULT_SM_SYNTAX_VERSION, GetDefaultSmSyntaxVersion())); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 0857f2456db6..0c720927280a 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -194,15 +194,15 @@ bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet) else nPrintSize = PRINT_SIZE_ZOOMED; - rSet->Put(SfxUInt16Item(GetWhich(SID_PRINTSIZE), nPrintSize)); - rSet->Put(SfxUInt16Item(GetWhich(SID_PRINTZOOM), sal::static_int_cast<sal_uInt16>(m_xZoom->get_value(FieldUnit::PERCENT)))); - rSet->Put(SfxBoolItem(GetWhich(SID_PRINTTITLE), m_xTitle->get_active())); - rSet->Put(SfxBoolItem(GetWhich(SID_PRINTTEXT), m_xText->get_active())); - rSet->Put(SfxBoolItem(GetWhich(SID_PRINTFRAME), m_xFrame->get_active())); - rSet->Put(SfxBoolItem(GetWhich(SID_NO_RIGHT_SPACES), m_xNoRightSpaces->get_active())); - rSet->Put(SfxBoolItem(GetWhich(SID_SAVE_ONLY_USED_SYMBOLS), m_xSaveOnlyUsedSymbols->get_active())); - rSet->Put(SfxBoolItem(GetWhich(SID_AUTO_CLOSE_BRACKETS), m_xAutoCloseBrackets->get_active())); - rSet->Put(SfxUInt16Item(GetWhich(SID_SMEDITWINDOWZOOM), sal::static_int_cast<sal_uInt16>(m_xSmZoom->get_value(FieldUnit::PERCENT)))); + rSet->Put(SfxUInt16Item(SID_PRINTSIZE, nPrintSize)); + rSet->Put(SfxUInt16Item(SID_PRINTZOOM, sal::static_int_cast<sal_uInt16>(m_xZoom->get_value(FieldUnit::PERCENT)))); + rSet->Put(SfxBoolItem(SID_PRINTTITLE, m_xTitle->get_active())); + rSet->Put(SfxBoolItem(SID_PRINTTEXT, m_xText->get_active())); + rSet->Put(SfxBoolItem(SID_PRINTFRAME, m_xFrame->get_active())); + rSet->Put(SfxBoolItem(SID_NO_RIGHT_SPACES, m_xNoRightSpaces->get_active())); + rSet->Put(SfxBoolItem(SID_SAVE_ONLY_USED_SYMBOLS, m_xSaveOnlyUsedSymbols->get_active())); + rSet->Put(SfxBoolItem(SID_AUTO_CLOSE_BRACKETS, m_xAutoCloseBrackets->get_active())); + rSet->Put(SfxUInt16Item(SID_SMEDITWINDOWZOOM, sal::static_int_cast<sal_uInt16>(m_xSmZoom->get_value(FieldUnit::PERCENT)))); SmGetActiveView()->GetEditWindow()->UpdateStatus(false); return true; @@ -210,7 +210,7 @@ bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet) void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet) { - SmPrintSize ePrintSize = static_cast<SmPrintSize>(static_cast<const SfxUInt16Item &>(rSet->Get(GetWhich(SID_PRINTSIZE))).GetValue()); + SmPrintSize ePrintSize = static_cast<SmPrintSize>(static_cast<const SfxUInt16Item &>(rSet->Get(SID_PRINTSIZE)).GetValue()); m_xSizeNormal->set_active(ePrintSize == PRINT_SIZE_NORMAL); m_xSizeScaled->set_active(ePrintSize == PRINT_SIZE_SCALED); @@ -218,15 +218,15 @@ void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet) m_xZoom->set_sensitive(m_xSizeZoomed->get_active()); - m_xZoom->set_value(static_cast<const SfxUInt16Item &>(rSet->Get(GetWhich(SID_PRINTZOOM))).GetValue(), FieldUnit::PERCENT); + m_xZoom->set_value(static_cast<const SfxUInt16Item &>(rSet->Get(SID_PRINTZOOM)).GetValue(), FieldUnit::PERCENT); m_xSmZoom->set_sensitive(true); - m_xSmZoom->set_value(static_cast<const SfxUInt16Item &>(rSet->Get(GetWhich(SID_SMEDITWINDOWZOOM))).GetValue(), FieldUnit::PERCENT); + m_xSmZoom->set_value(static_cast<const SfxUInt16Item &>(rSet->Get(SID_SMEDITWINDOWZOOM)).GetValue(), FieldUnit::PERCENT); - m_xTitle->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_PRINTTITLE))).GetValue()); - m_xNoRightSpaces->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_NO_RIGHT_SPACES))).GetValue()); - m_xSaveOnlyUsedSymbols->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_SAVE_ONLY_USED_SYMBOLS))).GetValue()); - m_xAutoCloseBrackets->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_AUTO_CLOSE_BRACKETS))).GetValue()); + m_xTitle->set_active(static_cast<const SfxBoolItem &>(rSet->Get(SID_PRINTTITLE)).GetValue()); + m_xNoRightSpaces->set_active(static_cast<const SfxBoolItem &>(rSet->Get(SID_NO_RIGHT_SPACES)).GetValue()); + m_xSaveOnlyUsedSymbols->set_active(static_cast<const SfxBoolItem &>(rSet->Get(SID_SAVE_ONLY_USED_SYMBOLS)).GetValue()); + m_xAutoCloseBrackets->set_active(static_cast<const SfxBoolItem &>(rSet->Get(SID_AUTO_CLOSE_BRACKETS)).GetValue()); } std::unique_ptr<SfxTabPage> SmPrintOptionsTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet) |