diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/section.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/section.cxx | 19 | ||||
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 21 |
3 files changed, 20 insertions, 22 deletions
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index 2ead8c7c6e7d..67609057b13c 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -130,8 +130,6 @@ public: bool IsConnectFlag() const { return m_bConnectFlag; } void SetConnectFlag(bool const bFlag){ m_bConnectFlag = bFlag; } - - static OUString CollapseWhiteSpaces(const OUString& sName); }; class SW_DLLPUBLIC SwSection diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 2e33038596cd..b76b3ddeac3d 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -176,23 +176,6 @@ bool SwSectionData::operator==(SwSectionData const& rOther) const // FIXME: old code ignored m_bCondHiddenFlag m_bHiddenFlag m_bConnectFlag } -OUString SwSectionData::CollapseWhiteSpaces(const OUString& sName) -{ - const sal_Int32 nLen = sName.getLength(); - const sal_Unicode cRef = ' '; - OUStringBuffer aBuf(nLen+1); - for (sal_Int32 i = 0; i<nLen; ) - { - const sal_Unicode cCur = sName[i++]; - aBuf.append(cCur); - if (cCur!=cRef) - continue; - while (i<nLen && sName[i]==cRef) - ++i; - } - return aBuf.makeStringAndClear(); -} - SwSection::SwSection( SectionType const eType, OUString const& rName, SwSectionFormat & rFormat) : SwClient(& rFormat) @@ -1438,7 +1421,7 @@ void SwSection::CreateLink( LinkCreateType eCreateType ) SwIntrnlSectRefLink *const pLnk = static_cast<SwIntrnlSectRefLink*>( m_RefLink.get() ); - const OUString sCmd(SwSectionData::CollapseWhiteSpaces(m_Data.GetLinkFileName())); + const OUString sCmd(m_Data.GetLinkFileName()); pLnk->SetUpdateMode( nUpdateType ); pLnk->SetVisible( pFormat->GetDoc()->getIDocumentLinksAdministration().IsVisibleLinks() ); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index a06a060f2edc..f87bd7513136 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -73,6 +73,23 @@ OUString BuildBitmap(bool bProtect, bool bHidden) return bHidden ? OUString(RID_BMP_HIDE) : OUString(RID_BMP_NO_HIDE); } +OUString CollapseWhiteSpaces(const OUString& sName) +{ + const sal_Int32 nLen = sName.getLength(); + const sal_Unicode cRef = ' '; + OUStringBuffer aBuf(nLen+1); + for (sal_Int32 i = 0; i<nLen; ) + { + const sal_Unicode cCur = sName[i++]; + aBuf.append(cCur); + if (cCur!=cRef) + continue; + while (i<nLen && sName[i]==cRef) + ++i; + } + return aBuf.makeStringAndClear(); +} + } static void lcl_ReadSections( SfxMedium& rMedium, weld::ComboBox& rBox ); @@ -1099,7 +1116,7 @@ IMPL_LINK(SwEditRegionDlg, FileNameEntryHdl, weld::Entry&, rEdit, void) m_bSubRegionsFilled = false; if (m_xDDECB->get_active()) { - OUString sLink( SwSectionData::CollapseWhiteSpaces(rEdit.get_text()) ); + OUString sLink( CollapseWhiteSpaces(rEdit.get_text()) ); sal_Int32 nPos = 0; sLink = sLink.replaceFirst( " ", OUStringChar(sfx2::cTokenSeparator), &nPos ); if (nPos>=0) @@ -1539,7 +1556,7 @@ bool SwInsertSectionTabPage::FillItemSet( SfxItemSet* ) OUString aLinkFile; if( bDDe ) { - aLinkFile = SwSectionData::CollapseWhiteSpaces(sFileName); + aLinkFile = CollapseWhiteSpaces(sFileName); sal_Int32 nPos = 0; aLinkFile = aLinkFile.replaceFirst( " ", OUStringChar(sfx2::cTokenSeparator), &nPos ); if (nPos>=0) |