avmedia/source/viewer/mediawindow_impl.cxx                                     
    |    3 
 basctl/source/basicide/baside2b.cxx                                            
    |    3 
 basctl/source/basicide/bastype2.cxx                                            
    |    3 
 basctl/source/basicide/bastype3.cxx                                            
    |    3 
 basctl/source/basicide/moduldl2.cxx                                            
    |    3 
 basic/source/classes/sbunoobj.cxx                                              
    |    2 
 basic/source/sbx/sbxscan.cxx                                                   
    |   28 
 
chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
 |    8 
 chart2/source/controller/dialogs/ChartTypeDialogController.cxx                 
    |   20 
 chart2/source/controller/dialogs/res_DataLabel.cxx                             
    |    6 
 chart2/source/controller/main/ChartController_Window.cxx                       
    |    6 
 chart2/source/controller/sidebar/ChartColorWrapper.cxx                         
    |    6 
 chart2/source/tools/ExponentialRegressionCurveCalculator.cxx                   
    |    6 
 comphelper/source/misc/profilezone.cxx                                         
    |    3 
 compilerplugins/clang/bufferadd.cxx                                            
    |    4 
 compilerplugins/clang/conditionalstring.cxx                                    
    |   33 
 compilerplugins/clang/elidestringvar.cxx                                       
    |    2 
 compilerplugins/clang/implicitboolconversion.cxx                               
    |    2 
 compilerplugins/clang/stringadd.cxx                                            
    |    4 
 compilerplugins/clang/stringconcatliterals.cxx                                 
    |    7 
 compilerplugins/clang/test/conditionalstring.cxx                               
    |   11 
 compilerplugins/clang/test/elidestringvar.cxx                                  
    |    3 
 compilerplugins/clang/test/staticvar.cxx                                       
    |    6 
 compilerplugins/clang/test/stringadd.cxx                                       
    |    2 
 compilerplugins/clang/test/stringconcatliterals.cxx                            
    |    5 
 connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx                       
    |    4 
 connectivity/source/drivers/jdbc/DatabaseMetaData.cxx                          
    |    6 
 connectivity/source/drivers/mork/MDatabaseMetaData.cxx                         
    |    4 
 cppuhelper/source/typemanager.cxx                                              
    |   33 
 cui/source/dialogs/scriptdlg.cxx                                               
    |    2 
 cui/source/inc/cfg.hxx                                                         
    |    2 
 cui/source/options/treeopt.cxx                                                 
    |    4 
 cui/source/tabpages/border.cxx                                                 
    |    8 
 dbaccess/source/core/api/SingleSelectQueryComposer.cxx                         
    |    3 
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx                          
    |    2 
 desktop/source/deployment/registry/component/dp_component.cxx                  
    |    3 
 desktop/source/pkgchk/unopkg/unopkg_misc.cxx                                   
    |    6 
 editeng/source/uno/unotext.cxx                                                 
    |    3 
 editeng/source/uno/unotext2.cxx                                                
    |    5 
 embeddedobj/source/msole/oleembed.cxx                                          
    |    6 
 extensions/IwyuFilter_extensions.yaml                                          
    |    3 
 extensions/source/abpilot/fieldmappingimpl.cxx                                 
    |    2 
 extensions/source/bibliography/bibconfig.cxx                                   
    |    2 
 extensions/source/bibliography/bibmod.cxx                                      
    |    7 
 extensions/source/bibliography/bibprop.hxx                                     
    |   30 
 extensions/source/bibliography/datman.cxx                                      
    |    6 
 extensions/source/bibliography/toolbar.cxx                                     
    |   10 
 extensions/source/logging/loggerconfig.cxx                                     
    |   15 
 extensions/source/propctrlr/formcomponenthandler.cxx                           
    |    7 
 extensions/source/propctrlr/selectlabeldialog.cxx                              
    |    6 
 filter/source/graphicfilter/ieps/ieps.cxx                                      
    |    3 
 filter/source/svg/svgexport.cxx                                                
    |    2 
 framework/Library_fwk.mk                                                       
    |    1 
 framework/inc/jobs/jobconst.hxx                                                
    |    6 
 framework/source/fwi/jobs/jobconst.cxx                                         
    |   32 
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx              
    |    5 
 framework/source/uiconfiguration/uiconfigurationmanager.cxx                    
    |    5 
 framework/source/uielement/controlmenucontroller.cxx                           
    |    3 
 i18npool/source/localedata/localedata.cxx                                      
    |    2 
 i18npool/source/nativenumber/nativenumbersupplier.cxx                          
    |   10 
 include/rtl/ustrbuf.hxx                                                        
    |   32 
 include/rtl/ustring.hxx                                                        
    |  234 -
 include/svl/itemprop.hxx                                                       
    |    5 
 include/vcl/IconThemeInfo.hxx                                                  
    |    2 
 include/xmloff/txtparae.hxx                                                    
    |   40 
 include/xmloff/xmlimp.hxx                                                      
    |    4 
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx                            
    |    7 
 l10ntools/source/localize.cxx                                                  
    |   27 
 oox/source/dump/oledumper.cxx                                                  
    |    6 
 oox/source/export/drawingml.cxx                                                
    |    4 
 oox/source/export/shapes.cxx                                                   
    |    5 
 reportdesign/source/core/api/ReportDefinition.cxx                              
    |    3 
 reportdesign/source/filter/xml/xmlCell.cxx                                     
    |    2 
 reportdesign/source/filter/xml/xmlFixedContent.cxx                             
    |    2 
 reportdesign/source/ui/inspection/DataProviderHandler.cxx                      
    |   11 
 reportdesign/source/ui/inspection/GeometryHandler.cxx                          
    |    5 
 reportdesign/source/ui/inspection/metadata.cxx                                 
    |    4 
 reportdesign/source/ui/report/ReportController.cxx                             
    |    3 
 sal/qa/rtl/strings/test_oustring_concat.cxx                                    
    |    5 
 sal/qa/rtl/strings/test_oustring_stringliterals.cxx                            
    |   16 
 sax/qa/cppunit/xmlimport.cxx                                                   
    |    4 
 sax/source/fastparser/legacyfastparser.cxx                                     
    |    7 
 sc/qa/unit/subsequent_export-test.cxx                                          
    |    2 
 sc/qa/unit/ucalc_sharedformula.cxx                                             
    |    3 
 sc/source/core/data/colorscale.cxx                                             
    |   45 
 sc/source/filter/excel/xlroot.cxx                                              
    |    2 
 sc/source/filter/excel/xltools.cxx                                             
    |    5 
 sc/source/filter/inc/xlroot.hxx                                                
    |    4 
 sc/source/filter/oox/defnamesbuffer.cxx                                        
    |    2 
 sc/source/ui/StatisticsDialogs/RegressionDialog.cxx                            
    |   11 
 sc/source/ui/navipi/content.cxx                                                
    |    6 
 sc/source/ui/unoobj/targuno.cxx                                                
    |    6 
 sc/source/ui/unoobj/textuno.cxx                                                
    |    2 
 sc/source/ui/vba/vbadialog.cxx                                                 
    |    7 
 sc/source/ui/view/olinewin.cxx                                                 
    |    6 
 scripting/source/provider/URIHelper.cxx                                        
    |    4 
 sd/inc/strmname.h                                                              
    |   35 
 sd/source/core/stlsheet.cxx                                                    
    |   69 
 sd/source/filter/ppt/pptin.cxx                                                 
    |    3 
 sd/source/ui/dlg/tpaction.cxx                                                  
    |    4 
 sd/source/ui/docshell/docshel4.cxx                                             
    |    6 
 sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx     
    |    9 
 sd/source/ui/framework/tools/FrameworkHelper.cxx                               
    |   15 
 sd/source/ui/inc/ToolBarManager.hxx                                            
    |   42 
 sd/source/ui/inc/framework/FrameworkHelper.hxx                                 
    |   24 
 sd/source/ui/unoidl/unoobj.cxx                                                 
    |    3 
 sd/source/ui/unoidl/unopage.cxx                                                
    |    7 
 sd/source/ui/view/ToolBarManager.cxx                                           
    |   16 
 sd/source/ui/view/viewoverlaymanager.cxx                                       
    |    8 
 sdext/source/pdfimport/tree/drawtreevisiting.cxx                               
    |    3 
 sdext/source/pdfimport/tree/writertreevisiting.cxx                             
    |    5 
 sdext/source/presenter/PresenterConfigurationAccess.cxx                        
    |    3 
 sdext/source/presenter/PresenterConfigurationAccess.hxx                        
    |    3 
 sdext/source/presenter/PresenterHelper.cxx                                     
    |    4 
 sdext/source/presenter/PresenterHelper.hxx                                     
    |    4 
 sdext/source/presenter/PresenterPaneFactory.cxx                                
    |   11 
 sdext/source/presenter/PresenterPaneFactory.hxx                                
    |   13 
 sdext/source/presenter/PresenterViewFactory.cxx                                
    |   13 
 sdext/source/presenter/PresenterViewFactory.hxx                                
    |   15 
 sfx2/inc/SfxRedactionHelper.hxx                                                
    |    3 
 sfx2/source/appl/sfxhelp.cxx                                                   
    |    2 
 sfx2/source/control/unoctitm.cxx                                               
    |    5 
 sfx2/source/dialog/filedlghelper.cxx                                           
    |   16 
 sfx2/source/doc/doctempl.cxx                                                   
    |    4 
 solenv/clang-format/excludelist                                                
    |    2 
 svgio/inc/svgtools.hxx                                                         
    |    8 
 svgio/source/svgreader/svgtools.cxx                                            
    |    6 
 svl/source/items/flagitem.cxx                                                  
    |    5 
 svl/source/items/itemprop.cxx                                                  
    |    2 
 svl/source/items/visitem.cxx                                                   
    |    6 
 svl/source/numbers/zformat.cxx                                                 
    |    8 
 svl/source/numbers/zforscan.cxx                                                
    |    4 
 svl/source/numbers/zforscan.hxx                                                
    |    4 
 svtools/source/config/colorcfg.cxx                                             
    |  105 
 svtools/source/svhtml/htmlkywd.cxx                                             
    | 1282 ++---
 svtools/source/svrtf/rtfkeywd.cxx                                              
    | 2206 +++++-----
 svx/source/dialog/frmsel.cxx                                                   
    |    4 
 svx/source/fmcomp/fmgridif.cxx                                                 
    |    9 
 svx/source/form/fmdmod.cxx                                                     
    |    6 
 svx/source/form/fmshimp.cxx                                                    
    |    3 
 svx/source/form/fmundo.cxx                                                     
    |    5 
 svx/source/sidebar/inspector/InspectorTextPanel.cxx                            
    |    7 
 svx/source/svdraw/svdoashp.cxx                                                 
    |    2 
 svx/source/tbxctrls/extrusioncontrols.cxx                                      
    |   11 
 svx/source/unodraw/unoshap3.cxx                                                
    |   13 
 svx/source/xml/xmleohlp.cxx                                                    
    |    5 
 sw/inc/tox.hxx                                                                 
    |    3 
 sw/qa/core/test_ToxLinkProcessor.cxx                                           
    |   12 
 sw/source/core/access/accpara.cxx                                              
    |    2 
 sw/source/core/doc/doctxm.cxx                                                  
    |   11 
 sw/source/core/tox/ToxTextGenerator.cxx                                        
    |    2 
 sw/source/core/tox/tox.cxx                                                     
    |    2 
 sw/source/core/unocore/unodraw.cxx                                             
    |    4 
 sw/source/core/unocore/unomap.cxx                                              
    |    2 
 sw/source/filter/html/css1atr.cxx                                              
    |   17 
 sw/source/ui/fldui/changedb.cxx                                                
    |    6 
 sw/source/ui/misc/bookmark.cxx                                                 
    |    5 
 sw/source/uibase/dbui/mmconfigitem.cxx                                         
    |    2 
 sw/source/uibase/inc/bookmark.hxx                                              
    |    2 
 sw/source/uibase/ribbar/workctrl.cxx                                           
    |    6 
 sw/source/uibase/uiview/view2.cxx                                              
    |    9 
 toolkit/source/awt/vclxtoolkit.cxx                                             
    |  155 
 toolkit/source/controls/unocontrol.cxx                                         
    |    3 
 ucb/source/ucp/cmis/cmis_content.cxx                                           
    |    5 
 ucb/source/ucp/file/bc.cxx                                                     
    |    4 
 ucb/source/ucp/file/filglob.cxx                                                
    |    8 
 ucb/source/ucp/file/filtask.cxx                                                
    |    2 
 ucb/source/ucp/file/filtask.hxx                                                
    |    6 
 ucb/source/ucp/webdav-neon/DAVProperties.cxx                                   
    |   13 
 ucb/source/ucp/webdav-neon/DAVProperties.hxx                                   
    |   24 
 unotools/source/misc/wincodepage.cxx                                           
    |    6 
 vbahelper/source/vbahelper/vbacommandbarhelper.hxx                             
    |    2 
 vcl/inc/IconThemeSelector.hxx                                                  
    |    2 
 vcl/source/app/IconThemeInfo.cxx                                               
    |    6 
 vcl/source/app/IconThemeSelector.cxx                                           
    |    2 
 vcl/source/app/svapp.cxx                                                       
    |    5 
 vcl/source/filter/graphicfilter.cxx                                            
    |    3 
 vcl/unx/generic/window/salframe.cxx                                            
    |    7 
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx                       
    |    7 
 writerfilter/source/rtftok/rtfdispatchdestination.cxx                          
    |    8 
 writerperfect/source/common/WPFTEncodingDialog.cxx                             
    |    3 
 writerperfect/source/writer/exp/xmlimp.cxx                                     
    |    6 
 xmloff/source/core/XMLEmbeddedObjectImportContext.cxx                          
    |   22 
 xmloff/source/core/xmlimp.cxx                                                  
    |    2 
 xmloff/source/draw/animimp.cxx                                                 
    |    8 
 xmloff/source/draw/shapeimport.cxx                                             
    |    9 
 xmloff/source/forms/elementexport.cxx                                          
    |    3 
 xmloff/source/text/txtfldi.cxx                                                 
    |    4 
 xmloff/source/text/txtparae.cxx                                                
    |   21 
 xmloff/source/text/txtvfldi.cxx                                                
    |    2 
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx                                  
    |    8 
 xmlsecurity/source/dialogs/certificateviewer.cxx                               
    |    6 
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx                         
    |    8 
 xmlsecurity/source/helper/ooxmlsecexporter.cxx                                 
    |   11 
 194 files changed, 2816 insertions(+), 2658 deletions(-)

