diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/tox.hxx | 3 | ||||
-rw-r--r-- | sw/qa/core/test_ToxLinkProcessor.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/access/accpara.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/tox/ToxTextGenerator.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/tox/tox.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/css1atr.cxx | 17 | ||||
-rw-r--r-- | sw/source/ui/fldui/changedb.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/misc/bookmark.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/dbui/mmconfigitem.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/bookmark.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/workctrl.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 9 |
15 files changed, 49 insertions, 36 deletions
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index bbb4a8e373f0..fdec079490e8 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -75,7 +75,6 @@ namespace sw { extern const sal_Unicode C_NUM_REPL; extern const sal_Unicode C_END_PAGE_NUM; -extern const OUStringLiteral S_PAGE_DELI; class SW_DLLPUBLIC SwTOXMark final : public SfxPoolItem @@ -168,6 +167,8 @@ public: SAL_DLLPRIVATE void SetXTOXMark(css::uno::Reference<css::text::XDocumentIndexMark> const& xMark) { m_wXDocumentIndexMark = xMark; } void RegisterToTOXType( SwTOXType& rMark ); + + static constexpr OUStringLiteral S_PAGE_DELI = u", "; }; // index types diff --git a/sw/qa/core/test_ToxLinkProcessor.cxx b/sw/qa/core/test_ToxLinkProcessor.cxx index 0339590f93e2..9b690be4211a 100644 --- a/sw/qa/core/test_ToxLinkProcessor.cxx +++ b/sw/qa/core/test_ToxLinkProcessor.cxx @@ -40,18 +40,14 @@ public: SwGlobals::ensure(); } - static const OUStringLiteral STYLE_NAME_1; - static const OUStringLiteral STYLE_NAME_2; + static constexpr OUStringLiteral STYLE_NAME_1 = u"anyStyle1"; + static constexpr OUStringLiteral STYLE_NAME_2 = u"anyStyle2"; static const sal_uInt16 POOL_ID_1; static const sal_uInt16 POOL_ID_2; - static const OUStringLiteral URL_1; - static const OUStringLiteral URL_2; + static constexpr OUStringLiteral URL_1 = u"anyUrl1"; + static constexpr OUStringLiteral URL_2 = u"anyUrl2"; }; -const OUStringLiteral ToxLinkProcessorTest::STYLE_NAME_1 = u"anyStyle1"; -const OUStringLiteral ToxLinkProcessorTest::STYLE_NAME_2 = u"anyStyle2"; -const OUStringLiteral ToxLinkProcessorTest::URL_1 = u"anyUrl1"; -const OUStringLiteral ToxLinkProcessorTest::URL_2 = u"anyUrl2"; const sal_uInt16 ToxLinkProcessorTest::POOL_ID_1 = 42; const sal_uInt16 ToxLinkProcessorTest::POOL_ID_2 = 43; diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index e90f428898c7..1a543581f253 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1782,7 +1782,7 @@ void SwAccessibleParagraph::_getSupplementalAttributesImpl( { const SfxItemPropertyMapEntry* pPropMap( aSwMapProvider.GetPropertyMapEntries( PROPERTY_MAP_ACCESSIBILITY_TEXT_ATTRIBUTE ) ); - while ( pPropMap->aName.getLength() ) + while ( !pPropMap->aName.empty() ) { const SfxPoolItem* pItem = pSet->GetItem( pPropMap->nWID ); if ( pItem ) diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index d5d16626650e..2b1e63c995b3 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -1721,7 +1721,8 @@ void SwTOXBaseSection::UpdatePageNum_( SwTextNode* pNd, // collect starts end ends of main entry character style std::unique_ptr< std::vector<sal_uInt16> > xCharStyleIdx(pMainEntryNums ? new std::vector<sal_uInt16> : nullptr); - OUString sSrchStr = OUStringChar(C_NUM_REPL) + S_PAGE_DELI + OUStringChar(C_NUM_REPL); + OUString sSrchStr + = OUStringChar(C_NUM_REPL) + SwTOXMark::S_PAGE_DELI + OUStringChar(C_NUM_REPL); sal_Int32 nStartPos = pNd->GetText().indexOf(sSrchStr); sSrchStr = OUStringChar(C_NUM_REPL) + OUStringChar(C_END_PAGE_NUM); sal_Int32 nEndPos = pNd->GetText().indexOf(sSrchStr); @@ -1786,7 +1787,7 @@ void SwTOXBaseSection::UpdatePageNum_( SwTextNode* pNd, else if (nCount) //#58127# If nCount == 0, then the only PageNumber is already in aNumStr! { if (nCount == 1 ) - aNumStr += S_PAGE_DELI; + aNumStr += SwTOXMark::S_PAGE_DELI; else aNumStr += "-"; @@ -1795,7 +1796,7 @@ void SwTOXBaseSection::UpdatePageNum_( SwTextNode* pNd, // Create new String nBeg = rNums[i]; - aNumStr += S_PAGE_DELI; + aNumStr += SwTOXMark::S_PAGE_DELI; //the change of the character style must apply after sPageDeli is appended if (xCharStyleIdx && bMainEntryChanges) { @@ -1810,7 +1811,7 @@ void SwTOXBaseSection::UpdatePageNum_( SwTextNode* pNd, { // Insert all Numbers aNumStr += aType.GetNumStr( rNums[i] ); if (i+1 != rNums.size()) - aNumStr += S_PAGE_DELI; + aNumStr += SwTOXMark::S_PAGE_DELI; } } // Flush when ending and the following old values @@ -1826,7 +1827,7 @@ void SwTOXBaseSection::UpdatePageNum_( SwTextNode* pNd, if(nCount >= 2) aNumStr += "-"; else if(nCount == 1) - aNumStr += S_PAGE_DELI; + aNumStr += SwTOXMark::S_PAGE_DELI; //#58127# If nCount == 0, then the only PageNumber is already in aNumStr! if(nCount) aNumStr += rDescs[i-1]->GetNumType().GetNumStr( nBeg+nCount ); diff --git a/sw/source/core/tox/ToxTextGenerator.cxx b/sw/source/core/tox/ToxTextGenerator.cxx index cfef4d3561f5..11ced0144d8f 100644 --- a/sw/source/core/tox/ToxTextGenerator.cxx +++ b/sw/source/core/tox/ToxTextGenerator.cxx @@ -414,7 +414,7 @@ ToxTextGenerator::ConstructPageNumberPlaceholder(size_t numberOfToxSources) // Place holder for the PageNumber; we only respect the first one retval.append(C_NUM_REPL); for (size_t i = 1; i < numberOfToxSources; ++i) { - retval.append(S_PAGE_DELI); + retval.append(SwTOXMark::S_PAGE_DELI); retval.append(C_NUM_REPL); } retval.append(C_END_PAGE_NUM); diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 27288881d76e..149a305a348a 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -45,8 +45,6 @@ using namespace std; const sal_Unicode C_NUM_REPL = '@'; const sal_Unicode C_END_PAGE_NUM = '~'; -const OUStringLiteral S_PAGE_DELI(u", "); - namespace { diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 8e280ea7179a..5a3fdbb38736 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -21,6 +21,8 @@ #include <initializer_list> #include <memory> +#include <string_view> + #include <sal/log.hxx> #include <cmdid.h> @@ -2184,7 +2186,7 @@ uno::Sequence< OUString > SwXShape::getSupportedServiceNames() if (SvxShape* pSvxShape = GetSvxShape()) aSeq = pSvxShape->getSupportedServiceNames(); return comphelper::concatSequences( - aSeq, std::initializer_list<OUStringLiteral>{ u"com.sun.star.drawing.Shape" }); + aSeq, std::initializer_list<std::u16string_view>{ u"com.sun.star.drawing.Shape" }); } SvxShape* SwXShape::GetSvxShape() diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index c29bb8a7fa6f..a609da4d53d9 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -697,7 +697,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s SfxItemPropertyMapEntry* aTextDefaultMap_Impl = GetTextDefaultPropertyMap(); m_aMapEntriesArr[nPropertyId] = aTextDefaultMap_Impl; for( SfxItemPropertyMapEntry * pMap = aTextDefaultMap_Impl; - pMap->aName.getLength(); ++pMap ) + !pMap->aName.empty(); ++pMap ) { // UNO_NAME_PAGE_DESC_NAME should keep its MAYBEVOID flag if (RES_PAGEDESC != pMap->nWID || MID_PAGEDESC_PAGEDESCNAME != pMap->nMemberId) diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index a3891b0e51dc..0110b8c6bc4f 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <hintids.hxx> #include <comphelper/string.hxx> #include <vcl/svapp.hxx> @@ -1752,9 +1756,9 @@ static Writer& OutCSS1_SwFootnoteInfo( Writer& rWrt, const SwEndNoteInfo& rInfo, if( bHasNotes ) { - aSelector = OOO_STRING_SVTOOLS_HTML_anchor "." + - ( bEndNote ? OUStringLiteral(u"" OOO_STRING_SVTOOLS_HTML_sdendnote_anc) - : OUStringLiteral(u"" OOO_STRING_SVTOOLS_HTML_sdfootnote_anc) ); + aSelector = OUString::Concat(OOO_STRING_SVTOOLS_HTML_anchor ".") + + ( bEndNote ? std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_sdendnote_anc) + : std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_sdfootnote_anc) ); SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE, &aSelector ); rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_size, @@ -1783,9 +1787,10 @@ static Writer& OutCSS1_SwFootnoteInfo( Writer& rWrt, const SwEndNoteInfo& rInfo, } if( aItemSet.Count() ) { - aSelector = OOO_STRING_SVTOOLS_HTML_anchor "." + - ( bEndNote ? OUStringLiteral(u"" OOO_STRING_SVTOOLS_HTML_sdendnote_sym) - : OUStringLiteral(u"" OOO_STRING_SVTOOLS_HTML_sdfootnote_sym)); + aSelector = OUString::Concat(OOO_STRING_SVTOOLS_HTML_anchor ".") + + ( bEndNote ? std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_sdendnote_sym) + : std::u16string_view( + u"" OOO_STRING_SVTOOLS_HTML_sdfootnote_sym)); if( OutCSS1Rule( rHTMLWrt, aSelector, aItemSet, true, false )) rHTMLWrt.m_aScriptTextStyles.insert( pSymCharFormat->GetName() ); } diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index e83e1afd640f..e4e44316f9ab 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/CommandType.hpp> @@ -112,7 +116,7 @@ std::unique_ptr<weld::TreeIter> SwChangeDBDlg::Insert(const OUString& rDBName) OUString sUserData = rDBName.getToken(0, DB_DELIM, nIdx); sal_Int32 nCommandType = sUserData.toInt32(); - OUString rToInsert = nCommandType ? OUStringLiteral(u"" RID_BMP_DBQUERY) : OUStringLiteral(u"" RID_BMP_DBTABLE); + OUString rToInsert = nCommandType ? std::u16string_view(u"" RID_BMP_DBQUERY) : std::u16string_view(u"" RID_BMP_DBTABLE); std::unique_ptr<weld::TreeIter> xIter(m_xUsedDBTLB->make_iterator()); if (m_xUsedDBTLB->get_iter_first(*xIter)) diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index e62f778cc68c..b69cce75b47b 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -38,7 +38,6 @@ using namespace ::com::sun::star; -const OUStringLiteral BookmarkTable::aForbiddenChars(u"/\\@*?\",#"); const char BookmarkTable::cSeparator(';'); // callback to modify EditBox @@ -55,9 +54,9 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, ModifyHdl, weld::Entry&, void) for (sal_Int32 i = 0; i < BookmarkTable::aForbiddenChars.getLength(); i++) { const sal_Int32 nTmpLen = sTmp.getLength(); - sTmp = sTmp.replaceAll(OUStringChar(BookmarkTable::aForbiddenChars.data[i]), ""); + sTmp = sTmp.replaceAll(OUStringChar(BookmarkTable::aForbiddenChars.getStr()[i]), ""); if (sTmp.getLength() != nTmpLen) - sMsg += OUStringChar(BookmarkTable::aForbiddenChars.data[i]); + sMsg += OUStringChar(BookmarkTable::aForbiddenChars.getStr()[i]); } const bool bHasForbiddenChars = sTmp.getLength() != nLen; m_xForbiddenChars->set_visible(bHasForbiddenChars); diff --git a/sw/source/uibase/dbui/mmconfigitem.cxx b/sw/source/uibase/dbui/mmconfigitem.cxx index 01560e02cae3..cdcb729c10a1 100644 --- a/sw/source/uibase/dbui/mmconfigitem.cxx +++ b/sw/source/uibase/dbui/mmconfigitem.cxx @@ -55,7 +55,7 @@ using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; -const char16_t cAddressDataAssignments[] = u"AddressDataAssignments"; +constexpr char16_t cAddressDataAssignments[] = u"AddressDataAssignments"; const char cDBColumnAssignments[] = "DBColumnAssignments"; const char cDataSourceName[] = "DataSource/DataSourceName"; const char cDataTableName[] = "DataSource/DataTableName" ; diff --git a/sw/source/uibase/inc/bookmark.hxx b/sw/source/uibase/inc/bookmark.hxx index 2699c03eefe3..b6107e2914af 100644 --- a/sw/source/uibase/inc/bookmark.hxx +++ b/sw/source/uibase/inc/bookmark.hxx @@ -57,7 +57,7 @@ public: int get_sort_column() const { return m_xControl->get_sort_column(); } void set_sort_column(int nColumn) { m_xControl->set_sort_column(nColumn); } - static const OUStringLiteral aForbiddenChars; + static constexpr OUStringLiteral aForbiddenChars = u"/\\@*?\",#"; static const char cSeparator; }; diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index d38711fa6cef..6a73899d52f9 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <i18nutil/unicode.hxx> #include <vcl/InterimItemWindow.hxx> #include <sfx2/dispatch.hxx> @@ -175,7 +179,7 @@ static sal_uInt16 aNavigationInsertIds[ NAVI_ENTRIES ] = NID_TABLE_FORMULA_ERROR }; -OUStringLiteral const aNavigationImgIds[ NAVI_ENTRIES ] = +std::u16string_view const aNavigationImgIds[ NAVI_ENTRIES ] = { u"" RID_BMP_RIBBAR_TBL, u"" RID_BMP_RIBBAR_FRM, diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index bf235be5d1ec..b4ae522a2cf9 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -139,6 +139,7 @@ #include <pagefrm.hxx> #include <memory> +#include <string_view> const char sStatusDelim[] = " : "; @@ -193,7 +194,7 @@ OUString SwView::GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUStr { // Show user-defined page number in brackets if any. OUString extra; - if (!rPgStr.isEmpty() && OUString::number(nPhyNum) != rPgStr) + if (!rPgStr.isEmpty() && std::u16string_view(OUString::number(nPhyNum)) != rPgStr) extra = rPgStr; else if (nPhyNum != nVirtNum) extra = OUString::number(nVirtNum); @@ -1361,7 +1362,8 @@ void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUStr const SfxStringItem aTmp( FN_STAT_PAGE, sTemp ); // Used to distinguish which tooltip to show const SfxBoolItem bExtendedTooltip( FN_STAT_PAGE, - !rPgStr.isEmpty() && OUString::number(nPhyNum) != rPgStr + !rPgStr.isEmpty() + && std::u16string_view(OUString::number(nPhyNum)) != rPgStr && nPhyNum != nVirtNum ); SfxBindings &rBnd = GetViewFrame()->GetBindings(); @@ -1423,7 +1425,8 @@ void SwView::StateStatusLine(SfxItemSet &rSet) GetViewFrame()->GetBindings().SetState( aTmp ); // Used to distinguish which tooltip to show const SfxBoolItem bExtendedTooltip( FN_STAT_PAGE, !sDisplay.isEmpty() && - OUString::number( nPage ) != sDisplay && + std::u16string_view(OUString::number( nPage )) + != sDisplay && nPage != nLogPage ); GetViewFrame()->GetBindings().SetState( bExtendedTooltip ); //if existing page number is not equal to old page number, send out this event. |