include/sfx2/templatedlg.hxx              |    4 ++--
 include/sfx2/templatelocalview.hxx        |    4 ++--
 sfx2/source/control/templatelocalview.cxx |    2 +-
 sfx2/source/dialog/backingwindow.cxx      |    4 ++--
 sfx2/source/dialog/backingwindow.hxx      |    2 +-
 sfx2/source/doc/templatedlg.cxx           |   18 +++++++++---------
 6 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit 513bc803f5b254ef807ef3021f73547b34c29afb
Author:     Michael Weghorn <[email protected]>
AuthorDate: Wed Dec 31 11:49:00 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Jan 3 08:10:01 2026 +0100

    sfx2: Use usual indentation of 4 spaces
    
    ... instead of just 3 spaces.
    
    Change-Id: I035c3706b4af1f1d8996d0bccfd7231cb7cd4f05
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196376
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index da107093540c..d5052d1cb429 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -1379,10 +1379,10 @@ IMPL_LINK(SfxTemplateSelectionDlg, OpenTemplateHdl, 
const ThumbnailViewItem*, pI
 
 IMPL_LINK_NOARG(SfxTemplateSelectionDlg, OkClickHdl, weld::Button&, void)
 {
-   const TemplateViewItem* pViewItem = static_cast<const 
TemplateViewItem*>(*maSelTemplates.begin());
-   msTemplatePath = pViewItem->getPath();
+    const TemplateViewItem* pViewItem = static_cast<const 
TemplateViewItem*>(*maSelTemplates.begin());
+    msTemplatePath = pViewItem->getPath();
 
-   m_xDialog->response(RET_OK);
+    m_xDialog->response(RET_OK);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 47150a6526b7b77799ade0b0cf01d5c7849b344b
Author:     Michael Weghorn <[email protected]>
AuthorDate: Wed Dec 31 11:45:39 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Jan 3 08:09:50 2026 +0100

    sfx2: Avoid some const_cast in SfxTemplateManagerDlg
    
    TemplateViewItem::getPath is const, so there is no need
    to have a non-const TemplateViewItem.
    
    Adjust the variables/params accordingly and drop
    2 now no longer necessary const_casts.
    
    Change-Id: I4058410efe8fb60568eb15107f75cf318ab74d8d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196375
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx
index 59241d7abb96..2ebc1287ad93 100644
--- a/include/sfx2/templatedlg.hxx
+++ b/include/sfx2/templatedlg.hxx
@@ -72,7 +72,7 @@ protected:
 
     DECL_DLLPRIVATE_LINK(OpenRegionHdl, void*, void);
     DECL_DLLPRIVATE_LINK(CreateContextMenuHdl, ThumbnailViewItem*, void);
-    DECL_DLLPRIVATE_LINK(OpenTemplateHdl, ThumbnailViewItem*, void);
+    DECL_DLLPRIVATE_LINK(OpenTemplateHdl, const ThumbnailViewItem*, void);
     DECL_DLLPRIVATE_LINK(EditTemplateHdl, ThumbnailViewItem*, void);
     DECL_DLLPRIVATE_LINK(DeleteTemplateHdl, void*, void);
     DECL_DLLPRIVATE_LINK(DefaultTemplateHdl, ThumbnailViewItem*, void);
@@ -179,7 +179,7 @@ public:
     bool IsStartWithTemplate() const { return mxCBXHideDlg->get_active(); };
 
 private:
-    DECL_DLLPRIVATE_LINK(OpenTemplateHdl, ThumbnailViewItem*, void);
+    DECL_DLLPRIVATE_LINK(OpenTemplateHdl, const ThumbnailViewItem*, void);
     DECL_DLLPRIVATE_LINK(OkClickHdl, weld::Button&, void);
     DECL_DLLPRIVATE_LINK(TimeOut, Timer*, void);
 
diff --git a/include/sfx2/templatelocalview.hxx 
b/include/sfx2/templatelocalview.hxx
index c724f0c19707..63c3c9d77a52 100644
--- a/include/sfx2/templatelocalview.hxx
+++ b/include/sfx2/templatelocalview.hxx
@@ -132,7 +132,7 @@ public:
 
     void setCreateContextMenuHdl(const Link<ThumbnailViewItem*,void> &rLink);
 
-    void setOpenTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
+    void setOpenTemplateHdl(const Link<const ThumbnailViewItem*, void>& rLink);
 
     void setEditTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
 
@@ -174,7 +174,7 @@ protected:
 
     Link<void*,void>              maOpenRegionHdl;
     Link<ThumbnailViewItem*,void> maCreateContextMenuHdl;
-    Link<ThumbnailViewItem*,void> maOpenTemplateHdl;
+    Link<const ThumbnailViewItem*, void> maOpenTemplateHdl;
     Link<ThumbnailViewItem*,void> maEditTemplateHdl;
     Link<void*,void> maDeleteTemplateHdl;
     Link<ThumbnailViewItem*,void> maDefaultTemplateHdl;
diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index 169c0da2464e..4828c4b234de 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -789,7 +789,7 @@ void TemplateLocalView::setCreateContextMenuHdl(const 
Link<ThumbnailViewItem*,vo
     maCreateContextMenuHdl = rLink;
 }
 
-void TemplateLocalView::setOpenTemplateHdl(const Link<ThumbnailViewItem*,void> 
&rLink)
+void TemplateLocalView::setOpenTemplateHdl(const Link<const 
ThumbnailViewItem*, void>& rLink)
 {
     maOpenTemplateHdl = rLink;
 }
diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index 23d75694bbb0..71559e5edb30 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -683,7 +683,7 @@ IMPL_LINK(BackingWindow, CreateContextMenuHdl, 
ThumbnailViewItem*, pItem, void)
         mxLocalView->createContextMenu();
 }
 
-IMPL_LINK(BackingWindow, OpenTemplateHdl, ThumbnailViewItem*, pItem, void)
+IMPL_LINK(BackingWindow, OpenTemplateHdl, const ThumbnailViewItem*, pItem, 
void)
 {
     uno::Sequence< PropertyValue > aArgs{
         comphelper::makePropertyValue(u"AsTemplate"_ustr, true),
@@ -692,7 +692,7 @@ IMPL_LINK(BackingWindow, OpenTemplateHdl, 
ThumbnailViewItem*, pItem, void)
         comphelper::makePropertyValue(u"InteractionHandler"_ustr, 
task::InteractionHandler::createWithParent( 
::comphelper::getProcessComponentContext(), nullptr ))
     };
 
-    TemplateViewItem *pTemplateItem = static_cast<TemplateViewItem*>(pItem);
+    const TemplateViewItem* pTemplateItem = static_cast<const 
TemplateViewItem*>(pItem);
 
     Reference< XDispatchProvider > xFrame( mxFrame, UNO_QUERY );
 
diff --git a/sfx2/source/dialog/backingwindow.hxx 
b/sfx2/source/dialog/backingwindow.hxx
index e8ac74f6a143..b41650db3f56 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -98,7 +98,7 @@ class BackingWindow : public InterimItemWindow
     DECL_LINK(MenuSelectHdl, const OUString&, void);
     DECL_STATIC_LINK(BackingWindow, ExtLinkClickHdl, weld::Button&, void);
     DECL_LINK(CreateContextMenuHdl, ThumbnailViewItem*, void);
-    DECL_LINK(OpenTemplateHdl, ThumbnailViewItem*, void);
+    DECL_LINK(OpenTemplateHdl, const ThumbnailViewItem*, void);
     DECL_LINK(EditTemplateHdl, ThumbnailViewItem*, void);
 
     void initControls();
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 96a300f47d53..da107093540c 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -250,7 +250,7 @@ SfxTemplateManagerDlg::~SfxTemplateManagerDlg()
     // Ignore view events since we are cleaning the object
     mxLocalView->setItemStateHdl(Link<const ThumbnailViewItem*,void>());
     mxLocalView->setOpenRegionHdl(Link<void*,void>());
-    mxLocalView->setOpenTemplateHdl(Link<ThumbnailViewItem*, void>());
+    mxLocalView->setOpenTemplateHdl(Link<const ThumbnailViewItem*, void>());
 }
 
 short SfxTemplateManagerDlg::run()
@@ -693,7 +693,7 @@ IMPL_LINK(SfxTemplateManagerDlg, CreateContextMenuHdl, 
ThumbnailViewItem*, pItem
     mxLocalView->createContextMenu(bIsDefault, bIsInternal, bIsSingleSel, 
aDefaultImg);
 }
 
-IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem, 
void)
+IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, const ThumbnailViewItem*, 
pItem, void)
 {
     uno::Sequence< PropertyValue > aArgs{
         comphelper::makePropertyValue(u"AsTemplate"_ustr, true),
@@ -703,7 +703,7 @@ IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, 
ThumbnailViewItem*, pItem, voi
         comphelper::makePropertyValue(u"ReadOnly"_ustr, true)
     };
 
-    TemplateViewItem *pTemplateItem = static_cast<TemplateViewItem*>(pItem);
+    const TemplateViewItem* pTemplateItem = static_cast<const 
TemplateViewItem*>(pItem);
 
     try
     {
@@ -1052,7 +1052,7 @@ void SfxTemplateManagerDlg::OnTemplateExport()
 
 void SfxTemplateManagerDlg::OnTemplateOpen ()
 {
-    ThumbnailViewItem *pItem = 
const_cast<ThumbnailViewItem*>(*maSelTemplates.begin());
+    const ThumbnailViewItem* pItem = *maSelTemplates.begin();
 
     OpenTemplateHdl(pItem);
 }
@@ -1369,9 +1369,9 @@ IMPL_LINK_NOARG(SfxTemplateSelectionDlg, TimeOut, Timer*, 
void)
     m_xDialog->set_centered_on_parent(false);
 }
 
-IMPL_LINK(SfxTemplateSelectionDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem, 
void)
+IMPL_LINK(SfxTemplateSelectionDlg, OpenTemplateHdl, const ThumbnailViewItem*, 
pItem, void)
 {
-    TemplateViewItem *pViewItem = static_cast<TemplateViewItem*>(pItem);
+    const TemplateViewItem* pViewItem = static_cast<const 
TemplateViewItem*>(pItem);
     msTemplatePath = pViewItem->getPath();
 
     m_xDialog->response(RET_OK);
@@ -1379,7 +1379,7 @@ IMPL_LINK(SfxTemplateSelectionDlg, OpenTemplateHdl, 
ThumbnailViewItem*, pItem, v
 
 IMPL_LINK_NOARG(SfxTemplateSelectionDlg, OkClickHdl, weld::Button&, void)
 {
-   TemplateViewItem *pViewItem = 
static_cast<TemplateViewItem*>(const_cast<ThumbnailViewItem*>(*maSelTemplates.begin()));
+   const TemplateViewItem* pViewItem = static_cast<const 
TemplateViewItem*>(*maSelTemplates.begin());
    msTemplatePath = pViewItem->getPath();
 
    m_xDialog->response(RET_OK);

Reply via email to