New commits:
commit e6dfaf9f44f9939abc338c83b3024108431d0f69
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue Sep 8 09:48:17 2020 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Wed Sep 16 23:02:09 2020 +0200

    Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uString
    
    ...from which an OUString can cheaply be instantiated.  This is the OUString
    equivalent of 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "Turn OStringLiteral 
into
    a consteval'ed, static-refcound rtl_String".  Most remarks about that commit
    apply here too (this commit is just substantially bigger and a bit more
    complicated because there were so much more uses of OUStringLiteral than of
    OStringLiteral):
    
    The one downside is that OUStringLiteral now needs to be a template 
abstracting
    over the string length.  But any uses for which that is a problem (e.g., as 
the
    element type of a container that would no longer be homogeneous, or in the
    signature of a function that shall not be turned into a template for one 
reason
    or another) can be replaced with std::u16string_view, without loss of 
efficiency
    compared to the original OUStringLiteral, and without loss of expressivity.
    
    The new OUStringLiteral ctor code would probably not be very efficient if it
    were ever executed at runtime, but it is intended to be only executed at 
compile
    time.  Where available, C++20 "consteval" is used to statically ensure that.
    
    The intended use of the new OUStringLiteral is in all cases where an
    object that shall itself not be an OUString (e.g., because it shall be a
    global static variable for which the OUString ctor/dtor would be 
detrimental at
    library load/unload) must be converted to an OUString instance in at least 
one
    place.  Other string literal abstractions could use std::u16string_view (or 
just
    plain char16_t const[N]), but interestingly OUStringLiteral might be more
    efficient than constexpr std::u16string_view even for such cases, as it 
should
    not need any relocations at library load time.  For now, no existing uses of
    OUStringLiteral have been changed to some other abstraction (unless 
technically
    necessary as discussed above), and no additional places that would benefit 
from
    OUStringLiteral have been changed to use it.
    
    Global constexpr OUStringLiteral variables defined in an included file 
would be
    somewhat suboptimal, as each translation unit that uses them would create 
its
    own, unshared instance.  The envisioned solution is to turn them into static
    data members of some class (and there may be a loplugin coming to find and 
fix
    affected places).  Another approach that has been taken here in a few cases
    where such variables were only used in one .cxx anyway is to move their
    definitions from the .hxx into that one .cxx (in turn causing some files to
    become empty and get removed completely)---which also silenced some GCC
    -Werror=unused-variable if a variable from a .hxx was not used in some .cxx
    including it.
    
    To keep individual commits reasonably manageable, some consumers of
    OUStringLiteral in rtl/ustrbuf.hxx and rtl/ustring.hxx are left in a 
somewhat
    odd state for now, where they don't take advantage of OUStringLiteral's
    equivalence to rtl_uString, but just keep extracting its contents and copy 
it
    elsewhere.  In follow-up commits, those consumers should be changed
    appropriately, making them treat OUStringLiteral like an rtl_uString or
    dropping the OUStringLiteral overload in favor of an existing (and cheap to 
use
    now) OUString overload, etc.
    
    In a similar vein, comparison operators between OUString and 
std::u16string_view
    have been added to the existing plethora of comparison operator overloads.  
It
    would be nice to eventually consolidate them, esp. with the overloads taking
    OUStringLiteral and/or char16_t const[N] string literals, but that appears
    tricky to get right without introducing new ambiguities.  Also, a handful of
    places across the code base use comparisons between OUString and 
OUStringNumber,
    which are now ambiguous (converting the OUStringNumber to either OUString or
    std::u16string_view).  For simplicity, those few places have manually been 
fixed
    for now by adding explicit conversion to std::u16string_view.
    
    Also some compilerplugins code needed to be adapted, and some of the
    compilerplugins/test cases have become irrelevant (and have been removed), 
as
    the tested code would no longer compile in the first place.
    
    sal/qa/rtl/strings/test_oustring_concat.cxx documents a workaround for GCC 
bug
    <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96878> "Failed class template
    argument deduction in unevaluated, parenthesized context".  That place, as 
well
    as uses of OUStringLiteral in 
extensions/source/abpilot/fieldmappingimpl.cxx and
    i18npool/source/localedata/localedata.cxx, which have been replaced with
    OUString::Concat (and which is arguably a better choice, anyway), also 
caused
    failures with at least Clang 5.0.2 (but would not have caused failures with 
at
    least recent Clang 12 trunk, so appear to be bugs in Clang that have 
meanwhile
    been fixed).
    
    Change-Id: I34174462a28f2000cfeb2d219ffd533a767920b8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102222
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/avmedia/source/viewer/mediawindow_impl.cxx 
b/avmedia/source/viewer/mediawindow_impl.cxx
index 78203960456c..c2a654969c07 100644
--- a/avmedia/source/viewer/mediawindow_impl.cxx
+++ b/avmedia/source/viewer/mediawindow_impl.cxx
@@ -25,6 +25,7 @@
 #include <helpids.h>
 
 #include <algorithm>
+#include <string_view>
 
 #include <sal/log.hxx>
 #include <comphelper/processfactory.hxx>
