vcl/inc/wizdlg.hxx | 35 ---------------------------- vcl/source/control/roadmapwizard.cxx | 5 ++-- vcl/source/control/roadmapwizardmachine.cxx | 14 +++++------ vcl/source/control/wizimpldata.hxx | 35 ++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 43 deletions(-)
New commits: commit 8157eff1f19b3aa2d84ba2bc89927d18608d2c7b Author: Michael Weghorn <[email protected]> AuthorDate: Mon May 19 13:31:32 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon May 19 23:31:35 2025 +0200 vcl: Move RoadmapWizardImpl back to wizimpldata.hxx While RoadmapWizardImpl used to have vcl::Window specific members before Change-Id: I8d2becd4c9d84883d00222cccd35a9402df38ca5 Author: Michael Weghorn <[email protected]> Date: Mon May 19 12:16:47 2025 +0200 vcl: Have only one pointer to ORoadmap and Change-Id: I8d5ecd999dbee4b97ab2bd785aa5053db27f1240 Author: Michael Weghorn <[email protected]> Date: Mon May 19 12:25:22 2025 +0200 vcl: Move RoadmapWizardImpl::maResponses to RoadmapWizard , it also gets used by the weld::Widget based RoadmapWizardMachine (that just didn't make use of the vcl::Window specific members). Therefore, now that the vcl::Window specific bits have been removed from the struct, move it back to where it used to be before commit 2d268b2fe518ccb5ba19ed225c033e9148d64f22 Author: Michael Weghorn <[email protected]> Date: Sat May 17 23:32:45 2025 +0200 vcl: More clearly separate vcl::Window specific RoadmapWizard bits and only include that header for the source file containing the RoadmapWizardMachine implementation that was moved to a separate source file in commit c854f5aaae575a0570f79a225b80b53ed420578c Author: Michael Weghorn <[email protected]> Date: Sun May 18 01:00:33 2025 +0200 vcl: Move RoadmapWizardMachine to own source file (which had helped to see the actual dependencies/relationships between the different classes/structs more clearly/easily). This finishes separating the weld::Widget based implementation (RoadmapWizardMachine) more clearly from the vcl::Window specific one (RoadmapWizard), as no vcl::Window related headers are included for the implementation of the former any more now. Change-Id: I9022569cbf7feac62234221937708ca5e1ba876f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185527 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/vcl/inc/wizdlg.hxx b/vcl/inc/wizdlg.hxx index c9d5eb116209..e37cd18af9de 100644 --- a/vcl/inc/wizdlg.hxx +++ b/vcl/inc/wizdlg.hxx @@ -27,7 +27,6 @@ #include <map> #include <memory> -#include <set> struct ImplWizPageData { @@ -44,38 +43,6 @@ struct ImplWizButtonData namespace vcl { - using namespace RoadmapWizardTypes; - namespace - { - typedef ::std::set< WizardTypes::WizardState > StateSet; - - typedef ::std::map< - PathId, - WizardPath - > Paths; - } - - struct RoadmapWizardImpl - { - Paths aPaths; - PathId nActivePath; - StateSet aDisabledStates; - bool bActivePathIsDefinite; - - RoadmapWizardImpl() - :nActivePath( PathId::INVALID ) - ,bActivePathIsDefinite( false ) - { - } - - /// returns the index of the current state in given path, or -1 - static sal_Int32 getStateIndexInPath( WizardTypes::WizardState _nState, const WizardPath& _rPath ); - /// returns the index of the current state in the path with the given id, or -1 - sal_Int32 getStateIndexInPath( WizardTypes::WizardState _nState, PathId _nPathId ); - /// returns the index of the first state in which the two given paths differ - static sal_Int32 getFirstDifferentIndex( const WizardPath& _rLHS, const WizardPath& _rRHS ); - }; - //= RoadmapWizard /** wizard for a roadmap diff --git a/vcl/source/control/roadmapwizardmachine.cxx b/vcl/source/control/roadmapwizardmachine.cxx index 2ddf538faf45..4d0c147bf0db 100644 --- a/vcl/source/control/roadmapwizardmachine.cxx +++ b/vcl/source/control/roadmapwizardmachine.cxx @@ -18,9 +18,9 @@ */ +#include "wizimpldata.hxx" + #include <strings.hrc> -#include <svdata.hxx> -#include <wizdlg.hxx> #include <osl/diagnose.h> #include <tools/debug.hxx> diff --git a/vcl/source/control/wizimpldata.hxx b/vcl/source/control/wizimpldata.hxx index d68c27f801fc..8135dc568cdd 100644 --- a/vcl/source/control/wizimpldata.hxx +++ b/vcl/source/control/wizimpldata.hxx @@ -21,8 +21,11 @@ #include <rtl/ustring.hxx> #include <vcl/builderpage.hxx> +#include <vcl/roadmapwizardmachine.hxx> #include <vcl/wizardmachine.hxx> +#include <map> +#include <set> #include <stack> constexpr OUString HID_WIZARD_NEXT = u"SVT_HID_WIZARD_NEXT"_ustr; @@ -36,6 +39,38 @@ struct WizPageData namespace vcl { + using namespace RoadmapWizardTypes; + namespace + { + typedef ::std::set< WizardTypes::WizardState > StateSet; + + typedef ::std::map< + PathId, + WizardPath + > Paths; + } + + struct RoadmapWizardImpl + { + Paths aPaths; + PathId nActivePath; + StateSet aDisabledStates; + bool bActivePathIsDefinite; + + RoadmapWizardImpl() + :nActivePath( PathId::INVALID ) + ,bActivePathIsDefinite( false ) + { + } + + /// returns the index of the current state in given path, or -1 + static sal_Int32 getStateIndexInPath( WizardTypes::WizardState _nState, const WizardPath& _rPath ); + /// returns the index of the current state in the path with the given id, or -1 + sal_Int32 getStateIndexInPath( WizardTypes::WizardState _nState, PathId _nPathId ); + /// returns the index of the first state in which the two given paths differ + static sal_Int32 getFirstDifferentIndex( const WizardPath& _rLHS, const WizardPath& _rRHS ); + }; + struct WizardMachineImplData { OUString sTitleBase; // the base for the title commit 07ad2798f75a63d5c3ff55ddf3e88cac5fd41813 Author: Michael Weghorn <[email protected]> AuthorDate: Mon May 19 13:24:58 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon May 19 23:31:27 2025 +0200 vcl: Don't use RoadmapTypes in RoadmapWizardMachine RoadmapTypes::ItemIndex is a sal_Int32 typedef used primarily for the vcl (i.e. vcl::Window based) ORoadmap. Don't use that in the weld::Widget based RoadmapWizardMachine for no apparent reason, but use other integer types appropriate for the context instead, which makes clearer this class is not directly related to ORoadmap (and doesn't make any direct use of vcl::Window anywhere, but makes use of the weld abstraction). Change-Id: I8a94e9d24abe6c4ec637f459094b9f8dbcd42992 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185526 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/vcl/source/control/roadmapwizardmachine.cxx b/vcl/source/control/roadmapwizardmachine.cxx index 8d523e9cd457..2ddf538faf45 100644 --- a/vcl/source/control/roadmapwizardmachine.cxx +++ b/vcl/source/control/roadmapwizardmachine.cxx @@ -112,7 +112,7 @@ namespace vcl assert(nCurrentStatePathIndex >= 0 && o3tl::make_unsigned(nCurrentStatePathIndex) < rActivePath.size()); // determine up to which index (in the new path) we have to display the items - RoadmapTypes::ItemIndex nUpperStepBoundary = static_cast<RoadmapTypes::ItemIndex>(rActivePath.size()); + int nUpperStepBoundary = rActivePath.size(); if ( !m_pImpl->bActivePathIsDefinite ) { for (auto const& path : m_pImpl->aPaths) @@ -145,9 +145,9 @@ namespace vcl // now, we have to remove all items after nCurrentStatePathIndex, and insert the items from the active // path, up to (excluding) nUpperStepBoundary - RoadmapTypes::ItemIndex nRoadmapItems = m_xAssistant->get_n_pages(); - RoadmapTypes::ItemIndex nLoopUntil = ::std::max( nUpperStepBoundary, nRoadmapItems ); - for ( RoadmapTypes::ItemIndex nItemIndex = nCurrentStatePathIndex; nItemIndex < nLoopUntil; ++nItemIndex ) + int nRoadmapItems = m_xAssistant->get_n_pages(); + int nLoopUntil = ::std::max(nUpperStepBoundary, nRoadmapItems); + for (int nItemIndex = nCurrentStatePathIndex; nItemIndex < nLoopUntil; ++nItemIndex) { bool bExistentItem = ( nItemIndex < nRoadmapItems ); bool bNeedItem = ( nItemIndex < nUpperStepBoundary ); @@ -169,7 +169,7 @@ namespace vcl { // there is an item with this index in the roadmap - does it match what is requested by // the respective state in the active path? - RoadmapTypes::ItemId nPresentItemId = m_xAssistant->get_page_ident(nItemIndex).toInt32(); + sal_Int32 nPresentItemId = m_xAssistant->get_page_ident(nItemIndex).toInt32(); WizardTypes::WizardState nRequiredState = rActivePath[ nItemIndex ]; if ( nPresentItemId != nRequiredState ) { commit 9b7604e14566e7f92131e9e06d0d61325d50eeb0 Author: Michael Weghorn <[email protected]> AuthorDate: Mon May 19 12:25:22 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon May 19 23:31:19 2025 +0200 vcl: Move RoadmapWizardImpl::maResponses to RoadmapWizard These vcl::Windows (buttons) are only relevant for the vcl::Window based RoadmapWizard, not for the weld::Widget based RoadmapWizardMachine that also uses RoadmapWizardImpl, so move this to RoadmapWizard to get rid of any use of vcl::Window classes in RoadmapWizardImpl and thus RoadmapWizardMachine. Change-Id: I8d5ecd999dbee4b97ab2bd785aa5053db27f1240 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185525 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/inc/wizdlg.hxx b/vcl/inc/wizdlg.hxx index 5ba43579d6fc..c9d5eb116209 100644 --- a/vcl/inc/wizdlg.hxx +++ b/vcl/inc/wizdlg.hxx @@ -57,7 +57,6 @@ namespace vcl struct RoadmapWizardImpl { - std::map<VclPtr<vcl::Window>, short> maResponses; Paths aPaths; PathId nActivePath; StateSet aDisabledStates; @@ -108,6 +107,7 @@ namespace vcl VclPtr<PushButton> mpPrevBtn; VclPtr<PushButton> mpNextBtn; VclPtr<ORoadmap> mpRoadmap; + std::map<VclPtr<vcl::Window>, short> maResponses; sal_uInt16 mnCurLevel; sal_Int16 mnLeftAlignCount; bool mbEmptyViewMargin; diff --git a/vcl/source/control/roadmapwizard.cxx b/vcl/source/control/roadmapwizard.cxx index 7c2b5d427479..d0c04e0527f1 100644 --- a/vcl/source/control/roadmapwizard.cxx +++ b/vcl/source/control/roadmapwizard.cxx @@ -160,6 +160,7 @@ namespace vcl mpPrevBtn.clear(); mpNextBtn.clear(); mpRoadmap.disposeAndClear(); + maResponses.clear(); Dialog::dispose(); } @@ -403,7 +404,7 @@ namespace vcl void RoadmapWizard::AddButtonResponse( Button* pButton, int response) { - m_xRoadmapImpl->maResponses[pButton] = response; + maResponses[pButton] = response; } void RoadmapWizard::implConstruct() @@ -1032,7 +1033,7 @@ namespace vcl rJsonWriter.put("dialogid", sDialogId.copy(nStartPos)); { auto aResponses = rJsonWriter.startArray("responses"); - for (const auto& rResponse : m_xRoadmapImpl->maResponses) + for (const auto& rResponse : maResponses) { auto aResponse = rJsonWriter.startStruct(); rJsonWriter.put("id", rResponse.first->get_id());
