sw/inc/IDocumentFieldsAccess.hxx | 4 sw/inc/IDocumentListsAccess.hxx | 15 sw/inc/SwRewriter.hxx | 3 sw/inc/SwStyleNameMapper.hxx | 26 - sw/inc/ToxLinkProcessor.hxx | 8 sw/inc/ccoll.hxx | 7 sw/inc/charfmt.hxx | 2 sw/inc/charformats.hxx | 10 sw/inc/crsrsh.hxx | 6 sw/inc/dbfld.hxx | 4 sw/inc/ddefld.hxx | 6 sw/inc/doc.hxx | 104 ++-- sw/inc/docary.hxx | 6 sw/inc/docsh.hxx | 11 sw/inc/docstyle.hxx | 21 - sw/inc/editsh.hxx | 24 - sw/inc/expfld.hxx | 10 sw/inc/fesh.hxx | 30 - sw/inc/fldbas.hxx | 3 sw/inc/fmtcol.hxx | 8 sw/inc/fmtinfmt.hxx | 13 sw/inc/fmtruby.hxx | 6 sw/inc/format.hxx | 9 sw/inc/frameformats.hxx | 10 sw/inc/frmfmt.hxx | 14 sw/inc/hints.hxx | 9 sw/inc/list.hxx | 6 sw/inc/names.hxx | 50 ++ sw/inc/ndole.hxx | 6 sw/inc/numrule.hxx | 17 sw/inc/pagedesc.hxx | 28 - sw/inc/paratr.hxx | 5 sw/inc/redline.hxx | 6 sw/inc/section.hxx | 14 sw/inc/swcrsr.hxx | 4 sw/inc/swtable.hxx | 10 sw/inc/swtblfmt.hxx | 6 sw/inc/tblafmt.hxx | 32 - sw/inc/tox.hxx | 36 - sw/inc/unocrsrhelper.hxx | 4 sw/inc/unoframe.hxx | 2 sw/inc/unosett.hxx | 26 - sw/inc/unostyle.hxx | 27 - sw/inc/unoxstyle.hxx | 17 sw/inc/usrfld.hxx | 6 sw/inc/view.hxx | 3 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx | 2 sw/qa/core/crsr/crsr.cxx | 2 sw/qa/core/doc/doc.cxx | 2 sw/qa/core/frmedt/frmedt.cxx | 4 sw/qa/core/header_footer/HeaderFooterTest.cxx | 6 sw/qa/core/layout/flycnt.cxx | 8 sw/qa/core/layout/layact.cxx | 2 sw/qa/core/test_ToxLinkProcessor.cxx | 22 - sw/qa/core/unocore/unocore.cxx | 4 sw/qa/core/uwriter.cxx | 22 - sw/qa/extras/htmlexport/htmlexport2.cxx | 2 sw/qa/extras/layout/layout.cxx | 3 sw/qa/extras/layout/layout4.cxx | 4 sw/qa/extras/layout/layout5.cxx | 2 sw/qa/extras/mailmerge/mailmerge2.cxx | 6 sw/qa/extras/rtfexport/rtfexport3.cxx | 6 sw/qa/extras/rtfexport/rtfexport8.cxx | 2 sw/qa/extras/uiwriter/uiwriter.cxx | 14 sw/qa/extras/uiwriter/uiwriter2.cxx | 2 sw/qa/extras/uiwriter/uiwriter3.cxx | 6 sw/qa/extras/uiwriter/uiwriter4.cxx | 20 sw/qa/extras/uiwriter/uiwriter6.cxx | 30 - sw/qa/extras/uiwriter/uiwriter7.cxx | 28 - sw/qa/extras/uiwriter/uiwriter8.cxx | 20 sw/qa/extras/uiwriter/uiwriter9.cxx | 4 sw/qa/extras/ww8export/ww8export4.cxx | 2 sw/qa/filter/ascii/ascii.cxx | 4 sw/qa/filter/ww8/ww8.cxx | 2 sw/source/core/access/AccessibilityCheck.cxx | 36 - sw/source/core/access/AccessibilityIssue.cxx | 16 sw/source/core/access/accdoc.cxx | 2 sw/source/core/access/accframebase.cxx | 4 sw/source/core/access/accpara.cxx | 4 sw/source/core/access/acctable.cxx | 12 sw/source/core/attr/format.cxx | 14 sw/source/core/attr/swatrset.cxx | 10 sw/source/core/bastyp/init.cxx | 2 sw/source/core/crsr/crstrvl.cxx | 8 sw/source/core/crsr/swcrsr.cxx | 4 sw/source/core/crsr/trvltbl.cxx | 2 sw/source/core/doc/DocumentChartDataProviderManager.cxx | 2 sw/source/core/doc/DocumentContentOperationsManager.cxx | 8 sw/source/core/doc/DocumentFieldsManager.cxx | 36 - sw/source/core/doc/DocumentLayoutManager.cxx | 14 sw/source/core/doc/DocumentLinksAdministrationManager.cxx | 8 sw/source/core/doc/DocumentListsManager.cxx | 17 sw/source/core/doc/DocumentStylePoolManager.cxx | 10 sw/source/core/doc/SwStyleNameMapper.cxx | 65 +-- sw/source/core/doc/dbgoutsw.cxx | 20 sw/source/core/doc/docchart.cxx | 8 sw/source/core/doc/docdesc.cxx | 18 sw/source/core/doc/docdraw.cxx | 4 sw/source/core/doc/docfld.cxx | 8 sw/source/core/doc/docfly.cxx | 2 sw/source/core/doc/docfmt.cxx | 46 +- sw/source/core/doc/docftn.cxx | 2 sw/source/core/doc/docglbl.cxx | 2 sw/source/core/doc/doclay.cxx | 68 +-- sw/source/core/doc/docnew.cxx | 30 - sw/source/core/doc/docnum.cxx | 28 - sw/source/core/doc/docredln.cxx | 2 sw/source/core/doc/doctxm.cxx | 28 - sw/source/core/doc/fmtcol.cxx | 8 sw/source/core/doc/list.cxx | 2 sw/source/core/doc/notxtfrm.cxx | 6 sw/source/core/doc/number.cxx | 24 - sw/source/core/doc/tblafmt.cxx | 32 - sw/source/core/doc/tblrwcl.cxx | 2 sw/source/core/doc/textboxhelper.cxx | 2 sw/source/core/docnode/ndcopy.cxx | 2 sw/source/core/docnode/ndsect.cxx | 16 sw/source/core/docnode/ndtbl.cxx | 34 - sw/source/core/docnode/node.cxx | 6 sw/source/core/docnode/nodes.cxx | 4 sw/source/core/docnode/section.cxx | 12 sw/source/core/edit/edattr.cxx | 4 sw/source/core/edit/edfcol.cxx | 32 - sw/source/core/edit/edfld.cxx | 2 sw/source/core/edit/edfmt.cxx | 10 sw/source/core/edit/edglss.cxx | 2 sw/source/core/edit/editsh.cxx | 8 sw/source/core/edit/ednumber.cxx | 4 sw/source/core/fields/cellfml.cxx | 8 sw/source/core/fields/dbfld.cxx | 10 sw/source/core/fields/ddefld.cxx | 6 sw/source/core/fields/expfld.cxx | 18 sw/source/core/fields/fldbas.cxx | 4 sw/source/core/fields/macrofld.cxx | 2 sw/source/core/fields/reffld.cxx | 12 sw/source/core/fields/tblcalc.cxx | 2 sw/source/core/fields/textapi.cxx | 4 sw/source/core/fields/usrfld.cxx | 8 sw/source/core/frmedt/fecopy.cxx | 2 sw/source/core/frmedt/fedesc.cxx | 2 sw/source/core/frmedt/fefly1.cxx | 24 - sw/source/core/frmedt/feflyole.cxx | 4 sw/source/core/frmedt/feshview.cxx | 4 sw/source/core/frmedt/fetab.cxx | 15 sw/source/core/frmedt/fews.cxx | 2 sw/source/core/graphic/GraphicSizeCheck.cxx | 4 sw/source/core/inc/DocumentListsManager.hxx | 17 sw/source/core/inc/GraphicSizeCheck.hxx | 2 sw/source/core/inc/SwUndoFmt.hxx | 54 +- sw/source/core/inc/UndoAttribute.hxx | 4 sw/source/core/inc/UndoCore.hxx | 6 sw/source/core/inc/UndoDelete.hxx | 4 sw/source/core/inc/UndoInsert.hxx | 4 sw/source/core/inc/UndoNumbering.hxx | 4 sw/source/core/inc/UndoTable.hxx | 16 sw/source/core/inc/rolbck.hxx | 4 sw/source/core/inc/unofield.hxx | 1 sw/source/core/layout/atrfrm.cxx | 12 sw/source/core/layout/colfrm.cxx | 2 sw/source/core/layout/dbg_lay.cxx | 4 sw/source/core/layout/newfrm.cxx | 2 sw/source/core/layout/pagechg.cxx | 4 sw/source/core/layout/pagedesc.cxx | 12 sw/source/core/layout/paintfrm.cxx | 10 sw/source/core/layout/wsfrm.cxx | 2 sw/source/core/para/paratr.cxx | 4 sw/source/core/table/swnewtable.cxx | 2 sw/source/core/table/swtable.cxx | 2 sw/source/core/text/EnhancedPDFExportHelper.cxx | 8 sw/source/core/text/inftxt.cxx | 6 sw/source/core/tox/ToxLinkProcessor.cxx | 6 sw/source/core/tox/ToxTextGenerator.cxx | 4 sw/source/core/tox/tox.cxx | 16 sw/source/core/tox/txmsrt.cxx | 10 sw/source/core/txtnode/chrfmt.cxx | 9 sw/source/core/txtnode/fmtatr2.cxx | 10 sw/source/core/txtnode/ndtxt.cxx | 28 - sw/source/core/txtnode/txtatr2.cxx | 4 sw/source/core/undo/SwUndoFmt.cxx | 38 - sw/source/core/undo/rolbck.cxx | 2 sw/source/core/undo/unattr.cxx | 12 sw/source/core/undo/undel.cxx | 2 sw/source/core/undo/undobj1.cxx | 2 sw/source/core/undo/unins.cxx | 2 sw/source/core/undo/unnum.cxx | 2 sw/source/core/undo/untbl.cxx | 12 sw/source/core/unocore/SwXTextDefaults.cxx | 4 sw/source/core/unocore/unochart.cxx | 49 +- sw/source/core/unocore/unocoll.cxx | 16 sw/source/core/unocore/unocrsrhelper.cxx | 27 - sw/source/core/unocore/unodraw.cxx | 4 sw/source/core/unocore/unofield.cxx | 42 +- sw/source/core/unocore/unoframe.cxx | 26 - sw/source/core/unocore/unoidx.cxx | 46 +- sw/source/core/unocore/unoobj.cxx | 16 sw/source/core/unocore/unosect.cxx | 8 sw/source/core/unocore/unosett.cxx | 69 +-- sw/source/core/unocore/unostyle.cxx | 245 +++++------ sw/source/core/unocore/unotbl.cxx | 26 - sw/source/core/unocore/unotext.cxx | 2 sw/source/filter/basflt/fltshell.cxx | 6 sw/source/filter/html/css1atr.cxx | 10 sw/source/filter/html/htmlatr.cxx | 18 sw/source/filter/html/htmlcss1.cxx | 28 - sw/source/filter/html/htmlctxt.cxx | 2 sw/source/filter/html/htmlflywriter.cxx | 8 sw/source/filter/html/htmlgrin.cxx | 2 sw/source/filter/html/htmlnumreader.cxx | 4 sw/source/filter/html/htmlnumwriter.cxx | 2 sw/source/filter/html/htmlplug.cxx | 4 sw/source/filter/html/htmlsect.cxx | 10 sw/source/filter/html/htmltab.cxx | 2 sw/source/filter/html/htmltabw.cxx | 2 sw/source/filter/html/swcss1.hxx | 2 sw/source/filter/html/swhtml.hxx | 2 sw/source/filter/html/wrthtml.cxx | 8 sw/source/filter/html/wrthtml.hxx | 6 sw/source/filter/inc/msfilter.hxx | 4 sw/source/filter/indexing/IndexingExport.cxx | 10 sw/source/filter/ww8/docxattributeoutput.cxx | 10 sw/source/filter/ww8/docxsdrexport.cxx | 2 sw/source/filter/ww8/rtfattributeoutput.cxx | 2 sw/source/filter/ww8/writerhelper.cxx | 4 sw/source/filter/ww8/writerhelper.hxx | 4 sw/source/filter/ww8/writerwordglue.cxx | 44 +- sw/source/filter/ww8/wrtw8nds.cxx | 6 sw/source/filter/ww8/wrtw8num.cxx | 8 sw/source/filter/ww8/wrtw8sty.cxx | 8 sw/source/filter/ww8/wrtww8.cxx | 8 sw/source/filter/ww8/ww8atr.cxx | 30 - sw/source/filter/ww8/ww8graf.cxx | 4 sw/source/filter/ww8/ww8graf2.cxx | 4 sw/source/filter/ww8/ww8par.cxx | 8 sw/source/filter/ww8/ww8par2.cxx | 24 - sw/source/filter/ww8/ww8par3.cxx | 14 sw/source/filter/ww8/ww8par5.cxx | 42 +- sw/source/filter/ww8/ww8par6.cxx | 4 sw/source/filter/xml/swxml.cxx | 11 sw/source/filter/xml/xmlfmt.cxx | 2 sw/source/filter/xml/xmlfmte.cxx | 2 sw/source/filter/xml/xmlimp.cxx | 4 sw/source/filter/xml/xmltble.cxx | 10 sw/source/filter/xml/xmltbli.cxx | 12 sw/source/filter/xml/xmltexte.cxx | 2 sw/source/filter/xml/xmltexti.cxx | 2 sw/source/ui/chrdlg/break.cxx | 14 sw/source/ui/chrdlg/drpcps.cxx | 6 sw/source/ui/chrdlg/swuiccoll.cxx | 4 sw/source/ui/config/optload.cxx | 16 sw/source/ui/dbui/dbinsdlg.cxx | 15 sw/source/ui/dialog/uiregionsw.cxx | 24 - sw/source/ui/envelp/envfmt.cxx | 4 sw/source/ui/fldui/fldpage.cxx | 4 sw/source/ui/fldui/fldref.cxx | 4 sw/source/ui/fldui/fldvar.cxx | 8 sw/source/ui/fmtui/tmpdlg.cxx | 18 sw/source/ui/frmdlg/column.cxx | 2 sw/source/ui/frmdlg/cption.cxx | 8 sw/source/ui/frmdlg/frmpage.cxx | 62 +- sw/source/ui/index/cntex.cxx | 10 sw/source/ui/index/cnttab.cxx | 98 ++-- sw/source/ui/misc/docfnote.cxx | 30 - sw/source/ui/misc/linenum.cxx | 4 sw/source/ui/misc/num.cxx | 12 sw/source/ui/misc/outline.cxx | 32 - sw/source/ui/misc/titlepage.cxx | 8 sw/source/ui/table/autoformatpreview.cxx | 2 sw/source/ui/table/convert.cxx | 4 sw/source/ui/table/instable.cxx | 12 sw/source/ui/table/tabledlg.cxx | 12 sw/source/ui/table/tautofmt.cxx | 12 sw/source/uibase/app/appenv.cxx | 8 sw/source/uibase/app/applab.cxx | 4 sw/source/uibase/app/docsh2.cxx | 4 sw/source/uibase/app/docst.cxx | 94 ++-- sw/source/uibase/app/docstyle.cxx | 292 +++++++------- sw/source/uibase/chrdlg/ccoll.cxx | 8 sw/source/uibase/config/StoredChapterNumbering.cxx | 18 sw/source/uibase/config/modcfg.cxx | 4 sw/source/uibase/config/uinums.cxx | 4 sw/source/uibase/dialog/regionsw.cxx | 2 sw/source/uibase/dochdl/swdtflvr.cxx | 16 sw/source/uibase/docvw/HeaderFooterWin.cxx | 6 sw/source/uibase/docvw/edtwin.cxx | 10 sw/source/uibase/docvw/edtwin2.cxx | 8 sw/source/uibase/fldui/fldmgr.cxx | 10 sw/source/uibase/frmdlg/frmmgr.cxx | 2 sw/source/uibase/inc/caption.hxx | 7 sw/source/uibase/inc/formatclipboard.hxx | 4 sw/source/uibase/inc/inputwin.hxx | 6 sw/source/uibase/inc/numprevw.hxx | 4 sw/source/uibase/inc/optload.hxx | 8 sw/source/uibase/inc/outline.hxx | 8 sw/source/uibase/inc/swuicnttab.hxx | 4 sw/source/uibase/inc/toxmgr.hxx | 18 sw/source/uibase/inc/uinums.hxx | 12 sw/source/uibase/inc/wrtsh.hxx | 24 - sw/source/uibase/ribbar/inputwin.cxx | 6 sw/source/uibase/shells/basesh.cxx | 10 sw/source/uibase/shells/frmsh.cxx | 24 - sw/source/uibase/shells/grfsh.cxx | 2 sw/source/uibase/shells/tabsh.cxx | 4 sw/source/uibase/shells/textfld.cxx | 4 sw/source/uibase/shells/textsh.cxx | 2 sw/source/uibase/shells/textsh1.cxx | 20 sw/source/uibase/shells/txtattr.cxx | 2 sw/source/uibase/shells/txtnum.cxx | 6 sw/source/uibase/table/chartins.cxx | 2 sw/source/uibase/table/tablemgr.cxx | 2 sw/source/uibase/uiview/formatclipboard.cxx | 8 sw/source/uibase/uiview/view2.cxx | 30 - sw/source/uibase/uiview/viewdlg2.cxx | 10 sw/source/uibase/uiview/viewsrch.cxx | 6 sw/source/uibase/uno/loktxdoc.cxx | 4 sw/source/uibase/uno/unotxdoc.cxx | 8 sw/source/uibase/uno/unotxvw.cxx | 6 sw/source/uibase/utlui/attrdesc.cxx | 8 sw/source/uibase/utlui/content.cxx | 65 +-- sw/source/uibase/utlui/glbltree.cxx | 8 sw/source/uibase/utlui/uitool.cxx | 28 - sw/source/uibase/wrtsh/move.cxx | 6 sw/source/uibase/wrtsh/select.cxx | 4 sw/source/uibase/wrtsh/wrtsh1.cxx | 20 sw/source/uibase/wrtsh/wrtsh2.cxx | 2 324 files changed, 2256 insertions(+), 2165 deletions(-)
New commits: commit ac3b217a43e21b00f434fa796a0c966b9ddfd9df Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Mon Dec 9 19:09:50 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Apr 16 16:33:12 2025 +0200 Make UINames and Programmatic Names typesafe by wrapping up OUStrings inside some type-safe wrappers to make it obvious in the code what kind of name we are dealing with. The new classes are in sw/inc/names.hxx Note that I spun the names for table formats out into their own name class TableStyleName, becuase they are weird. Most of the time they are UINames, but not always. Change-Id: Iaf320639fd1aae8ba0f99866ff206906544c42be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178839 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/IDocumentFieldsAccess.hxx b/sw/inc/IDocumentFieldsAccess.hxx index b496b800202f..5ebebb2076e8 100644 --- a/sw/inc/IDocumentFieldsAccess.hxx +++ b/sw/inc/IDocumentFieldsAccess.hxx @@ -60,7 +60,9 @@ namespace com::sun::star::uno { class Any; } virtual SwFieldType* GetFieldType(SwFieldIds nResId, const OUString& rName, bool bDbFieldMatching) const = 0; - // convenience method + // convenience methods + SwFieldType* GetFieldType(SwFieldIds nResId, const UIName& rName, bool bDbFieldMatching) const + { return GetFieldType(nResId, rName.toString(), bDbFieldMatching); } SwFieldType* GetFieldType(SwFieldIds nResId, const ReferenceMarkerName& rName, bool bDbFieldMatching) const { return GetFieldType(nResId, rName.toString(), bDbFieldMatching); } diff --git a/sw/inc/IDocumentListsAccess.hxx b/sw/inc/IDocumentListsAccess.hxx index 8d78dbed86b5..4af4ad15908c 100644 --- a/sw/inc/IDocumentListsAccess.hxx +++ b/sw/inc/IDocumentListsAccess.hxx @@ -22,6 +22,7 @@ #include <rtl/ustring.hxx> class SwList; +class UIName; /** Provides access to the lists of a document. */ @@ -29,16 +30,16 @@ class IDocumentListsAccess { public: virtual SwList* createList( const OUString& rListId, - const OUString& rDefaultListStyleName ) = 0; + const UIName& rDefaultListStyleName ) = 0; virtual SwList* getListByName( const OUString& rListId ) const = 0; - virtual void createListForListStyle( const OUString& rListStyleName ) = 0; - virtual SwList* getListForListStyle( const OUString& rListStyleName ) const = 0; - virtual void deleteListForListStyle( const OUString& rListStyleName ) = 0; - virtual void deleteListsByDefaultListStyle( const OUString& rListStyleName ) = 0; + virtual void createListForListStyle( const UIName& rListStyleName ) = 0; + virtual SwList* getListForListStyle( const UIName& rListStyleName ) const = 0; + virtual void deleteListForListStyle( const UIName& rListStyleName ) = 0; + virtual void deleteListsByDefaultListStyle( const UIName& rListStyleName ) = 0; // #i91400# - virtual void trackChangeOfListStyleName( const OUString& rListStyleName, - const OUString& rNewListStyleName ) = 0; + virtual void trackChangeOfListStyleName( const UIName& rListStyleName, + const UIName& rNewListStyleName ) = 0; protected: virtual ~IDocumentListsAccess() {}; }; diff --git a/sw/inc/SwRewriter.hxx b/sw/inc/SwRewriter.hxx index f4191c3fa3f0..8857b5393526 100644 --- a/sw/inc/SwRewriter.hxx +++ b/sw/inc/SwRewriter.hxx @@ -40,7 +40,8 @@ public: SwRewriter(); void AddRule(SwUndoArg eWhat, const OUString& rWith); - // convenience method + // convenience methods + void AddRule(SwUndoArg eWhat, const UIName& rWith) { AddRule(eWhat, rWith.toString()); } void AddRule(SwUndoArg eWhat, const ReferenceMarkerName& rWith) { AddRule(eWhat, rWith.toString()); diff --git a/sw/inc/SwStyleNameMapper.hxx b/sw/inc/SwStyleNameMapper.hxx index dbd1ca166243..eff343c9c76f 100644 --- a/sw/inc/SwStyleNameMapper.hxx +++ b/sw/inc/SwStyleNameMapper.hxx @@ -22,12 +22,11 @@ #include <rtl/ustring.hxx> #include "SwGetPoolIdFromName.hxx" #include "swdllapi.h" +#include "names.hxx" #include <unordered_map> #include <vector> -class ProgName; - /** This class holds all data about the names of styles used in the user * interface (UI names...these are localised into different languages). * These UI names are loaded from the resource files on demand. @@ -72,6 +71,7 @@ class ProgName; * " (user)", we simply remove it. */ + typedef std::unordered_map<OUString, sal_uInt16> NameToIdHash; class SwStyleNameMapper final @@ -80,7 +80,7 @@ class SwStyleNameMapper final friend void FinitCore(); static void fillProgNameFromId(sal_uInt16 nId, ProgName &rName); - static void fillNameFromId(sal_uInt16 nId, OUString &rName, bool bProgName); + static void fillUINameFromId(sal_uInt16 nId, UIName &rName); static const OUString& getNameFromId(sal_uInt16 nId, const OUString &rName, bool bProgName); static const NameToIdHash& getHashTable ( SwGetPoolIdFromName, bool bProgName ); @@ -91,32 +91,32 @@ class SwStyleNameMapper final public: // This gets the UI Name from the programmatic name SAL_WARN_UNUSED_RESULT - static const OUString& GetUIName(const ProgName& rName, SwGetPoolIdFromName); - static void FillUIName(const ProgName& rName, OUString& rFillName, + static UIName GetUIName(const ProgName& rName, SwGetPoolIdFromName); + static void FillUIName(const ProgName& rName, UIName& rFillName, SwGetPoolIdFromName); // Get the programmatic Name from the UI name SAL_WARN_UNUSED_RESULT - static ProgName GetProgName(const OUString& rName, + static ProgName GetProgName(const UIName& rName, SwGetPoolIdFromName); - static void FillProgName(const OUString& rName, ProgName& rFillName, + static void FillProgName(const UIName& rName, ProgName& rFillName, SwGetPoolIdFromName); // This gets the UI Name from the Pool ID - SW_DLLPUBLIC static void FillUIName(sal_uInt16 nId, OUString& rFillName); + SW_DLLPUBLIC static void FillUIName(sal_uInt16 nId, UIName& rFillName); SAL_WARN_UNUSED_RESULT - SW_DLLPUBLIC static const OUString& GetUIName(sal_uInt16 nId, + SW_DLLPUBLIC static UIName GetUIName(sal_uInt16 nId, const ProgName& rName); // This gets the programmatic Name from the Pool ID static void FillProgName(sal_uInt16 nId, ProgName& rFillName); SAL_WARN_UNUSED_RESULT SW_DLLPUBLIC static ProgName GetProgName(sal_uInt16 nId, - const OUString& rName); + const UIName& rName); // This gets the PoolId from the UI Name SAL_WARN_UNUSED_RESULT - SW_DLLPUBLIC static sal_uInt16 GetPoolIdFromUIName(const OUString& rName, + SW_DLLPUBLIC static sal_uInt16 GetPoolIdFromUIName(const UIName& rName, SwGetPoolIdFromName); // Get the Pool ID from the programmatic name @@ -131,9 +131,9 @@ public: // Non-matching names remain unchanged. SAL_WARN_UNUSED_RESULT SW_DLLPUBLIC static ProgName GetSpecialExtraProgName( - const OUString& rExtraUIName); + const UIName& rExtraUIName); SAL_WARN_UNUSED_RESULT - static const OUString & GetSpecialExtraUIName(const ProgName& rExtraProgName); + static UIName GetSpecialExtraUIName(const ProgName& rExtraProgName); static const std::vector<OUString>& GetTextUINameArray(); static const std::vector<OUString>& GetListsUINameArray(); diff --git a/sw/inc/ToxLinkProcessor.hxx b/sw/inc/ToxLinkProcessor.hxx index 967e658d4970..86521cb42632 100644 --- a/sw/inc/ToxLinkProcessor.hxx +++ b/sw/inc/ToxLinkProcessor.hxx @@ -31,7 +31,7 @@ public: virtual ~ToxLinkProcessor() {} void - StartNewLink(sal_Int32 startPosition, const OUString& characterStyle); + StartNewLink(sal_Int32 startPosition, const UIName& characterStyle); /** Close a link which has been found during processing. * @@ -54,15 +54,15 @@ private: * This method is overridden in the unittests. You should not override it yourself. */ virtual sal_uInt16 - ObtainPoolId(const OUString& characterStyle) const; + ObtainPoolId(const UIName& characterStyle) const; /** Information about a started link */ struct StartedLink { - StartedLink(sal_Int32 startPosition, OUString characterStyle) : + StartedLink(sal_Int32 startPosition, UIName characterStyle) : mStartPosition(startPosition), mCharacterStyle(std::move(characterStyle)) { } sal_Int32 mStartPosition; - OUString mCharacterStyle; + UIName mCharacterStyle; }; /** A link that has been encountered while parsing a tox. diff --git a/sw/inc/ccoll.hxx b/sw/inc/ccoll.hxx index 6da1f80bc61d..5ab70b68e80b 100644 --- a/sw/inc/ccoll.hxx +++ b/sw/inc/ccoll.hxx @@ -22,6 +22,7 @@ #include <svl/poolitem.hxx> #include <tools/solar.h> #include "swdllapi.h" +#include "names.hxx" enum class Master_CollCondition; @@ -40,7 +41,7 @@ class SW_DLLPUBLIC SwCondCollItem final : public SfxPoolItem { static const CommandStruct s_aCmds[COND_COMMAND_COUNT]; - OUString m_sStyles[COND_COMMAND_COUNT]; + UIName m_sStyles[COND_COMMAND_COUNT]; public: DECLARE_ITEM_TYPE_FUNCTION(SwCondCollItem) @@ -57,8 +58,8 @@ public: static const CommandStruct* GetCmds() { return s_aCmds; } - OUString GetStyle(sal_uInt16 nPos) const; - void SetStyle(const OUString* pStyle, sal_uInt16 nPos); + UIName GetStyle(sal_uInt16 nPos) const; + void SetStyle(const UIName* pStyle, sal_uInt16 nPos); }; diff --git a/sw/inc/charfmt.hxx b/sw/inc/charfmt.hxx index 166db1d708fc..bb66c1abdca9 100644 --- a/sw/inc/charfmt.hxx +++ b/sw/inc/charfmt.hxx @@ -29,7 +29,7 @@ class SW_DLLPUBLIC SwCharFormat final : public SwFormat SwTextFormatColl* mpLinkedParaFormat = nullptr; - SwCharFormat( SwAttrPool& rPool, const OUString &rFormatName, + SwCharFormat( SwAttrPool& rPool, const UIName &rFormatName, SwCharFormat *pDerivedFrom ) : SwFormat( rPool, rFormatName, aCharFormatSetRange, pDerivedFrom, RES_CHRFMT ) {} diff --git a/sw/inc/charformats.hxx b/sw/inc/charformats.hxx index 73c4ffeccc59..c2c49d160895 100644 --- a/sw/inc/charformats.hxx +++ b/sw/inc/charformats.hxx @@ -31,7 +31,7 @@ struct char_formats_name_key : boost::multi_index::composite_key< SwCharFormat*, - boost::multi_index::const_mem_fun<SwFormat, const OUString&, &SwFormat::GetName>, + boost::multi_index::const_mem_fun<SwFormat, const UIName&, &SwFormat::GetName>, boost::multi_index::identity<SwCharFormat*> // the actual object pointer > { @@ -46,7 +46,7 @@ typedef boost::multi_index_container< class SW_DLLPUBLIC SwCharFormats final : public SwFormatsBase { // function updating ByName index via modify - friend void SwFormat::SetFormatName(const OUString&, bool); + friend void SwFormat::SetFormatName(const UIName&, bool); public: typedef SwCharFormatsBase::nth_index<0>::type ByPos; @@ -83,7 +83,7 @@ public: size_t GetPos(const SwCharFormat* p) const; // search for formats by name - ByName::const_iterator findByName(const OUString& name) const; + ByName::const_iterator findByName(const UIName& name) const; SwCharFormat* operator[](size_t index_) const { return m_PosIndex.operator[](index_); } const_iterator begin() const { return m_PosIndex.begin(); } @@ -101,10 +101,10 @@ public: void DeleteAndDestroyAll(bool keepDefault = false); // Override return type to reduce casting - virtual SwCharFormat* FindFormatByName(const OUString& rName) const override; + virtual SwCharFormat* FindFormatByName(const UIName& rName) const override; /** Need to call this when the format name changes */ - void SetFormatNameAndReindex(SwCharFormat* v, const OUString& sNewName); + void SetFormatNameAndReindex(SwCharFormat* v, const UIName& sNewName); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 3d2db39bb09b..485a5aefe60c 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -643,7 +643,7 @@ public: SW_DLLPUBLIC bool GoNextCell( bool bAppendLine = true ); SW_DLLPUBLIC bool GoPrevCell(); // go to this box (if available and inside of table) - bool GotoTable( const OUString& rName ); + bool GotoTable( const UIName& rName ); // select a table row, column or box (based on the current cursor) bool SelTableRow() { return SelTableRowOrCol( true ); } @@ -709,8 +709,8 @@ public: // in a headerframe otherwise in a footerframe SW_DLLPUBLIC bool IsInHeaderFooter( bool* pbInHeader = nullptr ) const; - bool GotoNextTOXBase( const OUString* = nullptr ); - bool GotoPrevTOXBase( const OUString* = nullptr ); + bool GotoNextTOXBase( const UIName* = nullptr ); + bool GotoPrevTOXBase( const UIName* = nullptr ); void GotoTOXMarkBase(); // jump to the next or previous index entry bool GotoNxtPrvTOXMark( bool bNext = true ); diff --git a/sw/inc/dbfld.hxx b/sw/inc/dbfld.hxx index 708db0a2b135..984058a48572 100644 --- a/sw/inc/dbfld.hxx +++ b/sw/inc/dbfld.hxx @@ -28,7 +28,7 @@ class SwDoc; class SW_DLLPUBLIC SwDBFieldType final : public SwValueFieldType { SwDBData m_aDBData; - OUString m_sName; ///< only used in ::GetName() ! + UIName m_sName; ///< only used in ::GetName() ! OUString m_sColumn; tools::Long m_nRefCnt; @@ -37,7 +37,7 @@ public: SwDBFieldType(SwDoc* pDocPtr, const OUString& rColumnName, SwDBData aDBData); virtual ~SwDBFieldType() override; - virtual OUString GetName() const override; + virtual UIName GetName() const override; virtual std::unique_ptr<SwFieldType> Copy() const override; void AddRef() { m_nRefCnt++; } diff --git a/sw/inc/ddefld.hxx b/sw/inc/ddefld.hxx index 9d0ef6fa71f5..278542e744db 100644 --- a/sw/inc/ddefld.hxx +++ b/sw/inc/ddefld.hxx @@ -49,7 +49,7 @@ namespace sw // FieldType for DDE class SW_DLLPUBLIC SwDDEFieldType final : public SwFieldType { - OUString m_aName; + UIName m_aName; OUString m_aExpansion; tools::SvRef<sfx2::SvBaseLink> m_RefLink; @@ -62,7 +62,7 @@ class SW_DLLPUBLIC SwDDEFieldType final : public SwFieldType SAL_DLLPRIVATE void RefCntChgd(); public: - SwDDEFieldType( OUString aName, const OUString& rCmd, + SwDDEFieldType( UIName aName, const OUString& rCmd, SfxLinkUpdateMode ); virtual ~SwDDEFieldType() override; @@ -71,7 +71,7 @@ public: m_bCRLFFlag = false; } virtual std::unique_ptr<SwFieldType> Copy() const override; - virtual OUString GetName() const override; + virtual UIName GetName() const override; virtual void QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) const override; virtual void PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich ) override; diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 2ee90daac79f..ae0ed7e852e2 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -281,7 +281,7 @@ class SwDoc final mutable std::unique_ptr<SwNumRuleTable> mpNumRuleTable; //< List of all named NumRules. // Hash map to find numrules by name - mutable std::unordered_map<OUString, SwNumRule *> maNumRuleMap; + mutable std::unordered_map<UIName, SwNumRule *> maNumRuleMap; std::unique_ptr<SwPagePreviewPrtData> m_pPgPViewPrtData; //< Indenting / spacing for printing of page view. SwExtTextInput *mpExtInputRing; @@ -352,7 +352,7 @@ private: SwFrameFormat* ); sal_Int8 SetFlyFrameAnchor( SwFrameFormat& rFlyFormat, SfxItemSet& rSet, bool bNewFrames ); - typedef SwFormat* (SwDoc::*FNCopyFormat)( const OUString&, SwFormat*, bool ); + typedef SwFormat* (SwDoc::*FNCopyFormat)( const UIName&, SwFormat*, bool ); SwFormat* CopyFormat( const SwFormat& rFormat, const SwFormatsBase& rFormatArr, FNCopyFormat fnCopyFormat, const SwFormat& rDfltFormat ); void CopyFormatArr( const SwFormatsBase& rSourceArr, SwFormatsBase const & rDestArr, @@ -393,11 +393,11 @@ private: DECL_LINK( DoUpdateModifiedOLE, Timer *, void ); public: - SW_DLLPUBLIC SwFormat *MakeCharFormat_(const OUString &, SwFormat *, bool ); - SwFormat *MakeFrameFormat_(const OUString &, SwFormat *, bool ); + SW_DLLPUBLIC SwFormat *MakeCharFormat_(const UIName &, SwFormat *, bool ); + SwFormat *MakeFrameFormat_(const UIName &, SwFormat *, bool ); private: - SwFormat *MakeTextFormatColl_(const OUString &, SwFormat *, bool ); + SwFormat *MakeTextFormatColl_(const UIName &, SwFormat *, bool ); private: OUString msDocAccTitle; @@ -603,8 +603,8 @@ public: bool bDrawAlso, bool bAsCharAlso = false ) const; - SwFlyFrameFormat *MakeFlyFrameFormat (const OUString &rFormatName, SwFrameFormat *pDerivedFrom); - SwDrawFrameFormat *MakeDrawFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom); + SwFlyFrameFormat *MakeFlyFrameFormat (const UIName &rFormatName, SwFrameFormat *pDerivedFrom); + SwDrawFrameFormat *MakeDrawFrameFormat(const UIName &rFormatName, SwFrameFormat *pDerivedFrom); // From now on this interface has to be used for Flys. // pAnchorPos must be set, if they are not attached to pages AND @@ -701,16 +701,16 @@ public: SW_DLLPUBLIC SwDBData const & GetDBData(); // Some helper functions - OUString GetUniqueGrfName(std::u16string_view rPrefix = std::u16string_view()) const; - OUString GetUniqueOLEName() const; - SW_DLLPUBLIC OUString GetUniqueFrameName() const; - OUString GetUniqueShapeName() const; - SW_DLLPUBLIC OUString GetUniqueDrawObjectName() const; + UIName GetUniqueGrfName(UIName rPrefix = UIName()) const; + UIName GetUniqueOLEName() const; + SW_DLLPUBLIC UIName GetUniqueFrameName() const; + UIName GetUniqueShapeName() const; + SW_DLLPUBLIC UIName GetUniqueDrawObjectName() const; SW_DLLPUBLIC o3tl::sorted_vector<SwRootFrame*> GetAllLayouts(); - void SetFlyName( SwFlyFrameFormat& rFormat, const OUString& rName ); - SW_DLLPUBLIC const SwFlyFrameFormat* FindFlyByName( const OUString& rName, SwNodeType nNdTyp = SwNodeType::NONE ) const; + void SetFlyName( SwFlyFrameFormat& rFormat, const UIName& rName ); + SW_DLLPUBLIC const SwFlyFrameFormat* FindFlyByName( const UIName& rName, SwNodeType nNdTyp = SwNodeType::NONE ) const; static void GetGrfNms( const SwFlyFrameFormat& rFormat, OUString* pGrfName, OUString* pFltName ); @@ -780,15 +780,15 @@ public: // Remove all language dependencies from all existing formats void RemoveAllFormatLanguageDependencies(); - SW_DLLPUBLIC SwFrameFormat* MakeFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom, + SW_DLLPUBLIC SwFrameFormat* MakeFrameFormat(const UIName &rFormatName, SwFrameFormat *pDerivedFrom, bool bAuto = true); SW_DLLPUBLIC void DelFrameFormat( SwFrameFormat *pFormat, bool bBroadcast = false ); - SwFrameFormat* FindFrameFormatByName( const OUString& rName ) const; + SwFrameFormat* FindFrameFormatByName( const UIName& rName ) const; - SW_DLLPUBLIC SwCharFormat *MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom); + SW_DLLPUBLIC SwCharFormat *MakeCharFormat(const UIName &rFormatName, SwCharFormat *pDerivedFrom); void DelCharFormat(size_t nFormat, bool bBroadcast = false); void DelCharFormat(SwCharFormat const * pFormat, bool bBroadcast = false); - SwCharFormat* FindCharFormatByName( const OUString& rName ) const + SwCharFormat* FindCharFormatByName( const UIName& rName ) const { return mpCharFormatTable->FindFormatByName(rName); } // Formatcollections (styles) @@ -797,9 +797,9 @@ public: SwTextFormatColl* GetDfltTextFormatColl() { return mpDfltTextFormatColl.get(); } const SwTextFormatColls *GetTextFormatColls() const { return mpTextFormatCollTable.get(); } SwTextFormatColls *GetTextFormatColls() { return mpTextFormatCollTable.get(); } - SW_DLLPUBLIC SwTextFormatColl *MakeTextFormatColl( const OUString &rFormatName, + SW_DLLPUBLIC SwTextFormatColl *MakeTextFormatColl( const UIName &rFormatName, SwTextFormatColl *pDerivedFrom); - SwConditionTextFormatColl* MakeCondTextFormatColl( const OUString &rFormatName, + SwConditionTextFormatColl* MakeCondTextFormatColl( const UIName &rFormatName, SwTextFormatColl *pDerivedFrom); void DelTextFormatColl(size_t nFormat, bool bBroadcast = false); void DelTextFormatColl( SwTextFormatColl const * pColl, bool bBroadcast = false ); @@ -815,7 +815,7 @@ public: const bool bResetListAttrs = false, const bool bResetAllCharAttrs = false, SwRootFrame const* pLayout = nullptr); - SwTextFormatColl* FindTextFormatCollByName( const OUString& rName ) const + SwTextFormatColl* FindTextFormatCollByName( const UIName& rName ) const { return mpTextFormatCollTable->FindFormatByName(rName); } void ChkCondColls(); @@ -823,7 +823,7 @@ public: const SwGrfFormatColl* GetDfltGrfFormatColl() const { return mpDfltGrfFormatColl.get(); } SwGrfFormatColl* GetDfltGrfFormatColl() { return mpDfltGrfFormatColl.get(); } const SwGrfFormatColls *GetGrfFormatColls() const { return mpGrfFormatCollTable.get(); } - SwGrfFormatColl *MakeGrfFormatColl(const OUString &rFormatName, + SwGrfFormatColl *MakeGrfFormatColl(const UIName &rFormatName, SwGrfFormatColl *pDerivedFrom); // Table formatting @@ -831,9 +831,9 @@ public: sw::TableFrameFormats* GetTableFrameFormats() { return mpTableFrameFormatTable.get(); } SW_DLLPUBLIC size_t GetTableFrameFormatCount( bool bUsed ) const; SwTableFormat& GetTableFrameFormat(size_t nFormat, bool bUsed ) const; - SwTableFormat* MakeTableFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom); + SwTableFormat* MakeTableFrameFormat(const UIName &rFormatName, SwFrameFormat *pDerivedFrom); void DelTableFrameFormat( SwTableFormat* pFormat ); - SW_DLLPUBLIC SwTableFormat* FindTableFormatByName( const OUString& rName, bool bAll = false ) const; + SW_DLLPUBLIC SwTableFormat* FindTableFormatByName( const UIName& rName, bool bAll = false ) const; /** Access to frames. Iterate over Flys - for Basic-Collections. */ @@ -842,7 +842,7 @@ public: SW_DLLPUBLIC std::vector<SwFrameFormat const*> GetFlyFrameFormats( FlyCntType eType, bool bIgnoreTextBoxes); - SwFrameFormat* GetFlyFrameFormatByName( const OUString& sFrameFormatName ); + SwFrameFormat* GetFlyFrameFormatByName( const UIName& sFrameFormatName ); // Copy formats in own arrays and return them. SwFrameFormat *CopyFrameFormat ( const SwFrameFormat& ); @@ -900,7 +900,7 @@ public: size_t GetPageDescCnt() const { return m_PageDescs.size(); } const SwPageDesc& GetPageDesc(const size_t i) const { return *m_PageDescs[i]; } SwPageDesc& GetPageDesc(size_t const i) { return *m_PageDescs[i]; } - SW_DLLPUBLIC SwPageDesc* FindPageDesc(const OUString& rName, size_t* pPos = nullptr) const; + SW_DLLPUBLIC SwPageDesc* FindPageDesc(const UIName& rName, size_t* pPos = nullptr) const; // Just searches the pointer in the m_PageDescs vector! bool ContainsPageDesc(const SwPageDesc *pDesc, size_t* pPos) const; @@ -920,14 +920,14 @@ public: { CopyPageDescHeaderFooterImpl( false, rSrcFormat, rDestFormat ); } // For Reader - SW_DLLPUBLIC void ChgPageDesc( const OUString & rName, const SwPageDesc& ); + SW_DLLPUBLIC void ChgPageDesc( const UIName & rName, const SwPageDesc& ); SW_DLLPUBLIC void ChgPageDesc( size_t i, const SwPageDesc& ); - void DelPageDesc( const OUString & rName, bool bBroadcast = false); + void DelPageDesc( const UIName & rName, bool bBroadcast = false); void DelPageDesc( size_t i, bool bBroadcast = false ); void PreDelPageDesc(SwPageDesc const * pDel); - SW_DLLPUBLIC SwPageDesc* MakePageDesc(const OUString &rName, const SwPageDesc* pCpy = nullptr, + SW_DLLPUBLIC SwPageDesc* MakePageDesc(const UIName &rName, const SwPageDesc* pCpy = nullptr, bool bRegardLanguage = true); - void BroadcastStyleOperation(const OUString& rName, SfxStyleFamily eFamily, + void BroadcastStyleOperation(const UIName& rName, SfxStyleFamily eFamily, SfxHintId nOp); /** The html import sometimes overwrites the page sizes set in @@ -963,7 +963,7 @@ public: OUString GetUniqueTOXBaseName( const SwTOXType& rType, const OUString& sChkStr ) const; - bool SetTOXBaseName(const SwTOXBase& rTOXBase, const OUString& rName); + bool SetTOXBaseName(const SwTOXBase& rTOXBase, const UIName& rName); // After reading file update all tables/indices void SetUpdateTOX( bool bFlag ) { mbUpdateTOX = bFlag; } @@ -1103,24 +1103,24 @@ public: void AddNumRule(SwNumRule * pRule); // add optional parameter <eDefaultNumberFormatPositionAndSpaceMode> - SW_DLLPUBLIC sal_uInt16 MakeNumRule( const OUString &rName, + SW_DLLPUBLIC sal_uInt16 MakeNumRule( const UIName &rName, const SwNumRule* pCpy = nullptr, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode = SvxNumberFormat::LABEL_WIDTH_AND_POSITION ); - sal_uInt16 FindNumRule( std::u16string_view rName ) const; + sal_uInt16 FindNumRule( const UIName& rName ) const; std::set<OUString> GetUsedBullets(); - SW_DLLPUBLIC SwNumRule* FindNumRulePtr( const OUString& rName ) const; + SW_DLLPUBLIC SwNumRule* FindNumRulePtr( const UIName& rName ) const; // Deletion only possible if Rule is not used! - bool RenameNumRule(const OUString & aOldName, const OUString & aNewName, + bool RenameNumRule(const UIName & aOldName, const UIName & aNewName, bool bBroadcast = false); - SW_DLLPUBLIC bool DelNumRule( const OUString& rName, bool bBroadCast = false ); - SW_DLLPUBLIC OUString GetUniqueNumRuleName( const OUString* pChkStr = nullptr, bool bAutoNum = true ) const; + SW_DLLPUBLIC bool DelNumRule( const UIName& rName, bool bBroadCast = false ); + SW_DLLPUBLIC UIName GetUniqueNumRuleName( const UIName* pChkStr = nullptr, bool bAutoNum = true ) const; void UpdateNumRule(); // Update all invalids. void ChgNumRuleFormats( const SwNumRule& rRule ); - void ReplaceNumRule( const SwPosition& rPos, const OUString& rOldRule, - const OUString& rNewRule ); + void ReplaceNumRule( const SwPosition& rPos, const UIName& rOldRule, + const UIName& rNewRule ); // Goto next/previous on same level. static bool GotoNextNum( SwPosition&, SwRootFrame const* pLayout, @@ -1239,7 +1239,7 @@ public: sal_uInt16 nCnt, bool bSameHeight = false ); TableMergeErr MergeTable( SwPaM& rPam ); - OUString GetUniqueTableName() const; + UIName GetUniqueTableName() const; bool IsInsTableFormatNum() const; bool IsInsTableChangeNumFormat() const; bool IsInsTableAlignNum() const; @@ -1262,7 +1262,7 @@ public: /// AutoFormat for table/table selection. /// @param bResetDirect Reset direct formatting that might be applied to the cells. - bool SetTableAutoFormat(const SwSelBoxes& rBoxes, const SwTableAutoFormat& rNew, bool bResetDirect = false, OUString const* pStyleNameToSet = nullptr); + bool SetTableAutoFormat(const SwSelBoxes& rBoxes, const SwTableAutoFormat& rNew, bool bResetDirect = false, TableStyleName const* pStyleNameToSet = nullptr); // Query attributes. bool GetTableAutoFormat( const SwSelBoxes& rBoxes, SwTableAutoFormat& rGet ); @@ -1276,11 +1276,11 @@ public: /// Counts table styles without triggering lazy-load of them. bool HasTableStyles() const { return m_pTableStyles != nullptr; } // Create a new table style. Tracked by Undo. - SW_DLLPUBLIC SwTableAutoFormat* MakeTableStyle(const OUString& rName); + SW_DLLPUBLIC SwTableAutoFormat* MakeTableStyle(const TableStyleName& rName); // Delete table style named rName. Tracked by undo. - SW_DLLPUBLIC std::unique_ptr<SwTableAutoFormat> DelTableStyle(const OUString& rName, bool bBroadcast = false); + SW_DLLPUBLIC std::unique_ptr<SwTableAutoFormat> DelTableStyle(const TableStyleName& rName, bool bBroadcast = false); // Change (replace) a table style named rName. Tracked by undo. - SW_DLLPUBLIC void ChgTableStyle(const OUString& rName, const SwTableAutoFormat& rNewFormat); + SW_DLLPUBLIC void ChgTableStyle(const TableStyleName& rName, const SwTableAutoFormat& rNewFormat); const SwCellStyleTable& GetCellStyles() const { return *mpCellStyles; } SwCellStyleTable& GetCellStyles() { return *mpCellStyles; } @@ -1302,13 +1302,13 @@ public: bool InsCopyOfTable( SwPosition& rInsPos, const SwSelBoxes& rBoxes, const SwTable* pCpyTable, bool bCpyName = false, - bool bCorrPos = false, const OUString& rStyleName = u""_ustr ); + bool bCorrPos = false, const TableStyleName& rStyleName = TableStyleName() ); - void UnProtectCells( const OUString& rTableName ); + void UnProtectCells( const UIName& rTableName ); bool UnProtectCells( const SwSelBoxes& rBoxes ); void UnProtectTables( const SwPaM& rPam ); bool HasTableAnyProtection( const SwPosition* pPos, - const OUString* pTableName, + const UIName* pTableName, bool* pFullTableProtection ); // Split table at baseline position, i.e. create a new table. @@ -1320,13 +1320,13 @@ public: bool MergeTable( const SwPosition& rPos, bool bWithPrev ); // Make charts of given table update. - void UpdateCharts( const OUString& rName ) const; + void UpdateCharts( const UIName& rName ) const; // Update all charts, for that exists any table. void UpdateAllCharts() { DoUpdateAllCharts(); } // Table is renamed and refreshes charts. - void SetTableName( SwFrameFormat& rTableFormat, const OUString &rNewName ); + void SetTableName( SwFrameFormat& rTableFormat, const UIName &rNewName ); // @return the reference in document that is set for name. const SwFormatRefMark* GetRefMark( const ReferenceMarkerName& rName ) const; @@ -1347,11 +1347,11 @@ public: SwFlyFrameFormat* InsertLabel( const SwLabelType eType, const OUString &rText, const OUString& rSeparator, const OUString& rNumberingSeparator, const bool bBefore, const sal_uInt16 nId, const SwNodeOffset nIdx, - const OUString& rCharacterStyle, + const UIName& rCharacterStyle, const bool bCpyBrd ); SwFlyFrameFormat* InsertDrawLabel( const OUString &rText, const OUString& rSeparator, const OUString& rNumberSeparator, - const sal_uInt16 nId, const OUString& rCharacterStyle, SdrObject& rObj ); + const sal_uInt16 nId, const UIName& rCharacterStyle, SdrObject& rObj ); // Query attribute pool. const SwAttrPool& GetAttrPool() const { return *mpAttrPool; } @@ -1662,7 +1662,7 @@ public: // Change a format undoable. SW_DLLPUBLIC void ChgFormat(SwFormat & rFormat, const SfxItemSet & rSet); - void RenameFormat(SwFormat & rFormat, const OUString & sNewName, + void RenameFormat(SwFormat & rFormat, const UIName & sNewName, bool bBroadcast = false); // Change a TOX undoable. diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx index dc8d0941dc04..248c7bfb510b 100644 --- a/sw/inc/docary.hxx +++ b/sw/inc/docary.hxx @@ -47,8 +47,8 @@ public: virtual ~SwFormatsBase(); // default linear search implementation, some subclasses will override with a more efficient search - virtual SwFormat* FindFormatByName(const OUString& rName) const; - virtual void Rename(const SwFrameFormat&, const OUString&) {}; + virtual SwFormat* FindFormatByName(const UIName& rName) const; + virtual void Rename(const SwFrameFormat&, const UIName&) {}; SwFormatsBase() = default; SwFormatsBase(SwFormatsBase const &) = default; @@ -160,7 +160,7 @@ public: { return SwVectorModifyBase<Value>::operator[](idx); } // Override return type to reduce casting - virtual Value FindFormatByName(const OUString& rName) const override + virtual Value FindFormatByName(const UIName& rName) const override { return static_cast<Value>(SwFormatsBase::FindFormatByName(rName)); } }; diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 767234155d5f..c74dddfbf7ba 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -54,6 +54,7 @@ class SwViewShell; class SwDocStyleSheetPool; class SwXTextDocument; class SwTextFormatColl; +class UIName; namespace svt { class EmbeddedObjectRef; @@ -131,8 +132,8 @@ class SW_DLLPUBLIC SwDocShell /// Used to activate certain dialog pane SAL_DLLPRIVATE void Edit( weld::Window* pDialogParent, - const OUString &rName, - const OUString& rParent, + const UIName& rName, + const UIName& rParent, const SfxStyleFamily nFamily, SfxStyleSearchBits nMask, const bool bNew, @@ -150,8 +151,8 @@ class SW_DLLPUBLIC SwDocShell SwWrtShell* pShell, sal_uInt16 nMode); SAL_DLLPRIVATE SfxStyleFamily DoWaterCan( const OUString &rName, SfxStyleFamily nFamily); - SAL_DLLPRIVATE void UpdateStyle(const OUString &rName, SfxStyleFamily nFamily, SwWrtShell* pShell); - SAL_DLLPRIVATE void MakeByExample(const OUString &rName, + SAL_DLLPRIVATE void UpdateStyle(const UIName &rName, SfxStyleFamily nFamily, SwWrtShell* pShell); + SAL_DLLPRIVATE void MakeByExample(const UIName &rName, SfxStyleFamily nFamily, SfxStyleSearchBits nMask, SwWrtShell* pShell); SAL_DLLPRIVATE void SubInitNew(); ///< for InitNew and HtmlSourceMode. @@ -274,7 +275,7 @@ public: /// Identifies slot by which the dialog is triggered. Used to activate certain dialog pane void FormatPage( weld::Window* pDialogParent, - const OUString& rPage, + const UIName& rPage, const OUString& rPageId, SwWrtShell& rActShell, SfxRequest* pRequest = nullptr); diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx index f5a7a70a350f..8be2c4f71d30 100644 --- a/sw/inc/docstyle.hxx +++ b/sw/inc/docstyle.hxx @@ -161,19 +161,26 @@ class SwStyleSheetIterator final : public SfxStyleSheetIterator, public SfxListe // Local helper class. class SwPoolFormatList { - std::vector<std::pair<SfxStyleFamily, OUString>> maImpl; - typedef std::unordered_map<std::pair<SfxStyleFamily, OUString>, sal_uInt32> UniqueHash; + struct Hash + { + size_t operator()(const std::pair<SfxStyleFamily, UIName>& p) const + { + return std::hash<SfxStyleFamily>()(p.first) ^ std::hash<UIName>()(p.second); + } + }; + std::vector<std::pair<SfxStyleFamily, UIName>> maImpl; + typedef std::unordered_map<std::pair<SfxStyleFamily, UIName>, sal_uInt32, Hash> UniqueHash; UniqueHash maUnique; void rehash(); public: SwPoolFormatList() {} - void Append( SfxStyleFamily eFam, const OUString& rStr ); + void Append( SfxStyleFamily eFam, const UIName& rStr ); void clear() { maImpl.clear(); maUnique.clear(); } size_t size() { return maImpl.size(); } bool empty() { return maImpl.empty(); } - sal_uInt32 FindName(SfxStyleFamily eFam, const OUString& rName); - void RemoveName(SfxStyleFamily eFam, const OUString& rName); - const std::pair<SfxStyleFamily,OUString> &operator[](sal_uInt32 nIdx) { return maImpl[ nIdx ]; } + sal_uInt32 FindName(SfxStyleFamily eFam, const UIName& rName); + void RemoveName(SfxStyleFamily eFam, const UIName& rName); + const std::pair<SfxStyleFamily,UIName> &operator[](sal_uInt32 nIdx) { return maImpl[ nIdx ]; } }; rtl::Reference< SwDocStyleSheet > mxIterSheet; @@ -182,7 +189,7 @@ class SwStyleSheetIterator final : public SfxStyleSheetIterator, public SfxListe sal_uInt32 m_nLastPos; bool m_bFirstCalled; - bool IsUsedInComments(const OUString& rName) const; + bool IsUsedInComments(const UIName& rName) const; void AppendStyleList(const std::vector<OUString>& rLst, bool bUsed, bool bTestHidden, diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index f973da20c81d..69b5d3cba0af 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -292,15 +292,15 @@ public: /// TABLE size_t GetTableFrameFormatCount( bool bUsed = false ) const; SwFrameFormat& GetTableFrameFormat(size_t nFormat, bool bUsed = false ) const; - SW_DLLPUBLIC OUString GetUniqueTableName() const; + SW_DLLPUBLIC UIName GetUniqueTableName() const; /// CHAR SW_DLLPUBLIC sal_uInt16 GetCharFormatCount() const; SW_DLLPUBLIC SwCharFormat& GetCharFormat(sal_uInt16 nFormat) const; SwCharFormat* GetCurCharFormat() const; void FillByEx(SwCharFormat*); - SwCharFormat* MakeCharFormat( const OUString& rName ); - SW_DLLPUBLIC SwCharFormat* FindCharFormatByName( const OUString& rName ) const; + SwCharFormat* MakeCharFormat( const UIName& rName ); + SW_DLLPUBLIC SwCharFormat* FindCharFormatByName( const UIName& rName ) const; /* FormatCollections (new) - Explaining the general naming pattern: * GetXXXCount() returns the count of xxx in the document. @@ -342,10 +342,10 @@ public: SW_DLLPUBLIC void SetTextFormatColl(SwTextFormatColl*, const bool bResetListAttrs = false, SetAttrMode nMode = SetAttrMode::DEFAULT); - SW_DLLPUBLIC SwTextFormatColl *MakeTextFormatColl(const OUString &rFormatCollName, + SW_DLLPUBLIC SwTextFormatColl *MakeTextFormatColl(const UIName &rFormatCollName, SwTextFormatColl *pDerivedFrom = nullptr); void FillByEx(SwTextFormatColl*); - SW_DLLPUBLIC SwTextFormatColl* FindTextFormatCollByName( const OUString& rName ) const; + SW_DLLPUBLIC SwTextFormatColl* FindTextFormatCollByName( const UIName& rName ) const; /// @return "Auto-Collection" with given Id. If it does not exist create it. SW_DLLPUBLIC SwTextFormatColl* GetTextCollFromPool( sal_uInt16 nId ); @@ -569,7 +569,7 @@ public: bool SelectionHasNumber() const; bool SelectionHasBullet() const; - SW_DLLPUBLIC OUString GetUniqueNumRuleName() const; + SW_DLLPUBLIC UIName GetUniqueNumRuleName() const; void ChgNumRuleFormats( const SwNumRule& rRule ); /// Set (and query if) a numbering with StartFlag starts at current PointPos. @@ -579,7 +579,7 @@ public: sal_uInt16 GetNodeNumStart( SwPaM* pPaM ) const; - void ReplaceNumRule( const OUString& rOldRule, const OUString& rNewRule ); + void ReplaceNumRule( const UIName& rOldRule, const UIName& rNewRule ); /** Searches for a text node with a numbering rule. in case a list style is found, <sListId> holds the list id, to which the @@ -692,7 +692,7 @@ public: // #i73788# /// Remove default parameter, because method always called this default value. SW_DLLPUBLIC Graphic GetIMapGraphic() const; ///< @return a graphic for all Flys! - const SwFlyFrameFormat* FindFlyByName( const OUString& rName ) const; + const SwFlyFrameFormat* FindFlyByName( const UIName& rName ) const; /** @return a ClientObject, if CurrentCursor->Point() points to a SwOLENode (and mark is neither set not pointint to same ClientObject) @@ -700,13 +700,13 @@ public: SW_DLLPUBLIC svt::EmbeddedObjectRef& GetOLEObject() const; /// Is there an OLEObject with this name (SwFormat)? - bool HasOLEObj( std::u16string_view rName ) const; + bool HasOLEObj( const UIName& rName ) const; /// @return pointer to the data of the chart in which Cursr is. - void SetChartName( const OUString &rName ); + void SetChartName( const UIName &rName ); /// Update content of all charts for table with given name. - void UpdateCharts( const OUString& rName ); + void UpdateCharts( const UIName& rName ); OUString GetCurWord() const; @@ -754,7 +754,7 @@ public: sal_uInt16 nRows, sal_uInt16 nCols ); void UpdateTable(); - SW_DLLPUBLIC void SetTableName( SwFrameFormat& rTableFormat, const OUString &rNewName ); + SW_DLLPUBLIC void SetTableName( SwFrameFormat& rTableFormat, const UIName &rNewName ); SW_DLLPUBLIC SwFrameFormat *GetTableFormat(); SW_DLLPUBLIC bool TextToTable( const SwInsertTableOptions& rInsTableOpts, ///< All diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index f8694304f6c1..5f7253a6605d 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -147,7 +147,7 @@ class SwSetExpField; class SW_DLLPUBLIC SwSetExpFieldType final : public SwValueFieldType { - OUString m_sName; + UIName m_sName; OUString m_sDelim; sal_uInt16 m_nType; sal_uInt8 m_nLevel; @@ -156,10 +156,10 @@ class SW_DLLPUBLIC SwSetExpFieldType final : public SwValueFieldType virtual void SwClientNotify(const SwModify&, const SfxHint&) override; public: - SwSetExpFieldType( SwDoc* pDoc, OUString aName, + SwSetExpFieldType( SwDoc* pDoc, UIName aName, sal_uInt16 nType = nsSwGetSetExpType::GSE_EXPR ); virtual std::unique_ptr<SwFieldType> Copy() const override; - virtual OUString GetName() const override; + virtual UIName GetName() const override; inline void SetType(sal_uInt16 nTyp); inline sal_uInt16 GetType() const; @@ -171,7 +171,7 @@ public: void SetDeleted( bool b ) { m_bDeleted = b; } /// Overlay, because set-field takes care for its being updated by itself. - inline const OUString& GetSetRefName() const; + inline const UIName& GetSetRefName() const; void SetSeqRefNo( SwSetExpField& rField ); @@ -198,7 +198,7 @@ inline void SwSetExpFieldType::SetType( sal_uInt16 nTyp ) inline sal_uInt16 SwSetExpFieldType::GetType() const { return m_nType; } -inline const OUString& SwSetExpFieldType::GetSetRefName() const +inline const UIName& SwSetExpFieldType::GetSetRefName() const { return m_sName; } class SW_DLLPUBLIC SwSetExpField final : public SwFormulaField diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index 6b5dd4e47707..a907e64a859f 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -463,19 +463,19 @@ public: void SetCheckForOLEInCaption( bool bFlag ) { m_bCheckForOLEInCaption = bFlag; } /// Set name at selected FlyFrame. - SW_DLLPUBLIC void SetFlyName( const OUString& rName ); - OUString GetFlyName() const; + SW_DLLPUBLIC void SetFlyName( const UIName& rName ); + UIName GetFlyName() const; /// get reference to OLE object (if there is one) for selected FlyFrame css::uno::Reference < css::embed::XEmbeddedObject > GetOleRef() const; /// Created unique name for frame. - SW_DLLPUBLIC OUString GetUniqueGrfName() const; - SW_DLLPUBLIC OUString GetUniqueOLEName() const; - SW_DLLPUBLIC OUString GetUniqueFrameName() const; + SW_DLLPUBLIC UIName GetUniqueGrfName() const; + SW_DLLPUBLIC UIName GetUniqueOLEName() const; + SW_DLLPUBLIC UIName GetUniqueFrameName() const; /// Jump to named Fly (graphic/OLE). - bool GotoFly( const OUString& rName, FlyCntType eType, + bool GotoFly( const UIName& rName, FlyCntType eType, bool bSelFrame ); /// Position is a graphic with URL? @@ -614,7 +614,7 @@ public: SW_DLLPUBLIC size_t GetCurPageDesc( const bool bCalcFrame = true ) const; size_t GetMousePageDesc( const Point &rPt ) const; SW_DLLPUBLIC size_t GetPageDescCnt() const; - SW_DLLPUBLIC SwPageDesc* FindPageDescByName( const OUString& rName, + SW_DLLPUBLIC SwPageDesc* FindPageDescByName( const UIName& rName, bool bGetFromPool = false, size_t* pPos = nullptr ); @@ -713,7 +713,7 @@ public: cursor is not allowed in readonly. */ SW_DLLPUBLIC void UnProtectCells(); ///< Refers to table selection. void UnProtectTables(); ///< Unprotect all tables in selection. - bool HasTableAnyProtection( const OUString* pTableName, + bool HasTableAnyProtection( const UIName* pTableName, bool* pFullTableProtection ); bool CanUnProtectCells() const; @@ -734,7 +734,7 @@ public: bool IsAdjustCellWidthAllowed( bool bBalance = false ) const; /// Set table style of the current table. - void SetTableStyle(const OUString& rStyleName); + void SetTableStyle(const TableStyleName& rStyleName); SW_DLLPUBLIC bool SetTableStyle(const SwTableAutoFormat& rNew); SW_DLLPUBLIC bool ResetTableStyle(); @@ -742,7 +742,7 @@ public: /// @param pTableNode Table node to update. When nullptr, current cursor position is used. /// @param bResetDirect Reset direct formatting that might be applied to the cells. /// @param pStyleName new style to apply - bool UpdateTableStyleFormatting(SwTableNode *pTableNode = nullptr, bool bResetDirect = false, OUString const* pStyleName = nullptr); + bool UpdateTableStyleFormatting(SwTableNode *pTableNode = nullptr, bool bResetDirect = false, TableStyleName const* pStyleName = nullptr); SW_DLLPUBLIC bool GetTableAutoFormat( SwTableAutoFormat& rGet ); @@ -761,7 +761,7 @@ public: void InsertLabel( const SwLabelType eType, const OUString &rText, const OUString& rSeparator, const OUString& rNumberSeparator, const bool bBefore, const sal_uInt16 nId, - const OUString& rCharacterStyle, + const UIName& rCharacterStyle, const bool bCpyBrd ); /// The ruler needs some information too. @@ -783,10 +783,10 @@ public: SW_DLLPUBLIC void GetConnectableFrameFormats (SwFrameFormat & rFormat, std::u16string_view rReference, bool bSuccessors, - std::vector< OUString > & aPrevPageVec, - std::vector< OUString > & aThisPageVec, - std::vector< OUString > & aNextPageVec, - std::vector< OUString > & aRestVec); + std::vector< UIName > & aPrevPageVec, + std::vector< UIName > & aThisPageVec, + std::vector< UIName > & aNextPageVec, + std::vector< UIName > & aRestVec); /** SwFEShell::GetShapeBackground diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index 7518c47582f3..0d682139cf82 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -24,6 +24,7 @@ #include "swtypes.hxx" #include "calbck.hxx" #include "nodeoffset.hxx" +#include "names.hxx" #include <com/sun/star/beans/XPropertySet.hpp> #include <cppuhelper/weakref.hxx> @@ -268,7 +269,7 @@ public: static const OUString & GetTypeStr( SwFieldTypesEnum nTypeId ); /// Only in derived classes. - virtual OUString GetName() const; + virtual UIName GetName() const; virtual std::unique_ptr<SwFieldType> Copy() const = 0; virtual void QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) const; virtual void PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich ); diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx index 5c61255ee695..4a9e5ea739fa 100644 --- a/sw/inc/fmtcol.hxx +++ b/sw/inc/fmtcol.hxx @@ -38,7 +38,7 @@ namespace sw{ class DocumentStylePoolManager; } class SAL_DLLPUBLIC_RTTI SwFormatColl: public SwFormat { protected: - SwFormatColl( SwAttrPool& rPool, const OUString &rFormatName, + SwFormatColl( SwAttrPool& rPool, const UIName &rFormatName, const WhichRangesContainer& pWhichRanges, SwFormatColl* pDerFrom, sal_uInt16 nFormatWhich ) : SwFormat( rPool, rFormatName, pWhichRanges, pDerFrom, nFormatWhich ) @@ -70,7 +70,7 @@ class SW_DLLPUBLIC SwTextFormatColl SwCharFormat* mpLinkedCharFormat = nullptr; protected: - SwTextFormatColl( SwAttrPool& rPool, const OUString &rFormatCollName, + SwTextFormatColl( SwAttrPool& rPool, const UIName &rFormatCollName, SwTextFormatColl* pDerFrom = nullptr, sal_uInt16 nFormatWh = RES_TXTFMTCOLL ) : SwFormatColl(rPool, rFormatCollName, aTextFormatCollSetRange, pDerFrom, nFormatWh) @@ -155,7 +155,7 @@ class SwGrfFormatColl final : public SwFormatColl { friend class SwDoc; - SwGrfFormatColl( SwAttrPool& rPool, const OUString &rFormatCollName, + SwGrfFormatColl( SwAttrPool& rPool, const UIName &rFormatCollName, SwGrfFormatColl* pDerFrom = nullptr ) : SwFormatColl( rPool, rFormatCollName, aGrfFormatCollSetRange, pDerFrom, RES_GRFFMTCOLL ) @@ -217,7 +217,7 @@ class SW_DLLPUBLIC SwConditionTextFormatColl final : public SwTextFormatColl SwFormatCollConditions m_CondColls; - SwConditionTextFormatColl( SwAttrPool& rPool, const OUString &rFormatCollName, + SwConditionTextFormatColl( SwAttrPool& rPool, const UIName &rFormatCollName, SwTextFormatColl* pDerFrom ) : SwTextFormatColl( rPool, rFormatCollName, pDerFrom, RES_CONDTXTFMTCOLL ) {} diff --git a/sw/inc/fmtinfmt.hxx b/sw/inc/fmtinfmt.hxx index a77dcfb28be0..18af582f1ef7 100644 --- a/sw/inc/fmtinfmt.hxx +++ b/sw/inc/fmtinfmt.hxx @@ -23,6 +23,7 @@ #include "swdllapi.h" #include <memory> #include "calbck.hxx" +#include "names.hxx" class SvxMacro; class SvxMacroTableDtor; @@ -40,8 +41,8 @@ class SW_DLLPUBLIC SwFormatINetFormat final OUString msURL; ///< URL. OUString msTargetFrame; ///< Target frame for URL. - OUString msINetFormatName; - OUString msVisitedFormatName; + UIName msINetFormatName; + UIName msVisitedFormatName; OUString msHyperlinkName; ///< Name of the link. std::unique_ptr<SvxMacroTableDtor> mpMacroTable; SwTextINetFormat* mpTextAttr; ///< My TextAttribute. @@ -93,14 +94,14 @@ public: } void SetINetFormatAndId( - const OUString& rNm, + const UIName& rNm, const sal_uInt16 nId ) { msINetFormatName = rNm; mnINetFormatId = nId; } - const OUString& GetINetFormat() const + const UIName& GetINetFormat() const { return msINetFormatName; } @@ -111,14 +112,14 @@ public: } void SetVisitedFormatAndId( - const OUString& rNm, + const UIName& rNm, const sal_uInt16 nId ) { msVisitedFormatName = rNm; mnVisitedFormatId = nId; } - const OUString& GetVisitedFormat() const + const UIName& GetVisitedFormat() const { return msVisitedFormatName; } diff --git a/sw/inc/fmtruby.hxx b/sw/inc/fmtruby.hxx index 09ad479cc344..e1cf4ff0cd52 100644 --- a/sw/inc/fmtruby.hxx +++ b/sw/inc/fmtruby.hxx @@ -32,7 +32,7 @@ class SW_DLLPUBLIC SwFormatRuby final : public SfxPoolItem friend class SwTextRuby; OUString m_sRubyText; ///< The ruby text. - OUString m_sCharFormatName; ///< Name of the charformat. + UIName m_sCharFormatName; ///< Name of the charformat. SwTextRuby* m_pTextAttr; ///< The TextAttribute. sal_uInt16 m_nCharFormatId; ///< PoolId of the charformat. sal_uInt16 m_nPosition; ///< Position of the Ruby-character. @@ -64,8 +64,8 @@ public: const OUString& GetText() const { return m_sRubyText; } void SetText( const OUString& rText ) { m_sRubyText = rText; } - const OUString& GetCharFormatName() const { return m_sCharFormatName; } - void SetCharFormatName( const OUString& rNm ) { m_sCharFormatName = rNm; } + const UIName& GetCharFormatName() const { return m_sCharFormatName; } + void SetCharFormatName( const UIName& rNm ) { m_sCharFormatName = rNm; } sal_uInt16 GetCharFormatId() const { return m_nCharFormatId; } void SetCharFormatId( sal_uInt16 nNew ) { m_nCharFormatId = nNew; } diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx index 3f88d6ae2927..b30a7647d143 100644 --- a/sw/inc/format.hxx +++ b/sw/inc/format.hxx @@ -25,6 +25,7 @@ #include "calbck.hxx" #include "hintids.hxx" #include "swatrset.hxx" +#include "names.hxx" #include <memory> class IDocumentSettingAccess; @@ -47,7 +48,7 @@ class SW_DLLPUBLIC SwFormat : public sw::BorderCacheOwner, public sw::Broadcasti { friend class SwFrameFormat; - OUString m_aFormatName; + UIName m_aFormatName; SwAttrSet m_aSet; sal_uInt16 m_nWhichId; @@ -67,7 +68,7 @@ class SW_DLLPUBLIC SwFormat : public sw::BorderCacheOwner, public sw::Broadcasti virtual void InvalidateInSwFntCache() {}; protected: - SwFormat( SwAttrPool& rPool, const OUString& rFormatNm, + SwFormat( SwAttrPool& rPool, const UIName& rFormatNm, const WhichRangesContainer& pWhichRanges, SwFormat *pDrvdFrame, sal_uInt16 nFormatWhich ); SwFormat( const SwFormat& rFormat ); virtual void SwClientNotify(const SwModify&, const SfxHint&) override; @@ -128,9 +129,9 @@ public: SwFormat* DerivedFrom() const { return const_cast<SwFormat*>(static_cast<const SwFormat*>(GetRegisteredIn())); } bool IsDefault() const { return DerivedFrom() == nullptr; } - const OUString& GetName() const { return m_aFormatName; } + const UIName& GetName() const { return m_aFormatName; } bool HasName(std::u16string_view rName) const { return m_aFormatName == rName; } - virtual void SetFormatName( const OUString& rNewName, bool bBroadcast=false ); + virtual void SetFormatName( const UIName& rNewName, bool bBroadcast=false ); /// For querying the attribute array. const SwAttrSet& GetAttrSet() const { return m_aSet; } diff --git a/sw/inc/frameformats.hxx b/sw/inc/frameformats.hxx index ca0d5025fbe2..069613e2b954 100644 --- a/sw/inc/frameformats.hxx +++ b/sw/inc/frameformats.hxx @@ -49,7 +49,7 @@ template <class value_type> class FrameFormats final : public SwFormatsBase struct FrameFormatsKey : boost::multi_index::composite_key< value_type, - boost::multi_index::const_mem_fun<SwFormat, const OUString&, &SwFormat::GetName>, + boost::multi_index::const_mem_fun<SwFormat, const UIName&, &SwFormat::GetName>, boost::multi_index::const_mem_fun<SwFormat, sal_uInt16, &SwFormat::Which>, boost::multi_index::identity<value_type> // the actual object pointer > @@ -135,12 +135,12 @@ public: return m_vContainer.template project<ByPos>(it); }; - const_name_iterator findByTypeAndName(sal_uInt16 type, const OUString& name) const + const_name_iterator findByTypeAndName(sal_uInt16 type, const UIName& name) const { return GetByTypeAndName().find(std::make_tuple(name, type)); }; // search for formats by name - range_type findRangeByName(const OUString& rName) const + range_type findRangeByName(const UIName& rName) const { auto& idx = GetByTypeAndName(); auto it = idx.lower_bound(std::make_tuple(rName, sal_uInt16(0))); @@ -169,7 +169,7 @@ public: { return const_cast<value_type&>(operator[](idx)); }; - virtual void Rename(const SwFrameFormat& rFormat, const OUString& sNewName) override + virtual void Rename(const SwFrameFormat& rFormat, const UIName& sNewName) override { assert(dynamic_cast<value_type>(const_cast<SwFrameFormat*>(&rFormat))); iterator it = find(static_cast<value_type>(const_cast<SwFrameFormat*>(&rFormat))); @@ -224,7 +224,7 @@ public: }; // Override return type to reduce casting - value_type FindFrameFormatByName(const OUString& rName) const + value_type FindFrameFormatByName(const UIName& rName) const { auto& idx = GetByTypeAndName(); auto it = idx.lower_bound(std::make_tuple(rName, sal_uInt16(0))); diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx index d2a4ad6e6090..60bea698d7f4 100644 --- a/sw/inc/frmfmt.hxx +++ b/sw/inc/frmfmt.hxx @@ -91,15 +91,15 @@ class SW_DLLPUBLIC SwFrameFormat struct change_name { - change_name(const OUString &rName) : mName(rName) {} + change_name(const UIName &rName) : mName(rName) {} void operator()(SwFormat *pFormat) { pFormat->m_aFormatName = mName; } - const OUString &mName; + const UIName &mName; }; protected: SwFrameFormat( SwAttrPool& rPool, - const OUString &rFormatNm, + const UIName &rFormatNm, SwFrameFormat *pDrvdFrame, sal_uInt16 nFormatWhich = RES_FRMFMT, const WhichRangesContainer& pWhichRange = aFrameFormatSetRange); @@ -186,7 +186,7 @@ public: void dumpAsXml(xmlTextWriterPtr pWriter) const override; - virtual void SetFormatName( const OUString& rNewName, bool bBroadcast=false ) override; + virtual void SetFormatName( const UIName& rNewName, bool bBroadcast=false ) override; void MoveTableBox(SwTableBox& rTableBox, const SwFrameFormat* pOldFormat); virtual bool IsVisible() const; }; @@ -198,7 +198,7 @@ namespace sw friend ::SwFlyFrameFormat; SpzFrameFormat( SwAttrPool& rPool, - const OUString& rFormatName, + const UIName& rFormatName, SwFrameFormat* pDerivedFrame, sal_uInt16 nFormatWhich) : SwFrameFormat(rPool, rFormatName, pDerivedFrame, nFormatWhich) @@ -227,7 +227,7 @@ class SW_DLLPUBLIC SwFlyFrameFormat final : public sw::SpzFrameFormat SwFlyFrameFormat( const SwFlyFrameFormat &rCpy ) = delete; SwFlyFrameFormat &operator=( const SwFlyFrameFormat &rCpy ) = delete; - SwFlyFrameFormat( SwAttrPool& rPool, const OUString &rFormatNm, SwFrameFormat *pDrvdFrame ); + SwFlyFrameFormat( SwAttrPool& rPool, const UIName &rFormatNm, SwFrameFormat *pDrvdFrame ); public: virtual ~SwFlyFrameFormat() override; @@ -416,7 +416,7 @@ class SW_DLLPUBLIC SwDrawFrameFormat final : public sw::SpzFrameFormat bool mbPosAttrSet; - SwDrawFrameFormat(SwAttrPool& rPool, const OUString& rFormatName, SwFrameFormat* pDerivedFrame) + SwDrawFrameFormat(SwAttrPool& rPool, const UIName& rFormatName, SwFrameFormat* pDerivedFrame) : sw::SpzFrameFormat(rPool, rFormatName, pDerivedFrame, RES_DRAWFRMFMT), m_pSdrObjectCached(nullptr), meLayoutDir(SwFrameFormat::HORI_L2R), diff --git a/sw/inc/hints.hxx b/sw/inc/hints.hxx index 645cf6b0c8d3..9f73d0c48b18 100644 --- a/sw/inc/hints.hxx +++ b/sw/inc/hints.hxx @@ -21,6 +21,7 @@ #include "swatrset.hxx" #include "swtypes.hxx" +#include "names.hxx" #include <utility> #include <vcl/vclptr.hxx> @@ -237,9 +238,9 @@ public: class NameChanged final : public SfxHint { public: - const OUString m_sOld; - const OUString m_sNew; - NameChanged(const OUString& rOld, const OUString& rNew) : SfxHint(SfxHintId::SwNameChanged), m_sOld(rOld), m_sNew(rNew) {}; + const UIName m_sOld; + const UIName m_sNew; + NameChanged(const UIName& rOld, const UIName& rNew) : SfxHint(SfxHintId::SwNameChanged), m_sOld(rOld), m_sNew(rNew) {}; }; class TitleChanged final : public SfxHint { @@ -379,7 +380,7 @@ public: const SwTable* m_pTable; ///< Pointer to the current table union { const SwTable* pDelTable; ///< Merge: Pointer to the table to be removed - const OUString* pNewTableNm; ///< Split: the name of the new table + const UIName* pNewTableNm; ///< Split: the name of the new table } m_aData; sal_uInt16 m_nSplitLine; ///< Split: from this BaseLine on will be split TableFormulaUpdateFlags m_eFlags; diff --git a/sw/inc/list.hxx b/sw/inc/list.hxx index 8055eb065dce..046c05fae9ad 100644 --- a/sw/inc/list.hxx +++ b/sw/inc/list.hxx @@ -46,9 +46,9 @@ class SwList const OUString & GetListId() const { return msListId; } - const OUString & GetDefaultListStyleName() const { return msDefaultListStyleName; } + const UIName & GetDefaultListStyleName() const { return msDefaultListStyleName; } - void SetDefaultListStyleName(OUString const&); + void SetDefaultListStyleName(UIName const&); void InsertListItem(SwNodeNum& rNodeNum, SwListRedlineType eRedlines, @@ -75,7 +75,7 @@ class SwList // unique identifier of the list const OUString msListId; // default list style for the list items, identified by the list style name - OUString msDefaultListStyleName; + UIName msDefaultListStyleName; // list trees for certain document ranges struct tListTreeForRange diff --git a/sw/inc/names.hxx b/sw/inc/names.hxx index 088c2ffcfd9c..37559fd86510 100644 --- a/sw/inc/names.hxx +++ b/sw/inc/names.hxx @@ -12,6 +12,34 @@ #include <functional> /// Thin wrapper around OUString to make visible in code when we are dealing with a UIName vs a Programmatic Name +class UIName +{ +public: + UIName() {} + constexpr explicit UIName(const OUString& s) + : m_s(s) + { + } + const OUString& toString() const { return m_s; } + bool isEmpty() const { return m_s.isEmpty(); } + bool operator==(const UIName& s) const { return m_s == s.m_s; } + bool operator==(const OUString& s) const { return m_s == s; } + bool operator==(std::u16string_view s) const { return m_s == s; } + bool operator<(const UIName& s) const { return m_s < s.m_s; } + bool operator>(const UIName& s) const { return m_s > s.m_s; } + +private: + OUString m_s; +}; + +namespace std +{ +template <> struct hash<UIName> +{ + std::size_t operator()(UIName const& s) const { return std::hash<OUString>()(s.toString()); } +}; +} + class ProgName { public: @@ -63,4 +91,26 @@ template <> struct hash<ReferenceMarkerName> }; } +// SwTableAutoFormat names are their special little snowflake. Mostly they are UINames, but sometimes they +// are programmatic names, so I isolated them into their own world. +class TableStyleName +{ +public: + TableStyleName() {} + constexpr explicit TableStyleName(const OUString& s) + : m_s(s) + { + } + const OUString& toString() const { return m_s; } + bool isEmpty() const { return m_s.isEmpty(); } + bool operator==(const TableStyleName& s) const = default; + bool operator==(const OUString& s) const { return m_s == s; } + bool operator==(std::u16string_view s) const { return m_s == s; } + bool operator<(const TableStyleName& s) const { return m_s < s.m_s; } + bool operator>(const TableStyleName& s) const { return m_s > s.m_s; } + +private: + OUString m_s; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx index 1354ebe30760..edf6887a7f24 100644 --- a/sw/inc/ndole.hxx +++ b/sw/inc/ndole.hxx @@ -93,7 +93,7 @@ class SW_DLLPUBLIC SwOLENode final: public SwNoTextNode { friend class SwNodes; mutable SwOLEObj maOLEObj; - OUString msChartTableName; ///< with chart objects: name of referenced table. + UIName msChartTableName; ///< with chart objects: name of referenced table. bool mbOLESizeInvalid; /**< Should be considered at SwDoc::PrtOLENotify (e.g. copied). Is not persistent. */ @@ -156,8 +156,8 @@ public: // #i99665# bool IsChart() const; - const OUString& GetChartTableName() const { return msChartTableName; } - void SetChartTableName( const OUString& rNm ) { msChartTableName = rNm; } + const UIName& GetChartTableName() const { return msChartTableName; } + void SetChartTableName( const UIName& rNm ) { msChartTableName = rNm; } // react on visual change (invalidate) diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx index b9a30ec55546..9363d769f986 100644 --- a/sw/inc/numrule.hxx +++ b/sw/inc/numrule.hxx @@ -75,6 +75,7 @@ public: void SetCharFormat( SwCharFormat* ); using SvxNumberFormat::SetCharFormatName; + // this should return UIName but cannot because we are overriding code from include/editeng virtual OUString GetCharFormatName() const override; //For i120928,access the cp info of graphic within bullet @@ -121,9 +122,9 @@ private: tParagraphStyleList maParagraphStyleList; /** unordered_map containing "name->rule" relation */ - std::unordered_map<OUString, SwNumRule *> * mpNumRuleMap; + std::unordered_map<UIName, SwNumRule *> * mpNumRuleMap; - OUString msName; + UIName msName; SwNumRuleType meRuleType; sal_uInt16 mnPoolFormatId; ///< Id-for NumRules created "automatically" sal_uInt16 mnPoolHelpId; ///< HelpId for this Pool-style. @@ -142,7 +143,7 @@ private: public: /// add parameter <eDefaultNumberFormatPositionAndSpaceMode> - SW_DLLPUBLIC SwNumRule( OUString aNm, + SW_DLLPUBLIC SwNumRule( UIName aNm, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode, SwNumRuleType = NUM_RULE ); @@ -153,7 +154,7 @@ public: SW_DLLPUBLIC bool operator==( const SwNumRule& ) const; bool operator!=( const SwNumRule& r ) const { return !(*this == r); } - void Reset( const OUString& rName ); + void Reset( const UIName& rName ); SW_DLLPUBLIC const SwNumFormat* GetNumFormat( sal_uInt16 i ) const; SW_DLLPUBLIC const SwNumFormat& Get( sal_uInt16 i ) const; @@ -203,9 +204,9 @@ public: @param pNumRuleMap map to register in */ void SetNumRuleMap( - std::unordered_map<OUString, SwNumRule *>* pNumRuleMap ); + std::unordered_map<UIName, SwNumRule *>* pNumRuleMap ); - static OUString GetOutlineRuleName(); + static UIName GetOutlineRuleName(); static sal_uInt16 GetNumIndent( sal_uInt8 nLvl ); static sal_uInt16 GetBullIndent( sal_uInt8 nLvl ); @@ -223,9 +224,9 @@ public: and copies them if appropriate. */ void CheckCharFormats( SwDoc& rDoc ); - const OUString& GetName() const { return msName; } + const UIName& GetName() const { return msName; } - void SetName( const OUString& rNm, + void SetName( const UIName& rNm, IDocumentListsAccess& rDocListAccess ); bool IsAutoRule() const { return mbAutoRuleFlag; } diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index f18ae6375ece..f390fc0e9c99 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -142,7 +142,7 @@ class SW_DLLPUBLIC SwPageDesc final friend class SwDoc; friend class SwPageDescs; - OUString m_StyleName; + UIName m_StyleName; SvxNumberType m_NumType; SwFrameFormat m_Master; SwFrameFormat m_Left; @@ -182,21 +182,21 @@ class SW_DLLPUBLIC SwPageDesc final SAL_DLLPRIVATE void ResetAllAttr(); - SAL_DLLPRIVATE SwPageDesc(const OUString&, SwFrameFormat*, SwDoc *pDc ); + SAL_DLLPRIVATE SwPageDesc(const UIName&, SwFrameFormat*, SwDoc *pDc ); struct change_name { - change_name(const OUString &rName) : mName(rName) {} + change_name(const UIName &rName) : mName(rName) {} void operator()(SwPageDesc *pPageDesc) { pPageDesc->m_StyleName = mName; } - const OUString &mName; + const UIName &mName; }; virtual void SwClientNotify(const SwModify&, const SfxHint&) override; public: bool IsUsed() const; - const OUString& GetName() const { return m_StyleName; } - bool SetName(const OUString& rNewName); + const UIName& GetName() const { return m_StyleName; } + bool SetName(const UIName& rNewName); bool GetLandscape() const { return m_IsLandscape; } void SetLandscape( bool bNew ) { m_IsLandscape = bNew; } @@ -291,7 +291,7 @@ public: /// Given a SwNode return the pagedesc in use at that location. static const SwPageDesc* GetPageDescOfNode(const SwNode& rNd); - static SwPageDesc* GetByName(SwDoc& rDoc, std::u16string_view rName); + static SwPageDesc* GetByName(SwDoc& rDoc, const UIName& rName); SwPageDesc& operator=( const SwPageDesc& ); @@ -304,9 +304,9 @@ public: namespace std { template<> struct less<SwPageDesc*> { - bool operator()(const SwPageDesc *pPageDesc, std::u16string_view rName) const + bool operator()(const SwPageDesc *pPageDesc, const UIName& rName) const { return pPageDesc->GetName() < rName; } - bool operator()(std::u16string_view rName, const SwPageDesc *pPageDesc) const + bool operator()(const UIName& rName, const SwPageDesc *pPageDesc) const { return rName < pPageDesc->GetName(); } bool operator()(const SwPageDesc *lhs, const SwPageDesc *rhs) const { return lhs->GetName() < rhs->GetName(); } @@ -381,7 +381,7 @@ public: SwPageDesc m_PageDesc; private: SwDoc * m_pDoc; - OUString m_sFollow; + UIName m_sFollow; void SetPageDesc(const SwPageDesc & rPageDesc); @@ -393,7 +393,7 @@ public: SwPageDescExt & operator = (const SwPageDescExt & rSrc); SwPageDescExt & operator = (const SwPageDesc & rSrc); - OUString const & GetName() const; + UIName const & GetName() const; explicit operator SwPageDesc() const; // #i7983# }; @@ -421,13 +421,13 @@ typedef boost::multi_index_container< class SwPageDescs final { // function updating ByName index via modify - friend bool SwPageDesc::SetName( const OUString& rNewName ); + friend bool SwPageDesc::SetName( const UIName& rNewName ); typedef SwPageDescsBase::nth_index<0>::type ByPos; typedef SwPageDescsBase::nth_index<1>::type ByName; typedef ByPos::iterator iterator; - iterator find_( const OUString &name ) const; + iterator find_( const UIName &name ) const; SwPageDescsBase m_Array; ByPos &m_PosIndex; @@ -452,7 +452,7 @@ public: void erase( size_type index ); void erase( const_iterator const& position ); - const_iterator find( const OUString &name ) const + const_iterator find( const UIName &name ) const { return find_( name ); } const value_type& operator[]( size_t index_ ) const { return m_PosIndex.operator[]( index_ ); } diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx index a4eca3d6c1c2..43f59172aee5 100644 --- a/sw/inc/paratr.hxx +++ b/sw/inc/paratr.hxx @@ -158,8 +158,8 @@ public: SwNumRuleItem() : SfxStringItem( RES_PARATR_NUMRULE, OUString() ) {} - SwNumRuleItem( const OUString& rRuleName ) - : SfxStringItem( RES_PARATR_NUMRULE, rRuleName ) {} + SwNumRuleItem( const UIName& rRuleName ) + : SfxStringItem( RES_PARATR_NUMRULE, rRuleName.toString() ) {} SwNumRuleItem(SwNumRuleItem const &) = default; // SfxPoolItem copy function dichotomy @@ -177,6 +177,7 @@ public: virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + UIName GetValue() const { return UIName(SfxStringItem::GetValue()); } void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index 6a88a0a3ccd1..71ebcebbe37c 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -51,19 +51,19 @@ public: class SW_DLLPUBLIC SwRedlineExtraData_FormatColl final : public SwRedlineExtraData { - OUString m_sFormatNm; + UIName m_sFormatNm; std::unique_ptr<SfxItemSet> m_pSet; sal_uInt16 m_nPoolId; bool m_bFormatAll; // don't strip the last paragraph mark public: - SwRedlineExtraData_FormatColl( OUString aColl, sal_uInt16 nPoolFormatId, + SwRedlineExtraData_FormatColl( UIName aColl, sal_uInt16 nPoolFormatId, const SfxItemSet* pSet = nullptr, bool bFormatAll = true ); virtual ~SwRedlineExtraData_FormatColl() override; virtual SwRedlineExtraData* CreateNew() const override; virtual void Reject( SwPaM& rPam ) const override; virtual bool operator == ( const SwRedlineExtraData& ) const override; - const OUString& GetFormatName() const { return m_sFormatNm; } + const UIName& GetFormatName() const { return m_sFormatNm; } void SetItemSet( const SfxItemSet& rSet ); SfxItemSet* GetItemSet( ) const { return m_pSet.get(); } void SetFormatAll( bool bAll ) { m_bFormatAll = bAll; } diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index b2f5fb53a54a..e7f98c2408f7 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -62,7 +62,7 @@ class SW_DLLPUBLIC SwSectionData private: SectionType m_eType; - OUString m_sSectionName; + UIName m_sSectionName; OUString m_sCondition; ///< Hide condition OUString m_sLinkFileName; OUString m_sLinkFilePassword; // Must be changed to Sequence. @@ -85,14 +85,14 @@ private: public: - SwSectionData(SectionType const eType, OUString aName); + SwSectionData(SectionType const eType, UIName aName); explicit SwSectionData(SwSection const&); SwSectionData(SwSectionData const&); SwSectionData & operator=(SwSectionData const&); bool operator==(SwSectionData const&) const; - const OUString& GetSectionName() const { return m_sSectionName; } - void SetSectionName(OUString const& rName){ m_sSectionName = rName; } + const UIName& GetSectionName() const { return m_sSectionName; } + void SetSectionName(UIName const& rName){ m_sSectionName = rName; } SectionType GetType() const { return m_eType; } void SetType(SectionType const eNew) { m_eType = eNew; } @@ -164,7 +164,7 @@ protected: public: - SwSection(SectionType const eType, OUString const& rName, + SwSection(SectionType const eType, UIName const& rName, SwSectionFormat & rFormat); virtual ~SwSection() override; @@ -172,8 +172,8 @@ public: void SetSectionData(SwSectionData const& rData); - const OUString& GetSectionName() const { return m_Data.GetSectionName(); } - void SetSectionName(OUString const& rName){ m_Data.SetSectionName(rName); } + const UIName& GetSectionName() const { return m_Data.GetSectionName(); } + void SetSectionName(UIName const& rName){ m_Data.SetSectionName(rName); } SectionType GetType() const { return m_Data.GetType(); } void SetType(SectionType const eType) { return m_Data.SetType(eType); } diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index 0526eb04d892..85235f32be04 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -176,7 +176,7 @@ public: bool Right( sal_uInt16 nCnt ) { return LeftRight(false, nCnt, SwCursorSkipMode::Chars, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr, false); } bool GoNextCell( sal_uInt16 nCnt = 1 ) { return GoPrevNextCell( true, nCnt ); } bool GoPrevCell( sal_uInt16 nCnt = 1 ) { return GoPrevNextCell( false, nCnt ); } - virtual bool GotoTable( const OUString& rName ); + virtual bool GotoTable( const UIName& rName ); bool GotoTableBox( const OUString& rName ); bool GotoRegion( std::u16string_view rName ); SW_DLLPUBLIC bool GotoFootnoteAnchor(); @@ -277,7 +277,7 @@ public: virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, SwRootFrame const*, bool) override; - virtual bool GotoTable( const OUString& rName ) override; + virtual bool GotoTable( const UIName& rName ) override; void InsertBox( const SwTableBox& rTableBox ); void DeleteBox(size_t nPos); diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 7ad75e262c0a..6eace044635a 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -133,7 +133,7 @@ protected: sal_uInt16 m_nRowsToRepeat; // Number of rows to repeat on every page. /// Name of the table style to be applied on this table. - OUString maTableStyleName; + TableStyleName maTableStyleName; bool m_bModifyLocked :1; bool m_bNewModel :1; // false: old SubTableModel; true: new RowSpanModel @@ -193,10 +193,10 @@ public: bool IsNewModel() const { return m_bNewModel; } /// Return the table style name of this table. - const OUString& GetTableStyleName() const { return maTableStyleName; } + const TableStyleName& GetTableStyleName() const { return maTableStyleName; } /// Set the new table style name for this table. - void SetTableStyleName(const OUString& rName) { maTableStyleName = rName; } + void SetTableStyleName(const TableStyleName& rName) { maTableStyleName = rName; } sal_uInt16 GetRowsToRepeat() const { return std::min( o3tl::narrowing<sal_uInt16>(GetTabLines().size()), m_nRowsToRepeat ); } void SetRowsToRepeat( sal_uInt16 nNumOfRows ) { m_nRowsToRepeat = nNumOfRows; } @@ -284,7 +284,7 @@ public: const bool bPerformValidCheck = false ) const; // Copy selected boxes to another document. bool MakeCopy( SwDoc&, const SwPosition&, const SwSelBoxes&, - bool bCpyName = false, const OUString& rStyleName = u""_ustr ) const; + bool bCpyName = false, const TableStyleName& rStyleName = TableStyleName() ) const; // Copy table in this bool InsTable( const SwTable& rCpyTable, const SwNodeIndex&, SwUndoTableCpyTable* pUndo ); @@ -366,7 +366,7 @@ public: void SwitchFormulasToInternalRepresentation() { UpdateFields(TBL_BOXPTR); } void Merge(const SwTable& rTable, SwHistory* pHistory); - void Split(const OUString& sNewTableName, sal_uInt16 nSplitLine, SwHistory* pHistory); + void Split(const UIName& sNewTableName, sal_uInt16 nSplitLine, SwHistory* pHistory); static void GatherFormulas(SwDoc& rDoc, std::vector<SwTableBoxFormula*>& rvFormulas); diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx index 28e15e26e060..a567f4675cc5 100644 --- a/sw/inc/swtblfmt.hxx +++ b/sw/inc/swtblfmt.hxx @@ -28,7 +28,7 @@ class SW_DLLPUBLIC SwTableFormat final : public SwFrameFormat { friend class SwDoc; - SwTableFormat( SwAttrPool& rPool, const OUString &rFormatNm, + SwTableFormat( SwAttrPool& rPool, const UIName &rFormatNm, SwFrameFormat *pDrvdFrame ) : SwFrameFormat( rPool, rFormatNm, pDrvdFrame, RES_FRMFMT, aTableSetRange ) {} @@ -42,7 +42,7 @@ class SAL_DLLPUBLIC_RTTI SwTableLineFormat final : public SwFrameFormat friend class SwDoc; SwTableLineFormat( SwAttrPool& rPool, SwFrameFormat *pDrvdFrame ) - : SwFrameFormat( rPool, OUString(), pDrvdFrame, RES_FRMFMT, aTableLineSetRange ) + : SwFrameFormat( rPool, UIName(), pDrvdFrame, RES_FRMFMT, aTableLineSetRange ) {} public: @@ -54,7 +54,7 @@ class SAL_DLLPUBLIC_RTTI SwTableBoxFormat final: public SwFrameFormat friend class SwDoc; SwTableBoxFormat(SwAttrPool& rPool, SwFrameFormat* pDrvdFrame) - : SwFrameFormat(rPool, OUString(), pDrvdFrame, RES_FRMFMT, aTableBoxSetRange) + : SwFrameFormat(rPool, UIName(), pDrvdFrame, RES_FRMFMT, aTableBoxSetRange) {} // For recognition of changes (especially TableBoxAttribute). diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx index d0a147af7885..3b9cbbb32ac9 100644 --- a/sw/inc/tblafmt.hxx +++ b/sw/inc/tblafmt.hxx @@ -159,7 +159,7 @@ class SW_DLLPUBLIC SwTableAutoFormat unotools::WeakReference<SwXTextTableStyle> m_xUnoTextTableStyle; - OUString m_aName; + TableStyleName m_aName; // note that this could be a ProgName __or__ a UIName sal_uInt16 m_nStrResId; // Common flags of Calc and Writer. @@ -185,7 +185,7 @@ class SW_DLLPUBLIC SwTableAutoFormat bool m_bHidden; bool m_bUserDefined; public: - SwTableAutoFormat( OUString aName ); + SwTableAutoFormat( const TableStyleName& aName ); SwTableAutoFormat( const SwTableAutoFormat& rNew ); ~SwTableAutoFormat(); @@ -202,8 +202,8 @@ public: SwBoxAutoFormat& GetBoxFormat( sal_uInt8 nPos ); static const SwBoxAutoFormat& GetDefaultBoxFormat(); - void SetName( const OUString& rNew ) { m_aName = rNew; m_nStrResId = USHRT_MAX; } - const OUString& GetName() const { return m_aName; } + void SetName( const TableStyleName& rNew ) { m_aName = rNew; m_nStrResId = USHRT_MAX; } + const TableStyleName& GetName() const { return m_aName; } void UpdateFromSet( sal_uInt8 nPos, const SfxItemSet& rSet, SwTableAutoFormatUpdateFlags eFlags, SvNumberFormatter const * ); @@ -285,13 +285,13 @@ public: void InsertAutoFormat(size_t i, std::unique_ptr<SwTableAutoFormat> pFormat); void EraseAutoFormat(size_t i); - void EraseAutoFormat(const OUString& rName); + void EraseAutoFormat(const TableStyleName& rName); std::unique_ptr<SwTableAutoFormat> ReleaseAutoFormat(size_t i); /// Removes an autoformat. Returns pointer to the removed autoformat or nullptr. - std::unique_ptr<SwTableAutoFormat> ReleaseAutoFormat(const OUString& rName); + std::unique_ptr<SwTableAutoFormat> ReleaseAutoFormat(const TableStyleName& rName); /// Find table style with the provided name, return nullptr when not found. - SwTableAutoFormat* FindAutoFormat(std::u16string_view rName) const; + SwTableAutoFormat* FindAutoFormat(const TableStyleName& rName) const; void Load(); bool Save() const; @@ -299,17 +299,17 @@ public: class SwCellStyleDescriptor { - const std::pair<OUString, std::unique_ptr<SwBoxAutoFormat>>& m_rCellStyleDesc; + const std::pair<UIName, std::unique_ptr<SwBoxAutoFormat>>& m_rCellStyleDesc; public: - SwCellStyleDescriptor(const std::pair<OUString, std::unique_ptr<SwBoxAutoFormat>>& rCellStyleDesc) : m_rCellStyleDesc(rCellStyleDesc) { } + SwCellStyleDescriptor(const std::pair<UIName, std::unique_ptr<SwBoxAutoFormat>>& rCellStyleDesc) : m_rCellStyleDesc(rCellStyleDesc) { } - const OUString& GetName() const { return m_rCellStyleDesc.first; } + const UIName& GetName() const { return m_rCellStyleDesc.first; } const SwBoxAutoFormat& GetAutoFormat() const { return *m_rCellStyleDesc.second; } }; class SwCellStyleTable { - std::vector<std::pair<OUString, std::unique_ptr<SwBoxAutoFormat>>> m_aCellStyles; + std::vector<std::pair<UIName, std::unique_ptr<SwBoxAutoFormat>>> m_aCellStyles; public: SwCellStyleTable(); ~SwCellStyleTable(); @@ -319,13 +319,13 @@ public: void clear(); /// Add a copy of rBoxFormat - void AddBoxFormat(const SwBoxAutoFormat& rBoxFormat, const OUString& sName); + void AddBoxFormat(const SwBoxAutoFormat& rBoxFormat, const UIName& sName); void RemoveBoxFormat(const OUString& sName); - void ChangeBoxFormatName(std::u16string_view sFromName, const OUString& sToName); - /// If found returns its name. If not found returns an empty OUString - const OUString & GetBoxFormatName(const SwBoxAutoFormat& rBoxFormat) const; + void ChangeBoxFormatName(std::u16string_view sFromName, const UIName& sToName); + /// If found returns its name. If not found returns an empty UIName + UIName GetBoxFormatName(const SwBoxAutoFormat& rBoxFormat) const; /// If found returns a ptr to a BoxFormat. If not found returns nullptr - SwBoxAutoFormat* GetBoxFormat(std::u16string_view sName) const; + SwBoxAutoFormat* GetBoxFormat(const UIName& sName) const; }; #endif diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index 6ce0514f8351..44b28bf7c766 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -244,7 +244,7 @@ enum FormTokenType struct SW_DLLPUBLIC SwFormToken { OUString sText; - OUString sCharStyleName; + UIName sCharStyleName; SwTwips nTabStopPosition; FormTokenType eTokenType; sal_uInt16 nPoolId; @@ -314,7 +314,7 @@ public: class SW_DLLPUBLIC SwForm { SwFormTokens m_aPattern[ AUTH_TYPE_END + 1 ]; // #i21237# - OUString m_aTemplate[ AUTH_TYPE_END + 1 ]; + UIName m_aTemplate[ AUTH_TYPE_END + 1 ]; TOXTypes m_eType; sal_uInt16 m_nFormMaxLevel; @@ -328,8 +328,8 @@ public: SwForm& operator=( const SwForm& rForm ); - inline void SetTemplate(sal_uInt16 nLevel, const OUString& rName); - inline OUString const & GetTemplate(sal_uInt16 nLevel) const; + inline void SetTemplate(sal_uInt16 nLevel, const UIName& rName); + inline UIName const & GetTemplate(sal_uInt16 nLevel) const; // #i21237# void SetPattern(sal_uInt16 nLevel, SwFormTokens&& rName); @@ -426,14 +426,14 @@ namespace o3tl { class SW_DLLPUBLIC SwTOXBase : public SwClient { SwForm m_aForm; // description of the lines - OUString m_aName; // unique name + UIName m_aName; // unique name OUString m_aTitle; // title OUString m_aBookmarkName; //Bookmark Name - OUString m_sMainEntryCharStyle; // name of the character style applied to main index entries + UIName m_sMainEntryCharStyle; // name of the character style applied to main index entries - OUString m_aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER - OUString m_sSequenceName; // FieldTypeName of a caption sequence + UIName m_aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER + UIName m_sSequenceName; // FieldTypeName of a caption sequence LanguageType m_eLanguage; OUString m_sSortAlgorithm; @@ -479,8 +479,8 @@ public: SwTOXElement GetCreateType() const; // creation types - const OUString& GetTOXName() const {return m_aName;} - void SetTOXName(const OUString& rSet) {m_aName = rSet;} + const UIName& GetTOXName() const {return m_aName;} + void SetTOXName(const UIName& rSet) {m_aName = rSet;} // for record the TOC field expression of MS Word binary format const OUString& GetMSTOCExpression() const{return maMSTOCExpression;} @@ -500,8 +500,8 @@ public: TOXTypes GetType() const; - const OUString& GetMainEntryCharStyle() const {return m_sMainEntryCharStyle;} - void SetMainEntryCharStyle(const OUString& rSet) {m_sMainEntryCharStyle = rSet;} + const UIName& GetMainEntryCharStyle() const {return m_sMainEntryCharStyle;} + void SetMainEntryCharStyle(const UIName& rSet) {m_sMainEntryCharStyle = rSet;} // content index only inline void SetLevel(sal_uInt16); // consider outline level @@ -517,12 +517,12 @@ public: // index of objects - OUString const & GetStyleNames(sal_uInt16 nLevel) const + UIName const & GetStyleNames(sal_uInt16 nLevel) const { SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?"); return m_aStyleNames[nLevel]; } - void SetStyleNames(const OUString& rSet, sal_uInt16 nLevel) + void SetStyleNames(const UIName& rSet, sal_uInt16 nLevel) { SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?"); m_aStyleNames[nLevel] = rSet; @@ -539,8 +539,8 @@ public: bool IsProtected() const { return m_bProtected; } void SetProtected(bool bSet) { m_bProtected = bSet; } - const OUString& GetSequenceName() const {return m_sSequenceName;} - void SetSequenceName(const OUString& rSet) {m_sSequenceName = rSet;} + const UIName& GetSequenceName() const {return m_sSequenceName;} + void SetSequenceName(const UIName& rSet) {m_sSequenceName = rSet;} SwCaptionDisplay GetCaptionDisplay() const { return m_eCaptionDisplay;} void SetCaptionDisplay(SwCaptionDisplay eSet) {m_eCaptionDisplay = eSet;} @@ -664,13 +664,13 @@ inline OUString const & SwTOXMark::GetSecondaryKeyReading() const //SwForm -inline void SwForm::SetTemplate(sal_uInt16 nLevel, const OUString& rTemplate) +inline void SwForm::SetTemplate(sal_uInt16 nLevel, const UIName& rTemplate) { SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()"); m_aTemplate[nLevel] = rTemplate; } -inline OUString const & SwForm::GetTemplate(sal_uInt16 nLevel) const +inline UIName const & SwForm::GetTemplate(sal_uInt16 nLevel) const { SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()"); return m_aTemplate[nLevel]; diff --git a/sw/inc/unocrsrhelper.hxx b/sw/inc/unocrsrhelper.hxx index 5ec7d6636536..270b2a69d6dd 100644 --- a/sw/inc/unocrsrhelper.hxx +++ b/sw/inc/unocrsrhelper.hxx @@ -234,8 +234,8 @@ namespace SwUnoCursorHelper SW_DLLPUBLIC void GetSelectableFromAny( css::uno::Reference<css::uno::XInterface> const& xIfc, SwDoc & rTargetDoc, - std::optional<SwPaM>& o_rpPaM, std::pair<OUString, FlyCntType> & o_rFrame, - OUString & o_rTableName, SwUnoTableCursor const*& o_rpTableCursor, + std::optional<SwPaM>& o_rpPaM, std::pair<UIName, FlyCntType> & o_rFrame, + UIName & o_rTableName, SwUnoTableCursor const*& o_rpTableCursor, ::sw::mark::MarkBase const*& o_rpMark, std::vector<SdrObject *> & o_rSdrObjects); diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index 535e0fedc631..3da0a1f6387d 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -74,7 +74,7 @@ private: // Descriptor-interface std::unique_ptr<BaseFrameProperties_Impl> m_pProps; bool m_bIsDescriptor; - OUString m_sName; + UIName m_sName; sal_Int64 m_nDrawAspect; sal_Int64 m_nVisibleAreaWidth; diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx index 1f25fb666282..025d52e0556b 100644 --- a/sw/inc/unosett.hxx +++ b/sw/inc/unosett.hxx @@ -31,6 +31,7 @@ #include <com/sun/star/container/XNamed.hpp> #include <cppuhelper/implbase.hxx> #include "unobaseclass.hxx" +#include "names.hxx" class SwDoc; class SwFormatCol; @@ -38,7 +39,6 @@ class SwDocShell; class SwNumRule; class SwNumFormat; class SfxItemPropertySet; -class ProgName; namespace com::sun::star::beans { struct PropertyValue; } class SwXFootnoteProperties final : public cppu::WeakImplHelper @@ -143,9 +143,9 @@ private: class Impl; ::sw::UnoImplPtr<Impl> m_pImpl; - OUString m_sNewCharStyleNames[MAXLEVEL]; - OUString m_sNewBulletFontNames[MAXLEVEL]; - OUString m_sCreatedNumRuleName; //connects to a numbering in SwDoc + UIName m_sNewCharStyleNames[MAXLEVEL]; + UIName m_sNewBulletFontNames[MAXLEVEL]; + UIName m_sCreatedNumRuleName; //connects to a numbering in SwDoc SwDoc* m_pDoc; // Only if *not* used as chapter numbering. SwDocShell* m_pDocShell; // Only if used as chapter numbering. SwNumRule* m_pNumRule; @@ -195,24 +195,24 @@ public: void SetNumberingRuleByIndex(SwNumRule& rNumRule, const css::uno::Sequence< css::beans::PropertyValue>& rProperties, sal_Int32 nIndex); - const OUString* GetNewCharStyleNames() const {return m_sNewCharStyleNames;} - const OUString* GetBulletFontNames() const {return m_sNewBulletFontNames;} + const UIName* GetNewCharStyleNames() const {return m_sNewCharStyleNames;} + const UIName* GetBulletFontNames() const {return m_sNewBulletFontNames;} const SwNumRule* GetNumRule() const {return m_pNumRule;} - static bool isInvalidStyle(std::u16string_view rName); + static bool isInvalidStyle(const UIName& rName); void Invalidate() {m_pDocShell = nullptr;} - const OUString& GetCreatedNumRuleName() const {return m_sCreatedNumRuleName;} + const UIName& GetCreatedNumRuleName() const {return m_sCreatedNumRuleName;} SW_DLLPUBLIC css::uno::Any getPropertyByIndex(sal_Int32 nIndex, const OUString& rPropName); static css::uno::Sequence<css::beans::PropertyValue> GetPropertiesForNumFormat( - const SwNumFormat& rFormat, OUString const& rCharFormatName, + const SwNumFormat& rFormat, UIName const& rCharFormatName, ProgName const* pHeadingStyleName, OUString const & referer); static void SetPropertiesToNumFormat( SwNumFormat & aFormat, - OUString & rCharStyleName, - OUString *const pBulletFontName, - OUString *const pHeadingStyleName, + UIName & rCharStyleName, + UIName *const pBulletFontName, + UIName *const pHeadingStyleName, OUString *const pParagraphStyleName, SwDoc *const pDoc, SwDocShell *const pDocShell, @@ -221,7 +221,7 @@ public: private: css::uno::Any GetNumberingRuleByIndex(const SwNumRule& rNumRule, sal_Int32 nIndex, const OUString& rPropName) const; static css::uno::Any GetPropertyForNumFormat( - const SwNumFormat& rFormat, OUString const& rCharFormatName, + const SwNumFormat& rFormat, UIName const& rCharFormatName, ProgName const* pHeadingStyleName, OUString const & referer, OUString const & rPropName); }; diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx index 875e4c9677fa..67a54ce77931 100644 --- a/sw/inc/unostyle.hxx +++ b/sw/inc/unostyle.hxx @@ -280,10 +280,10 @@ class SwXTextTableStyle final : public cppu::ImplInheritanceHelper public: SwXTextTableStyle(SwDocShell* pDocShell, SwTableAutoFormat* pTableAutoFormat); /// Create non physical style - SwXTextTableStyle(SwDocShell* pDocShell, const OUString& rTableAutoFormatName); + SwXTextTableStyle(SwDocShell* pDocShell, const TableStyleName& rTableAutoFormatName); /// This function looks for a SwTableAutoFormat with given name. Returns nullptr if could not be found. - static SwTableAutoFormat* GetTableAutoFormat(SwDocShell* pDocShell, std::u16string_view sName); + static SwTableAutoFormat* GetTableAutoFormat(SwDocShell* pDocShell, const TableStyleName& sName); /// Returns box format assigned to this style SwTableAutoFormat* GetTableFormat(); void SetPhysical(); @@ -326,7 +326,7 @@ public: virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override; virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; - static rtl::Reference<SwXTextTableStyle> CreateXTextTableStyle(SwDocShell* pDocShell, const OUString& rTableAutoFormatName); + static rtl::Reference<SwXTextTableStyle> CreateXTextTableStyle(SwDocShell* pDocShell, const TableStyleName& rTableAutoFormatName); }; /// A text cell style is a UNO API wrapper for a SwBoxAutoFormat core class @@ -342,16 +342,16 @@ class SwXTextCellStyle final : public cppu::ImplInheritanceHelper /// Stores SwBoxAutoFormat when this is not a physical style. std::shared_ptr<SwBoxAutoFormat> m_pBoxAutoFormat_Impl; /// UIName of the table style that contains this cell style - OUString m_sTableStyleUIName; + TableStyleName m_sTableStyleUIName; /// There are no built-in cell style names - presumably these don't need to be converted. - OUString m_sName; + UIName m_sName; /// If true, then it points to a core object, if false, then this is a created, but not-yet-inserted format. bool m_bPhysical; public: - SwXTextCellStyle(SwDocShell* pDocShell, SwBoxAutoFormat* pBoxAutoFormat, OUString sParentStyle); + SwXTextCellStyle(SwDocShell* pDocShell, SwBoxAutoFormat* pBoxAutoFormat, TableStyleName sParentStyle); /// Create non physical style - SwXTextCellStyle(SwDocShell* pDocShell, OUString sName); + SwXTextCellStyle(SwDocShell* pDocShell, UIName sName); /** * This function looks for a SwBoxAutoFormat with given name. Parses the name and returns parent name. @@ -360,7 +360,7 @@ class SwXTextCellStyle final : public cppu::ImplInheritanceHelper * @param pParentName Optional output. Pointer to an OUString where parsed parent name will be returned. * @return Pointer to a SwBoxAutoFormat, nullptr if not found. */ - static SwBoxAutoFormat* GetBoxAutoFormat(SwDocShell* pDocShell, std::u16string_view sName, OUString* pParentName); + static SwBoxAutoFormat* GetBoxAutoFormat(SwDocShell* pDocShell, const UIName& sName, TableStyleName* pParentName); /// returns box format assigned to this style SwBoxAutoFormat* GetBoxFormat(); /// Sets the address of SwBoxAutoFormat this style is bound to. Usable only when style is physical. @@ -398,7 +398,7 @@ class SwXTextCellStyle final : public cppu::ImplInheritanceHelper virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override; virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; - static rtl::Reference<SwXTextCellStyle> CreateXTextCellStyle(SwDocShell* pDocShell, const OUString& sName); + static rtl::Reference<SwXTextCellStyle> CreateXTextCellStyle(SwDocShell* pDocShell, const UIName& sName); }; class SW_DLLPUBLIC SwXStyleFamily final : public cppu::WeakImplHelper @@ -414,9 +414,9 @@ class SW_DLLPUBLIC SwXStyleFamily final : public cppu::WeakImplHelper SfxStyleSheetBasePool* m_pBasePool; SwDocShell* m_pDocShell; - SwXStyle* FindStyle(std::u16string_view rStyleName) const; -e ... etc. - the rest is truncated