@@ -182,7 +183,7 @@ uno::Reference<media::XPlayer> 
MediaWindowImpl::createPlayer(const OUString& rUR
     {
         uno::Reference<uno::XComponentContext> 
xContext(::comphelper::getProcessComponentContext());
 
-        static OUStringLiteral aServiceManagers[] =
+        static std::u16string_view aServiceManagers[] =
         {
             u"" AVMEDIA_MANAGER_SERVICE_PREFERRED,
             u"" AVMEDIA_MANAGER_SERVICE_NAME,
diff --git a/basctl/source/basicide/baside2b.cxx 
b/basctl/source/basicide/baside2b.cxx
index f129d0066d49..8c2f9514843b 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -20,6 +20,7 @@
 #include <sal/config.h>
 
 #include <cassert>
+#include <string_view>
 
 #include <helpids.h>
 #include <iderid.hxx>
@@ -1417,7 +1418,7 @@ void BreakPointWindow::ShowMarker(vcl::RenderContext& 
rRenderContext)
     Size const aOutSz = GetOutputSize();
     long const nLineHeight = GetTextHeight();
 
-    Image aMarker = GetImage(bErrorMarker ? OUStringLiteral(u"" 
RID_BMP_ERRORMARKER) : OUStringLiteral(u"" RID_BMP_STEPMARKER));
+    Image aMarker = GetImage(bErrorMarker ? std::u16string_view(u"" 
RID_BMP_ERRORMARKER) : std::u16string_view(u"" RID_BMP_STEPMARKER));
 
     Size aMarkerSz(aMarker.GetSizePixel());
     aMarkerSz = rRenderContext.PixelToLogic(aMarkerSz);
diff --git a/basctl/source/basicide/bastype2.cxx 
b/basctl/source/basicide/bastype2.cxx
index 066a01baf68e..6fd2fb522fd4 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -37,6 +37,7 @@
 
 #include <initializer_list>
 #include <memory>
+#include <string_view>
 
 #include <com/sun/star/script/ModuleType.hpp>
 #include <com/sun/star/script/vba/XVBAModuleInfo.hpp>
@@ -244,7 +245,7 @@ void SbTreeListBox::ImpCreateLibEntries(const 
weld::TreeIter& rIter, const Scrip
             // create tree list box entry
             OUString sId;
             if ( ( nMode & BrowseMode::Dialogs ) && !( nMode & 
BrowseMode::Modules ) )
-                sId = bLoaded ? OUStringLiteral(u"" RID_BMP_DLGLIB) : 
OUStringLiteral(u"" RID_BMP_DLGLIBNOTLOADED);
+                sId = bLoaded ? std::u16string_view(u"" RID_BMP_DLGLIB) : 
std::u16string_view(u"" RID_BMP_DLGLIBNOTLOADED);
             else
                 sId = bLoaded ? OUStringLiteral(u"" RID_BMP_MODLIB) : 
OUStringLiteral(u"" RID_BMP_MODLIBNOTLOADED);
             std::unique_ptr<weld::TreeIter> 
xLibRootEntry(m_xControl->make_iterator(&rIter));
diff --git a/basctl/source/basicide/bastype3.cxx 
b/basctl/source/basicide/bastype3.cxx
index 6b2a6b0b9777..da39ee5350a4 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -26,6 +26,7 @@
 #include <com/sun/star/script/XLibraryContainer.hpp>
 #include <com/sun/star/script/XLibraryContainerPassword.hpp>
 #include <deque>
+#include <string_view>
 #include <osl/diagnose.h>
 #include <tools/debug.hxx>
 
@@ -101,7 +102,7 @@ IMPL_LINK(SbTreeListBox, RequestingChildrenHdl, const 
weld::TreeIter&, rEntry, b
 
                 // exchange image
                 const bool bDlgMode = (nMode & BrowseMode::Dialogs) && !(nMode 
& BrowseMode::Modules);
-                auto const aImage(bDlgMode ? OUStringLiteral(u"" 
RID_BMP_DLGLIB) : OUStringLiteral(u"" RID_BMP_MODLIB));
+                auto const aImage(bDlgMode ? std::u16string_view(u"" 
RID_BMP_DLGLIB) : std::u16string_view(u"" RID_BMP_MODLIB));
                 SetEntryBitmaps(rEntry, aImage);
             }
             else
diff --git a/basctl/source/basicide/moduldl2.cxx 
b/basctl/source/basicide/moduldl2.cxx
index b0d6d655c7aa..5b78745613da 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -65,6 +65,7 @@
 #include <cppuhelper/implbase.hxx>
 
 #include <cassert>
+#include <string_view>
 
 namespace basctl
 {
@@ -1349,7 +1350,7 @@ void createLibImpl(weld::Window* pWin, const 
ScriptDocument& rDocument,
 
                 BrowseMode nMode = pBasicBox->GetMode();
                 bool bDlgMode = ( nMode & BrowseMode::Dialogs ) && !( nMode & 
BrowseMode::Modules );
-                const auto sId = bDlgMode ? OUStringLiteral(u"" 
RID_BMP_DLGLIB) : OUStringLiteral(u"" RID_BMP_MODLIB);
+                const auto sId = bDlgMode ? std::u16string_view(u"" 
RID_BMP_DLGLIB) : std::u16string_view(u"" RID_BMP_MODLIB);
                 pBasicBox->AddEntry(aLibName, sId, xRootEntry.get(), false, 
std::make_unique<Entry>(OBJ_TYPE_LIBRARY));
                 pBasicBox->AddEntry(aModName, RID_BMP_MODULE, 
xRootEntry.get(), false, std::make_unique<Entry>(OBJ_TYPE_MODULE));
                 pBasicBox->set_cursor(*xRootEntry);
diff --git a/basic/source/classes/sbunoobj.cxx 
b/basic/source/classes/sbunoobj.cxx
index 976cdfbdd6f2..018362e2d544 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -98,7 +98,7 @@ using namespace cppu;
 
 
 // Identifiers for creating the strings for dbg_Properties
-char16_t const ID_DBG_SUPPORTEDINTERFACES[] = u"Dbg_SupportedInterfaces";
+char16_t constexpr ID_DBG_SUPPORTEDINTERFACES[] = u"Dbg_SupportedInterfaces";
 char const ID_DBG_PROPERTIES[] = "Dbg_Properties";
 char const ID_DBG_METHODS[] = "Dbg_Methods";
 
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index fe86154e8a2b..922d892df367 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <config_features.h>
 
 #include <vcl/errcode.hxx>
@@ -603,7 +607,7 @@ enum class VbaFormatType
 struct VbaFormatInfo
 {
     VbaFormatType meType;
-    OUStringLiteral mpVbaFormat; // Format string in vba
+    std::u16string_view mpVbaFormat; // Format string in vba
     NfIndexTableOffset meOffset; // SvNumberFormatter format index, if meType 
= VbaFormatType::Offset
     const char* mpOOoFormat;     // if meType = VbaFormatType::UserDefined
 };
@@ -611,17 +615,17 @@ struct VbaFormatInfo
 #if HAVE_FEATURE_SCRIPTING
 const VbaFormatInfo pFormatInfoTable[] =
 {
-    { VbaFormatType::Offset,      OUStringLiteral(u"Long Date"),   
NF_DATE_SYSTEM_LONG,    nullptr },
-    { VbaFormatType::UserDefined, OUStringLiteral(u"Medium Date"), 
NF_NUMBER_STANDARD,     "DD-MMM-YY" },
-    { VbaFormatType::Offset,      OUStringLiteral(u"Short Date"),  
NF_DATE_SYSTEM_SHORT,   nullptr },
-    { VbaFormatType::UserDefined, OUStringLiteral(u"Long Time"),   
NF_NUMBER_STANDARD,     "H:MM:SS AM/PM" },
-    { VbaFormatType::Offset,      OUStringLiteral(u"Medium Time"), 
NF_TIME_HHMMAMPM,       nullptr },
-    { VbaFormatType::Offset,      OUStringLiteral(u"Short Time"),  
NF_TIME_HHMM,           nullptr },
-    { VbaFormatType::Offset,      OUStringLiteral(u"ddddd"),       
NF_DATE_SYSTEM_SHORT,   nullptr },
-    { VbaFormatType::Offset,      OUStringLiteral(u"dddddd"),      
NF_DATE_SYSTEM_LONG,    nullptr },
-    { VbaFormatType::UserDefined, OUStringLiteral(u"ttttt"),       
NF_NUMBER_STANDARD,     "H:MM:SS AM/PM" },
-    { VbaFormatType::Offset,      OUStringLiteral(u"ww"),          NF_DATE_WW, 
            nullptr },
-    { VbaFormatType::Null,        OUStringLiteral(u""),            
NF_INDEX_TABLE_ENTRIES, nullptr }
+    { VbaFormatType::Offset,      std::u16string_view(u"Long Date"),   
NF_DATE_SYSTEM_LONG,    nullptr },
+    { VbaFormatType::UserDefined, std::u16string_view(u"Medium Date"), 
NF_NUMBER_STANDARD,     "DD-MMM-YY" },
+    { VbaFormatType::Offset,      std::u16string_view(u"Short Date"),  
NF_DATE_SYSTEM_SHORT,   nullptr },
+    { VbaFormatType::UserDefined, std::u16string_view(u"Long Time"),   
NF_NUMBER_STANDARD,     "H:MM:SS AM/PM" },
+    { VbaFormatType::Offset,      std::u16string_view(u"Medium Time"), 
NF_TIME_HHMMAMPM,       nullptr },
+    { VbaFormatType::Offset,      std::u16string_view(u"Short Time"),  
NF_TIME_HHMM,           nullptr },
+    { VbaFormatType::Offset,      std::u16string_view(u"ddddd"),       
NF_DATE_SYSTEM_SHORT,   nullptr },
+    { VbaFormatType::Offset,      std::u16string_view(u"dddddd"),      
NF_DATE_SYSTEM_LONG,    nullptr },
+    { VbaFormatType::UserDefined, std::u16string_view(u"ttttt"),       
NF_NUMBER_STANDARD,     "H:MM:SS AM/PM" },
+    { VbaFormatType::Offset,      std::u16string_view(u"ww"),          
NF_DATE_WW,             nullptr },
+    { VbaFormatType::Null,        std::u16string_view(u""),            
NF_INDEX_TABLE_ENTRIES, nullptr }
 };
 
 const VbaFormatInfo* getFormatInfo( const OUString& rFmt )
diff --git 
a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
 
b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
index f69c7c20f5ec..5ee50f4dbd73 100644
--- 
a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
+++ 
b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include "WrappedAxisAndGridExistenceProperties.hxx"
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/chart2/XAxis.hpp>
@@ -342,14 +346,14 @@ 
WrappedAxisLabelExistenceProperty::WrappedAxisLabelExistenceProperty(bool bMain,
     switch( m_nDimensionIndex )
     {
         case 0:
-            m_aOuterName = m_bMain ? OUStringLiteral(u"HasXAxisDescription") : 
OUStringLiteral(u"HasSecondaryXAxisDescription");
+            m_aOuterName = m_bMain ? 
std::u16string_view(u"HasXAxisDescription") : 
std::u16string_view(u"HasSecondaryXAxisDescription");
             break;
         case 2:
             OSL_ENSURE(m_bMain,"there is no description available for a 
secondary z axis");
             m_aOuterName = "HasZAxisDescription";
             break;
         default:
-            m_aOuterName = m_bMain ? OUStringLiteral(u"HasYAxisDescription") : 
OUStringLiteral(u"HasSecondaryYAxisDescription");
+            m_aOuterName = m_bMain ? 
std::u16string_view(u"HasYAxisDescription") : 
std::u16string_view(u"HasSecondaryYAxisDescription");
             break;
     }
 }
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx 
b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index 7939fcf06c12..748df3e1b40e 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -401,7 +401,7 @@ OUString ColumnChartDialogController::getName()
 
 OUString ColumnChartDialogController::getImage()
 {
-    return OUStringLiteral(u"" BMP_TYPE_COLUMN);
+    return BMP_TYPE_COLUMN;
 }
 
 const tTemplateServiceChartTypeParameterMap& 
ColumnChartDialogController::getTemplateMap() const
@@ -478,7 +478,7 @@ OUString BarChartDialogController::getName()
 
 OUString BarChartDialogController::getImage()
 {
-    return OUStringLiteral(u"" BMP_TYPE_BAR);
+    return BMP_TYPE_BAR;
 }
 
 const tTemplateServiceChartTypeParameterMap& 
BarChartDialogController::getTemplateMap() const
@@ -554,7 +554,7 @@ OUString PieChartDialogController::getName()
 
 OUString PieChartDialogController::getImage()
 {
-    return OUStringLiteral(u"" BMP_TYPE_PIE);
+    return BMP_TYPE_PIE;
 }
 
 const tTemplateServiceChartTypeParameterMap& 
PieChartDialogController::getTemplateMap() const
@@ -620,7 +620,7 @@ OUString LineChartDialogController::getName()
 
 OUString LineChartDialogController::getImage()
 {
-    return OUStringLiteral(u"" BMP_TYPE_LINE);
+    return BMP_TYPE_LINE;
 }
 
 const tTemplateServiceChartTypeParameterMap& 
LineChartDialogController::getTemplateMap() const
@@ -767,7 +767,7 @@ OUString XYChartDialogController::getName()
 
 OUString XYChartDialogController::getImage()
 {
-    return OUStringLiteral(u"" BMP_TYPE_XY);
+    return BMP_TYPE_XY;
 }
 
 const tTemplateServiceChartTypeParameterMap& 
XYChartDialogController::getTemplateMap() const
@@ -870,7 +870,7 @@ OUString AreaChartDialogController::getName()
 
 OUString AreaChartDialogController::getImage()
 {
-    return OUStringLiteral(u"" BMP_TYPE_AREA);
+    return BMP_TYPE_AREA;
 }
 
 bool AreaChartDialogController::shouldShow_3DLookControl() const
@@ -957,7 +957,7 @@ OUString NetChartDialogController::getName()
 
 OUString NetChartDialogController::getImage()
 {
-    return OUStringLiteral(u"" BMP_TYPE_NET);
+    return BMP_TYPE_NET;
 }
 
 bool NetChartDialogController::shouldShow_StackingControl() const
@@ -1052,7 +1052,7 @@ OUString StockChartDialogController::getName()
 
 OUString StockChartDialogController::getImage()
 {
-    return OUStringLiteral(u"" BMP_TYPE_STOCK);
+    return BMP_TYPE_STOCK;
 }
 
 const tTemplateServiceChartTypeParameterMap& 
StockChartDialogController::getTemplateMap() const
@@ -1097,7 +1097,7 @@ OUString CombiColumnLineChartDialogController::getName()
 
 OUString CombiColumnLineChartDialogController::getImage()
 {
-    return OUStringLiteral(u"" BMP_TYPE_COLUMN_LINE);
+    return BMP_TYPE_COLUMN_LINE;
 }
 
 const tTemplateServiceChartTypeParameterMap& 
CombiColumnLineChartDialogController::getTemplateMap() const
@@ -1227,7 +1227,7 @@ OUString BubbleChartDialogController::getName()
 
 OUString BubbleChartDialogController::getImage()
 {
-    return OUStringLiteral(u"" BMP_TYPE_BUBBLE);
+    return BMP_TYPE_BUBBLE;
 }
 
 const tTemplateServiceChartTypeParameterMap& 
BubbleChartDialogController::getTemplateMap() const
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx 
b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 62568fc71296..281beb86dd6f 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include "res_DataLabel.hxx"
 
 #include <TextDirectionListBox.hxx>
@@ -39,7 +43,7 @@ namespace chart
 namespace
 {
 
-const OUStringLiteral our_aLBEntryMap[] = {u" ", u", ", u"; ", u"\n", u". "};
+const std::u16string_view our_aLBEntryMap[] = {u" ", u", ", u"; ", u"\n", u". 
"};
 
 bool lcl_ReadNumberFormatFromItemSet( const SfxItemSet& rSet, sal_uInt16 
nValueWhich, sal_uInt16 nSourceFormatWhich, sal_uLong& rnFormatKeyOut, bool& 
rbSourceFormatOut, bool& rbSourceFormatMixedStateOut )
 {
diff --git a/chart2/source/controller/main/ChartController_Window.cxx 
b/chart2/source/controller/main/ChartController_Window.cxx
index aedeab062113..bd5167766097 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <ChartController.hxx>
 #include <PositionAndSizeHelper.hxx>
 #include <ObjectIdentifier.hxx>
@@ -1015,7 +1019,7 @@ void ChartController::execute_Command( const 
CommandEvent& rCEvt )
         OUString aMenuName;
         if ( isShapeContext() )
             // #i12587# support for shapes in chart
-            aMenuName = m_pDrawViewWrapper->IsTextEdit() ? OUStringLiteral( 
u"drawtext" ) : OUStringLiteral( u"draw" );
+            aMenuName = m_pDrawViewWrapper->IsTextEdit() ? 
std::u16string_view( u"drawtext" ) : std::u16string_view( u"draw" );
         else
         {
             // todo: the context menu should be specified by an xml file in 
uiconfig
diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx 
b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
index 133d02354dbc..aace24ef7830 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
@@ -7,6 +7,10 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include "ChartColorWrapper.hxx"
 
 #include <ObjectIdentifier.hxx>
@@ -97,7 +101,7 @@ void ChartColorWrapper::updateModel(const 
css::uno::Reference<css::frame::XModel
 void ChartColorWrapper::updateData()
 {
     static const OUStringLiteral aLineColor = u"LineColor";
-    static const OUStringLiteral aCommands[2] = {u".uno:XLineColor", 
u".uno:FillColor"};
+    static const std::u16string_view aCommands[2] = {u".uno:XLineColor", 
u".uno:FillColor"};
 
     css::uno::Reference<css::beans::XPropertySet> xPropSet = 
getPropSet(mxModel);
     if (!xPropSet.is())
diff --git a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx 
b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
index 13ddf1582cd0..1aa962ab5e3e 100644
--- a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <ExponentialRegressionCurveCalculator.hxx>
 #include <RegressionCalculationHelper.hxx>
 #include <SpecialCharacters.hxx>
@@ -199,7 +203,7 @@ OUString 
ExponentialRegressionCurveCalculator::ImplGetRepresentation(
             OUString aValueString = getFormattedString( xNumFormatter, 
nNumberFormatKey, m_fLogIntercept, pValueLength );
             if ( aValueString != "0" )  // aValueString may be rounded to 0 if 
nValueLength is small
             {
-                aTmpBuf.append( aValueString ).append( (m_fLogSlope < 0.0) ? 
OUStringLiteral(u" ") : OUStringLiteral(u" + ") );
+                aTmpBuf.append( aValueString ).append( (m_fLogSlope < 0.0) ? 
std::u16string_view(u" ") : std::u16string_view(u" + ") );
             }
         }
     }
diff --git a/comphelper/source/misc/profilezone.cxx 
b/comphelper/source/misc/profilezone.cxx
index 8f82331dd41b..f9284b1f4a51 100644
--- a/comphelper/source/misc/profilezone.cxx
+++ b/comphelper/source/misc/profilezone.cxx
@@ -11,6 +11,7 @@
 
 #include <atomic>
 #include <iostream>
+#include <string_view>
 
 #include <comphelper/sequence.hxx>
 #include <comphelper/profilezone.hxx>
@@ -58,7 +59,7 @@ long long addRecording(const char * aProfileId, long long 
aCreateTime)
 
     OUString sRecordingData(OUString::number(osl_getThreadIdentifier(nullptr)) 
+ " " +
         OUString::number(aTime/1000000.0) + " " + aString + ": " +
-        (aCreateTime == 0 ? OUStringLiteral(u"start") : 
OUStringLiteral(u"stop")) +
+        (aCreateTime == 0 ? std::u16string_view(u"start") : 
std::u16string_view(u"stop")) +
         (aCreateTime != 0 ? (" " + OUString::number((aTime - 
aCreateTime)/1000.0) + " ms") : OUString("")));
 
     ::osl::MutexGuard aGuard( g_aMutex );
diff --git a/compilerplugins/clang/bufferadd.cxx 
b/compilerplugins/clang/bufferadd.cxx
index fd32d4874e64..bc8c7065b2a1 100644
--- a/compilerplugins/clang/bufferadd.cxx
+++ b/compilerplugins/clang/bufferadd.cxx
@@ -360,7 +360,7 @@ bool BufferAdd::isSideEffectFree(Expr const* expr)
                 return true;
         // Expr::HasSideEffects does not like stuff that passes through 
OUStringLiteral
         auto dc2 = 
loplugin::DeclCheck(constructExpr->getConstructor()->getParent());
-        if (dc2.Struct("OUStringLiteral").Namespace("rtl").GlobalNamespace())
+        if (dc2.Class("OUStringLiteral").Namespace("rtl").GlobalNamespace())
             return true;
     }
 
@@ -368,7 +368,7 @@ bool BufferAdd::isSideEffectFree(Expr const* expr)
     if (auto functionalCastExpr = dyn_cast<CXXFunctionalCastExpr>(expr))
     {
         auto tc = loplugin::TypeCheck(functionalCastExpr->getType());
-        if (tc.Struct("OUStringLiteral").Namespace("rtl").GlobalNamespace())
+        if (tc.Class("OUStringLiteral").Namespace("rtl").GlobalNamespace())
             return isSideEffectFree(functionalCastExpr->getSubExpr());
     }
 
diff --git a/compilerplugins/clang/conditionalstring.cxx 
b/compilerplugins/clang/conditionalstring.cxx
index 2d40c1b3aebf..bf6c196846dc 100644
--- a/compilerplugins/clang/conditionalstring.cxx
+++ b/compilerplugins/clang/conditionalstring.cxx
@@ -15,8 +15,8 @@
 #include "compat.hxx"
 #include "plugin.hxx"
 
-// Find uses of OUString in conditional expressions that could be rewritten as 
OUStringLiteral, as
-// in
+// Find uses of OUString in conditional expressions that could be rewritten as 
std::u16string_view,
+// as in
 //
 //   s += (b ? OUString("xy") : OUString(z");
 
@@ -73,11 +73,11 @@ public:
             return true;
         }
         //TODO: Instead of a hardcoded list of functions, check that `fn` has 
overloads taking
-        // OUString and OUStringLiteral, respectively (and operator + is even 
more complicated than
-        // that, going via ToStringHelper<OUStringLiteral> specialization; the 
getNumArgs checks for
-        // the various functions are meant to guard against the unlikely case 
that the affected
-        // parameters get defaulted in the future; overloaded operators cannot 
generally have
-        // defaulted parameters):
+        // OUString and std::u16string_view, respectively (and operator + is 
even more complicated
+        // than that, going via ToStringHelper<std::u16string_view> 
specialization; the getNumArgs
+        // checks for the various functions are meant to guard against the 
unlikely case that the
+        // affected parameters get defaulted in the future; overloaded 
operators cannot generally
+        // have defaulted parameters):
         loplugin::DeclCheck const dc(fn);
         if 
(dc.Operator(OO_Equal).Class("OUString").Namespace("rtl").GlobalNamespace())
         {
@@ -358,7 +358,7 @@ private:
     enum class Kind
     {
         OUStringFromLiteral,
-        OUStringLiteralOrVoid,
+        StringViewOrVoid,
         Other
     };
 
@@ -373,9 +373,11 @@ private:
     Kind getKind(Expr const* expr)
     {
         auto const tc = loplugin::TypeCheck(ignoreImplicit(expr)->getType());
-        if (tc.Struct("OUStringLiteral").Namespace("rtl").GlobalNamespace() || 
tc.Void())
+        if (tc.ClassOrStruct("basic_string_view").StdNamespace() //TODO: check 
explicitly for
+            // std::basic_string_view<char16_t>
+            || tc.Void())
         {
-            return Kind::OUStringLiteralOrVoid;
+            return Kind::StringViewOrVoid;
         }
         if (loplugin::TypeCheck(expr->getType())
                 .Class("OUString")
@@ -423,8 +425,7 @@ private:
             return;
         }
         auto const k2 = getKind(cond->getFalseExpr());
-        if (k2 == Kind::Other
-            || (k1 == Kind::OUStringLiteralOrVoid && k2 == 
Kind::OUStringLiteralOrVoid))
+        if (k2 == Kind::Other || (k1 == Kind::StringViewOrVoid && k2 == 
Kind::StringViewOrVoid))
         {
             return;
         }
@@ -432,20 +433,20 @@ private:
         {
             report(DiagnosticsEngine::Warning,
                    ("replace both 2nd and 3rd operands of conditional 
expression with"
-                    " `rtl::OUStringLiteral`"),
+                    " `std::u16string_view`"),
                    cond->getExprLoc())
                 << cond->getSourceRange();
         }
         else
         {
-            assert((k1 == Kind::OUStringFromLiteral && k2 == 
Kind::OUStringLiteralOrVoid)
-                   || (k1 == Kind::OUStringLiteralOrVoid && k2 == 
Kind::OUStringFromLiteral));
+            assert((k1 == Kind::OUStringFromLiteral && k2 == 
Kind::StringViewOrVoid)
+                   || (k1 == Kind::StringViewOrVoid && k2 == 
Kind::OUStringFromLiteral));
             auto const second = k1 == Kind::OUStringFromLiteral;
             auto const sub
                 = (second ? cond->getTrueExpr() : 
cond->getFalseExpr())->IgnoreParenImpCasts();
             report(DiagnosticsEngine::Warning,
                    ("replace %select{2nd|3rd}0 operand of conditional 
expression with"
-                    " `rtl::OUStringLiteral`"),
+                    " `std::u16string_view`"),
                    sub->getExprLoc())
                 << (second ? 0 : 1) << sub->getSourceRange();
             report(DiagnosticsEngine::Note, "conditional expression is here", 
cond->getExprLoc())
diff --git a/compilerplugins/clang/elidestringvar.cxx 
b/compilerplugins/clang/elidestringvar.cxx
index 561e14c17a40..27b0e5ab77bd 100644
--- a/compilerplugins/clang/elidestringvar.cxx
+++ b/compilerplugins/clang/elidestringvar.cxx
@@ -125,7 +125,7 @@ public:
             {
                 auto const e2 = e1->getArg(0);
                 if (loplugin::TypeCheck(e2->getType())
-                        .Struct("OUStringLiteral")
+                        .Class("OUStringLiteral")
                         .Namespace("rtl")
                         .GlobalNamespace())
                 {
diff --git a/compilerplugins/clang/implicitboolconversion.cxx 
b/compilerplugins/clang/implicitboolconversion.cxx
index 53da99518ff0..14db22788596 100644
--- a/compilerplugins/clang/implicitboolconversion.cxx
+++ b/compilerplugins/clang/implicitboolconversion.cxx
@@ -719,7 +719,7 @@ bool ImplicitBoolConversion::VisitImplicitCastExpr(
     if (ignoreLocation(expr)) {
         return true;
     }
-    if (isBool(expr->getSubExprAsWritten()) && !isBool(expr)) {
+    if (isBool(compat::getSubExprAsWritten(expr)) && !isBool(expr)) {
         // Ignore NoOp from 'sal_Bool' (aka 'unsigned char') to 'const unsigned
         // char' in makeAny(b) with b of type sal_Bool:
         if (expr->getCastKind() != CK_NoOp) {
diff --git a/compilerplugins/clang/stringadd.cxx 
b/compilerplugins/clang/stringadd.cxx
index 288e19c95981..3410c2a6c436 100644
--- a/compilerplugins/clang/stringadd.cxx
+++ b/compilerplugins/clang/stringadd.cxx
@@ -330,7 +330,7 @@ bool StringAdd::isSideEffectFree(Expr const* expr)
                 return true;
         // Expr::HasSideEffects does not like stuff that passes through 
OUStringLiteral
         auto dc2 = 
loplugin::DeclCheck(constructExpr->getConstructor()->getParent());
-        if (dc2.Struct("OUStringLiteral").Namespace("rtl").GlobalNamespace())
+        if (dc2.Class("OUStringLiteral").Namespace("rtl").GlobalNamespace())
             return true;
     }
 
@@ -338,7 +338,7 @@ bool StringAdd::isSideEffectFree(Expr const* expr)
     if (auto functionalCastExpr = dyn_cast<CXXFunctionalCastExpr>(expr))
     {
         auto tc = loplugin::TypeCheck(functionalCastExpr->getType());
-        if (tc.Struct("OUStringLiteral").Namespace("rtl").GlobalNamespace())
+        if (tc.Class("OUStringLiteral").Namespace("rtl").GlobalNamespace())
             return isSideEffectFree(functionalCastExpr->getSubExpr());
     }
 
diff --git a/compilerplugins/clang/stringconcatliterals.cxx 
b/compilerplugins/clang/stringconcatliterals.cxx
index 509a10363c01..f82114199de8 100644
--- a/compilerplugins/clang/stringconcatliterals.cxx
+++ b/compilerplugins/clang/stringconcatliterals.cxx
@@ -27,7 +27,9 @@ Expr const * stripCtor(Expr const * expr) {
         return expr;
     }
     auto qt = loplugin::DeclCheck(e2->getConstructor());
-    if 
(qt.MemberFunction().Class("OStringLiteral").Namespace("rtl").GlobalNamespace())
 {
+    if 
(qt.MemberFunction().Class("OStringLiteral").Namespace("rtl").GlobalNamespace()
+        || 
qt.MemberFunction().Class("OUStringLiteral").Namespace("rtl").GlobalNamespace())
+    {
         if (e2->getNumArgs() == 1) {
             return e2->getArg(0)->IgnoreParenImpCasts();
         }
@@ -36,8 +38,7 @@ Expr const * stripCtor(Expr const * expr) {
     if (!((qt.MemberFunction().Class("OString").Namespace("rtl")
            .GlobalNamespace())
           || (qt.MemberFunction().Class("OUString").Namespace("rtl")
-              .GlobalNamespace())
-          || 
qt.MemberFunction().Struct("OUStringLiteral").Namespace("rtl").GlobalNamespace()))
+              .GlobalNamespace())))
     {
         return expr;
     }
diff --git a/compilerplugins/clang/test/conditionalstring.cxx 
b/compilerplugins/clang/test/conditionalstring.cxx
index f38bc1d2436f..c044ee324b50 100644
--- a/compilerplugins/clang/test/conditionalstring.cxx
+++ b/compilerplugins/clang/test/conditionalstring.cxx
@@ -13,17 +13,14 @@
 
 void f(OUString s, bool b)
 {
-    // expected-error@+2 {{replace 2nd operand of conditional expression with 
`rtl::OUStringLiteral` [loplugin:conditionalstring]}}
+    // expected-error@+2 {{replace 2nd operand of conditional expression with 
`std::u16string_view` [loplugin:conditionalstring]}}
     // expected-note@+1 {{conditional expression is here 
[loplugin:conditionalstring]}}
     s += (b ? OUString("a") : throw 0);
-    // expected-error@+2 {{replace 2nd operand of conditional expression with 
`rtl::OUStringLiteral` [loplugin:conditionalstring]}}
-    // expected-note@+1 {{conditional expression is here 
[loplugin:conditionalstring]}}
-    s += (b ? OUString("a") : OUStringLiteral(u"b"));
-    // expected-error@+1 {{replace both 2nd and 3rd operands of conditional 
expression with `rtl::OUStringLiteral` [loplugin:conditionalstring]}}
+    // expected-error@+1 {{replace both 2nd and 3rd operands of conditional 
expression with `std::u16string_view` [loplugin:conditionalstring]}}
     b = (b ? ("x") : (OUString(("y")))) == s;
-    // expected-error@+1 {{replace both 2nd and 3rd operands of conditional 
expression with `rtl::OUStringLiteral` [loplugin:conditionalstring]}}
+    // expected-error@+1 {{replace both 2nd and 3rd operands of conditional 
expression with `std::u16string_view` [loplugin:conditionalstring]}}
     b = operator==(s, b ? OUString("x") : OUString("y"));
