sw/source/core/doc/DocumentStylePoolManager.cxx | 2 +- sw/source/core/unocore/unofield.cxx | 2 +- sw/source/filter/html/htmlcss1.cxx | 4 ++-- sw/source/filter/html/htmlform.cxx | 2 +- sw/source/ui/config/optpage.cxx | 2 +- sw/source/uibase/config/usrpref.cxx | 8 ++++---- sw/source/uibase/dochdl/swdtflvr.cxx | 6 +++--- sw/source/uibase/docvw/edtwin.cxx | 4 ++-- sw/source/uibase/envelp/envimg.cxx | 2 +- sw/source/uibase/envelp/labimg.cxx | 4 ++-- sw/source/uibase/ribbar/workctrl.cxx | 2 +- sw/source/uibase/shells/basesh.cxx | 2 +- sw/source/uibase/shells/beziersh.cxx | 4 ++-- sw/source/uibase/shells/drawdlg.cxx | 4 ++-- sw/source/uibase/shells/frmsh.cxx | 2 +- sw/source/uibase/shells/tabsh.cxx | 4 ++-- sw/source/uibase/uiview/pview.cxx | 18 +++++++++--------- sw/source/uibase/uiview/viewport.cxx | 2 +- 18 files changed, 37 insertions(+), 37 deletions(-)
New commits: commit cce54572538404c7ff3cc9fbf39c54cb3d3a33e8 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Jul 10 08:50:30 2025 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Jul 11 11:28:22 2025 +0200 add more constness Change-Id: I94333a57043743dd9d6924d20c85a2a5484fe8d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187662 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 0830799e3c1e..efad982ec193 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -123,7 +123,7 @@ namespace void lcl_SetDfltFont( DefaultFontType nFntType, SfxItemSet& rSet ) { - static struct { + static const struct { sal_uInt16 nResLngId; sal_uInt16 nResFntId; } aArr[ 3 ] = { diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index c564aad27449..675e8f8d2660 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -570,7 +570,7 @@ void SAL_CALL SwXFieldMaster::setPropertyValue( const std::vector<OUString>& rExtraArr( SwStyleNameMapper::GetExtraUINameArray()); const OUString sTypeName = pType->GetName(); - static sal_uInt16 nIds[] = + static const sal_uInt16 nIds[] = { RES_POOLCOLL_LABEL_DRAWING - RES_POOLCOLL_EXTRA_BEGIN, RES_POOLCOLL_LABEL_ABB - RES_POOLCOLL_EXTRA_BEGIN, diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index 3b8702641be8..3e3a65c9f41c 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -394,8 +394,8 @@ void SwCSS1Parser::SetPageDescAttrs( const SvxBrushItem *pBrush, if( !(bSetBrush || bSetBox || bSetFrameDir) ) return; - static sal_uInt16 aPoolIds[] = { RES_POOLPAGE_HTML, RES_POOLPAGE_FIRST, - RES_POOLPAGE_LEFT, RES_POOLPAGE_RIGHT }; + static const sal_uInt16 aPoolIds[] = { RES_POOLPAGE_HTML, RES_POOLPAGE_FIRST, + RES_POOLPAGE_LEFT, RES_POOLPAGE_RIGHT }; for(sal_uInt16 i : aPoolIds) { const SwPageDesc *pPageDesc = GetPageDesc( i, false ); diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index a387f019d51f..de65b93116d2 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -124,7 +124,7 @@ HTMLOptionEnum<HTMLWordWrapMode> const aHTMLTextAreaWrapTable[] = { nullptr, HTMLWordWrapMode(0) } }; -static SvMacroItemId aEventTypeTable[] = +const SvMacroItemId aEventTypeTable[] = { SvMacroItemId::HtmlOnSubmitForm, SvMacroItemId::HtmlOnResetForm, diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 3591ffb215ec..c6bfe5178485 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1504,7 +1504,7 @@ bool SwTableOptionsTabPage::FillItemSet( SfxItemSet* ) if(m_pWrtShell && SelectionType::Table & m_pWrtShell->GetSelectionType()) { m_pWrtShell->SetTableChgMode(eMode); - static sal_uInt16 aInva[] = + static const sal_uInt16 aInva[] = { FN_TABLE_MODE_FIX, FN_TABLE_MODE_FIX_PROP, FN_TABLE_MODE_VARIABLE, diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index 1da3a75756b4..f6a9ba329995 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -304,7 +304,7 @@ void SwContentViewConfig::Load() Sequence<OUString> SwLayoutViewConfig::GetPropertyNames() const { - static const char* aPropNames[] = + static const char* const aPropNames[] = { "Line/Guide", // 0 "Window/HorizontalScroll", // 1 @@ -458,7 +458,7 @@ void SwLayoutViewConfig::Notify(const css::uno::Sequence<OUString>&) Sequence<OUString> SwGridConfig::GetPropertyNames() { - static const char* aPropNames[] = + static const char* const aPropNames[] = { "Option/SnapToGrid", // 0 "Option/VisibleGrid", // 1 @@ -553,7 +553,7 @@ void SwGridConfig::Notify( const css::uno::Sequence< OUString >& ) Sequence<OUString> SwCursorConfig::GetPropertyNames() { - static const char* aPropNames[] = + static const char* const aPropNames[] = { "DirectCursor/UseDirectCursor", // 0 "DirectCursor/Insert", // 1 @@ -635,7 +635,7 @@ void SwCursorConfig::Notify(const css::uno::Sequence<OUString>& ) Sequence<OUString> SwFmtAidsAutoComplConfig::GetPropertyNames() { - static const char* aPropNames[] = { + static const char* const aPropNames[] = { "EncloseWithCharacters", // 0 }; const int nCount = SAL_N_ELEMENTS(aPropNames); diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index e9710dbac06d..1cef436f973e 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -3483,7 +3483,7 @@ bool SwTransferable::TestAllowedFormat( const TransferableDataHelper& rData, * the list of formats which will be offered to the user in the 'Paste * Special...' dialog and the paste button menu */ -static SotClipboardFormatId aPasteSpecialIds[] = +const SotClipboardFormatId aPasteSpecialIds[] = { SotClipboardFormatId::HTML, SotClipboardFormatId::HTML_SIMPLE, @@ -3559,7 +3559,7 @@ void SwTransferable::PrePasteSpecial( const SwWrtShell& rSh, const TransferableD if( SwTransferable::TestAllowedFormat( rData, SotClipboardFormatId::LINK, nDest )) pDlg->Insert( SotClipboardFormatId::LINK, SwResId(STR_DDEFORMAT) ); - for( SotClipboardFormatId* pIds = aPasteSpecialIds; *pIds != SotClipboardFormatId::NONE; ++pIds ) + for( const SotClipboardFormatId* pIds = aPasteSpecialIds; *pIds != SotClipboardFormatId::NONE; ++pIds ) if( SwTransferable::TestAllowedFormat( rData, *pIds, nDest )) pDlg->Insert( *pIds, OUString() ); } @@ -3612,7 +3612,7 @@ void SwTransferable::FillClipFormatItem( const SwWrtShell& rSh, if( SwTransferable::TestAllowedFormat( rData, SotClipboardFormatId::LINK, nDest )) rToFill.AddClipbrdFormat( SotClipboardFormatId::LINK, SwResId(STR_DDEFORMAT) ); - for( SotClipboardFormatId* pIds = aPasteSpecialIds; *pIds != SotClipboardFormatId::NONE; ++pIds ) + for( const SotClipboardFormatId* pIds = aPasteSpecialIds; *pIds != SotClipboardFormatId::NONE; ++pIds ) if( SwTransferable::TestAllowedFormat( rData, *pIds, nDest )) rToFill.AddClipbrdFormat(*pIds, OUString()); } diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index f8c8798c7a5b..66aa75f036cc 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -5477,7 +5477,7 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl) rSh.Edit(); } - static sal_uInt16 aInva[] = + static const sal_uInt16 aInva[] = { SID_STYLE_WATERCAN, SID_ATTR_CHAR_COLOR_EXT, @@ -6430,7 +6430,7 @@ void SwEditWin::SetChainMode( bool bOn ) m_bChainMode = bOn; - static sal_uInt16 aInva[] = + static const sal_uInt16 aInva[] = { FN_FRAME_CHAIN, FN_FRAME_UNCHAIN, 0 }; diff --git a/sw/source/uibase/envelp/envimg.cxx b/sw/source/uibase/envelp/envimg.cxx index 48ed74c86635..b83740d3c510 100644 --- a/sw/source/uibase/envelp/envimg.cxx +++ b/sw/source/uibase/envelp/envimg.cxx @@ -248,7 +248,7 @@ void SwEnvCfgItem::Notify( const css::uno::Sequence< OUString >& ) {} Sequence<OUString> SwEnvCfgItem::GetPropertyNames() { - static const char* aPropNames[] = + static const char* const aPropNames[] = { "Inscription/Addressee", // 0 "Inscription/Sender", // 1 diff --git a/sw/source/uibase/envelp/labimg.cxx b/sw/source/uibase/envelp/labimg.cxx index 50e0b13442cd..c221d872992b 100644 --- a/sw/source/uibase/envelp/labimg.cxx +++ b/sw/source/uibase/envelp/labimg.cxx @@ -184,7 +184,7 @@ SwLabItem* SwLabItem::Clone(SfxItemPool*) const Sequence<OUString> SwLabCfgItem::GetPropertyNames() const { - static const char* aLabelPropNames[] = + static const char* const aLabelPropNames[] = { "Medium/Continuous", // 0 "Medium/Brand", // 1 @@ -207,7 +207,7 @@ Sequence<OUString> SwLabCfgItem::GetPropertyNames() const "Inscription/Address", //18 "Inscription/Database" //19 }; - static const char* aBusinessPropNames[] = + static const char* const aBusinessPropNames[] = { "PrivateAddress/FirstName", // 0 "PrivateAddress/Name", // 1 diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index be2039c3246b..cabba617b0ae 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -162,7 +162,7 @@ IMPL_STATIC_LINK(SwTbxAutoTextCtrl, PopupHdl, Menu*, pMenu, bool) // Navigation-Popup // determine the order of the toolbox items -static sal_uInt16 aNavigationInsertIds[ NAVI_ENTRIES ] = +const sal_uInt16 aNavigationInsertIds[ NAVI_ENTRIES ] = { NID_TBL, NID_FRM, diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index fe28029ff5b4..67cedf8135a1 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2373,7 +2373,7 @@ void SwBaseShell::SetFrameMode(FlyMode eMode, SwWrtShell *pSh ) } else if( eMode == FLY_DRAG_END ) { - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { SID_ATTR_POSITION, SID_ATTR_SIZE, 0 }; diff --git a/sw/source/uibase/shells/beziersh.cxx b/sw/source/uibase/shells/beziersh.cxx index 3f55ffe15601..db41a6cc3497 100644 --- a/sw/source/uibase/shells/beziersh.cxx +++ b/sw/source/uibase/shells/beziersh.cxx @@ -115,7 +115,7 @@ void SwBezierShell::Execute(SfxRequest const &rReq) case SID_BEZIER_INSERT: { GetView().GetEditWin().SetBezierMode(nSlotId); - static sal_uInt16 aInva[] = + static const sal_uInt16 aInva[] = { SID_BEZIER_INSERT, SID_BEZIER_MOVE, @@ -175,7 +175,7 @@ void SwBezierShell::Execute(SfxRequest const &rReq) { pSdrView->SetMarkedPointsSmooth(eKind); - static sal_uInt16 aInva[] = + static const sal_uInt16 aInva[] = { SID_BEZIER_SMOOTH, SID_BEZIER_EDGE, diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx index 028b77c7830a..62570e316503 100644 --- a/sw/source/uibase/shells/drawdlg.cxx +++ b/sw/source/uibase/shells/drawdlg.cxx @@ -131,7 +131,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), false); pSh->EndAction(); - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { SID_ATTR_FILL_STYLE, SID_ATTR_FILL_COLOR, @@ -186,7 +186,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), false); pSh->EndAction(); - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { SID_ATTR_LINE_STYLE, // ( SID_SVX_START + 169 ) SID_ATTR_LINE_DASH, // ( SID_SVX_START + 170 ) diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 8f613c9a83f1..cca0595bdac5 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -1398,7 +1398,7 @@ void SwFrameShell::ExecDrawDlgTextFrame(SfxRequest const & rReq) // set attributes at FlyFrame GetShell().SetFlyFrameAttr(const_cast< SfxItemSet& >(*pDlg->GetOutputItemSet())); - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { SID_ATTR_FILL_STYLE, SID_ATTR_FILL_COLOR, diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index e75bb001df08..f81a3af93217 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -1145,7 +1145,7 @@ void SwTableShell::Execute(SfxRequest &rReq) : TableChgMode::VarWidthChangeAbs ); SfxBindings& rBind = GetView().GetViewFrame().GetBindings(); - static sal_uInt16 aInva[] = + static const sal_uInt16 aInva[] = { FN_TABLE_MODE_FIX, FN_TABLE_MODE_FIX_PROP, FN_TABLE_MODE_VARIABLE, @@ -1299,7 +1299,7 @@ void SwTableShell::Execute(SfxRequest &rReq) aSet.Put( aAttr ); rSh.SetTableAttr( aSet ); rSh.EndUndo(SwUndoId::TABLE_ATTR); - static sal_uInt16 aInva[] = + static const sal_uInt16 aInva[] = { SID_ATTR_TABLE_LEFT_SPACE, SID_ATTR_TABLE_RIGHT_SPACE, 0 diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 77a6229bd1aa..ea3093e5e06c 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -246,7 +246,7 @@ void SwPagePreviewWin::CalcWish( sal_Int16 nNewRow, sal_Int16 nNewCol ) // Order must be maintained! // additional invalidate page status. - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN, FN_PREVIEW_ZOOM, @@ -354,7 +354,7 @@ bool SwPagePreviewWin::MovePage( int eMoveMode ) mnSttPage = nNewSttPage; // additional invalidate page status. - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN, FN_STAT_PAGE, 0 @@ -503,7 +503,7 @@ void SwPagePreviewWin::MouseButtonDown( const MouseEvent& rMEvt ) mrView.SetVScrollbarThumbPos( nNewSelectedPage ); } // invalidate page status. - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { FN_STAT_PAGE, 0 }; @@ -641,7 +641,7 @@ void SwPagePreview::ExecPgUpAndPgDown( const bool _bPgUp, } ScrollViewSzChg(); // additional invalidate page status. - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN, FN_STAT_PAGE, 0 @@ -703,7 +703,7 @@ void SwPagePreview::Execute( SfxRequest &rReq ) // book preview mode changed. Thus, adjust scrollbars and // invalidate corresponding states. ScrollViewSzChg(); - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN, FN_STAT_PAGE, FN_SHOW_BOOKVIEW, 0 @@ -822,7 +822,7 @@ void SwPagePreview::Execute( SfxRequest &rReq ) } GetViewShell()->ShowPreviewSelection( nNewSelectedPage ); // invalidate page status. - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { FN_STAT_PAGE, 0 }; @@ -1286,7 +1286,7 @@ bool SwPagePreview::ChgPage( int eMvMode, bool bUpdateScrollbar ) { ScrollViewSzChg(); - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN, 0 @@ -1510,7 +1510,7 @@ void SwPagePreview::EndScrollHdl(weld::Scrollbar& rScrollbar, bool bHori) m_pViewWin->Scroll(nThmbPos - m_pViewWin->GetPaintedPreviewDocRect().Left(), 0); } // additional invalidate page status. - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN, FN_STAT_PAGE, 0 @@ -1685,7 +1685,7 @@ sal_uInt16 SwPagePreview::SetPrinter( SfxPrinter *pNew, SfxPrinterChangeFlags n rESh.SetModified(); rESh.EndAllAction(); - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE, SID_RULER_BORDERS, SID_RULER_PAGE_POS, 0 diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index f511f4a8e354..4b5aa9d4a2d4 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -106,7 +106,7 @@ static void lcl_GetPos(SwView const * pView, void SwView::InvalidateRulerPos() { - static sal_uInt16 aInval[] = + static const sal_uInt16 aInval[] = { SID_ATTR_PARA_LRSPACE, SID_RULER_BORDERS, SID_RULER_PAGE_POS, SID_RULER_LR_MIN_MAX, SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE,