Move SvtViewOptions from unotools to svtools

The SvtViewOptions class is used to store the state
of windows/dialogs.

So far, SvtViewOptions::SetWindowState and
SvtViewOptions::GetWindowState are string-based
and the callers are responsible for (de)serializing
the vcl::WindowData to/from string.

This will be changed to become the responsibility
of SvtViewOptions in an upcoming commit.

Since unotools is below vcl in the module
dependency chain, it cannot make use of vcl,
i.e. vcl::WindowData couldn't be used there.

Therefore, move SvtViewOptions from unotools
to svtools, which is above vcl in the module
dependencies.
(svtools/README.md summarizes the purpose of the
module as "Tools on the Top of VCL", which seems
an appropriate place for helper code to manage
the state/options for dialogs, tab pages,...)

Change-Id: If849224c35c7ac895659ddb7c17e6d17061d61a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208124
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2026-07-15 14:45:41 +02:00
parent 85d059629c
commit 312aac710b
43 changed files with 45 additions and 47 deletions
+1 -1
View File
@@ -44,8 +44,8 @@
#include <sfx2/objface.hxx>
#include <sfx2/viewfrm.hxx>
#include <svl/srchitem.hxx>
#include <svtools/viewoptions.hxx>
#include <tools/debug.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/weld/MessageDialog.hxx>
#if defined(DISABLE_DYNLOADING) || ENABLE_MERGELIBS
+1 -1
View File
@@ -46,6 +46,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <svtools/imagemgr.hxx>
#include <svtools/viewoptions.hxx>
#include <sal/log.hxx>
#include <osl/diagnose.h>
#include <dialmgr.hxx>
@@ -61,7 +62,6 @@
#include <sfx2/sidebar/ResourceManager.hxx>
#include <sfx2/sidebar/Context.hxx>
#include <unotools/viewoptions.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+1 -1
View File
@@ -38,9 +38,9 @@
#include <svl/itemset.hxx>
#include <svl/stritem.hxx>
#include <svtools/dlgname.hxx>
#include <svtools/viewoptions.hxx>
#include <svx/passwd.hxx>
#include <tools/debug.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/commandevent.hxx>
#include <vcl/svapp.hxx>
#include <vcl/vclenum.hxx>
+1 -1
View File
@@ -20,7 +20,7 @@
#include <dialmgr.hxx>
#include <o3tl/any.hxx>
#include <comphelper/propertyvalue.hxx>
#include <unotools/viewoptions.hxx>
#include <svtools/viewoptions.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/graph.hxx>
#include <vcl/vclenum.hxx>
+1 -1
View File
@@ -19,11 +19,11 @@
#include <svx/svxdlg.hxx>
#include <sfx2/filedlghelper.hxx>
#include <svtools/viewoptions.hxx>
#include <tools/urlobj.hxx>
#include <unotools/defaultoptions.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/moduleoptions.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/weld/Builder.hxx>
#include <vcl/weld/Label.hxx>
+1 -1
View File
@@ -94,6 +94,7 @@
#include <svl/intitem.hxx>
#include <svl/cjkoptions.hxx>
#include <svl/ctloptions.hxx>
#include <svtools/viewoptions.hxx>
#include <svx/databaseregistrationui.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/urlobj.hxx>
@@ -101,7 +102,6 @@
#include <unotools/configmgr.hxx>
#include <unotools/moduleoptions.hxx>
#include <unotools/optionsdlg.hxx>
#include <unotools/viewoptions.hxx>
#include <utility>
#include <vcl/help.hxx>
#include <vcl/svapp.hxx>
+1 -3
View File
@@ -11,9 +11,7 @@
#include "autocmpledit.hxx"
#include <svtools/place.hxx>
#include <unotools/viewoptions.hxx>
#include <svtools/viewoptions.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld/Button.hxx>
#include <vcl/weld/ToggleButton.hxx>
+1 -1
View File
@@ -41,9 +41,9 @@
#include <vcl/weld/MessageDialog.hxx>
#include <unotools/ucbhelper.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/viewoptions.hxx>
#include <svtools/ehdl.hxx>
#include <svtools/sfxecode.hxx>
#include <svtools/viewoptions.hxx>
#include <fpicker/strings.hrc>
#include <svtools/helpids.h>
@@ -18,10 +18,10 @@
*/
#pragma once
#include <unotools/unotoolsdllapi.h>
#include <com/sun/star/uno/Reference.hxx>
#include <sal/types.h>
#include <rtl/ustring.hxx>
#include <svtools/svtdllapi.h>
namespace com::sun::star::beans { struct NamedValue; }
namespace com::sun::star::container { class XNameAccess; }
@@ -91,7 +91,7 @@ enum class EViewType
@devstatus ready to use
*//*-*************************************************************************************************************/
class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions final
class SAL_WARN_UNUSED SVT_DLLPUBLIC SvtViewOptions final
{
// public methods
+1 -1
View File
@@ -17,11 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <unotools/viewoptions.hxx>
#include <formula/formdata.hxx>
#include <formula/funcutl.hxx>
#include <formula/tokenarray.hxx>
#include <formula/FormulaCompiler.hxx>
#include <svtools/viewoptions.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/weld/Dialog.hxx>
#include <vcl/windowstate.hxx>
+1 -1
View File
@@ -20,7 +20,7 @@
#include <DesignView.hxx>
#include <ReportController.hxx>
#include <svtools/acceleratorexecute.hxx>
#include <unotools/viewoptions.hxx>
#include <svtools/viewoptions.hxx>
#include <RptDef.hxx>
#include <UITools.hxx>
#include <RptObject.hxx>
@@ -123,8 +123,8 @@
#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
#include <svtools/cliplistener.hxx>
#include <svtools/viewoptions.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/viewoptions.hxx>
#include <unotools/localedatawrapper.hxx>
#include <osl/mutex.hxx>
+1 -1
View File
@@ -13,7 +13,7 @@
#include <document.hxx>
#include <conditio.hxx>
#include <o3tl/safeint.hxx>
#include <unotools/viewoptions.hxx>
#include <svtools/viewoptions.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/weld/Dialog.hxx>
#include <vcl/windowstate.hxx>
+2 -2
View File
@@ -43,9 +43,9 @@
#include <unicode/ucsdet.h>
#include <sfx2/objsh.hxx>
#include <svx/txenctab.hxx>
#include <unotools/filteroptions_settings.hxx>
#include <unotools/viewoptions.hxx>
#include <svx/txenctab.hxx>
#include <svtools/viewoptions.hxx>
#include <vcl/weld/Button.hxx>
#include <vcl/weld/Dialog.hxx>
#include <vcl/weld/Frame.hxx>
+1 -1
View File
@@ -22,8 +22,8 @@
#include <scui_def.hxx>
#include <tpsort.hxx>
#include <sortdlg.hxx>
#include <unotools/viewoptions.hxx>
#include <svtools/viewoptions.hxx>
#include <vcl/tabs.hrc>
#include <vcl/weld/Dialog.hxx>
#include <vcl/windowstate.hxx>
+1 -1
View File
@@ -25,8 +25,8 @@
#include <svx/xcolit.hxx>
#include <svl/intitem.hxx>
#include <unotools/viewoptions.hxx>
#include <svtools/unitconv.hxx>
#include <svtools/viewoptions.hxx>
#include <vcl/weld/Dialog.hxx>
#include <o3tl/string_view.hxx>
#include <vcl/weld/Builder.hxx>
+1 -1
View File
@@ -346,6 +346,7 @@
#include <svtools/sfxecode.hxx>
#include <svtools/soerr.hxx>
#include <svtools/svtdllapi.h>
#include <svtools/viewoptions.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/color.hxx>
#include <tools/datetime.hxx>
@@ -387,7 +388,6 @@
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/unotoolsdllapi.h>
#include <unotools/useroptions.hxx>
#include <unotools/viewoptions.hxx>
#endif // PCH_LEVEL >= 3
#if PCH_LEVEL >= 4
#include <appbaslib.hxx>
+1 -1
View File
@@ -18,7 +18,6 @@
*/
#include <memory>
#include <unotools/viewoptions.hxx>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/util/XCloseable.hpp>
@@ -38,6 +37,7 @@
#include <sfx2/module.hxx>
#include <sfx2/dockwin.hxx>
#include <sfx2/dispatch.hxx>
#include <svtools/viewoptions.hxx>
#include <workwin.hxx>
#include <sfx2/sfxsids.hrc>
+1 -1
View File
@@ -70,10 +70,10 @@
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <unotools/historyoptions.hxx>
#include <unotools/viewoptions.hxx>
#include <tools/urlobj.hxx>
#include <svtools/imagemgr.hxx>
#include <svtools/miscopt.hxx>
#include <svtools/viewoptions.hxx>
#include <utility>
#include <vcl/commandevent.hxx>
#include <vcl/event.hxx>
+1 -1
View File
@@ -19,7 +19,7 @@
#include <vcl/help.hxx>
#include <svl/eitem.hxx>
#include <unotools/viewoptions.hxx>
#include <svtools/viewoptions.hxx>
#include <vcl/idle.hxx>
#include <vcl/weld/Builder.hxx>
#include <vcl/weld/Button.hxx>
+1 -1
View File
@@ -78,8 +78,8 @@
#include <vcl/dibtools.hxx>
#include <vcl/graphicfilter.hxx>
#include <unotools/filteroptions_settings.hxx>
#include <unotools/viewoptions.hxx>
#include <svtools/helpids.h>
#include <svtools/viewoptions.hxx>
#include <comphelper/docpasswordrequest.hxx>
#include <comphelper/docpasswordhelper.hxx>
#include <ucbhelper/content.hxx>
+1 -1
View File
@@ -21,9 +21,9 @@
#include <ctime>
#endif
#include <unotools/viewoptions.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
#include <svtools/viewoptions.hxx>
#include <tools/debug.hxx>
#include <vcl/dialoghelper.hxx>
+1 -1
View File
@@ -21,8 +21,8 @@
#include <srchdlg.hxx>
#include <comphelper/string.hxx>
#include <svtools/viewoptions.hxx>
#include <tools/debug.hxx>
#include <unotools/viewoptions.hxx>
#include <o3tl/string_view.hxx>
#include <vcl/weld/Builder.hxx>
#include <utility>
+1 -1
View File
@@ -27,7 +27,7 @@
#include <sfx2/sfxresid.hxx>
#include <sfx2/sfxdlg.hxx>
#include <sfx2/viewsh.hxx>
#include <unotools/viewoptions.hxx>
#include <svtools/viewoptions.hxx>
#include <utility>
#include <vcl/vclenum.hxx>
#include <vcl/virdev.hxx>
+1 -1
View File
@@ -15,6 +15,7 @@
#include <o3tl/deleter.hxx>
#include <osl/file.hxx>
#include <sal/log.hxx>
#include <svtools/viewoptions.hxx>
#include <vcl/svapp.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/weld/Builder.hxx>
@@ -22,7 +23,6 @@
#include <vcl/weld/MessageDialog.hxx>
#include <vcl/weld/WaitObject.hxx>
#include <vcl/weld/weldutils.hxx>
#include <unotools/viewoptions.hxx>
#include <o3tl/string_view.hxx>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+1 -1
View File
@@ -26,6 +26,7 @@
#include <svl/eitem.hxx>
#include <svtools/sfxecode.hxx>
#include <svtools/ehdl.hxx>
#include <svtools/viewoptions.hxx>
#include <tools/urlobj.hxx>
#include <tools/debug.hxx>
@@ -36,7 +37,6 @@
#include <sfx2/sfxresid.hxx>
#include <sfx2/docfile.hxx>
#include <preview.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/weld/Builder.hxx>
#include <vcl/weld/Button.hxx>
+1 -1
View File
@@ -25,6 +25,7 @@
#include <sfx2/objsh.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/templatedlglocalview.hxx>
#include <svtools/viewoptions.hxx>
#include <templatecontaineritem.hxx>
#include <templateviewitem.hxx>
#include <sfx2/thumbnailviewitem.hxx>
@@ -32,7 +33,6 @@
#include <tools/urlobj.hxx>
#include <unotools/moduleoptions.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/event.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld/Builder.hxx>
+2 -2
View File
@@ -5497,6 +5497,7 @@ include/svtools/unoevent.hxx
include/svtools/unoimap.hxx
include/svtools/urlfilter.hxx
include/svtools/valueset.hxx
include/svtools/viewoptions.hxx
include/svx/AccessibleControlShape.hxx
include/svx/AccessibleGraphicShape.hxx
include/svx/AccessibleOLEShape.hxx
@@ -5967,7 +5968,6 @@ include/unotools/transliterationwrapper.hxx
include/unotools/ucbhelper.hxx
include/unotools/ucbstreamhelper.hxx
include/unotools/useroptions.hxx
include/unotools/viewoptions.hxx
include/unotools/wincodepage.hxx
include/vbahelper/vbaaccesshelper.hxx
include/vbahelper/vbaapplicationbase.hxx
@@ -10804,6 +10804,7 @@ svtools/source/config/miscopt.cxx
svtools/source/config/optionsdrawinglayer.cxx
svtools/source/config/printoptions.cxx
svtools/source/config/test/test.cxx
svtools/source/config/viewoptions.cxx
svtools/source/control/accessibleruler.cxx
svtools/source/control/accessibleruler.hxx
svtools/source/control/accessibletabbar.cxx
@@ -13673,7 +13674,6 @@ unotools/source/config/searchopt.cxx
unotools/source/config/securityoptions.cxx
unotools/source/config/syslocaleoptions.cxx
unotools/source/config/useroptions.cxx
unotools/source/config/viewoptions.cxx
unotools/source/i18n/calendarwrapper.cxx
unotools/source/i18n/charclass.cxx
unotools/source/i18n/collatorwrapper.cxx
+1
View File
@@ -89,6 +89,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/config/optionsdrawinglayer \
svtools/source/config/printoptions \
svtools/source/contnr/querydelete \
svtools/source/config/viewoptions \
svtools/source/control/accessibleruler \
svtools/source/control/accessibletabbar \
svtools/source/control/accessibletabbarbase \
@@ -17,13 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <unotools/viewoptions.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <svtools/viewoptions.hxx>
#include <unotools/configmgr.hxx>
#include <comphelper/configuration.hxx>
#include <comphelper/configurationhelper.hxx>
+1 -1
View File
@@ -320,6 +320,7 @@
#include <svtools/toolboxcontroller.hxx>
#include <svtools/unitconv.hxx>
#include <svtools/valueset.hxx>
#include <svtools/viewoptions.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/UnitConversion.hxx>
#include <tools/color.hxx>
@@ -349,7 +350,6 @@
#include <unotools/resmgr.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/unotoolsdllapi.h>
#include <unotools/viewoptions.hxx>
#include <unotools/weakref.hxx>
#endif // PCH_LEVEL >= 3
#if PCH_LEVEL >= 4
+1 -1
View File
@@ -33,8 +33,8 @@
#include <tools/mapunit.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <unotools/resmgr.hxx>
#include <svtools/viewoptions.hxx>
#include <svx/xmlexchg.hxx>
#include <unotools/viewoptions.hxx>
#include <sfx2/chalign.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/viewfrm.hxx>
+1 -1
View File
@@ -16,6 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <svtools/viewoptions.hxx>
#include <svx/sidebar/LineWidthPopup.hxx>
#include <svx/sidebar/LinePropertyPanelBase.hxx>
#include <com/sun/star/beans/NamedValue.hpp>
@@ -24,7 +25,6 @@
#include <svx/xlnwtit.hxx>
#include <tools/fldunit.hxx>
#include <unotools/localedatawrapper.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld/Builder.hxx>
@@ -31,11 +31,11 @@
#include <sfx2/objsh.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/weldutils.hxx>
#include <svtools/viewoptions.hxx>
#include <svx/dialcontrol.hxx>
#include <svx/dialmgr.hxx>
#include <svx/rectenum.hxx>
#include <svx/sdangitm.hxx>
#include <unotools/viewoptions.hxx>
#include <unotools/localedatawrapper.hxx>
#include <utility>
#include <vcl/canvastools.hxx>
@@ -18,13 +18,13 @@
*/
#include <sfx2/bindings.hxx>
#include "TextCharacterSpacingControl.hxx"
#include <unotools/viewoptions.hxx>
#include <editeng/editids.hrc>
#include <editeng/kernitem.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/tbxctrl.hxx>
#include <sfx2/viewfrm.hxx>
#include <svtools/viewoptions.hxx>
#include <tools/fldunit.hxx>
#include <TextCharacterSpacingPopup.hxx>
#include <svl/itempool.hxx>
+1 -1
View File
@@ -36,9 +36,9 @@
#include <vcl/virdev.hxx>
#include <vcl/settings.hxx>
#include <svtools/viewoptions.hxx>
#include <svx/strings.hrc>
#include <svx/dialmgr.hxx>
#include <unotools/viewoptions.hxx>
#include <comphelper/string.hxx>
#include <o3tl/string_view.hxx>
+1 -1
View File
@@ -473,6 +473,7 @@
#include <svtools/toolbarmenu.hxx>
#include <svtools/unitconv.hxx>
#include <svtools/valueset.hxx>
#include <svtools/viewoptions.hxx>
#include <svx/Palette.hxx>
#include <svx/XPropertyEntry.hxx>
#include <svx/autoformathelper.hxx>
@@ -537,7 +538,6 @@
#include <unotools/syslocale.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/unotoolsdllapi.h>
#include <unotools/viewoptions.hxx>
#include <unotools/weakref.hxx>
#include <vbahelper/vbadllapi.h>
#include <vbahelper/vbahelper.hxx>
+1 -1
View File
@@ -27,9 +27,9 @@
#include <i18nlangtag/mslangid.hxx>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <vcl/rendercontext/GetDefaultFontFlags.hxx>
#include <svtools/viewoptions.hxx>
#include <unotools/fontdefs.hxx>
#include <unotools/lingucfg.hxx>
#include <unotools/viewoptions.hxx>
#include <sfx2/sfxsids.hrc>
#include <sfx2/printer.hxx>
#include <sfx2/docfile.hxx>
+1 -1
View File
@@ -21,7 +21,7 @@
#include <rtl/ustrbuf.hxx>
#include <sfx2/request.hxx>
#include <svl/stritem.hxx>
#include <unotools/viewoptions.hxx>
#include <svtools/viewoptions.hxx>
#include <vcl/weld/Builder.hxx>
#include <vcl/weld/Dialog.hxx>
#include <vcl/weld/weldutils.hxx>
@@ -18,8 +18,8 @@
*/
#include <o3tl/deleter.hxx>
#include <svtools/viewoptions.hxx>
#include <svx/ctredlin.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/weld/Dialog.hxx>
#include <redlndlg.hxx>
+1 -1
View File
@@ -19,11 +19,11 @@
#pragma once
#include <svtools/viewoptions.hxx>
#include <vcl/weld/DialogController.hxx>
#include <vcl/weld/RadioButton.hxx>
#include <vcl/weld/Window.hxx>
#include <tblenum.hxx>
#include <unotools/viewoptions.hxx>
class SwWrtShell;
@@ -33,9 +33,9 @@
#include <svl/itempool.hxx>
#include <svl/intitem.hxx>
#include <svtools/unitconv.hxx>
#include <svtools/viewoptions.hxx>
#include <tools/fldunit.hxx>
#include <tools/mapunit.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/weld/Builder.hxx>
#include <swtypes.hxx>
-1
View File
@@ -83,7 +83,6 @@ $(eval $(call gb_Library_add_exception_objects,utl,\
unotools/source/config/securityoptions \
unotools/source/config/syslocaleoptions \
unotools/source/config/useroptions \
unotools/source/config/viewoptions \
unotools/source/i18n/calendarwrapper \
unotools/source/i18n/caserotate \
unotools/source/i18n/charclass \