-    // expected-error@+1 {{replace both 2nd and 3rd operands of conditional 
expression with `rtl::OUStringLiteral` [loplugin:conditionalstring]}}
+    // expected-error@+1 {{replace both 2nd and 3rd operands of conditional 
expression with `std::u16string_view` [loplugin:conditionalstring]}}
     s.operator+=(b ? OUString("x") : OUString("y"));
 }
 
diff --git a/compilerplugins/clang/test/elidestringvar.cxx 
b/compilerplugins/clang/test/elidestringvar.cxx
index bc0de05c999e..1835c183bb39 100644
--- a/compilerplugins/clang/test/elidestringvar.cxx
+++ b/compilerplugins/clang/test/elidestringvar.cxx
@@ -18,8 +18,9 @@ OUString f(sal_Unicode c, int n)
     OUString s2('a');
     // expected-note@+1 {{literal OUString variable defined here 
[loplugin:elidestringvar]}}
     OUString s3(u'a');
+    static constexpr OUStringLiteral s4lit(u"a");
     // expected-note@+1 {{literal OUString variable defined here 
[loplugin:elidestringvar]}}
-    OUString s4 = OUStringLiteral(u"a");
+    OUString s4 = s4lit;
     switch (n)
     {
         case 1:
diff --git a/compilerplugins/clang/test/staticvar.cxx 
b/compilerplugins/clang/test/staticvar.cxx
index f527df6a521a..5c0a86fc420f 100644
--- a/compilerplugins/clang/test/staticvar.cxx
+++ b/compilerplugins/clang/test/staticvar.cxx
@@ -11,6 +11,8 @@
 #include <sal/config.h>
 #include <rtl/ustring.hxx>
 
+#include <string_view>
+
 struct S1
 {
     int x, y;
@@ -52,13 +54,13 @@ S2 const& f3()
 // no warning expected
 struct S4
 {
-    OUStringLiteral const cName;
+    std::u16string_view const cName;
     bool const bCanBeVisible;
 };
 S4 const& f4()
 {
     static const S4 s1[] = {
-        { OUStringLiteral(u"/DocColor"), false },
+        { std::u16string_view(u"/DocColor"), false },
     };
     return s1[0];
 }
diff --git a/compilerplugins/clang/test/stringadd.cxx 
b/compilerplugins/clang/test/stringadd.cxx
index 0879805d3449..e17b207fcb64 100644
--- a/compilerplugins/clang/test/stringadd.cxx
+++ b/compilerplugins/clang/test/stringadd.cxx
@@ -18,7 +18,7 @@
 namespace test1
 {
 static const char XXX1[] = "xxx";
-static const char16_t XXX1u[] = u"xxx";
+static constexpr char16_t XXX1u[] = u"xxx";
 static const char XXX2[] = "xxx";
 void f1(OUString s1, int i, OString o)
 {
diff --git a/compilerplugins/clang/test/stringconcatliterals.cxx 
b/compilerplugins/clang/test/stringconcatliterals.cxx
index 348440f0ec4c..d19ebb97c1c3 100644
--- a/compilerplugins/clang/test/stringconcatliterals.cxx
+++ b/compilerplugins/clang/test/stringconcatliterals.cxx
@@ -20,7 +20,7 @@
 void f(std::ostream& s1)
 {
     static constexpr char foo[] = "foo";
-    static char16_t const foou[] = u"foo";
+    static constexpr char16_t foou[] = u"foo";
     s1 << "foo"
        << "foo";
     // expected-error@-1 {{replace '<<' between string literals with 
juxtaposition}}
@@ -37,9 +37,6 @@ void f(std::ostream& s1)
     s1 << "foo" << OUString(FOO);
     // expected-error@-1 {{replace '<<' between string literals with 
juxtaposition}}
     s1 << "foo" << OUString(foo);
-    s1 << "foo" << OUStringLiteral(u"foo"); //TODO: warn too, OUStringLiteral 
wrapped in OUString
-    s1 << "foo" << OUStringLiteral(FOOu); //TODO: warn too, OUStringLiteral 
wrapped in OUString
-    s1 << "foo" << OUStringLiteral(foou);
     OString s2;
     s2 = "foo" + OString("foo");
     // expected-error@-1 {{replace '+' between string literals with 
juxtaposition}}
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx 
b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
index 65cb6a4fe8a5..97cdd9775c7f 100644
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
@@ -26,6 +26,8 @@
 
 #include <cstddef>
 #include <string.h>
+#include <string_view>
+
 #include "EApi.h"
 
 using namespace connectivity::evoab;
@@ -978,7 +980,7 @@ Reference< XResultSet > SAL_CALL 
OEvoabDatabaseMetaData::getTableTypes(  )
     /* Don't need to change as evoab driver supports only table */
 
     // there exists no possibility to get table types so we have to check
-    static const OUStringLiteral sTableTypes[] =
+    static const std::u16string_view sTableTypes[] =
     {
         u"TABLE" // Currently we only support a 'TABLE' nothing more complex
     };
diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx 
b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
index 24275f3cd7ed..b14c1372c9a3 100644
--- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <sal/macros.h>
 #include <java/sql/DatabaseMetaData.hxx>
 #include <java/sql/Connection.hxx>
