cui/source/dialogs/SpellDialog.cxx | 4 +- cui/source/dialogs/hangulhanjadlg.cxx | 4 +- dbaccess/source/ui/control/sqledit.cxx | 4 +- desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 5 +- formula/source/ui/dlg/parawin.cxx | 2 - include/vcl/weld.hxx | 10 ++--- sc/source/ui/app/inputwin.cxx | 3 - sc/source/ui/dbgui/csvtablebox.cxx | 12 ++---- sc/source/ui/dbgui/filtdlg.cxx | 2 - sc/source/ui/miscdlgs/datafdlg.cxx | 2 - sc/source/ui/miscdlgs/optsolver.cxx | 4 +- sd/source/ui/annotations/annotationwindow.cxx | 4 +- sfx2/source/dialog/dinfdlg.cxx | 1 starmath/source/dialog.cxx | 3 + starmath/source/edit.cxx | 4 +- starmath/source/view.cxx | 4 +- svtools/source/control/valueset.cxx | 4 +- svtools/source/dialogs/addresstemplate.cxx | 4 +- svx/source/dialog/charmap.cxx | 3 + svx/source/dialog/rubydialog.cxx | 2 - svx/source/dialog/searchcharmap.cxx | 3 + sw/source/uibase/dbui/mailmergehelper.cxx | 2 - sw/source/uibase/docvw/AnnotationWin2.cxx | 4 +- vcl/inc/jsdialog/jsdialogbuilder.hxx | 8 ++-- vcl/inc/qt5/QtInstanceScrolledWindow.hxx | 6 +-- vcl/inc/salvtables.hxx | 10 ++--- vcl/jsdialog/jsdialogbuilder.cxx | 12 +++--- vcl/qt5/QtInstanceBuilder.cxx | 1 vcl/qt5/QtInstanceScrolledWindow.cxx | 35 ++------------------ vcl/source/app/salvtables.cxx | 26 +++----------- vcl/unx/gtk3/gtkinst.cxx | 26 ++++---------- 31 files changed, 76 insertions(+), 138 deletions(-)
New commits: commit 71e21d79e0a88371734c3c8fa5d198ac83b15887 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Jul 31 20:56:35 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 1 08:23:17 2025 +0200 tdf#130857 weld: Drop ScrolledWindow::vadjustment::{g,s}et_lower Each of them is used only once and the the setter is only called with 0, which is already the default value. See also previous commit Change-Id: Ia9ab1ae97a77df4efe1856350c1c824b20310896 Author: Michael Weghorn <m.wegh...@posteo.de> Date: Thu Jul 31 20:42:25 2025 +0200 tdf#130857 weld: Drop lower param for ScrolledWindow::{v,h}adjustment_configure for more background. Change-Id: Ia32b45cd269e93e943707031f114235c4a4f27f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188724 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 91a7bda870bf..e9c7104094fb 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -1079,7 +1079,7 @@ namespace svx if( _bUp ) { if( !m_pPrev ) - bRet = m_pScrollBar->vadjustment_get_value() > m_pScrollBar->vadjustment_get_lower(); + bRet = m_pScrollBar->vadjustment_get_value() > 0; } else { diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 05a47f6c648e..d0e3d08ef708 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -481,8 +481,6 @@ public: virtual void vadjustment_set_page_size(int size) = 0; virtual void vadjustment_set_page_increment(int size) = 0; virtual void vadjustment_set_step_increment(int size) = 0; - virtual int vadjustment_get_lower() const = 0; - virtual void vadjustment_set_lower(int lower) = 0; virtual void set_vpolicy(VclPolicyType eVPolicy) = 0; virtual VclPolicyType get_vpolicy() const = 0; void connect_vadjustment_changed(const Link<ScrolledWindow&, void>& rLink) diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 331ad7f36c3f..5e8c40e136dc 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -2039,7 +2039,6 @@ void CustomPropertiesControl::Init(weld::Builder& rBuilder) m_xPropertiesWin->SetRemovedHdl( LINK( this, CustomPropertiesControl, RemovedHdl ) ); - m_xVertScroll->vadjustment_set_lower(0); m_xVertScroll->vadjustment_set_upper(0); m_xVertScroll->vadjustment_set_page_size(0xFFFF); diff --git a/vcl/inc/qt5/QtInstanceScrolledWindow.hxx b/vcl/inc/qt5/QtInstanceScrolledWindow.hxx index b7a7bbc9165f..0239d1329f91 100644 --- a/vcl/inc/qt5/QtInstanceScrolledWindow.hxx +++ b/vcl/inc/qt5/QtInstanceScrolledWindow.hxx @@ -50,8 +50,6 @@ public: virtual void vadjustment_set_page_size(int nSize) override; virtual void vadjustment_set_page_increment(int nSize) override; virtual void vadjustment_set_step_increment(int nSize) override; - virtual int vadjustment_get_lower() const override; - virtual void vadjustment_set_lower(int nLower) override; virtual void set_vpolicy(VclPolicyType eVPolicy) override; virtual VclPolicyType get_vpolicy() const override; virtual int get_scroll_thickness() const override; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index d102f9d4ffa1..dd1f7ae469a6 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -2181,8 +2181,6 @@ public: virtual void vadjustment_set_value(int value) override; virtual int vadjustment_get_upper() const override; virtual void vadjustment_set_upper(int upper) override; - virtual int vadjustment_get_lower() const override; - virtual void vadjustment_set_lower(int lower) override; virtual int vadjustment_get_page_size() const override; virtual void vadjustment_set_page_size(int size) override; virtual void vadjustment_set_page_increment(int size) override; diff --git a/vcl/qt5/QtInstanceScrolledWindow.cxx b/vcl/qt5/QtInstanceScrolledWindow.cxx index c27c7c3f92b8..3578ddc67dd1 100644 --- a/vcl/qt5/QtInstanceScrolledWindow.cxx +++ b/vcl/qt5/QtInstanceScrolledWindow.cxx @@ -267,29 +267,6 @@ void QtInstanceScrolledWindow::vadjustment_set_step_increment(int nSize) }); } -int QtInstanceScrolledWindow::vadjustment_get_lower() const -{ - SolarMutexGuard g; - - int nMin = 0; - GetQtInstance().RunInMainThread([&] { - if (QScrollBar* pScrollBar = m_pScrollArea->verticalScrollBar()) - nMin = pScrollBar->minimum(); - }); - - return nMin; -} - -void QtInstanceScrolledWindow::vadjustment_set_lower(int nLower) -{ - SolarMutexGuard g; - - GetQtInstance().RunInMainThread([&] { - if (QScrollBar* pScrollBar = m_pScrollArea->verticalScrollBar()) - pScrollBar->setMinimum(nLower); - }); -} - void QtInstanceScrolledWindow::set_vpolicy(VclPolicyType eVPolicy) { SolarMutexGuard g; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index b973c90855e4..0bd3d97c4183 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2450,18 +2450,6 @@ void SalInstanceScrolledWindow::vadjustment_set_upper(int upper) rVertScrollBar.SetRangeMax(upper); } -int SalInstanceScrolledWindow::vadjustment_get_lower() const -{ - ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); - return rVertScrollBar.GetRangeMin(); -} - -void SalInstanceScrolledWindow::vadjustment_set_lower(int lower) -{ - ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); - rVertScrollBar.SetRangeMin(lower); -} - int SalInstanceScrolledWindow::vadjustment_get_page_size() const { ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index f697265c8de6..d93ad6c912fd 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -8471,18 +8471,6 @@ public: enable_notify_events(); } - virtual int vadjustment_get_lower() const override - { - return gtk_adjustment_get_lower(m_pVAdjustment); - } - - virtual void vadjustment_set_lower(int lower) override - { - disable_notify_events(); - gtk_adjustment_set_lower(m_pVAdjustment, lower); - enable_notify_events(); - } - virtual int vadjustment_get_page_size() const override { return gtk_adjustment_get_page_size(m_pVAdjustment); commit ff6a6025b607815660f7bf6d48b84f5965dc7efe Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Jul 31 20:42:25 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 1 08:23:11 2025 +0200 tdf#130857 weld: Drop lower param for ScrolledWindow::{v,h}adjustment_configure Drop the `lower` param for weld::ScrolledWindow::hadjustment_configure and weld::ScrolledWindow::vadjustment_configure which is always 0 anyway. While GtkScrolledwindow and QScrollArea both use the dimensions of the contained widget by default, GtkScrolledWindow supports using values disconnected from those (by using a GtkAdjustment with "arbitrary" values for each dimension) and the LO weld::ScrolledWindow is designed after those semantics. Using values disconnected to the size of the contained widget doesn't map well to QScrollArea semantics. Drop the always 0 minimum value, to have at least one aspect less that needs to be supported/cared about when considering how to implement the necessary logic in QtInstanceScrolledWindow for the case of using custom values (as is done e.g. in the Special Characters dialog). Change-Id: Ia9ab1ae97a77df4efe1856350c1c824b20310896 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188723 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index f6f485835ff6..4e6fc4d76182 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -1219,8 +1219,8 @@ void SentenceEditWindow_Impl::SetScrollBarRange() */ nVPageSize = std::min(nVPageSize, nVUpper); - m_xScrolledWindow->vadjustment_configure(nVCurrentDocPos, 0, nVUpper, - nVStepIncrement, nVPageIncrement, nVPageSize); + m_xScrolledWindow->vadjustment_configure(nVCurrentDocPos, nVUpper, nVStepIncrement, + nVPageIncrement, nVPageSize); m_xScrolledWindow->set_vpolicy(nVUpper > nVPageSize ? VclPolicyType::ALWAYS : VclPolicyType::NEVER); } diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index e06aae5e1051..91a7bda870bf 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -1455,7 +1455,7 @@ namespace svx static_assert(MAXNUM_SUGGESTIONS >= 5, "number of suggestions should not under-run the value of 5"); // 4 here, because we have 4 edits / page - m_xScrollSB->vadjustment_configure(0, 0, MAXNUM_SUGGESTIONS, 1, 4, 4); + m_xScrollSB->vadjustment_configure(0, MAXNUM_SUGGESTIONS, 1, 4, 4); m_xScrollSB->connect_vadjustment_changed(LINK(this, HangulHanjaEditDictDialog, ScrollHdl)); m_xEdit1->connect_changed( LINK( this, HangulHanjaEditDictDialog, EditModifyHdl1 ) ); diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index 184fde58b2b3..f4da70f00a82 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -468,8 +468,8 @@ void SQLEditView::SetScrollBarRange() */ nVPageSize = std::min(nVPageSize, nVUpper); - m_xScrolledWindow->vadjustment_configure(nVCurrentDocPos, 0, nVUpper, - nVStepIncrement, nVPageIncrement, nVPageSize); + m_xScrolledWindow->vadjustment_configure(nVCurrentDocPos, nVUpper, nVStepIncrement, + nVPageIncrement, nVPageSize); } IMPL_LINK_NOARG(SQLEditView, ScrollHdl, weld::ScrolledWindow&, void) diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 77c1c65a757c..7a1b33bc762d 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -682,9 +682,8 @@ void ExtensionBox_Impl::SetupScrollBar() if ( m_nTopIndex + aSize.Height() > nTotalHeight ) m_nTopIndex = nTotalHeight - aSize.Height(); - m_xScrollBar->vadjustment_configure(m_nTopIndex, 0, nTotalHeight, - m_nStdHeight, ( aSize.Height() * 4 ) / 5, - aSize.Height()); + m_xScrollBar->vadjustment_configure(m_nTopIndex, nTotalHeight, m_nStdHeight, + (aSize.Height() * 4) / 5, aSize.Height()); if (!m_bHasScrollBar) m_xScrollBar->set_vpolicy(VclPolicyType::ALWAYS); diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index 3c6d333a10f0..809c2e51984a 100644 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -428,7 +428,7 @@ void ParaWin::SetArgumentOffset(sal_uInt16 nOffset) } else { - m_xSlider->vadjustment_configure(nOffset, 0, nMaxArgs, 1, 4, 4); + m_xSlider->vadjustment_configure(nOffset, nMaxArgs, 1, 4, 4); m_xSlider->set_vpolicy(VclPolicyType::ALWAYS); Size aPrefSize(m_xGrid->get_preferred_size()); m_xSlider->set_size_request(aPrefSize.Width(), aPrefSize.Height()); diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 31aa0dbaab16..05a47f6c648e 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -452,8 +452,8 @@ protected: void signal_hadjustment_changed() { m_aHChangeHdl.Call(*this); } public: - virtual void hadjustment_configure(int value, int lower, int upper, int step_increment, - int page_increment, int page_size) + virtual void hadjustment_configure(int value, int upper, int step_increment, int page_increment, + int page_size) = 0; virtual int hadjustment_get_value() const = 0; virtual void hadjustment_set_value(int value) = 0; @@ -470,8 +470,8 @@ public: m_aHChangeHdl = rLink; } - virtual void vadjustment_configure(int value, int lower, int upper, int step_increment, - int page_increment, int page_size) + virtual void vadjustment_configure(int value, int upper, int step_increment, int page_increment, + int page_size) = 0; virtual int vadjustment_get_value() const = 0; virtual void vadjustment_set_value(int value) = 0; diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 645e73eb7531..c5fac3988203 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1431,8 +1431,7 @@ void ScTextWnd::SetScrollBarRange() nPageSize = std::min(nPageSize, nUpper); weld::ScrolledWindow& rVBar = mrGroupBar.GetScrollWin(); - rVBar.vadjustment_configure(nCurrentDocPos, 0, nUpper, - nStepIncrement, nPageIncrement, nPageSize); + rVBar.vadjustment_configure(nCurrentDocPos, nUpper, nStepIncrement, nPageIncrement, nPageSize); } void ScTextWnd::DoScroll() diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx index ab8231013009..a0a55ed183e5 100644 --- a/sc/source/ui/dbgui/csvtablebox.cxx +++ b/sc/source/ui/dbgui/csvtablebox.cxx @@ -136,25 +136,21 @@ void ScCsvTableBox::InitControls() void ScCsvTableBox::InitHScrollBar() { - int nLower = 0; int nValue = mxGrid->GetFirstVisPos(); int nUpper = mxGrid->GetPosCount() + 2; int nPageSize = mxGrid->GetVisPosCount(); // Undo scrollbar RTL if (AllSettings::GetLayoutRTL()) - nValue = nUpper - (nValue - nLower + nPageSize); + nValue = nUpper - (nValue + nPageSize); - mxScroll->hadjustment_configure(nValue, nLower, nUpper, - 1, mxGrid->GetVisPosCount() * 3 / 4, - nPageSize); + mxScroll->hadjustment_configure(nValue, nUpper, 1, mxGrid->GetVisPosCount() * 3 / 4, nPageSize); } void ScCsvTableBox::InitVScrollBar() { - mxScroll->vadjustment_configure(mxGrid->GetFirstVisLine(), 0, mxGrid->GetLineCount() + 1, - 1, mxGrid->GetVisLineCount() - 2, - mxGrid->GetVisLineCount()); + mxScroll->vadjustment_configure(mxGrid->GetFirstVisLine(), mxGrid->GetLineCount() + 1, 1, + mxGrid->GetVisLineCount() - 2, mxGrid->GetVisLineCount()); } void ScCsvTableBox::MakePosVisible( sal_Int32 nPos ) diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 493fdcaa042b..3fece05fb2b2 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -314,7 +314,7 @@ void ScFilterDlg::Init() } m_xScrollBar->connect_vadjustment_changed( LINK( this, ScFilterDlg, ScrollHdl ) ); - m_xScrollBar->vadjustment_configure(0, 0, 8, 1, 3, 4); + m_xScrollBar->vadjustment_configure(0, 8, 1, 3, 4); Size aSize(m_xContents->get_preferred_size()); m_xContents->set_size_request(aSize.Width(), aSize.Height()); diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx index 6490cdc3b5b2..2bf7a28bb92c 100644 --- a/sc/source/ui/miscdlgs/datafdlg.cxx +++ b/sc/source/ui/miscdlgs/datafdlg.cxx @@ -172,7 +172,7 @@ ScDataFormDlg::ScDataFormDlg(weld::Window* pParent, ScTabViewShell* pTabViewShel FillCtrls(); - m_xSlider->vadjustment_configure(0, 0, nEndRow - nStartRow + 1, 1, 10, 1); + m_xSlider->vadjustment_configure(0, nEndRow - nStartRow + 1, 1, 10, 1); m_xBtnNew->connect_clicked(LINK( this, ScDataFormDlg, Impl_NewHdl)); m_xBtnPrev->connect_clicked(LINK( this, ScDataFormDlg, Impl_PrevHdl)); diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index f4224c3a152e..38cf30d70d1c 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -385,8 +385,8 @@ void ScOptSolverDlg::ShowConditions() // allow to scroll one page behind the visible or stored rows tools::Long nVisible = nScrollPos + EDIT_ROW_COUNT; tools::Long nMax = std::max( nVisible, static_cast<tools::Long>(m_aConditions.size()) ); - m_xScrollBar->vadjustment_configure(nScrollPos, 0, nMax + EDIT_ROW_COUNT, 1, - EDIT_ROW_COUNT - 1, EDIT_ROW_COUNT); + m_xScrollBar->vadjustment_configure(nScrollPos, nMax + EDIT_ROW_COUNT, 1, EDIT_ROW_COUNT - 1, + EDIT_ROW_COUNT); EnableButtons(); } diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index fcb26c12398c..3f6127c5b09f 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -437,8 +437,8 @@ void AnnotationWindow::DoResize() */ nPageSize = std::min(nPageSize, nUpper); - mxVScrollbar->vadjustment_configure(nCurrentDocPos, 0, nUpper, - nStepIncrement, nPageIncrement, nPageSize); + mxVScrollbar->vadjustment_configure(nCurrentDocPos, nUpper, nStepIncrement, nPageIncrement, + nPageSize); } void AnnotationWindow::SetScrollbar() diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index eb99711bea6e..21f220a5ecb7 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1233,7 +1233,8 @@ void SmShowSymbolSet::SetSymbolSet(const SymbolPtrVec_t & rSymbolSet) void SmShowSymbolSet::SetScrollBarRange() { const int nLastRow = (aSymbolSet.size() - 1 + nColumns) / nColumns; - m_xScrolledWindow->vadjustment_configure(m_xScrolledWindow->vadjustment_get_value(), 0, nLastRow, 1, nRows - 1, nRows); + m_xScrolledWindow->vadjustment_configure(m_xScrolledWindow->vadjustment_get_value(), nLastRow, + 1, nRows - 1, nRows); Invalidate(); } diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index d67400d1c5ab..ef01494a051e 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -491,8 +491,8 @@ void SmEditWindow::SetScrollBarRanges() */ nVPageSize = std::min(nVPageSize, nVUpper); - mxScrolledWindow->vadjustment_configure(nVCurrentDocPos, 0, nVUpper, - nVStepIncrement, nVPageIncrement, nVPageSize); + mxScrolledWindow->vadjustment_configure(nVCurrentDocPos, nVUpper, nVStepIncrement, + nVPageIncrement, nVPageSize); } OUString SmEditWindow::GetText() const diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index af0533d14ebb..df0661fc70db 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -235,12 +235,12 @@ void SmGraphicWindow::Resize() // resize scrollbars and set their ranges if ( bHVisible ) { - mxScrolledWindow->hadjustment_configure(-aPixOffset.X(), 0, aTotPixSz.Width(), nColumnPixW, + mxScrolledWindow->hadjustment_configure(-aPixOffset.X(), aTotPixSz.Width(), nColumnPixW, aOutPixSz.Width(), aOutPixSz.Width()); } if ( bVVisible ) { - mxScrolledWindow->vadjustment_configure(-aPixOffset.Y(), 0, aTotPixSz.Height(), nLinePixH, + mxScrolledWindow->vadjustment_configure(-aPixOffset.Y(), aTotPixSz.Height(), nLinePixH, aOutPixSz.Height(), aOutPixSz.Height()); } } diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 2d893e98d597..79b388230765 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1153,8 +1153,8 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) tools::Long nPageSize = mnVisLines; if (nPageSize < 1) nPageSize = 1; - mxScrolledWindow->vadjustment_configure(mnFirstLine, 0, mnLines, 1, - mnVisLines, nPageSize); + mxScrolledWindow->vadjustment_configure(mnFirstLine, mnLines, 1, mnVisLines, + nPageSize); } if (bTurnScrollbarOn) diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index 8877108e899d..cc0bfa6af22f 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -568,8 +568,8 @@ void AssignmentPersistentData::ImplCommit() // limit the scrollbar range accordingly sal_Int32 nOverallFieldPairs = m_pImpl->aFieldLabels.size() / 2; - m_xFieldScroller->vadjustment_configure(0, 0, nOverallFieldPairs, - 1, FIELD_PAIRS_VISIBLE - 1, FIELD_PAIRS_VISIBLE); + m_xFieldScroller->vadjustment_configure(0, nOverallFieldPairs, 1, FIELD_PAIRS_VISIBLE - 1, + FIELD_PAIRS_VISIBLE); // reset the current field assignments m_pImpl->aFieldAssignments.resize(m_pImpl->aFieldLabels.size()); diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index c1017be14cd5..0403289f8170 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -707,7 +707,8 @@ void SvxShowCharSet::RecalculateFont(vcl::RenderContext& rRenderContext) nY = aSize.Height() / ROW_COUNT; const int nLastRow = (mxFontCharMap->GetCharCount() - 1 + COLUMN_COUNT) / COLUMN_COUNT; - mxScrollArea->vadjustment_configure(mxScrollArea->vadjustment_get_value(), 0, nLastRow, 1, ROW_COUNT - 1, ROW_COUNT); + mxScrollArea->vadjustment_configure(mxScrollArea->vadjustment_get_value(), nLastRow, 1, + ROW_COUNT - 1, ROW_COUNT); // restore last selected unicode int nMapIndex = mxFontCharMap->GetIndexFromChar(getSelectedChar()); diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 72147410ba8e..855def63c1e3 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -603,7 +603,7 @@ void SvxRubyDialog::Update() const Sequence<PropertyValues>& aRubyValues = m_pImpl->GetRubyValues(); sal_Int32 nLen = aRubyValues.getLength(); - m_xScrolledWindow->vadjustment_configure(0, 0, !nLen ? 1 : nLen, 1, 4, 4); + m_xScrolledWindow->vadjustment_configure(0, !nLen ? 1 : nLen, 1, 4, 4); if (nLen > 4) m_xScrolledWindow->set_vpolicy(VclPolicyType::ALWAYS); else diff --git a/svx/source/dialog/searchcharmap.cxx b/svx/source/dialog/searchcharmap.cxx index 16acbc61e985..0e814d461521 100644 --- a/svx/source/dialog/searchcharmap.cxx +++ b/svx/source/dialog/searchcharmap.cxx @@ -199,7 +199,8 @@ void SvxSearchCharSet::UpdateScrollRange() { //scrollbar settings int nLastRow = (getMaxCharCount() - 1 + COLUMN_COUNT) / COLUMN_COUNT; - mxScrollArea->vadjustment_configure(mxScrollArea->vadjustment_get_value(), 0, nLastRow, 1, ROW_COUNT - 1, ROW_COUNT); + mxScrollArea->vadjustment_configure(mxScrollArea->vadjustment_get_value(), nLastRow, 1, + ROW_COUNT - 1, ROW_COUNT); } void SvxSearchCharSet::SelectIndex(int nNewIndex, bool bFocus) diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index e3e1534204b2..a90be3aabb7e 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -368,7 +368,7 @@ void SwAddressPreview::UpdateScrollBar() if (nValue > nResultingRows) nValue = nResultingRows; m_xVScrollBar->set_vpolicy(m_pImpl->bEnableScrollBar && nResultingRows > m_pImpl->nRows ? VclPolicyType::ALWAYS : VclPolicyType::NEVER); - m_xVScrollBar->vadjustment_configure(nValue, 0, nResultingRows, 1, 10, m_pImpl->nRows); + m_xVScrollBar->vadjustment_configure(nValue, nResultingRows, 1, 10, m_pImpl->nRows); } } diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 629c66099563..b4de12eb8e24 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -829,8 +829,8 @@ void SwAnnotationWin::DoResize() */ nPageSize = std::min(nPageSize, nUpper); - mxVScrollbar->vadjustment_configure(nCurrentDocPos, 0, nUpper, - nStepIncrement, nPageIncrement, nPageSize); + mxVScrollbar->vadjustment_configure(nCurrentDocPos, nUpper, nStepIncrement, nPageIncrement, + nPageSize); } void SwAnnotationWin::SetSizePixel( const Size& rNewSize ) diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index ecce71c9b1bd..737bfe00097c 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -466,15 +466,15 @@ public: JSScrolledWindow(JSDialogSender* pSender, ::VclScrolledWindow* pWindow, SalInstanceBuilder* pBuilder, bool bTakeOwnership, bool bUserManagedScrolling); - virtual void vadjustment_configure(int value, int lower, int upper, int step_increment, - int page_increment, int page_size) override; + virtual void vadjustment_configure(int value, int upper, int step_increment, int page_increment, + int page_size) override; virtual void vadjustment_set_value(int value) override; void vadjustment_set_value_no_notification(int value); virtual void vadjustment_set_page_size(int size) override; virtual void set_vpolicy(VclPolicyType eVPolicy) override; - virtual void hadjustment_configure(int value, int lower, int upper, int step_increment, - int page_increment, int page_size) override; + virtual void hadjustment_configure(int value, int upper, int step_increment, int page_increment, + int page_size) override; virtual void hadjustment_set_value(int value) override; void hadjustment_set_value_no_notification(int value); virtual void hadjustment_set_page_size(int size) override; diff --git a/vcl/inc/qt5/QtInstanceScrolledWindow.hxx b/vcl/inc/qt5/QtInstanceScrolledWindow.hxx index 16ffe5b4c727..b7a7bbc9165f 100644 --- a/vcl/inc/qt5/QtInstanceScrolledWindow.hxx +++ b/vcl/inc/qt5/QtInstanceScrolledWindow.hxx @@ -27,7 +27,7 @@ public: virtual css::uno::Reference<css::awt::XWindow> CreateChildFrame() override; virtual void child_grab_focus() override; - virtual void hadjustment_configure(int nValue, int nLower, int nUpper, int nStepIncrement, + virtual void hadjustment_configure(int nValue, int nUpper, int nStepIncrement, int nPageIncrement, int nPageSize) override; virtual int hadjustment_get_value() const override; virtual void hadjustment_set_value(int nValue) override; @@ -40,7 +40,7 @@ public: virtual void set_hpolicy(VclPolicyType eHPolicy) override; virtual VclPolicyType get_hpolicy() const override; - virtual void vadjustment_configure(int nValue, int nLower, int nUpper, int nStepIncrement, + virtual void vadjustment_configure(int nValue, int nUpper, int nStepIncrement, int nPageIncrement, int nPageSize) override; virtual int vadjustment_get_value() const override; virtual void vadjustment_set_value(int nValue) override; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index d52483763a2b..d102f9d4ffa1 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -2162,8 +2162,8 @@ public: SalInstanceScrolledWindow(VclScrolledWindow* pScrolledWindow, SalInstanceBuilder* pBuilder, bool bTakeOwnership, bool bUserManagedScrolling); - virtual void hadjustment_configure(int value, int lower, int upper, int step_increment, - int page_increment, int page_size) override; + virtual void hadjustment_configure(int value, int upper, int step_increment, int page_increment, + int page_size) override; virtual int hadjustment_get_value() const override; virtual void hadjustment_set_value(int value) override; virtual int hadjustment_get_upper() const override; @@ -2175,8 +2175,8 @@ public: virtual void set_hpolicy(VclPolicyType eHPolicy) override; virtual VclPolicyType get_hpolicy() const override; - virtual void vadjustment_configure(int value, int lower, int upper, int step_increment, - int page_increment, int page_size) override; + virtual void vadjustment_configure(int value, int upper, int step_increment, int page_increment, + int page_size) override; virtual int vadjustment_get_value() const override; virtual void vadjustment_set_value(int value) override; virtual int vadjustment_get_upper() const override; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index c9bf2927a2ef..20dc77c10cdf 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1124,11 +1124,11 @@ JSScrolledWindow::JSScrolledWindow(JSDialogSender* pSender, ::VclScrolledWindow* { } -void JSScrolledWindow::vadjustment_configure(int value, int lower, int upper, int step_increment, +void JSScrolledWindow::vadjustment_configure(int value, int upper, int step_increment, int page_increment, int page_size) { - SalInstanceScrolledWindow::vadjustment_configure(value, lower, upper, step_increment, - page_increment, page_size); + SalInstanceScrolledWindow::vadjustment_configure(value, upper, step_increment, page_increment, + page_size); sendUpdate(); } @@ -1155,11 +1155,11 @@ void JSScrolledWindow::set_vpolicy(VclPolicyType eVPolicy) sendUpdate(); } -void JSScrolledWindow::hadjustment_configure(int value, int lower, int upper, int step_increment, +void JSScrolledWindow::hadjustment_configure(int value, int upper, int step_increment, int page_increment, int page_size) { - SalInstanceScrolledWindow::hadjustment_configure(value, lower, upper, step_increment, - page_increment, page_size); + SalInstanceScrolledWindow::hadjustment_configure(value, upper, step_increment, page_increment, + page_size); sendUpdate(); } diff --git a/vcl/qt5/QtInstanceScrolledWindow.cxx b/vcl/qt5/QtInstanceScrolledWindow.cxx index 06ac3f640287..c27c7c3f92b8 100644 --- a/vcl/qt5/QtInstanceScrolledWindow.cxx +++ b/vcl/qt5/QtInstanceScrolledWindow.cxx @@ -32,9 +32,8 @@ css::uno::Reference<css::awt::XWindow> QtInstanceScrolledWindow::CreateChildFram void QtInstanceScrolledWindow::child_grab_focus() { assert(false && "Not implemented yet"); } -void QtInstanceScrolledWindow::hadjustment_configure(int nValue, int nLower, int nUpper, - int nStepIncrement, int nPageIncrement, - int nPageSize) +void QtInstanceScrolledWindow::hadjustment_configure(int nValue, int nUpper, int nStepIncrement, + int nPageIncrement, int nPageSize) { SolarMutexGuard g; @@ -44,7 +43,6 @@ void QtInstanceScrolledWindow::hadjustment_configure(int nValue, int nLower, int return; pScrollBar->setValue(nValue); - pScrollBar->setMinimum(nLower); pScrollBar->setMaximum(nUpper); pScrollBar->setSingleStep(nStepIncrement); pScrollBar->setPageStep(nPageIncrement); @@ -161,9 +159,8 @@ VclPolicyType QtInstanceScrolledWindow::get_hpolicy() const return ePolicy; } -void QtInstanceScrolledWindow::vadjustment_configure(int nValue, int nLower, int nUpper, - int nStepIncrement, int nPageIncrement, - int nPageSize) +void QtInstanceScrolledWindow::vadjustment_configure(int nValue, int nUpper, int nStepIncrement, + int nPageIncrement, int nPageSize) { SolarMutexGuard g; @@ -173,7 +170,6 @@ void QtInstanceScrolledWindow::vadjustment_configure(int nValue, int nLower, int return; pScrollBar->setValue(nValue); - pScrollBar->setMinimum(nLower); pScrollBar->setMaximum(nUpper); pScrollBar->setSingleStep(nStepIncrement); pScrollBar->setPageStep(nPageIncrement); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 0f90a2fe7009..b973c90855e4 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2329,12 +2329,11 @@ SalInstanceScrolledWindow::SalInstanceScrolledWindow(VclScrolledWindow* pScrolle m_xScrolledWindow->setUserManagedScrolling(m_bUserManagedScrolling); } -void SalInstanceScrolledWindow::hadjustment_configure(int value, int lower, int upper, - int step_increment, int page_increment, - int page_size) +void SalInstanceScrolledWindow::hadjustment_configure(int value, int upper, int step_increment, + int page_increment, int page_size) { ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar(); - rHorzScrollBar.SetRangeMin(lower); + rHorzScrollBar.SetRangeMin(0); rHorzScrollBar.SetRangeMax(upper); rHorzScrollBar.SetLineSize(step_increment); rHorzScrollBar.SetPageSize(page_increment); @@ -2413,12 +2412,11 @@ VclPolicyType SalInstanceScrolledWindow::get_hpolicy() const return VclPolicyType::NEVER; } -void SalInstanceScrolledWindow::vadjustment_configure(int value, int lower, int upper, - int step_increment, int page_increment, - int page_size) +void SalInstanceScrolledWindow::vadjustment_configure(int value, int upper, int step_increment, + int page_increment, int page_size) { ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); - rVertScrollBar.SetRangeMin(lower); + rVertScrollBar.SetRangeMin(0); rVertScrollBar.SetRangeMax(upper); rVertScrollBar.SetLineSize(step_increment); rVertScrollBar.SetPageSize(page_increment); diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index f3179925558a..f697265c8de6 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -8350,14 +8350,14 @@ public: enable_notify_events(); } - virtual void hadjustment_configure(int value, int lower, int upper, - int step_increment, int page_increment, + virtual void hadjustment_configure(int value, int upper, int step_increment, int page_increment, int page_size) override { disable_notify_events(); if (SwapForRTL()) - value = upper - (value - lower + page_size); - gtk_adjustment_configure(m_pHAdjustment, value, lower, upper, step_increment, page_increment, page_size); + value = upper - (value + page_size); + gtk_adjustment_configure(m_pHAdjustment, value, 0, upper, step_increment, page_increment, + page_size); enable_notify_events(); } @@ -8438,12 +8438,12 @@ public: return GtkToVcl(eGtkHPolicy); } - virtual void vadjustment_configure(int value, int lower, int upper, - int step_increment, int page_increment, + virtual void vadjustment_configure(int value, int upper, int step_increment, int page_increment, int page_size) override { disable_notify_events(); - gtk_adjustment_configure(m_pVAdjustment, value, lower, upper, step_increment, page_increment, page_size); + gtk_adjustment_configure(m_pVAdjustment, value, 0, upper, step_increment, page_increment, + page_size); enable_notify_events(); } commit 1db8bf926f4860da0a72b1da79e40bbb1c0efe0d Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Jul 31 17:17:54 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 1 08:23:02 2025 +0200 tdf#130857 qt weld: Support "New Style from Selection" dialog This means that native Qt widgets are used for that dialog now when using the qt5 or qt6 VCL plugin and starting LO with environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. This dialog can be triggered as follows: * start Writer * press the "New Style from Selection" button in the toolbar Change-Id: I3199713ed4337f32b6b951e520a282608d98425d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188706 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index 2d184701ee73..c86f61d66bbf 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -159,6 +159,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile, const weld::W u"sfx/ui/inputdialog.ui"_ustr, u"sfx/ui/licensedialog.ui"_ustr, u"sfx/ui/loadtemplatedialog.ui"_ustr, + u"sfx/ui/newstyle.ui"_ustr, u"sfx/ui/password.ui"_ustr, u"sfx/ui/printeroptionsdialog.ui"_ustr, u"sfx/ui/querysavedialog.ui"_ustr,