sw/inc/fmtcol.hxx                            |   27 ++-------------------------
 sw/inc/format.hxx                            |    4 +---
 sw/inc/frmfmt.hxx                            |    7 -------
 sw/source/core/attr/format.cxx               |   25 ++-----------------------
 sw/source/core/doc/DocumentLayoutManager.cxx |    2 +-
 sw/source/core/doc/docdesc.cxx               |    4 ++--
 sw/source/core/doc/docfmt.cxx                |    4 ++--
 sw/source/core/doc/docnew.cxx                |   10 +++++-----
 sw/source/core/layout/atrfrm.cxx             |   11 -----------
 9 files changed, 15 insertions(+), 79 deletions(-)

New commits:
commit 51f3916a102c3a3c16dd84310aadfa3c935e516b
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu May 2 14:39:14 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri May 3 21:26:59 2024 +0200

    replace createFromAscii with OUString literals in SwFormat
    
    Change-Id: I53ec6e3914ef995a4fd708ea0f1c2976673d97d8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167090
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index 04b28e5bcf30..8ff61b8d0e98 100644
--- a/sw/inc/fmtcol.hxx
+++ b/sw/inc/fmtcol.hxx
@@ -37,12 +37,6 @@ namespace sw{ class DocumentStylePoolManager; }
 class SAL_DLLPUBLIC_RTTI SwFormatColl: public SwFormat
 {
 protected:
-    SwFormatColl( SwAttrPool& rPool, const char* pFormatName,
-                const WhichRangesContainer& pWhichRanges, SwFormatColl* 
pDerFrom,
-                sal_uInt16 nFormatWhich )
-          : SwFormat( rPool, pFormatName, pWhichRanges, pDerFrom, nFormatWhich 
)
-    { SetAuto(false); }
-
     SwFormatColl( SwAttrPool& rPool, const OUString &rFormatName,
                 const WhichRangesContainer& pWhichRanges, SwFormatColl* 
pDerFrom,
                 sal_uInt16 nFormatWhich )
@@ -75,19 +69,8 @@ class SAL_DLLPUBLIC_RTTI SwTextFormatColl
     SwCharFormat* mpLinkedCharFormat = nullptr;
 
 protected:
-    SwTextFormatColl( SwAttrPool& rPool, const char* pFormatCollName,
-                    SwTextFormatColl* pDerFrom = nullptr,
-                    sal_uInt16 nFormatWh = RES_TXTFMTCOLL )
-        : SwFormatColl(rPool, pFormatCollName, aTextFormatCollSetRange, 
pDerFrom, nFormatWh)
-        , mbStayAssignedToListLevelOfOutlineStyle(false)
-        , mbAssignedToOutlineStyle(false)
-        , m_bInSwFntCache(false)
-    {
-        mpNextTextFormatColl = this;
-    }
-
     SwTextFormatColl( SwAttrPool& rPool, const OUString &rFormatCollName,
-                    SwTextFormatColl* pDerFrom,
+                    SwTextFormatColl* pDerFrom = nullptr,
                     sal_uInt16 nFormatWh = RES_TXTFMTCOLL )
         : SwFormatColl(rPool, rFormatCollName, aTextFormatCollSetRange, 
pDerFrom, nFormatWh)
         , mbStayAssignedToListLevelOfOutlineStyle(false)
@@ -177,14 +160,8 @@ class SwGrfFormatColl final : public SwFormatColl
 {
     friend class SwDoc;
 
-    SwGrfFormatColl( SwAttrPool& rPool, const char* pFormatCollName,
-                    SwGrfFormatColl* pDerFrom = nullptr )
-        : SwFormatColl( rPool, pFormatCollName, aGrfFormatCollSetRange,
-                    pDerFrom, RES_GRFFMTCOLL )
-    {}
-
     SwGrfFormatColl( SwAttrPool& rPool, const OUString &rFormatCollName,
-                    SwGrfFormatColl* pDerFrom )
+                    SwGrfFormatColl* pDerFrom = nullptr )
         : SwFormatColl( rPool, rFormatCollName, aGrfFormatCollSetRange,
                     pDerFrom, RES_GRFFMTCOLL )
     {}
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index 92c7b73b73bf..5f0a2307893d 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -66,10 +66,8 @@ class SAL_DLLPUBLIC_RTTI SwFormat : public 
sw::BorderCacheOwner, public sw::Broa
     virtual void InvalidateInSwFntCache(sal_uInt16) {};
 
 protected:
-    SwFormat( SwAttrPool& rPool, const char* pFormatNm,
+    SwFormat( SwAttrPool& rPool, const OUString& rFormatNm,
             const WhichRangesContainer& pWhichRanges, SwFormat *pDrvdFrame, 
sal_uInt16 nFormatWhich );
-    SwFormat( SwAttrPool& rPool, OUString aFormatNm, const 
WhichRangesContainer& pWhichRanges,
-            SwFormat *pDrvdFrame, sal_uInt16 nFormatWhich );
     SwFormat( const SwFormat& rFormat );
     virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
     void Destr();
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 3c3203be5b89..a27ec875aef5 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -97,13 +97,6 @@ class SAL_DLLPUBLIC_RTTI SwFrameFormat
     };
 
 protected:
-    SwFrameFormat(
-        SwAttrPool& rPool,
-        const char* pFormatNm,
-        SwFrameFormat *pDrvdFrame,
-        sal_uInt16 nFormatWhich = RES_FRMFMT,
-        const WhichRangesContainer& pWhichRange = aFrameFormatSetRange);
-
     SwFrameFormat(
         SwAttrPool& rPool,
         const OUString &rFormatNm,
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index bcc8920cce73..8f38f7fc8ba8 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -36,31 +36,10 @@
 
 using namespace com::sun::star;
 
-SwFormat::SwFormat( SwAttrPool& rPool, const char* pFormatNm,
+SwFormat::SwFormat( SwAttrPool& rPool, const OUString& rFormatNm,
               const WhichRangesContainer& pWhichRanges, SwFormat *pDrvdFrame,
               sal_uInt16 nFormatWhich ) :
-    m_aFormatName( OUString::createFromAscii(pFormatNm) ),
-    m_aSet( rPool, pWhichRanges ),
-    m_nWhichId( nFormatWhich ),
-    m_nPoolFormatId( USHRT_MAX ),
-    m_nPoolHelpId( USHRT_MAX ),
-    m_nPoolHlpFileId( UCHAR_MAX )
-{
-    m_bAutoUpdateOnDirectFormat = false; // LAYER_IMPL
-    m_bAutoFormat = true;
-    m_bFormatInDTOR = m_bHidden = false;
-
-    if( pDrvdFrame )
-    {
-        pDrvdFrame->Add(*this);
-        m_aSet.SetParent( &pDrvdFrame->m_aSet );
-    }
-}
-
-SwFormat::SwFormat( SwAttrPool& rPool, OUString aFormatNm,
-              const WhichRangesContainer& pWhichRanges, SwFormat* pDrvdFrame,
-              sal_uInt16 nFormatWhich ) :
-    m_aFormatName( std::move(aFormatNm) ),
+    m_aFormatName( rFormatNm ),
     m_aSet( rPool, pWhichRanges ),
     m_nWhichId( nFormatWhich ),
     m_nPoolFormatId( USHRT_MAX ),
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx 
b/sw/source/core/doc/DocumentLayoutManager.cxx
index dc2b34977173..c1d7cfb2edf7 100644
--- a/sw/source/core/doc/DocumentLayoutManager.cxx
+++ b/sw/source/core/doc/DocumentLayoutManager.cxx
@@ -129,7 +129,7 @@ SwFrameFormat *DocumentLayoutManager::MakeLayoutFormat( 
RndStdIds eRequest, cons
     case RndStdIds::FOOTER:
         {
             pFormat = new SwFrameFormat( m_rDoc.GetAttrPool(),
-                                 (bHeader ? "Right header" : "Right footer"),
+                                 (bHeader ? u"Right header"_ustr : u"Right 
footer"_ustr),
                                  m_rDoc.GetDfltFrameFormat() );
 
             const SwNode& rEndOfAutotext( m_rDoc.GetNodes().GetEndOfAutotext() 
);
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index a8e803957bc6..0209c6af49ab 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -289,7 +289,7 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, 
const SwFormatHeader &rHe
                      (bFirst ? rDesc.IsFirstShared() : rDesc.IsHeaderShared()))
                 {
                     SwFrameFormat *pFormat = new SwFrameFormat( GetAttrPool(),
-                            bFirst ? "First header" : "Left header",
+                            bFirst ? u"First header"_ustr : u"Left 
header"_ustr,
                                                     GetDfltFrameFormat() );
                     ::lcl_DescSetAttr( *pRight, *pFormat, false );
                     // The section which the right header attribute is pointing
@@ -366,7 +366,7 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, 
const SwFormatFooter &rFo
                      (bFirst ? rDesc.IsFirstShared() : rDesc.IsFooterShared()))
                 {
                     SwFrameFormat *pFormat = new SwFrameFormat( GetAttrPool(),
-                            bFirst ? "First footer" : "Left footer",
+                            bFirst ? u"First footer"_ustr : u"Left 
footer"_ustr,
                                                     GetDfltFrameFormat() );
                     ::lcl_DescSetAttr( *pRight, *pFormat, false );
                     // The section to which the right footer attribute is 
pointing
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 97321edb1912..6690ae418831 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1390,7 +1390,7 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader,
     if( !pOldFormat )
         return;
 
-    SwFrameFormat* pNewFormat = new SwFrameFormat( GetAttrPool(), "CpyDesc",
+    SwFrameFormat* pNewFormat = new SwFrameFormat( GetAttrPool(), 
u"CpyDesc"_ustr,
                                         GetDfltFrameFormat() );
     pNewFormat->CopyAttrs( *pOldFormat );
 
@@ -1559,7 +1559,7 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, 
SwPageDesc& rDstDesc,
                 {
                     if (pStashedFormatSrc->GetDoc() != this)
                     {
-                        SwFrameFormat newFormat(GetAttrPool(), "CopyDesc", 
GetDfltFrameFormat());
+                        SwFrameFormat newFormat(GetAttrPool(), 
u"CopyDesc"_ustr, GetDfltFrameFormat());
 
                         SfxItemSet aAttrSet(pStashedFormatSrc->GetAttrSet());
                         aAttrSet.ClearItem(RES_HEADER);
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index cae96a360491..a56e7343e8f1 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -228,12 +228,12 @@ SwDoc::SwDoc()
     m_pDocumentLayoutManager( new ::sw::DocumentLayoutManager( *this ) ),
     m_pDocumentStylePoolManager( new ::sw::DocumentStylePoolManager( *this ) ),
     m_pDocumentExternalDataManager( new ::sw::DocumentExternalDataManager ),
-    mpDfltFrameFormat( new SwFrameFormat( GetAttrPool(), "Frameformat", 
nullptr ) ),
-    mpEmptyPageFormat( new SwFrameFormat( GetAttrPool(), "Empty Page", 
mpDfltFrameFormat.get() ) ),
-    mpColumnContFormat( new SwFrameFormat( GetAttrPool(), "Columncontainer", 
mpDfltFrameFormat.get() ) ),
+    mpDfltFrameFormat( new SwFrameFormat( GetAttrPool(), u"Frameformat"_ustr, 
nullptr ) ),
+    mpEmptyPageFormat( new SwFrameFormat( GetAttrPool(), u"Empty Page"_ustr, 
mpDfltFrameFormat.get() ) ),
+    mpColumnContFormat( new SwFrameFormat( GetAttrPool(), 
u"Columncontainer"_ustr, mpDfltFrameFormat.get() ) ),
     mpDfltCharFormat( new SwCharFormat( GetAttrPool(), 
DEFAULT_CHAR_FORMAT_NAME, nullptr ) ),
-    mpDfltTextFormatColl( new SwTextFormatColl( GetAttrPool(), "Paragraph 
style" ) ),
-    mpDfltGrfFormatColl( new SwGrfFormatColl( GetAttrPool(), 
"Graphikformatvorlage" ) ),
+    mpDfltTextFormatColl( new SwTextFormatColl( GetAttrPool(), u"Paragraph 
style"_ustr ) ),
+    mpDfltGrfFormatColl( new SwGrfFormatColl( GetAttrPool(), 
u"Graphikformatvorlage"_ustr ) ),
     mpFrameFormatTable( new sw::FrameFormats<SwFrameFormat*>() ),
     mpCharFormatTable( new SwCharFormats ),
     mpSpzFrameFormatTable( new sw::FrameFormats<sw::SpzFrameFormat*>() ),
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 3a4941187511..67047d7b0bf9 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2564,17 +2564,6 @@ SwHeaderAndFooterEatSpacingItem* 
SwHeaderAndFooterEatSpacingItem::Clone( SfxItem
     return new SwHeaderAndFooterEatSpacingItem( Which(), GetValue() );
 }
 
-SwFrameFormat::SwFrameFormat(
-    SwAttrPool& rPool,
-    const char* pFormatNm,
-    SwFrameFormat *pDrvdFrame,
-    sal_uInt16 nFormatWhich,
-    const WhichRangesContainer& pWhichRange)
-:   SwFormat(rPool, pFormatNm, pWhichRange, pDrvdFrame, nFormatWhich),
-    m_ffList(nullptr)
-{
-}
-
 SwFrameFormat::SwFrameFormat(
     SwAttrPool& rPool,
     const OUString &rFormatNm,

Reply via email to