[Libreoffice-commits] core.git: 2 commits - sdext/source sfx2/source

2022-12-14 Thread Stephan Bergmann (via logerrit)
 sdext/source/presenter/PresenterAccessibility.cxx |3 ++-
 sdext/source/presenter/PresenterNotesView.cxx |   10 ++
 sdext/source/presenter/PresenterNotesView.hxx |7 ++-
 sdext/source/presenter/PresenterProtocolHandler.cxx   |3 ++-
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx |3 ++-
 sfx2/source/devtools/SelectionChangeHandler.hxx   |   16 +++-
 6 files changed, 37 insertions(+), 5 deletions(-)

New commits:
commit 9e73ff9fce12e102bb3c3cea8d8bb96c88f2c9ad
Author: Stephan Bergmann 
AuthorDate: Tue Dec 13 10:28:31 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 14 08:55:32 2022 +

loplugin:unocast (sdext::presenter::PresenterNotesView)

(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

Change-Id: Iee184c75fb5d4a8f00b932c001df023de795c469
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144144
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/sdext/source/presenter/PresenterAccessibility.cxx 
b/sdext/source/presenter/PresenterAccessibility.cxx
index 4f2fa33f3866..7040da4a3c51 100644
--- a/sdext/source/presenter/PresenterAccessibility.cxx
+++ b/sdext/source/presenter/PresenterAccessibility.cxx
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -513,7 +514,7 @@ void PresenterAccessible::UpdateAccessibilityHierarchy()
 if (pNotesPane)
 xNotesView = pNotesPane->mxView;
 rtl::Reference pNotesView (
-dynamic_cast(xNotesView.get()));
+comphelper::getFromUnoTunnel(xNotesView));
 
 UpdateAccessibilityHierarchy(
 pPreviewPane ? pPreviewPane->mxContentWindow : 
Reference(),
diff --git a/sdext/source/presenter/PresenterNotesView.cxx 
b/sdext/source/presenter/PresenterNotesView.cxx
index 457be1f612b7..ca434f5fa8a8 100644
--- a/sdext/source/presenter/PresenterNotesView.cxx
+++ b/sdext/source/presenter/PresenterNotesView.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -376,6 +377,15 @@ void SAL_CALL PresenterNotesView::keyPressed (const 
awt::KeyEvent& rEvent)
 
 void SAL_CALL PresenterNotesView::keyReleased (const awt::KeyEvent&) {}
 
+sal_Int64 PresenterNotesView::getSomething(css::uno::Sequence const 
& aIdentifier) {
+return comphelper::getSomethingImpl(aIdentifier, this);
+}
+
+css::uno::Sequence const & PresenterNotesView::getUnoTunnelId() {
+static comphelper::UnoIdInit const id;
+return id.getSeq();
+}
+
 
 void PresenterNotesView::Layout()
 {
diff --git a/sdext/source/presenter/PresenterNotesView.hxx 
b/sdext/source/presenter/PresenterNotesView.hxx
index 1af3f241f004..05368a7151c6 100644
--- a/sdext/source/presenter/PresenterNotesView.hxx
+++ b/sdext/source/presenter/PresenterNotesView.hxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -45,7 +46,8 @@ typedef cppu::WeakComponentImplHelper<
 css::awt::XPaintListener,
 css::drawing::framework::XView,
 css::drawing::XDrawView,
-css::awt::XKeyListener
+css::awt::XKeyListener,
+css::lang::XUnoTunnel
 > PresenterNotesViewInterfaceBase;
 
 /** A drawing framework view of the notes of a slide.  At the moment this is
@@ -117,6 +119,9 @@ public:
 virtual void SAL_CALL keyPressed (const css::awt::KeyEvent& rEvent) 
override;
 virtual void SAL_CALL keyReleased (const css::awt::KeyEvent& rEvent) 
override;
 
+sal_Int64 SAL_CALL getSomething(css::uno::Sequence const & 
aIdentifier) override;
+static css::uno::Sequence const & getUnoTunnelId();
+
 private:
 css::uno::Reference mxViewId;
 ::rtl::Reference mpPresenterController;
diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx 
b/sdext/source/presenter/PresenterProtocolHandler.cxx
index a32a73b6180e..bda104ce37d8 100644
--- a/sdext/source/presenter/PresenterProtocolHandler.cxx
+++ b/sdext/source/presenter/PresenterProtocolHandler.cxx
@@ -24,6 +24,7 @@
 #include "PresenterPaneContainer.hxx"
 #include "PresenterViewFactory.hxx"
 #include "PresenterWindowManager.hxx"
+#include 
 #include 
 #include 
 #include 
@@ -792,7 +793,7 @@ NotesFontSizeCommand::NotesFontSizeCommand(
 if (!pDescriptor)
 return nullptr;
 
-return dynamic_cast(pDescriptor->mxView.get());
+return 
comphelper::getFromUnoTunnel(pDescriptor->mxView);
 }
 
 void NotesFontSizeCommand::Execute()
commit a98acca8fbc38d3fd5600ae5056a8e42b6d8a40d
Author: Stephan Bergmann 
AuthorDate: Tue Dec 13 11:28:31 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 14 08:55:19 2022 +

loplugin:unocast (SelectionChangeHandler)

(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

Change-Id: Ibc2511c8521923c854e4b450649ea616581af2fa
Reviewed-on: 

[Libreoffice-commits] core.git: 2 commits - sdext/source sfx2/source

2021-10-30 Thread Mike Kaganski (via logerrit)
 sdext/source/minimizer/configurationaccess.cxx |   49 +++--
 sdext/source/minimizer/impoptimizer.cxx|   62 ---
 sdext/source/minimizer/optimizationstats.cxx   |   13 +-
 sdext/source/minimizer/optimizerdialog.cxx |   15 +-
 sdext/source/minimizer/optimizerdialogcontrols.cxx |   20 ++-
 sdext/source/pdfimport/filterdet.cxx   |   27 +++--
 sdext/source/pdfimport/misc/pwdinteract.cxx|4 
 sdext/source/pdfimport/odf/odfemitter.cxx  |3 
 sdext/source/pdfimport/pdfiadaptor.cxx |8 -
 sdext/source/pdfimport/wrapper/wrapper.cxx |   15 +-
 sdext/source/presenter/PresenterAccessibility.cxx  |3 
 sdext/source/presenter/PresenterCanvasHelper.cxx   |9 -
 sdext/source/presenter/PresenterGeometryHelper.cxx |3 
 sdext/source/presenter/PresenterPaneFactory.cxx|   15 +-
 sdext/source/presenter/PresenterSlideShowView.cxx  |4 
 sdext/source/presenter/PresenterWindowManager.cxx  |9 -
 sfx2/source/appl/appopen.cxx   |5 
 sfx2/source/appl/appserv.cxx   |6 -
 sfx2/source/appl/newhelp.cxx   |7 -
 sfx2/source/appl/shutdownicon.cxx  |   33 +++---
 sfx2/source/appl/shutdowniconaqua.mm   |   18 +--
 sfx2/source/control/charwin.cxx|   10 -
 sfx2/source/control/dispatch.cxx   |9 -
 sfx2/source/control/recentdocsview.cxx |4 
 sfx2/source/control/recentdocsviewitem.cxx |   12 --
 sfx2/source/control/request.cxx|2 
 sfx2/source/control/thumbnailview.cxx  |4 
 sfx2/source/control/unoctitm.cxx   |   28 ++---
 sfx2/source/dialog/backingwindow.cxx   |   28 ++---
 sfx2/source/dialog/dinfdlg.cxx |   50 +
 sfx2/source/dialog/filedlghelper.cxx   |   23 ++--
 sfx2/source/dialog/filtergrouping.cxx  |   10 +
 sfx2/source/dialog/mailmodel.cxx   |   53 +
 sfx2/source/dialog/templdlg.cxx|6 -
 sfx2/source/doc/SfxDocumentMetaData.cxx|   44 +++-
 sfx2/source/doc/docfac.cxx |   18 +--
 sfx2/source/doc/docfile.cxx|   81 ---
 sfx2/source/doc/doctempl.cxx   |5 
 sfx2/source/doc/doctemplates.cxx   |   30 +
 sfx2/source/doc/exoticfileloadexception.cxx|5 
 sfx2/source/doc/exoticfileloadexception.hxx|2 
 sfx2/source/doc/graphhelp.cxx  |   15 +-
 sfx2/source/doc/guisaveas.cxx  |7 -
 sfx2/source/doc/iframe.cxx |   10 -
 sfx2/source/doc/objmisc.cxx|9 -
 sfx2/source/doc/objstor.cxx|   68 +++-
 sfx2/source/doc/printhelper.cxx|   51 +
 sfx2/source/doc/sfxbasemodel.cxx   |  112 +++--
 sfx2/source/doc/templatedlg.cxx|   36 ++
 sfx2/source/doc/zoomitem.cxx   |   17 +--
 sfx2/source/inet/inettbc.cxx   |   11 +-
 sfx2/source/notify/globalevents.cxx|3 
 sfx2/source/sidebar/ResourceManager.cxx|3 
 sfx2/source/sidebar/UnoDecks.cxx   |   12 --
 sfx2/source/sidebar/UnoPanels.cxx  |   12 --
 sfx2/source/view/ipclient.cxx  |7 -
 sfx2/source/view/lokcharthelper.cxx|   10 +
 sfx2/source/view/viewprn.cxx   |   27 ++---
 sfx2/source/view/viewsh.cxx|7 -
 59 files changed, 574 insertions(+), 595 deletions(-)

New commits:
commit 8b9e502480812f61a1c8d37c465aaf93763fe156
Author: Mike Kaganski 
AuthorDate: Fri Oct 29 10:02:46 2021 +0300
Commit: Mike Kaganski 
CommitDate: Sun Oct 31 06:56:57 2021 +0100

Prepare for removal of non-const operator[] from Sequence in sdext

Change-Id: I1992d1ffbbc80efe9749ebd254971a0a92a10019
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124386
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sdext/source/minimizer/configurationaccess.cxx 
b/sdext/source/minimizer/configurationaccess.cxx
index 0ed089e341a2..3479918c2dc9 100644
--- a/sdext/source/minimizer/configurationaccess.cxx
+++ b/sdext/source/minimizer/configurationaccess.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -427,38 +428,24 @@ sal_Int32 ConfigurationAccess::GetConfigProperty( const 
PPPOptimizerTokenEnum eP
 
 Sequence< PropertyValue > ConfigurationAccess::GetConfigurationSequence()
 {
-Sequence< PropertyValue > aRet( 15 );
 OptimizerSettings& rSettings( maSettings.front() );
-aRet[ 0 ].Name  = "JPEGCompression";
-aRet[ 0 ].Value <<= rSettings.mbJPEGCompression;
-aRet[ 1 ].Name  =