@@ -430,7 +434,7 @@ Reference< XResultSet > SAL_CALL 
java_sql_DatabaseMetaData::getTablePrivileges(
             {
                 // here we know that the count of column doesn't match
                 std::map<sal_Int32,sal_Int32> aColumnMatching;
-                static const OUStringLiteral sPrivs[] = {
+                static const std::u16string_view sPrivs[] = {
                                             u"TABLE_CAT",
                                             u"TABLE_SCHEM",
                                             u"TABLE_NAME",
diff --git a/connectivity/source/drivers/mork/MDatabaseMetaData.cxx 
b/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
index 012fa929fce1..959494095b9f 100644
--- a/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
@@ -13,6 +13,8 @@
 #include <com/sun/star/sdbc/TransactionIsolation.hpp>
 #include <com/sun/star/sdbc/ColumnSearch.hpp>
 #include <sal/log.hxx>
+
+#include <string_view>
 #include <vector>
 
 #include "MDatabaseMetaDataHelper.hxx"
@@ -795,7 +797,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates(  
)
 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes(  )
 {
     // there exists no possibility to get table types so we have to check
-    static const OUStringLiteral sTableTypes[] =
+    static const std::u16string_view sTableTypes[] =
     {
         u"TABLE",
         u"VIEW"
diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index b49e2ad267c1..194d746d9452 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -15,6 +15,7 @@
 #include <cstring>
 #include <set>
 #include <stack>
+#include <string_view>
 #include <vector>
 
 #include <com/sun/star/container/NoSuchElementException.hpp>
@@ -1802,27 +1803,27 @@ cppuhelper::TypeManager::TypeManager():
 css::uno::Any cppuhelper::TypeManager::find(OUString const & name) {
     //TODO: caching? (here or in unoidl::Manager?)
     struct Simple {
-        OUStringLiteral name;
+        std::u16string_view name;
         css::uno::TypeClass typeClass;
     };
     static Simple const simple[] = {
-        { OUStringLiteral(u"void"), css::uno::TypeClass_VOID },
-        { OUStringLiteral(u"boolean"), css::uno::TypeClass_BOOLEAN },
-        { OUStringLiteral(u"byte"), css::uno::TypeClass_BYTE },
-        { OUStringLiteral(u"short"), css::uno::TypeClass_SHORT },
-        { OUStringLiteral(u"unsigned short"),
+        { std::u16string_view(u"void"), css::uno::TypeClass_VOID },
+        { std::u16string_view(u"boolean"), css::uno::TypeClass_BOOLEAN },
+        { std::u16string_view(u"byte"), css::uno::TypeClass_BYTE },
+        { std::u16string_view(u"short"), css::uno::TypeClass_SHORT },
+        { std::u16string_view(u"unsigned short"),
           css::uno::TypeClass_UNSIGNED_SHORT },
-        { OUStringLiteral(u"long"), css::uno::TypeClass_LONG },
-        { OUStringLiteral(u"unsigned long"), css::uno::TypeClass_UNSIGNED_LONG 
},
-        { OUStringLiteral(u"hyper"), css::uno::TypeClass_HYPER },
-        { OUStringLiteral(u"unsigned hyper"),
+        { std::u16string_view(u"long"), css::uno::TypeClass_LONG },
+        { std::u16string_view(u"unsigned long"), 
css::uno::TypeClass_UNSIGNED_LONG },
+        { std::u16string_view(u"hyper"), css::uno::TypeClass_HYPER },
+        { std::u16string_view(u"unsigned hyper"),
           css::uno::TypeClass_UNSIGNED_HYPER },
-        { OUStringLiteral(u"float"), css::uno::TypeClass_FLOAT },
-        { OUStringLiteral(u"double"), css::uno::TypeClass_DOUBLE },
-        { OUStringLiteral(u"char"), css::uno::TypeClass_CHAR },
-        { OUStringLiteral(u"string"), css::uno::TypeClass_STRING },
-        { OUStringLiteral(u"type"), css::uno::TypeClass_TYPE },
-        { OUStringLiteral(u"any"), css::uno::TypeClass_ANY } };
+        { std::u16string_view(u"float"), css::uno::TypeClass_FLOAT },
+        { std::u16string_view(u"double"), css::uno::TypeClass_DOUBLE },
+        { std::u16string_view(u"char"), css::uno::TypeClass_CHAR },
+        { std::u16string_view(u"string"), css::uno::TypeClass_STRING },
+        { std::u16string_view(u"type"), css::uno::TypeClass_TYPE },
+        { std::u16string_view(u"any"), css::uno::TypeClass_ANY } };
     for (std::size_t i = 0; i != SAL_N_ELEMENTS(simple); ++i) {
         if (name == simple[i].name) {
             return css::uno::makeAny<
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 6a2a81bcc89e..78bb8be5d8f8 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -194,7 +194,7 @@ void SvxScriptOrgDialog::Init( const OUString& language  )
         Reference< browse::XBrowseNode > langEntries =
             getLangNodeFromRootNode( childNode, language );
 
-        insertEntry( uiName, app ? OUStringLiteral(u"" RID_CUIBMP_HARDDISK) : 
OUStringLiteral(u"" RID_CUIBMP_DOC),
+        insertEntry( uiName, app ? OUString(RID_CUIBMP_HARDDISK) : 
OUString(RID_CUIBMP_DOC),
             nullptr, true, std::make_unique< SFEntry >( langEntries, 
xDocumentModel ), factoryURL, false );
     }
 
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index dab1f2e2244a..f72f15fa6619 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -51,7 +51,7 @@ const char ITEM_DESCRIPTOR_RESOURCEURL[] = "ResourceURL";
 const char ITEM_DESCRIPTOR_UINAME[]      = "UIName";
 
 const char ITEM_MENUBAR_URL[] = "private:resource/menubar/menubar";
-const char16_t ITEM_TOOLBAR_URL[] = u"private:resource/toolbar/";
+constexpr char16_t ITEM_TOOLBAR_URL[] = u"private:resource/toolbar/";
 
 const char CUSTOM_TOOLBAR_STR[] = "custom_toolbar_";
 
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index f96f0ceefab3..25a2f9a679e1 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -18,6 +18,8 @@
  */
 
 #include <memory>
+#include <string_view>
+
 #include <config_features.h>
 #include <config_feature_opencl.h>
 #include <config_feature_desktop.h>
@@ -136,7 +138,7 @@ namespace {
 
 struct ModuleToGroupNameMap_Impl
 {
-    OUStringLiteral m_pModule;
+    std::u16string_view m_pModule;
     OUString    m_sGroupName;
     sal_uInt16  m_nNodeId;
 };
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index d192f1054474..4f42609ec0cf 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <sfx2/objsh.hxx>
 #include <svx/svxids.hrc>
 
@@ -275,7 +279,7 @@ SvxBorderTabPage::SvxBorderTabPage(weld::Container* pPage, 
weld::DialogControlle
     , 
m_xRemoveAdjcentCellBordersCB(m_xBuilder->weld_check_button("rmadjcellborders"))
     , 
m_xRemoveAdjcentCellBordersFT(m_xBuilder->weld_label("rmadjcellbordersft"))
 {
-    static std::vector<OUStringLiteral> aBorderImageIds;
+    static std::vector<std::u16string_view> aBorderImageIds;
 
     if (aBorderImageIds.empty())
     {
@@ -323,7 +327,7 @@ SvxBorderTabPage::SvxBorderTabPage(weld::Container* pPage, 
weld::DialogControlle
     for (auto const & rImageId : aBorderImageIds)
         m_aBorderImgVec.emplace_back(StockImage::Yes, rImageId);
 
-    static std::vector<OUStringLiteral> aShadowImageIds;
+    static std::vector<std::u16string_view> aShadowImageIds;
     if (aShadowImageIds.empty())
     {
         if (comphelper::LibreOfficeKit::isActive())
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx 
b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index d333d4ba05f0..06745cacabcc 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -53,6 +53,7 @@
 #include <unotools/sharedunocomponent.hxx>
 
 #include <memory>
+#include <string_view>
 
 using namespace ::dbaccess;
 using namespace ::dbtools;
@@ -1725,7 +1726,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( 
const Reference< XPropert
         if ( !sFilter.isEmpty() && !aSQL.isEmpty() )
         {
             sFilter = L_BRACKET + sFilter + R_BRACKET +
-                (andCriteria ? OUStringLiteral(u"" STR_AND) : 
OUStringLiteral(u"" STR_OR));
+                (andCriteria ? std::u16string_view(u"" STR_AND) : 
std::u16string_view(u"" STR_OR));
         }
         sFilter += aSQL;
 
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx 
b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index d8415b6c2b94..030c8caf07e8 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -2225,7 +2225,7 @@ OUString OSelectionBrowseBox::GetCellContents(sal_Int32 
nCellIndex, sal_uInt16 n
     switch (nCellIndex)
     {
         case BROW_VIS_ROW :
-            return pEntry->IsVisible() ? OUStringLiteral(u"1") : 
OUStringLiteral(u"0");
+            return pEntry->IsVisible() ? std::u16string_view(u"1") : 
std::u16string_view(u"0");
         case BROW_ORDER_ROW:
         {
             sal_Int32 nIdx = m_pOrderCell->get_widget().get_active();
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx 
b/desktop/source/deployment/registry/component/dp_component.cxx
index ce6951c4b89e..3ff6d653477a 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -49,6 +49,7 @@
 #include <algorithm>
 #include <deque>
 #include <memory>
+#include <string_view>
 #include <unordered_map>
 #include <vector>
 #include "dp_compbackenddb.hxx"
@@ -423,7 +424,7 @@ void BackendImpl::initServiceRdbFiles()
             &oldRDB, makeURL( getCachePath(), m_commonRDB_orig),
             xCmdEnv, false /* no throw */ );
     }
-    m_commonRDB = m_commonRDB_orig == "common.rdb" ? 
OUStringLiteral(u"common_.rdb") : OUStringLiteral(u"common.rdb");
+    m_commonRDB = m_commonRDB_orig == "common.rdb" ? 
std::u16string_view(u"common_.rdb") : std::u16string_view(u"common.rdb");
     if (oldRDB.get().is())
     {
         cacheDir.transferContent(
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx 
b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index 04b56bf46c61..f4c691fec9aa 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <config_folders.h>
 
 #include <vcl/svapp.hxx>
@@ -259,7 +263,7 @@ void printf_package(
         if (reg.IsAmbiguous)
             value = "unknown";
         else
-            value = reg.Value ? OUStringLiteral(u"yes") : 
OUStringLiteral(u"no");
+            value = reg.Value ? std::u16string_view(u"yes") : 
std::u16string_view(u"no");
     }
     else
         value = "n/a";
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 86a2c8062077..d4a3364f44fa 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -52,6 +52,7 @@
 
 #include <initializer_list>
 #include <memory>
+#include <string_view>
 
 using namespace ::cppu;
 using namespace ::com::sun::star;
@@ -2160,7 +2161,7 @@ uno::Sequence< OUString > SAL_CALL 
SvxUnoTextBase::getSupportedServiceNames_Stat
 {
     return comphelper::concatSequences(
         SvxUnoTextRangeBase::getSupportedServiceNames_Static(),
-        std::initializer_list<OUStringLiteral>{ u"com.sun.star.text.Text" });
+        std::initializer_list<std::u16string_view>{ u"com.sun.star.text.Text" 
});
 }
 
 namespace
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index a4573057df65..8aa040c97637 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -20,6 +20,7 @@
 #include <sal/config.h>
 
 #include <initializer_list>
+#include <string_view>
 
 #include <o3tl/safeint.hxx>
 #include <vcl/svapp.hxx>
@@ -365,7 +366,7 @@ uno::Sequence< OUString > SAL_CALL 
SvxUnoTextContent::getSupportedServiceNames()
 {
     return comphelper::concatSequences(
         SvxUnoTextRangeBase::getSupportedServiceNames(),
-        std::initializer_list<OUStringLiteral>{ 
u"com.sun.star.style.ParagraphProperties",
+        std::initializer_list<std::u16string_view>{ 
u"com.sun.star.style.ParagraphProperties",
                                           
u"com.sun.star.style.ParagraphPropertiesComplex",
                                           
u"com.sun.star.style.ParagraphPropertiesAsian",
                                           u"com.sun.star.text.TextContent",
@@ -644,7 +645,7 @@ uno::Sequence< OUString > SAL_CALL 
SvxUnoTextCursor::getSupportedServiceNames()
 {
     return comphelper::concatSequences(
         SvxUnoTextRangeBase::getSupportedServiceNames(),
-        std::initializer_list<OUStringLiteral>{ 
u"com.sun.star.style.ParagraphProperties",
+        std::initializer_list<std::u16string_view>{ 
u"com.sun.star.style.ParagraphProperties",
                                           
u"com.sun.star.style.ParagraphPropertiesComplex",
                                           
u"com.sun.star.style.ParagraphPropertiesAsian",
                                           u"com.sun.star.text.TextCursor" });
diff --git a/embeddedobj/source/msole/oleembed.cxx 
b/embeddedobj/source/msole/oleembed.cxx
index 70d2b5d0a7d9..b22ece2f7cea 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <oleembobj.hxx>
 #include <com/sun/star/embed/EmbedStates.hpp>
 #include <com/sun/star/embed/EmbedVerbs.hpp>
@@ -698,7 +702,7 @@ namespace
 
         //various stream names that can contain the real document contents for
         //this object in a straightforward direct way
-        static const OUStringLiteral aStreamNames[] =
+        static const std::u16string_view aStreamNames[] =
         {
             u"CONTENTS",
             u"Package",
diff --git a/extensions/IwyuFilter_extensions.yaml 
b/extensions/IwyuFilter_extensions.yaml
index ad9759f07188..043e83076d66 100644
--- a/extensions/IwyuFilter_extensions.yaml
+++ b/extensions/IwyuFilter_extensions.yaml
@@ -10,9 +10,6 @@ excludelist:
     extensions/source/abpilot/unodialogabp.cxx:
     # Needed for direct member access
     - com/sun/star/awt/XWindow.hpp
-    extensions/source/bibliography/bibmod.cxx:
-    # Needed for STATIC_USTRING macro + extern string magic to work at linking 
time
-    - bibprop.hxx
     extensions/source/bibliography/framectr.cxx:
     # Don't propose hxx -> h change in URE libs
     - cppuhelper/interfacecontainer.hxx
diff --git a/extensions/source/abpilot/fieldmappingimpl.cxx 
b/extensions/source/abpilot/fieldmappingimpl.cxx
index 6284aa977ff5..df003f36d07f 100644
--- a/extensions/source/abpilot/fieldmappingimpl.cxx
+++ b/extensions/source/abpilot/fieldmappingimpl.cxx
@@ -153,7 +153,7 @@ namespace abp
 
                 // access the configuration information which the driver uses 
for determining its column names
                 OUString sDriverAliasesNodeName(
-                    OUStringLiteral(sDriverSettingsNodeName)
+                    OUString::Concat(sDriverSettingsNodeName)
                     + "/ColumnAliases");
 
                 // create a config node for this
diff --git a/extensions/source/bibliography/bibconfig.cxx 
b/extensions/source/bibliography/bibconfig.cxx
index c6531cfda7e2..ee271f4cc898 100644
--- a/extensions/source/bibliography/bibconfig.cxx
+++ b/extensions/source/bibliography/bibconfig.cxx
@@ -33,7 +33,7 @@ using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::sdb;
 
 
-const char16_t cDataSourceHistory[] = u"DataSourceHistory";
+constexpr char16_t cDataSourceHistory[] = u"DataSourceHistory";
 
 Sequence<OUString> const & BibConfig::GetPropertyNames()
 {
diff --git a/extensions/source/bibliography/bibmod.cxx 
b/extensions/source/bibliography/bibmod.cxx
index 3ae8a473a9f8..1a4f6cca47d2 100644
--- a/extensions/source/bibliography/bibmod.cxx
+++ b/extensions/source/bibliography/bibmod.cxx
@@ -20,7 +20,6 @@
 #include <unotools/resmgr.hxx>
 
 #include "bibmod.hxx"
-#include "bibprop.hxx"
 #include "bibresid.hxx"
 #include "datman.hxx"
 #include "bibconfig.hxx"
@@ -87,10 +86,4 @@ BibConfig*  BibModul::GetConfig()
     return pBibConfig;
 }
 
-
-// PropertyNames
-const OUStringLiteral FM_PROP_LABEL = u"Label";
-const OUStringLiteral FM_PROP_CONTROLSOURCE = u"DataField";
-const OUStringLiteral FM_PROP_NAME = u"Name";
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/bibliography/bibprop.hxx 
b/extensions/source/bibliography/bibprop.hxx
deleted file mode 100644
index 5e670bcc6fa9..000000000000
--- a/extensions/source/bibliography/bibprop.hxx
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_EXTENSIONS_SOURCE_BIBLIOGRAPHY_BIBPROP_HXX
-#define INCLUDED_EXTENSIONS_SOURCE_BIBLIOGRAPHY_BIBPROP_HXX
-
-#include <rtl/ustring.hxx>
-
-extern const OUStringLiteral FM_PROP_LABEL;
-extern const OUStringLiteral FM_PROP_NAME;
-extern const OUStringLiteral FM_PROP_CONTROLSOURCE;
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/bibliography/datman.cxx 
b/extensions/source/bibliography/datman.cxx
index d782b01f9f20..47754921b3e9 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -51,7 +51,6 @@
 #include "bibresid.hxx"
 #include "bibmod.hxx"
 #include "bibview.hxx"
-#include "bibprop.hxx"
 #include "toolbar.hxx"
 #include "bibconfig.hxx"
 #include "bibbeam.hxx"
@@ -72,6 +71,11 @@ using namespace ::com::sun::star::form;
 using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::lang;
 
+// PropertyNames
+constexpr OUStringLiteral FM_PROP_LABEL = u"Label";
+constexpr OUStringLiteral FM_PROP_CONTROLSOURCE = u"DataField";
+constexpr OUStringLiteral FM_PROP_NAME = u"Name";
+
 static Reference< XConnection > getConnection(const OUString& _rURL)
 {
     // first get the sdb::DataSource corresponding to the url
diff --git a/extensions/source/bibliography/toolbar.cxx 
b/extensions/source/bibliography/toolbar.cxx
index 898d59337399..12f6cb5cb2df 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <comphelper/processfactory.hxx>
 #include <com/sun/star/frame/XDispatch.hpp>
 #include <com/sun/star/frame/XDispatchProvider.hpp>
@@ -597,9 +601,9 @@ void BibToolBar::RebuildToolbar()
 
 void BibToolBar::ApplyImageList()
 {
-    SetItemImage(nTBC_BT_AUTOFILTER, Image(StockImage::Yes, nSymbolsSize == 
SFX_SYMBOLS_SIZE_SMALL ? OUStringLiteral(u"" RID_EXTBMP_AUTOFILTER_SC) : 
OUStringLiteral(u"" RID_EXTBMP_AUTOFILTER_LC)));
-    SetItemImage(nTBC_BT_FILTERCRIT, Image(StockImage::Yes, nSymbolsSize == 
SFX_SYMBOLS_SIZE_SMALL ? OUStringLiteral(u"" RID_EXTBMP_FILTERCRIT_SC) : 
OUStringLiteral(u"" RID_EXTBMP_FILTERCRIT_LC)));
-    SetItemImage(nTBC_BT_REMOVEFILTER, Image(StockImage::Yes, nSymbolsSize == 
SFX_SYMBOLS_SIZE_SMALL ? OUStringLiteral(u"" RID_EXTBMP_REMOVE_FILTER_SORT_SC) 
: OUStringLiteral(u"" RID_EXTBMP_REMOVE_FILTER_SORT_LC)));
+    SetItemImage(nTBC_BT_AUTOFILTER, Image(StockImage::Yes, nSymbolsSize == 
SFX_SYMBOLS_SIZE_SMALL ? std::u16string_view(u"" RID_EXTBMP_AUTOFILTER_SC) : 
std::u16string_view(u"" RID_EXTBMP_AUTOFILTER_LC)));
+    SetItemImage(nTBC_BT_FILTERCRIT, Image(StockImage::Yes, nSymbolsSize == 
SFX_SYMBOLS_SIZE_SMALL ? std::u16string_view(u"" RID_EXTBMP_FILTERCRIT_SC) : 
std::u16string_view(u"" RID_EXTBMP_FILTERCRIT_LC)));
+    SetItemImage(nTBC_BT_REMOVEFILTER, Image(StockImage::Yes, nSymbolsSize == 
SFX_SYMBOLS_SIZE_SMALL ? std::u16string_view(u"" 
RID_EXTBMP_REMOVE_FILTER_SORT_SC) : std::u16string_view(u"" 
RID_EXTBMP_REMOVE_FILTER_SORT_LC)));
     AdjustToolBox();
 }
 
diff --git a/extensions/source/logging/loggerconfig.cxx 
b/extensions/source/logging/loggerconfig.cxx
index a78c1385363d..4fd183099544 100644
--- a/extensions/source/logging/loggerconfig.cxx
+++ b/extensions/source/logging/loggerconfig.cxx
@@ -20,6 +20,7 @@
 
 #include "loggerconfig.hxx"
 #include <stdio.h>
+#include <string_view>
 
 #include <com/sun/star/configuration/theDefaultProvider.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -75,7 +76,7 @@ namespace logging
         {
             struct Variable
             {
-                OUStringLiteral pVariablePattern;
+                std::u16string_view pVariablePattern;
                 OUString sVariableValue;
             };
 
@@ -115,11 +116,11 @@ namespace logging
 
             Variable const aVariables[] =
             {
-                {OUStringLiteral(u"$(loggername)"), sLoggerName},
-                {OUStringLiteral(u"$(date)"), sDate},
-                {OUStringLiteral(u"$(time)"), sTime},
-                {OUStringLiteral(u"$(datetime)"), sDateTime},
-                {OUStringLiteral(u"$(pid)"), aPID}
+                {std::u16string_view(u"$(loggername)"), sLoggerName},
+                {std::u16string_view(u"$(date)"), sDate},
+                {std::u16string_view(u"$(time)"), sTime},
+                {std::u16string_view(u"$(datetime)"), sDateTime},
+                {std::u16string_view(u"$(pid)"), aPID}
             };
 
             for (Variable const & aVariable : aVariables)
@@ -127,7 +128,7 @@ namespace logging
                 sal_Int32 nVariableIndex = _inout_rFileURL.indexOf( 
aVariable.pVariablePattern );
                 if  (nVariableIndex >= 0)
                 {
-                    _inout_rFileURL = _inout_rFileURL.replaceAt( 
nVariableIndex, aVariable.pVariablePattern.size, aVariable.sVariableValue );
+                    _inout_rFileURL = _inout_rFileURL.replaceAt( 
nVariableIndex, aVariable.pVariablePattern.size(), aVariable.sVariableValue );
                 }
             }
         }
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx 
b/extensions/source/propctrlr/formcomponenthandler.cxx
index c8a3cde773ba..fd71ce028da8 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -104,6 +104,7 @@
 
 #include <limits>
 #include <memory>
+#include <string_view>
 
 namespace pcr
 {
@@ -996,8 +997,8 @@ namespace pcr
             aDescriptor.Control = pControl;
 
             aDescriptor.PrimaryButtonId = PROPERTY_ID_TARGET_URL == nPropId
-                ? OUStringLiteral(u"" UID_PROP_DLG_ATTR_TARGET_URL)
-                : OUStringLiteral(u"" UID_PROP_DLG_IMAGE_URL);
+                ? std::u16string_view(u"" UID_PROP_DLG_ATTR_TARGET_URL)
+                : std::u16string_view(u"" UID_PROP_DLG_IMAGE_URL);
             break;
         }
 
@@ -1376,7 +1377,7 @@ namespace pcr
             aDescriptor.HasSecondaryButton = true;
 
         bool bIsDataProperty = ( nPropertyUIFlags & PROP_FLAG_DATA_PROPERTY ) 
!= 0;
-        aDescriptor.Category = bIsDataProperty ? OUStringLiteral(u"Data") : 
OUStringLiteral(u"General");
+        aDescriptor.Category = bIsDataProperty ? std::u16string_view(u"Data") 
: std::u16string_view(u"General");
         return aDescriptor;
     }
 
diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx 
b/extensions/source/propctrlr/selectlabeldialog.cxx
index 05b669aa0d7b..9cefcb72b273 100644
--- a/extensions/source/propctrlr/selectlabeldialog.cxx
+++ b/extensions/source/propctrlr/selectlabeldialog.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include "selectlabeldialog.hxx"
 #include <strings.hrc>
 #include <bitmaps.hlst>
@@ -91,7 +95,7 @@ namespace pcr
             // check which service the allowed components must support
             sal_Int16 nClassId = 0;
             try { nClassId = 
::comphelper::getINT16(m_xControlModel->getPropertyValue(PROPERTY_CLASSID)); } 
catch(...) { }
-            m_sRequiredService = (FormComponentType::RADIOBUTTON == nClassId) 
? OUStringLiteral(u"" SERVICE_COMPONENT_GROUPBOX) : OUStringLiteral(u"" 
SERVICE_COMPONENT_FIXEDTEXT);
+            m_sRequiredService = (FormComponentType::RADIOBUTTON == nClassId) 
? std::u16string_view(u"" SERVICE_COMPONENT_GROUPBOX) : std::u16string_view(u"" 
SERVICE_COMPONENT_FIXEDTEXT);
             m_aRequiredControlImage = (FormComponentType::RADIOBUTTON == 
nClassId) ? OUStringLiteral(u"" RID_EXTBMP_GROUPBOX) : OUStringLiteral(u"" 
RID_EXTBMP_FIXEDTEXT);
 
             // calc the currently set label control (so InsertEntries can calc 
m_xInitialSelection)
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx 
b/filter/source/graphicfilter/ieps/ieps.cxx
index c5ed1970865f..ee1315f2bf28 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -36,6 +36,7 @@
 #include <o3tl/char16_t2wchar_t.hxx>
 #include <o3tl/safeint.hxx>
 #include <memory>
+#include <string_view>
 
 class FilterConfigItem;
 
@@ -303,7 +304,7 @@ static void WriteFileInThread(void *wData)
 
 static bool RenderAsBMPThroughHelper(const sal_uInt8* pBuf, sal_uInt32 
nBytesRead,
                                      Graphic& rGraphic,
-                                     std::initializer_list<OUStringLiteral> 
aProgNames,
+                                     
std::initializer_list<std::u16string_view> aProgNames,
                                      rtl_uString* pArgs[], size_t nArgs)
 {
     oslProcess aProcess = nullptr;
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index dea16cf90d1f..1b8dec4d6672 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -82,7 +82,7 @@ using namespace ::xmloff::token;
 #define SVG_PROP_POSITIONED_CHARACTERS      "UsePositionedCharacters"
 
 // ooo xml elements
-const char16_t aOOOElemTextField[] = u"" NSPREFIX "text_field";
+constexpr char16_t aOOOElemTextField[] = u"" NSPREFIX "text_field";
 
 
 // ooo xml attributes for meta_slide
diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 754090d5512f..2d4fdda1c1ef 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -131,7 +131,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
     framework/source/fwi/helper/mischelper \
     framework/source/fwi/helper/shareablemutex \
     framework/source/fwi/jobs/configaccess \
-    framework/source/fwi/jobs/jobconst \
     framework/source/fwi/threadhelp/transactionmanager \
     framework/source/fwi/uielement/constitemcontainer \
     framework/source/fwi/uielement/itemcontainer \
diff --git a/framework/inc/jobs/jobconst.hxx b/framework/inc/jobs/jobconst.hxx
index 1420f80eef07..b2efb749e3a9 100644
--- a/framework/inc/jobs/jobconst.hxx
+++ b/framework/inc/jobs/jobconst.hxx
@@ -35,9 +35,9 @@ namespace framework{
 class JobConst
 {
     public:
-        static const OUStringLiteral ANSWER_DEACTIVATE_JOB;
-        static const OUStringLiteral ANSWER_SAVE_ARGUMENTS;
-        static const OUStringLiteral ANSWER_SEND_DISPATCHRESULT;
+        static constexpr OUStringLiteral ANSWER_DEACTIVATE_JOB = u"Deactivate";
+        static constexpr OUStringLiteral ANSWER_SAVE_ARGUMENTS = 
u"SaveArguments";
+        static constexpr OUStringLiteral ANSWER_SEND_DISPATCHRESULT = 
u"SendDispatchResult";
 };
 
 } // namespace framework
diff --git a/framework/source/fwi/jobs/jobconst.cxx 
b/framework/source/fwi/jobs/jobconst.cxx
deleted file mode 100644
index 7b2fd41f1e9a..000000000000
--- a/framework/source/fwi/jobs/jobconst.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <jobs/jobconst.hxx>
-
-namespace framework {
-
-const OUStringLiteral JobConst::ANSWER_DEACTIVATE_JOB = u"Deactivate";
-
-const OUStringLiteral JobConst::ANSWER_SAVE_ARGUMENTS = u"SaveArguments";
-
-const OUStringLiteral JobConst::ANSWER_SEND_DISPATCHRESULT = 
u"SendDispatchResult";
-
-} // namespace framework
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index c2eb88fe6f02..baa17fb48726 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -57,6 +57,7 @@
 #include <comphelper/sequenceashashmap.hxx>
 #include <comphelper/servicehelper.hxx>
 #include <memory>
+#include <string_view>
 
 using namespace css;
 using namespace com::sun::star::uno;
@@ -217,7 +218,7 @@ private:
 
 // important: The order and position of the elements must match the constant
 // definition of "css::ui::UIElementType"
-OUStringLiteral UIELEMENTTYPENAMES[] =
+std::u16string_view UIELEMENTTYPENAMES[] =
 {
     u"",  // Dummy value for unknown!
     u"" UIELEMENTTYPE_MENUBAR_NAME,
@@ -356,7 +357,7 @@ void 
ModuleUIConfigurationManager::impl_preloadUIElementTypeList( Layer eLayer,
         return;
 
     OUString aResURLPrefix =
-        RESOURCEURL_PREFIX +
+        OUString::Concat(RESOURCEURL_PREFIX) +
         UIELEMENTTYPENAMES[ nElementType ] +
         "/";
 
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index a46add91a726..9b8a54d50e8c 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -53,6 +53,7 @@
 #include <vcl/svapp.hxx>
 #include <sal/log.hxx>
 
+#include <string_view>
 #include <unordered_map>
 
 using namespace com::sun::star::uno;
@@ -195,7 +196,7 @@ private:
 
 // important: The order and position of the elements must match the constant
 // definition of "css::ui::UIElementType"
-OUStringLiteral UIELEMENTTYPENAMES[] =
+std::u16string_view UIELEMENTTYPENAMES[] =
 {
     u"",  // Dummy value for unknown!
     u"" UIELEMENTTYPE_MENUBAR_NAME,
@@ -282,7 +283,7 @@ void UIConfigurationManager::impl_preloadUIElementTypeList( 
sal_Int16 nElementTy
         if ( xElementTypeStorage.is() )
         {
             OUString aResURLPrefix =
-                RESOURCEURL_PREFIX +
+                OUString::Concat(RESOURCEURL_PREFIX) +
                 UIELEMENTTYPENAMES[ nElementType ] +
                 "/";
 
diff --git a/framework/source/uielement/controlmenucontroller.cxx 
b/framework/source/uielement/controlmenucontroller.cxx
index 34f8428117d6..8741b3d872b0 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -35,6 +35,7 @@
 #include <toolkit/awt/vclxmenu.hxx>
 #include <osl/mutex.hxx>
 #include <memory>
+#include <string_view>
 #include <unordered_map>
 
 #include <bitmaps.hlst>
@@ -65,7 +66,7 @@ static const char* aCommands[] =
     ".uno:ConvertToNavigationBar"
 };
 
-const OUStringLiteral aImgIds[] =
+const std::u16string_view aImgIds[] =
 {
     u"" RID_SVXBMP_EDITBOX,
     u"" RID_SVXBMP_BUTTON,
diff --git a/i18npool/source/localedata/localedata.cxx 
b/i18npool/source/localedata/localedata.cxx
index d9db1822fead..aef93c66fe33 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -1083,7 +1083,7 @@ OUString
 LocaleDataImpl::getIndexKeysByAlgorithm( const Locale& rLocale, const 
OUString& algorithm )
 {
     sal_Unicode **indexArray = getIndexArrayForAlgorithm(rLocale, algorithm);
-    return indexArray ? (OUStringLiteral(u"0-9") + indexArray[2]) : OUString();
+    return indexArray ? (OUString::Concat(u"0-9") + indexArray[2]) : 
OUString();
 }
 
 OUString
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx 
b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 67c7cb6e5ac6..b36cfd7b0925 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -648,15 +648,15 @@ OUString 
NativeNumberSupplierService::getNativeNumberString(const OUString& aNum
 
         struct CasingEntry
         {
-            OUStringLiteral aLiteral;
+            std::u16string_view aLiteral;
             WhichCasing     eCasing;
         };
 
         static const CasingEntry Casings[] =
         {
-            { OUStringLiteral(u"capitalize"), CAPITALIZE },
-            { OUStringLiteral(u"upper"), UPPER },
-            { OUStringLiteral(u"title"), TITLE }
+            { std::u16string_view(u"capitalize"), CAPITALIZE },
+            { std::u16string_view(u"upper"), UPPER },
+            { std::u16string_view(u"title"), TITLE }
         };
 
         sal_Int32 nStripCase = 0;
@@ -665,7 +665,7 @@ OUString 
NativeNumberSupplierService::getNativeNumberString(const OUString& aNum
         {
             if (rNativeNumberParams.startsWith( Casings[nCasing].aLiteral))
             {
-                nStripCase = Casings[nCasing].aLiteral.size;
+                nStripCase = Casings[nCasing].aLiteral.size();
                 break;
             }
         }
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 9800ba8d3020..56968def8d71 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -174,10 +174,10 @@ public:
     }
 
     /** @overload @since LibreOffice 5.4 */
-    OUStringBuffer(OUStringLiteral const & literal):
-        pData(nullptr), nCapacity(literal.size + 16) //TODO: check for overflow
+    template<std::size_t N> OUStringBuffer(OUStringLiteral<N> const & literal):
+        pData(nullptr), nCapacity(literal.getLength() + 16) //TODO: check for 
overflow
     {
-        rtl_uStringbuffer_newFromStr_WithLength(&pData, literal.data, 
literal.size);
+        rtl_uStringbuffer_newFromStr_WithLength(&pData, literal.getStr(), 
literal.getLength());
     }
 #endif
 
@@ -315,13 +315,13 @@ public:
     }
 
     /** @overload @since LibreOffice 5.4 */
-    OUStringBuffer & operator =(OUStringLiteral const & literal) {
-        sal_Int32 const n = literal.size;
+    template<std::size_t N> OUStringBuffer & operator =(OUStringLiteral<N> 
const & literal) {
+        sal_Int32 const n = literal.getLength();
         if (n >= nCapacity) {
             ensureCapacity(n + 16); //TODO: check for overflow
         }
         std::memcpy(
-            pData->buffer, literal.data,
+            pData->buffer, literal.getStr(),
             (n + 1) * sizeof (sal_Unicode)); //TODO: check for overflow
         pData->length = n;
         return *this;
@@ -659,8 +659,8 @@ public:
     }
 
     /** @overload @since LibreOffice 5.4 */
-    OUStringBuffer & append(OUStringLiteral const & literal) {
-        return append(literal.data, literal.size);
+    template<std::size_t N> OUStringBuffer & append(OUStringLiteral<N> const & 
literal) {
+        return append(literal.getStr(), literal.getLength());
     }
 #endif
 
@@ -1037,8 +1037,9 @@ public:
     }
 
     /** @overload @since LibreOffice 5.4 */
-    OUStringBuffer & insert(sal_Int32 offset, OUStringLiteral const & literal) 
{
-        return insert(offset, literal.data, literal.size);
+    template<std::size_t N>
+    OUStringBuffer & insert(sal_Int32 offset, OUStringLiteral<N> const & 
literal) {
+        return insert(offset, literal.getStr(), literal.getLength());
     }
 #endif
 
@@ -1446,12 +1447,13 @@ public:
     }
 
     /** @overload @since LibreOffice 5.4 */
-    sal_Int32 indexOf(OUStringLiteral const & literal, sal_Int32 fromIndex = 0)
+    template<std::size_t N>
+    sal_Int32 indexOf(OUStringLiteral<N> const & literal, sal_Int32 fromIndex 
= 0)
         const
     {
         sal_Int32 n = rtl_ustr_indexOfStr_WithLength(
-            pData->buffer + fromIndex, pData->length - fromIndex, literal.data,
-            literal.size);
+            pData->buffer + fromIndex, pData->length - fromIndex, 
literal.getStr(),
+            literal.getLength());
         return n < 0 ? n : n + fromIndex;
     }
 #endif
@@ -1534,9 +1536,9 @@ public:
     }
 
     /** @overload @since LibreOffice 5.4 */
-    sal_Int32 lastIndexOf(OUStringLiteral const & literal) const {
+    template<std::size_t N> sal_Int32 lastIndexOf(OUStringLiteral<N> const & 
literal) const {
         return rtl_ustr_lastIndexOfStr_WithLength(
-            pData->buffer, pData->length, literal.data, literal.size);
+            pData->buffer, pData->length, literal.getStr(), 
literal.getLength());
     }
 #endif
 
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index eebdc261e4f1..45272b325cc0 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -39,6 +39,7 @@
 #include "rtl/textenc.h"
 
 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
+#include "config_global.h"
 #include "rtl/stringconcat.hxx"
 #endif
 
@@ -68,35 +69,49 @@ class OUStringBuffer;
 /// @cond INTERNAL
 
 /**
-A simple wrapper around string literal.
+A wrapper dressing a string literal as a static-refcount rtl_uString.
 
 This class is not part of public API and is meant to be used only in 
LibreOffice code.
 @since LibreOffice 4.0
 */
-struct SAL_WARN_UNUSED OUStringLiteral
-{
-    template<typename T> constexpr OUStringLiteral(
-        T & literal,
-        typename libreoffice_internal::ConstCharArrayDetector<
-                T, libreoffice_internal::Dummy>::TypeUtf16
-            = libreoffice_internal::Dummy()):
-        size(libreoffice_internal::ConstCharArrayDetector<T>::length),
-        data(
-            
libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal))
-    {
-        assert(
-            libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal));
+template<std::size_t N> class SAL_WARN_UNUSED OUStringLiteral {
+    static_assert(N != 0);
+    static_assert(N - 1 <= std::numeric_limits<sal_Int32>::max(), "literal too 
long");
+
+public:
+#if HAVE_CPP_CONSTEVAL
+    consteval
+#else
+    constexpr
+#endif
+    OUStringLiteral(char16_t const (&literal)[N]) {
+        assert(literal[N - 1] == '\0');
+        //TODO: Use C++20 constexpr std::copy_n (P0202R3):
+        for (std::size_t i = 0; i != N; ++i) {
+            buffer[i] = literal[i];
+        }
     }
 
-    constexpr operator std::u16string_view() const { return {data, 
unsigned(size)}; }
+    constexpr sal_Int32 getLength() const { return length; }
+
+    constexpr sal_Unicode const * getStr() const SAL_RETURNS_NONNULL { return 
buffer; }
 
-    int size;
-    const sal_Unicode* data;
+    constexpr operator std::u16string_view() const { return {buffer, 
sal_uInt32(length)}; }
 
-    // So we can use this struct in some places interchangeably with OUString
-    constexpr sal_Int32 getLength() const { return size; }
+private:
+    // Same layout as rtl_uString (include/rtl/ustring.h):
+    oslInterlockedCount refCount = 0x40000000; // SAL_STRING_STATIC_FLAG 
(sal/rtl/strimp.hxx)
+    sal_Int32 length = N - 1;
+    sal_Unicode buffer[N] = {}; //TODO: drop initialization for C++20 (P1331R2)
 };
 
+#if defined RTL_STRING_UNITTEST
+namespace libreoffice_internal {
+template<std::size_t N> struct 
ExceptConstCharArrayDetector<OUStringLiteral<N>> {};
+template<std::size_t N> struct ExceptCharArrayDetector<OUStringLiteral<N>> {};
+}
+#endif
+
 /// @endcond
 #endif
 
@@ -347,20 +362,11 @@ public:
     /**
       New string from a string literal.
 
-      This constructor is similar to the "direct template" one, but can be
-      useful in cases where the latter does not work, like in
-
-        OUString(flag ? "a" : "bb")
-
-      written as
-
-        OUString(flag ? OUStringLiteral(u"a") : OUStringLiteral(u"bb"))
-
       @since LibreOffice 5.0
     */
-    OUString(OUStringLiteral literal): pData(NULL) {
-        rtl_uString_newFromStr_WithLength(&pData, literal.data, literal.size);
-    }
+    template<std::size_t N> OUString(OUStringLiteral<N> const & literal):
+        pData(const_cast<rtl_uString *>(reinterpret_cast<rtl_uString const 
*>(&literal))) {}
+    template<std::size_t N> OUString(OUStringLiteral<N> &&) = delete;
     /// @endcond
 #endif
 
@@ -552,11 +558,11 @@ public:
     }
 
     /** @overload @since LibreOffice 5.4 */
-    OUString & operator =(OUStringLiteral const & literal) {
-        if (literal.size == 0) {
+    template<std::size_t N> OUString & operator =(OUStringLiteral<N> const & 
literal) {
+        if (literal.getLength() == 0) {
             rtl_uString_new(&pData);
         } else {
-            rtl_uString_newFromStr_WithLength(&pData, literal.data, 
literal.size);
+            rtl_uString_newFromStr_WithLength(&pData, literal.getStr(), 
literal.getLength());
         }
         return *this;
     }
@@ -653,11 +659,11 @@ public:
     operator +=(T &) && = delete;
 
     /** @overload @since LibreOffice 5.4 */
-    OUString & operator +=(OUStringLiteral const & literal) & {
-        rtl_uString_newConcatUtf16L(&pData, pData, literal.data, literal.size);
+    template<std::size_t N> OUString & operator +=(OUStringLiteral<N> const & 
literal) & {
+        rtl_uString_newConcatUtf16L(&pData, pData, literal.getStr(), 
literal.getLength());
         return *this;
     }
-    void operator +=(OUStringLiteral const &) && = delete;
+    template<std::size_t N> void operator +=(OUStringLiteral<N> const &) && = 
delete;
 
     OUString & operator +=(std::u16string_view sv) & {
         if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
@@ -1812,93 +1818,191 @@ public:
        @since LibreOffice 5.0
     */
 
-    friend bool operator ==(OUString const & lhs, OUStringLiteral const & rhs) 
{
+    template<std::size_t N>
+    friend bool operator ==(OUString const & lhs, OUStringLiteral<N> const & 
rhs) {
         return
             rtl_ustr_reverseCompare_WithLength(
-                lhs.pData->buffer, lhs.pData->length, rhs.data, rhs.size)
+                lhs.pData->buffer, lhs.pData->length, rhs.getStr(), 
rhs.getLength())
             == 0;
     }
 
-    friend bool operator !=(OUString const & lhs, OUStringLiteral const & rhs) 
{
+    template<std::size_t N>
+    friend bool operator !=(OUString const & lhs, OUStringLiteral<N> const & 
rhs) {
         return
             rtl_ustr_reverseCompare_WithLength(
-                lhs.pData->buffer, lhs.pData->length, rhs.data, rhs.size)
+                lhs.pData->buffer, lhs.pData->length, rhs.getStr(), 
rhs.getLength())
             != 0;
     }
 
-    friend bool operator <(OUString const & lhs, OUStringLiteral const & rhs) {
+    template<std::size_t N>
+    friend bool operator <(OUString const & lhs, OUStringLiteral<N> const & 
rhs) {
         return
             (rtl_ustr_compare_WithLength(
-                lhs.pData->buffer, lhs.pData->length, rhs.data, rhs.size))
+                lhs.pData->buffer, lhs.pData->length, rhs.getStr(), 
rhs.getLength()))
             < 0;
     }
 
-    friend bool operator <=(OUString const & lhs, OUStringLiteral const & rhs) 
{
+    template<std::size_t N>
+    friend bool operator <=(OUString const & lhs, OUStringLiteral<N> const & 
rhs) {
         return
             (rtl_ustr_compare_WithLength(
-                lhs.pData->buffer, lhs.pData->length, rhs.data, rhs.size))
+                lhs.pData->buffer, lhs.pData->length, rhs.getStr(), 
rhs.getLength()))
             <= 0;
     }
 
-    friend bool operator >(OUString const & lhs, OUStringLiteral const & rhs) {
+    template<std::size_t N>
+    friend bool operator >(OUString const & lhs, OUStringLiteral<N> const & 
rhs) {
         return
             (rtl_ustr_compare_WithLength(
-                lhs.pData->buffer, lhs.pData->length, rhs.data, rhs.size))
+                lhs.pData->buffer, lhs.pData->length, rhs.getStr(), 
rhs.getLength()))
             > 0;
     }
 
-    friend bool operator >=(OUString const & lhs, OUStringLiteral const & rhs) 
{
+    template<std::size_t N>
+    friend bool operator >=(OUString const & lhs, OUStringLiteral<N> const & 
rhs) {
         return
             (rtl_ustr_compare_WithLength(
-                lhs.pData->buffer, lhs.pData->length, rhs.data, rhs.size))
+                lhs.pData->buffer, lhs.pData->length, rhs.getStr(), 
rhs.getLength()))
             >= 0;
     }
 
-    friend bool operator ==(OUStringLiteral const & lhs, OUString const & rhs) 
{
+    template<std::size_t N>
+    friend bool operator ==(OUStringLiteral<N> const & lhs, OUString const & 
rhs) {
         return
             rtl_ustr_reverseCompare_WithLength(
-                lhs.data, lhs.size, rhs.pData->buffer, rhs.pData->length)
+                lhs.getStr(), lhs.getLength(), rhs.pData->buffer, 
rhs.pData->length)
             == 0;
     }
 
-    friend bool operator !=(OUStringLiteral const & lhs, OUString const & rhs) 
{
+    template<std::size_t N>
+    friend bool operator !=(OUStringLiteral<N> const & lhs, OUString const & 
rhs) {
         return
             rtl_ustr_reverseCompare_WithLength(
-                lhs.data, lhs.size, rhs.pData->buffer, rhs.pData->length)
+                lhs.getStr(), lhs.getLength(), rhs.pData->buffer, 
rhs.pData->length)
             != 0;
     }
 
-    friend bool operator <(OUStringLiteral const & lhs, OUString const & rhs) {
+    template<std::size_t N>
+    friend bool operator <(OUStringLiteral<N> const & lhs, OUString const & 
rhs) {
         return
             (rtl_ustr_compare_WithLength(
-                lhs.data, lhs.size, rhs.pData->buffer, rhs.pData->length))
+                lhs.getStr(), lhs.getLength(), rhs.pData->buffer, 
rhs.pData->length))
             < 0;
     }
 
-    friend bool operator <=(OUStringLiteral const & lhs, OUString const & rhs) 
{
+    template<std::size_t N>
+    friend bool operator <=(OUStringLiteral<N> const & lhs, OUString const & 
rhs) {
         return
             (rtl_ustr_compare_WithLength(
-                lhs.data, lhs.size, rhs.pData->buffer, rhs.pData->length))
+                lhs.getStr(), lhs.getLength(), rhs.pData->buffer, 
rhs.pData->length))
             <= 0;
     }
 
-    friend bool operator >(OUStringLiteral const & lhs, OUString const & rhs) {
+    template<std::size_t N>
+    friend bool operator >(OUStringLiteral<N> const & lhs, OUString const & 
rhs) {
         return
             (rtl_ustr_compare_WithLength(
-                lhs.data, lhs.size, rhs.pData->buffer, rhs.pData->length))
+                lhs.getStr(), lhs.getLength(), rhs.pData->buffer, 
rhs.pData->length))
             > 0;
     }
 
-    friend bool operator >=(OUStringLiteral const & lhs, OUString const & rhs) 
{
+    template<std::size_t N>
+    friend bool operator >=(OUStringLiteral<N> const & lhs, OUString const & 
rhs) {
         return
             (rtl_ustr_compare_WithLength(
-                lhs.data, lhs.size, rhs.pData->buffer, rhs.pData->length))
+                lhs.getStr(), lhs.getLength(), rhs.pData->buffer, 
rhs.pData->length))
             >= 0;
     }
 
     /// @endcond
 #endif
 
+#if defined LIBO_INTERNAL_ONLY
+    friend bool operator ==(OUString const & lhs, std::u16string_view rhs) {
+        return
+            rtl_ustr_reverseCompare_WithLength(
+                lhs.pData->buffer, lhs.pData->length, rhs.data(), rhs.size())
+            == 0;
+    }
+
+    friend bool operator !=(OUString const & lhs, std::u16string_view rhs) {
+        return
+            rtl_ustr_reverseCompare_WithLength(
+                lhs.pData->buffer, lhs.pData->length, rhs.data(), rhs.size())
+            != 0;
+    }
+
+    friend bool operator <(OUString const & lhs, std::u16string_view rhs) {
+        return
+            (rtl_ustr_compare_WithLength(
+                lhs.pData->buffer, lhs.pData->length, rhs.data(), rhs.size()))
+            < 0;
+    }
+
+    friend bool operator <=(OUString const & lhs, std::u16string_view rhs) {
+        return
+            (rtl_ustr_compare_WithLength(
+                lhs.pData->buffer, lhs.pData->length, rhs.data(), rhs.size()))
+            <= 0;
+    }
+
+    friend bool operator >(OUString const & lhs, std::u16string_view rhs) {
+        return
+            (rtl_ustr_compare_WithLength(
+                lhs.pData->buffer, lhs.pData->length, rhs.data(), rhs.size()))
+            > 0;
+    }
+
+    friend bool operator >=(OUString const & lhs, std::u16string_view rhs) {
+        return
+            (rtl_ustr_compare_WithLength(
+                lhs.pData->buffer, lhs.pData->length, rhs.data(), rhs.size()))
+            >= 0;
+    }
+
+    friend bool operator ==(std::u16string_view lhs, OUString const & rhs) {
+        return
+            rtl_ustr_reverseCompare_WithLength(
+                lhs.data(), lhs.size(), rhs.pData->buffer, rhs.pData->length)
+            == 0;
+    }
+
+    friend bool operator !=(std::u16string_view lhs, OUString const & rhs) {
+        return
+            rtl_ustr_reverseCompare_WithLength(
+                lhs.data(), lhs.size(), rhs.pData->buffer, rhs.pData->length)
+            != 0;
+    }
+
+    friend bool operator <(std::u16string_view lhs, OUString const & rhs) {
+        return
+            (rtl_ustr_compare_WithLength(
+                lhs.data(), lhs.size(), rhs.pData->buffer, rhs.pData->length))
+            < 0;
+    }
+
+    friend bool operator <=(std::u16string_view lhs, OUString const & rhs) {
+        return
+            (rtl_ustr_compare_WithLength(
+                lhs.data(), lhs.size(), rhs.pData->buffer, rhs.pData->length))
+            <= 0;
+    }
+
+    friend bool operator >(std::u16string_view lhs, OUString const & rhs) {
+        return
+            (rtl_ustr_compare_WithLength(
+                lhs.data(), lhs.size(), rhs.pData->buffer, rhs.pData->length))
+            > 0;
+    }
+
+    friend bool operator >=(std::u16string_view lhs, OUString const & rhs) {
+        return
+            (rtl_ustr_compare_WithLength(
+                lhs.data(), lhs.size(), rhs.pData->buffer, rhs.pData->length))
+            >= 0;
+    }
+#endif
+
     /**
       Returns a hashcode for this string.
 
@@ -3295,11 +3399,11 @@ struct ToStringHelper< OUString >
 /**
  @internal
 */
-template<>
-struct ToStringHelper< OUStringLiteral >
+template<std::size_t N>
+struct ToStringHelper< OUStringLiteral<N> >
     {
-    static std::size_t length( const OUStringLiteral& str ) { return str.size; 
}
-    static sal_Unicode* addData( sal_Unicode* buffer, const OUStringLiteral& 
str ) { return addDataHelper( buffer, str.data, str.size ); }
+    static std::size_t length( const OUStringLiteral<N>& str ) { return 
str.getLength(); }
+    static sal_Unicode* addData( sal_Unicode* buffer, const 
OUStringLiteral<N>& str ) { return addDataHelper( buffer, str.getStr(), 
str.getLength() ); }
     static const bool allowOStringConcat = false;
     static const bool allowOUStringConcat = true;
     };
diff --git a/include/svl/itemprop.hxx b/include/svl/itemprop.hxx
index b845e08bb39d..e985977f265a 100644
--- a/include/svl/itemprop.hxx
+++ b/include/svl/itemprop.hxx
@@ -27,6 +27,7 @@
 #include <svl/svldllapi.h>
 #include <vector>
 #include <memory>
+#include <string_view>
 
 // values from com/sun/star/beans/PropertyAttribute
 #define PROPERTY_NONE 0
@@ -34,7 +35,7 @@
 /// map a property between beans::XPropertySet and SfxPoolItem
 struct SfxItemPropertyMapEntry
 {
-    OUStringLiteral                     aName; ///< name of property
+    std::u16string_view                 aName; ///< name of property
     css::uno::Type                      aType; ///< UNO type of property
     sal_uInt16                          nWID;  ///< WhichId of SfxPoolItem
     /// flag bitmap, @see css::beans::PropertyAttribute
@@ -44,7 +45,7 @@ struct SfxItemPropertyMapEntry
     sal_uInt8                           nMemberId;
     PropertyMoreFlags                   nMoreFlags;
 
-    SfxItemPropertyMapEntry(OUStringLiteral _aName, sal_uInt16 _nWID, 
css::uno::Type const & _rType,
+    SfxItemPropertyMapEntry(std::u16string_view _aName, sal_uInt16 _nWID, 
css::uno::Type const & _rType,
                                sal_Int16 _nFlags, sal_uInt8 const _nMemberId, 
PropertyMoreFlags _nMoreFlags = PropertyMoreFlags::NONE)
         : aName(      _aName )
         , aType(     _rType )
diff --git a/include/vcl/IconThemeInfo.hxx b/include/vcl/IconThemeInfo.hxx
index 825a0e14cafa..92892283c8fc 100644
--- a/include/vcl/IconThemeInfo.hxx
+++ b/include/vcl/IconThemeInfo.hxx
@@ -30,7 +30,7 @@ class VCL_DLLPUBLIC IconThemeInfo {
 public:
 
     /** The name of the icon theme to use for high contrast mode */
-    static const OUStringLiteral HIGH_CONTRAST_ID;
+    static constexpr OUStringLiteral HIGH_CONTRAST_ID = u"sifr";
 
     /** Construct an IconThemeInfo from the URL to a file.
      * This method will throw a std::runtime_error if the URL cannot be 
properly parsed.
diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
index 50e65990362b..2495f0f504d0 100644
--- a/include/xmloff/txtparae.hxx
+++ b/include/xmloff/txtparae.hxx
@@ -130,28 +130,28 @@ public:
 private:
 
     // Implement Title/Description Elements UI (#i73249#)
-    static const OUStringLiteral gsAnchorCharStyleName;
-    static const OUStringLiteral gsBeginNotice;
-    static const OUStringLiteral gsCategory;
-    static const OUStringLiteral gsCharStyleName;
-    static const OUStringLiteral gsCharStyleNames;
-    static const OUStringLiteral gsEndNotice;
-    static const OUStringLiteral gsFootnote;
-    static const OUStringLiteral gsFootnoteCounting;
-    static const OUStringLiteral gsNumberingType;
-    static const OUStringLiteral gsPageDescName;
-    static const OUStringLiteral gsPageStyleName;
-    static const OUStringLiteral gsParaStyleName;
-    static const OUStringLiteral gsPositionEndOfDoc;
-    static const OUStringLiteral gsPrefix;
-    static const OUStringLiteral gsReferenceId;
-    static const OUStringLiteral gsStartAt;
-    static const OUStringLiteral gsSuffix;
-    static const OUStringLiteral gsTextEndnoteService;
-    static const OUStringLiteral gsTextSection;
+    static constexpr OUStringLiteral gsAnchorCharStyleName = 
u"AnchorCharStyleName";
+    static constexpr OUStringLiteral gsBeginNotice = u"BeginNotice";
+    static constexpr OUStringLiteral gsCategory = u"Category";
+    static constexpr OUStringLiteral gsCharStyleName = u"CharStyleName";
+    static constexpr OUStringLiteral gsCharStyleNames = u"CharStyleNames";
+    static constexpr OUStringLiteral gsEndNotice = u"EndNotice";
+    static constexpr OUStringLiteral gsFootnote = u"Footnote";
+    static constexpr OUStringLiteral gsFootnoteCounting = u"FootnoteCounting";
+    static constexpr OUStringLiteral gsNumberingType = u"NumberingType";
+    static constexpr OUStringLiteral gsPageDescName = u"PageDescName";
+    static constexpr OUStringLiteral gsPageStyleName = u"PageStyleName";
+    static constexpr OUStringLiteral gsParaStyleName = u"ParaStyleName";
+    static constexpr OUStringLiteral gsPositionEndOfDoc = u"PositionEndOfDoc";
+    static constexpr OUStringLiteral gsPrefix = u"Prefix";
+    static constexpr OUStringLiteral gsReferenceId = u"ReferenceId";
+    static constexpr OUStringLiteral gsStartAt = u"StartAt";
+    static constexpr OUStringLiteral gsSuffix = u"Suffix";
+    static constexpr OUStringLiteral gsTextEndnoteService = 
u"com.sun.star.text.Endnote";
+    static constexpr OUStringLiteral gsTextSection = u"TextSection";
 
 protected:
-    static const OUStringLiteral gsFrameStyleName;
+    static constexpr OUStringLiteral gsFrameStyleName = u"FrameStyleName";
     SinglePropertySetInfoCache aCharStyleNamesPropInfoCache;
 
     SvXMLAutoStylePoolP& GetAutoStylePool() { return rAutoStylePool; }
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index 0f40ef548ceb..b73f565f5837 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -535,8 +535,8 @@ public:
     **/
     bool getBuildIds( sal_Int32& rUPD, sal_Int32& rBuild ) const;
 
-    static const OUStringLiteral aDefaultNamespace;
-    static const OUStringLiteral aNamespaceSeparator;
+    static constexpr OUStringLiteral aDefaultNamespace = u"";
+    static constexpr OUStringLiteral aNamespaceSeparator = u":";
 
     static const sal_uInt16 OOo_1x = 10;
     static const sal_uInt16 OOo_2x = 20;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 42896ac36d0f..f47b0a3ee4fd 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -35,6 +35,7 @@
 
 #include <cassert>
 #include <memory>
+#include <string_view>
 #include <utility>
 #include <vector>
 
@@ -466,7 +467,7 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
 // think it should be, do nothing, and just let the implicit loading
 // that happens when loading the JVM take care of it.
 
-static void load_msvcr(OUString const & jvm_dll, OUStringLiteral msvcr)
+static void load_msvcr(OUString const & jvm_dll, std::u16string_view msvcr)
 {
     // First check if msvcr71.dll is in the same folder as jvm.dll. It
     // normally isn't, at least up to 1.6.0_22, but who knows if it
@@ -575,7 +576,7 @@ static void do_msvcr_magic(OUString const &jvm_dll)
            imports->Name != 0 &&
            imports->Name + VAtoPhys < static_cast<DWORD>(st.st_size))
     {
-        static OUStringLiteral msvcrts[] =
+        static std::u16string_view msvcrts[] =
         {
             u"msvcr71.dll",
             u"msvcr100.dll"
@@ -585,7 +586,7 @@ static void do_msvcr_magic(OUString const &jvm_dll)
         for (size_t i = 0; i < SAL_N_ELEMENTS(msvcrts); ++i)
         {
             if (0 == rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(
-                    msvcrts[i].data, msvcrts[i].size,
+                    msvcrts[i].data(), msvcrts[i].size(),
                     importName, importNameLen))
             {
                 load_msvcr(Module, msvcrts[i]);
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index ab55d4447bb8..35fc924a0813 100644

... etc. - the rest is truncated
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to