use string_view in INetURLObject::decode
Change-Id: I10e04970ceac33c9c3fbfd0182dd2140e06cb80b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114658 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -1087,7 +1087,7 @@ void RemoteFilesDialog::UpdateControls( const OUString& rURL )
|
||||
if( nTitleStart != -1 )
|
||||
{
|
||||
OUString sTitle( INetURLObject::decode(
|
||||
aFolderName.copy( nTitleStart + 1 ),
|
||||
aFolderName.subView( nTitleStart + 1 ),
|
||||
INetURLObject::DecodeMechanism::WithCharset ) );
|
||||
|
||||
if( rFolder.mbIsFolder )
|
||||
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
|
||||
@return Added relation Id.
|
||||
*/
|
||||
OUString addRelation( const OUString& rType, const OUString& rTarget );
|
||||
OUString addRelation( const OUString& rType, std::u16string_view rTarget );
|
||||
|
||||
/** Adds new relation to part's relations.
|
||||
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
|
||||
@return Added relation Id.
|
||||
*/
|
||||
OUString addRelation( const css::uno::Reference< css::io::XOutputStream >& rOutputStream, const OUString& rType, const OUString& rTarget, bool bExternal = false );
|
||||
OUString addRelation( const css::uno::Reference< css::io::XOutputStream >& rOutputStream, const OUString& rType, std::u16string_view rTarget, bool bExternal = false );
|
||||
|
||||
/** Returns a stack of used textfields, used by the pptx importer to replace links to slidepages with the real page name */
|
||||
TextFieldStack& getTextFieldStack() const;
|
||||
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
|
||||
sax_fastparser::FSHelperPtr CreateOutputStream (
|
||||
const OUString& sFullStream,
|
||||
const OUString& sRelativeStream,
|
||||
std::u16string_view sRelativeStream,
|
||||
const css::uno::Reference< css::io::XOutputStream >& xParentRelation,
|
||||
const char* sContentType,
|
||||
const char* sRelationshipType,
|
||||
|
||||
@@ -839,12 +839,7 @@ public:
|
||||
@return The text, decoded according to the given mechanism and
|
||||
charset (escape sequences replaced by 'raw' characters).
|
||||
*/
|
||||
static inline OUString decode(OUString const & rText,
|
||||
DecodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset
|
||||
= RTL_TEXTENCODING_UTF8);
|
||||
|
||||
static inline OUString decode(OUStringBuffer const & rText,
|
||||
static inline OUString decode(std::u16string_view rText,
|
||||
DecodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset
|
||||
= RTL_TEXTENCODING_UTF8);
|
||||
@@ -1298,19 +1293,11 @@ inline OUString INetURLObject::encode(OUString const & rText, Part ePart,
|
||||
}
|
||||
|
||||
// static
|
||||
inline OUString INetURLObject::decode(OUString const & rText,
|
||||
inline OUString INetURLObject::decode(std::u16string_view rText,
|
||||
DecodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
return decode(rText.getStr(), rText.getStr() + rText.getLength(),
|
||||
eMechanism, eCharset);
|
||||
}
|
||||
|
||||
inline OUString INetURLObject::decode(OUStringBuffer const & rText,
|
||||
DecodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
return decode(rText.getStr(), rText.getStr() + rText.getLength(),
|
||||
return decode(rText.data(), rText.data() + rText.size(),
|
||||
eMechanism, eCharset);
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ TextFieldStack& XmlFilterBase::getTextFieldStack() const
|
||||
|
||||
namespace {
|
||||
|
||||
OUString lclAddRelation( const Reference< XRelationshipAccess >& rRelations, sal_Int32 nId, const OUString& rType, const OUString& rTarget, bool bExternal )
|
||||
OUString lclAddRelation( const Reference< XRelationshipAccess >& rRelations, sal_Int32 nId, const OUString& rType, std::u16string_view rTarget, bool bExternal )
|
||||
{
|
||||
OUString sId = "rId" + OUString::number( nId );
|
||||
|
||||
@@ -528,7 +528,7 @@ OUString lclAddRelation( const Reference< XRelationshipAccess >& rRelations, sal
|
||||
|
||||
} // namespace
|
||||
|
||||
OUString XmlFilterBase::addRelation( const OUString& rType, const OUString& rTarget )
|
||||
OUString XmlFilterBase::addRelation( const OUString& rType, std::u16string_view rTarget )
|
||||
{
|
||||
Reference< XRelationshipAccess > xRelations( getStorage()->getXStorage(), UNO_QUERY );
|
||||
if( xRelations.is() )
|
||||
@@ -537,7 +537,7 @@ OUString XmlFilterBase::addRelation( const OUString& rType, const OUString& rTar
|
||||
return OUString();
|
||||
}
|
||||
|
||||
OUString XmlFilterBase::addRelation( const Reference< XOutputStream >& rOutputStream, const OUString& rType, const OUString& rTarget, bool bExternal )
|
||||
OUString XmlFilterBase::addRelation( const Reference< XOutputStream >& rOutputStream, const OUString& rType, std::u16string_view rTarget, bool bExternal )
|
||||
{
|
||||
sal_Int32 nId = 0;
|
||||
|
||||
@@ -631,7 +631,7 @@ writeCoreProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties
|
||||
else
|
||||
sValue = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
|
||||
|
||||
rSelf.addRelation( sValue, "docProps/core.xml" );
|
||||
rSelf.addRelation( sValue, u"docProps/core.xml" );
|
||||
FSHelperPtr pCoreProps = rSelf.openFragmentStreamWithSerializer(
|
||||
"docProps/core.xml",
|
||||
"application/vnd.openxmlformats-package.core-properties+xml" );
|
||||
@@ -705,7 +705,7 @@ writeAppProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties >
|
||||
{
|
||||
rSelf.addRelation(
|
||||
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",
|
||||
"docProps/app.xml" );
|
||||
u"docProps/app.xml" );
|
||||
FSHelperPtr pAppProps = rSelf.openFragmentStreamWithSerializer(
|
||||
"docProps/app.xml",
|
||||
"application/vnd.openxmlformats-officedocument.extended-properties+xml" );
|
||||
@@ -845,7 +845,7 @@ writeCustomProperties( XmlFilterBase& rSelf, const Reference< XDocumentPropertie
|
||||
|
||||
rSelf.addRelation(
|
||||
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",
|
||||
"docProps/custom.xml" );
|
||||
u"docProps/custom.xml" );
|
||||
FSHelperPtr pAppProps = rSelf.openFragmentStreamWithSerializer(
|
||||
"docProps/custom.xml",
|
||||
"application/vnd.openxmlformats-officedocument.custom-properties+xml" );
|
||||
@@ -1177,7 +1177,7 @@ void XmlFilterBase::exportCustomFragments()
|
||||
const OUString fragmentPath = "customXml/item" + OUString::number((j+1)) + ".xml";
|
||||
if (customXmlDom.is())
|
||||
{
|
||||
addRelation(oox::getRelationship(Relationship::CUSTOMXML), "../" + fragmentPath);
|
||||
addRelation(oox::getRelationship(Relationship::CUSTOMXML), OUString("../" + fragmentPath));
|
||||
|
||||
uno::Reference<xml::sax::XSAXSerializable> serializer(customXmlDom, uno::UNO_QUERY);
|
||||
uno::Reference<xml::sax::XWriter> writer = xml::sax::Writer::create(comphelper::getProcessComponentContext());
|
||||
@@ -1198,7 +1198,7 @@ void XmlFilterBase::exportCustomFragments()
|
||||
// Adding itemprops's relationship entry to item.xml.rels file
|
||||
addRelation(openFragmentStream(fragmentPath, "application/xml"),
|
||||
oox::getRelationship(Relationship::CUSTOMXMLPROPS),
|
||||
"itemProps"+OUString::number((j+1))+".xml");
|
||||
OUString("itemProps"+OUString::number((j+1))+".xml"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3821,7 +3821,7 @@ sal_Unicode DrawingML::SubstituteBullet( sal_Unicode cBulletId, css::awt::FontDe
|
||||
|
||||
sax_fastparser::FSHelperPtr DrawingML::CreateOutputStream (
|
||||
const OUString& sFullStream,
|
||||
const OUString& sRelativeStream,
|
||||
std::u16string_view sRelativeStream,
|
||||
const Reference< XOutputStream >& xParentRelation,
|
||||
const char* sContentType,
|
||||
const char* sRelationshipType,
|
||||
@@ -4856,7 +4856,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX
|
||||
OUString dataFileName = "diagrams/data" + OUString::number(nDiagramId) + ".xml";
|
||||
OString dataRelId = OUStringToOString(
|
||||
mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMDATA),
|
||||
sRelationCompPrefix + dataFileName),
|
||||
OUString(sRelationCompPrefix + dataFileName)),
|
||||
RTL_TEXTENCODING_UTF8);
|
||||
|
||||
// add layout relation
|
||||
@@ -4864,7 +4864,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX
|
||||
OString layoutRelId
|
||||
= OUStringToOString(mpFB->addRelation(mpFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::DIAGRAMLAYOUT),
|
||||
sRelationCompPrefix + layoutFileName),
|
||||
OUString(sRelationCompPrefix + layoutFileName)),
|
||||
RTL_TEXTENCODING_UTF8);
|
||||
|
||||
// add style relation
|
||||
@@ -4872,7 +4872,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX
|
||||
OString styleRelId
|
||||
= OUStringToOString(mpFB->addRelation(mpFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::DIAGRAMQUICKSTYLE),
|
||||
sRelationCompPrefix + styleFileName),
|
||||
OUString(sRelationCompPrefix + styleFileName)),
|
||||
RTL_TEXTENCODING_UTF8);
|
||||
|
||||
// add color relation
|
||||
@@ -4880,7 +4880,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX
|
||||
OString colorRelId
|
||||
= OUStringToOString(mpFB->addRelation(mpFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::DIAGRAMCOLORS),
|
||||
sRelationCompPrefix + colorFileName),
|
||||
OUString(sRelationCompPrefix + colorFileName)),
|
||||
RTL_TEXTENCODING_UTF8);
|
||||
|
||||
OUString drawingFileName;
|
||||
@@ -4890,7 +4890,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX
|
||||
drawingFileName = "diagrams/drawing" + OUString::number(nDiagramId) + ".xml";
|
||||
OUString drawingRelId = mpFB->addRelation(
|
||||
mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMDRAWING),
|
||||
sRelationCompPrefix + drawingFileName);
|
||||
OUString(sRelationCompPrefix + drawingFileName));
|
||||
|
||||
// the data dom contains a reference to the drawing relation. We need to update it with the new generated
|
||||
// relation value before writing the dom to a file
|
||||
@@ -5021,7 +5021,7 @@ void DrawingML::writeDiagramRels(const uno::Sequence<uno::Sequence<uno::Any>>& x
|
||||
PropertySet aProps(xOutStream);
|
||||
aProps.setAnyProperty(PROP_RelId, uno::makeAny(sRelId.toInt32()));
|
||||
|
||||
mpFB->addRelation(xOutStream, sType, "../" + sFragment);
|
||||
mpFB->addRelation(xOutStream, sType, OUString("../" + sFragment));
|
||||
|
||||
OUString sDir = OUString::createFromAscii(GetComponentDir());
|
||||
uno::Reference<io::XOutputStream> xBinOutStream
|
||||
|
||||
@@ -2114,7 +2114,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape )
|
||||
|
||||
OUString const sRelId = mpFB->addRelation(
|
||||
mpFS->getOutputStream(), sRelationType,
|
||||
OUString::createFromAscii(GetRelationCompPrefix()) + sFileName);
|
||||
OUString(OUString::createFromAscii(GetRelationCompPrefix()) + sFileName));
|
||||
|
||||
mpFS->startElementNS(mnXmlNamespace, XML_graphicFrame);
|
||||
|
||||
|
||||
@@ -1184,7 +1184,7 @@ struct ConventionXL
|
||||
return lcl_makeExternalNameStr( rFile, rName, '!', false);
|
||||
}
|
||||
|
||||
static void makeExternalDocStr( OUStringBuffer& rBuffer, const OUString& rFullName )
|
||||
static void makeExternalDocStr( OUStringBuffer& rBuffer, std::u16string_view rFullName )
|
||||
{
|
||||
// Format that is easier to deal with inside OOo, because we use file
|
||||
// URL, and all characters are allowed. Check if it makes sense to do
|
||||
|
||||
@@ -209,7 +209,7 @@ void XclExpSstImpl::SaveXml( XclExpXmlStream& rStrm )
|
||||
|
||||
sax_fastparser::FSHelperPtr pSst = rStrm.CreateOutputStream(
|
||||
"xl/sharedStrings.xml",
|
||||
"sharedStrings.xml",
|
||||
u"sharedStrings.xml",
|
||||
rStrm.GetCurrentStream()->getOutputStream(),
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
|
||||
oox::getRelationship(Relationship::SHAREDSTRINGS));
|
||||
|
||||
@@ -939,7 +939,7 @@ void XclExpXmlStream::WriteAttribute(sal_Int32 nAttr, std::u16string_view sVal)
|
||||
|
||||
sax_fastparser::FSHelperPtr XclExpXmlStream::CreateOutputStream (
|
||||
const OUString& sFullStream,
|
||||
const OUString& sRelativeStream,
|
||||
std::u16string_view sRelativeStream,
|
||||
const uno::Reference< XOutputStream >& xParentRelation,
|
||||
const char* sContentType,
|
||||
std::u16string_view sRelationshipType,
|
||||
@@ -1093,7 +1093,7 @@ bool XclExpXmlStream::exportDocument()
|
||||
openFragmentStream("xl/vbaProject.bin", "application/vnd.ms-office.vbaProject");
|
||||
comphelper::OStorageHelper::CopyInputToOutput(xVBAStream, xVBAOutput);
|
||||
|
||||
addRelation(GetCurrentStream()->getOutputStream(), oox::getRelationship(Relationship::VBAPROJECT), "vbaProject.bin");
|
||||
addRelation(GetCurrentStream()->getOutputStream(), oox::getRelationship(Relationship::VBAPROJECT), u"vbaProject.bin");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3189,7 +3189,7 @@ void XclExpXmlStyleSheet::SaveXml( XclExpXmlStream& rStrm )
|
||||
{
|
||||
sax_fastparser::FSHelperPtr aStyleSheet = rStrm.CreateOutputStream(
|
||||
"xl/styles.xml",
|
||||
"styles.xml",
|
||||
u"styles.xml",
|
||||
rStrm.GetCurrentStream()->getOutputStream(),
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
|
||||
oox::getRelationship(Relationship::STYLES));
|
||||
|
||||
@@ -309,7 +309,7 @@ public:
|
||||
|
||||
sax_fastparser::FSHelperPtr CreateOutputStream (
|
||||
const OUString& sFullStream,
|
||||
const OUString& sRelativeStream,
|
||||
std::u16string_view sRelativeStream,
|
||||
const css::uno::Reference< css::io::XOutputStream >& xParentRelation,
|
||||
const char* sContentType,
|
||||
std::u16string_view sRelationshipType,
|
||||
|
||||
@@ -1616,7 +1616,7 @@ static void lcl_WriteUserNamesXml( XclExpXmlStream& rWorkbookStrm )
|
||||
{
|
||||
sax_fastparser::FSHelperPtr pUserNames = rWorkbookStrm.CreateOutputStream(
|
||||
"xl/revisions/userNames.xml",
|
||||
"revisions/userNames.xml",
|
||||
u"revisions/userNames.xml",
|
||||
rWorkbookStrm.GetCurrentStream()->getOutputStream(),
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml",
|
||||
CREATE_OFFICEDOC_RELATION_TYPE("usernames"));
|
||||
@@ -1639,7 +1639,7 @@ void XclExpChangeTrack::WriteXml( XclExpXmlStream& rWorkbookStrm )
|
||||
|
||||
sax_fastparser::FSHelperPtr pRevisionHeaders = rWorkbookStrm.CreateOutputStream(
|
||||
"xl/revisions/revisionHeaders.xml",
|
||||
"revisions/revisionHeaders.xml",
|
||||
u"revisions/revisionHeaders.xml",
|
||||
rWorkbookStrm.GetCurrentStream()->getOutputStream(),
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml",
|
||||
CREATE_OFFICEDOC_RELATION_TYPE("revisionHeaders"));
|
||||
|
||||
@@ -384,7 +384,7 @@ bool PowerPointExport::exportDocument()
|
||||
//write document properties
|
||||
writeDocumentProperties();
|
||||
|
||||
addRelation(oox::getRelationship(Relationship::OFFICEDOCUMENT), "ppt/presentation.xml");
|
||||
addRelation(oox::getRelationship(Relationship::OFFICEDOCUMENT), u"ppt/presentation.xml");
|
||||
|
||||
OUString aMediaType;
|
||||
if (mbPptm)
|
||||
@@ -414,7 +414,7 @@ bool PowerPointExport::exportDocument()
|
||||
|
||||
addRelation(mPresentationFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::THEME),
|
||||
"theme/theme1.xml");
|
||||
u"theme/theme1.xml");
|
||||
|
||||
mPresentationFS->startElementNS(XML_p, XML_presentation, PNMSS);
|
||||
|
||||
@@ -953,7 +953,7 @@ void PowerPointExport::WriteAuthors()
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml");
|
||||
addRelation(mPresentationFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::COMMENTAUTHORS),
|
||||
"commentAuthors.xml");
|
||||
u"commentAuthors.xml");
|
||||
|
||||
pFS->startElementNS(XML_p, XML_cmAuthorLst,
|
||||
FSNS(XML_xmlns, XML_p), getNamespaceURL(OOX_NS(ppt)));
|
||||
@@ -1070,7 +1070,7 @@ void PowerPointExport::WriteVBA()
|
||||
comphelper::OStorageHelper::CopyInputToOutput(xMacrosStream, xOutputStream);
|
||||
|
||||
// Write the relationship.
|
||||
addRelation(mPresentationFS->getOutputStream(), oox::getRelationship(Relationship::VBAPROJECT), "vbaProject.bin");
|
||||
addRelation(mPresentationFS->getOutputStream(), oox::getRelationship(Relationship::VBAPROJECT), u"vbaProject.bin");
|
||||
}
|
||||
|
||||
void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_uInt16 /* nMode */,
|
||||
@@ -1205,7 +1205,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum)
|
||||
// add implicit relation to notes master
|
||||
addRelation(pFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::NOTESMASTER),
|
||||
"../notesMasters/notesMaster1.xml");
|
||||
u"../notesMasters/notesMaster1.xml");
|
||||
|
||||
SAL_INFO("sd.eppt", "-----------------");
|
||||
}
|
||||
@@ -1879,7 +1879,7 @@ void PowerPointExport::WriteNotesMaster()
|
||||
|
||||
OUString sRelId = addRelation(mPresentationFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::NOTESMASTER),
|
||||
"notesMasters/notesMaster1.xml");
|
||||
u"notesMasters/notesMaster1.xml");
|
||||
|
||||
mPresentationFS->singleElementNS(XML_p, XML_notesMasterId,
|
||||
FSNS(XML_r, XML_id), sRelId);
|
||||
|
||||
@@ -215,7 +215,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval,
|
||||
{
|
||||
// find BasicManager
|
||||
SfxObjectShell* pDoc = nullptr;
|
||||
OUString aBasMgrName( INetURLObject::decode(aMacro.copy( 8, nThirdSlashPos-8 ), INetURLObject::DecodeMechanism::WithCharset) );
|
||||
OUString aBasMgrName( INetURLObject::decode(aMacro.subView( 8, nThirdSlashPos-8 ), INetURLObject::DecodeMechanism::WithCharset) );
|
||||
if ( aBasMgrName.isEmpty() )
|
||||
pBasMgr = pAppMgr;
|
||||
else if ( aBasMgrName == "." )
|
||||
@@ -252,7 +252,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval,
|
||||
}
|
||||
|
||||
// find BASIC method
|
||||
OUString aQualifiedMethod( INetURLObject::decode(aMacro.copy( nThirdSlashPos+1 ), INetURLObject::DecodeMechanism::WithCharset) );
|
||||
OUString aQualifiedMethod( INetURLObject::decode(aMacro.subView( nThirdSlashPos+1 ), INetURLObject::DecodeMechanism::WithCharset) );
|
||||
OUString aArgs;
|
||||
if ( -1 != nArgsPos )
|
||||
{
|
||||
@@ -315,7 +315,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval,
|
||||
{
|
||||
// direct API call on a specified object
|
||||
OUStringBuffer aCall;
|
||||
aCall.append('[').append(INetURLObject::decode(aMacro.copy(6),
|
||||
aCall.append('[').append(INetURLObject::decode(aMacro.subView(6),
|
||||
INetURLObject::DecodeMechanism::WithCharset));
|
||||
aCall.append(']');
|
||||
pAppMgr->GetLib(0)->Execute(aCall.makeStringAndClear());
|
||||
|
||||
@@ -431,7 +431,7 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i
|
||||
sal_Int32 nArgsPos = aScript.indexOf( '(' );
|
||||
if ( ( nThirdSlashPos != -1 ) && ( nArgsPos == -1 || nThirdSlashPos < nArgsPos ) )
|
||||
{
|
||||
OUString aBasMgrName( INetURLObject::decode( aScript.copy( 8, nThirdSlashPos-8 ), INetURLObject::DecodeMechanism::WithCharset ) );
|
||||
OUString aBasMgrName( INetURLObject::decode( aScript.subView( 8, nThirdSlashPos-8 ), INetURLObject::DecodeMechanism::WithCharset ) );
|
||||
if (pDoc && aBasMgrName == ".")
|
||||
aLibrary = pDoc->GetTitle();
|
||||
else
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ void RepaintPagePreview( SwViewShell const * pVwSh, const SwRect& rRect );
|
||||
// Read ChgMode for tables from configuration.
|
||||
TableChgMode GetTableChgDefaultMode();
|
||||
|
||||
bool JumpToSwMark( SwViewShell const * pVwSh, const OUString& rMark );
|
||||
bool JumpToSwMark( SwViewShell const * pVwSh, std::u16string_view rMark );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -591,7 +591,7 @@ public:
|
||||
void SetCursorAtTop( bool bFlag, bool bCenter = false )
|
||||
{ m_bTopCursor = bFlag; m_bCenterCursor = bCenter; }
|
||||
|
||||
bool JumpToSwMark( const OUString& rMark );
|
||||
bool JumpToSwMark( std::u16string_view rMark );
|
||||
|
||||
tools::Long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName,
|
||||
const OUString& rFilterName, sal_Int16 nVersion = 0 );
|
||||
|
||||
@@ -242,7 +242,7 @@ DECLARE_LINKS_EXPORT_TEST(testNon_ascii_link_export, "non_ascii_link.docx", USE_
|
||||
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
|
||||
|
||||
assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
|
||||
INetURLObject::decode(OUString("file:///C:/TEMP/%C3%A9kezet.docx"),
|
||||
INetURLObject::decode(u"file:///C:/TEMP/%C3%A9kezet.docx",
|
||||
INetURLObject::DecodeMechanism::ToIUri,
|
||||
RTL_TEXTENCODING_UTF8));
|
||||
}
|
||||
|
||||
@@ -738,7 +738,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
|
||||
rWrtShell.Push();
|
||||
OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("#1%19the%20tocmark%19C%7Ctoxmark"), url);
|
||||
rView.JumpToSwMark(url.copy(1)); // SfxApplication::OpenDocExec_Impl eats the "#"
|
||||
rView.JumpToSwMark(url.subView(1)); // SfxApplication::OpenDocExec_Impl eats the "#"
|
||||
CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(CH_TXTATR_INWORD) + "tocmark"),
|
||||
rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
|
||||
rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
|
||||
@@ -753,7 +753,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
|
||||
rWrtShell.Push();
|
||||
OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("#__RefHeading___Toc105_706348105"), url);
|
||||
rView.JumpToSwMark(url.copy(1));
|
||||
rView.JumpToSwMark(url.subView(1));
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("foo"),
|
||||
rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
|
||||
rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
|
||||
@@ -773,7 +773,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
|
||||
rWrtShell.Push();
|
||||
OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("#1%19the%20udmark%19UUser-Defined%7Ctoxmark"), url);
|
||||
rView.JumpToSwMark(url.copy(1));
|
||||
rView.JumpToSwMark(url.subView(1));
|
||||
CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(CH_TXTATR_INWORD) + "udmark the first"),
|
||||
rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
|
||||
rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
|
||||
@@ -788,7 +788,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
|
||||
rWrtShell.Push();
|
||||
OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("#2%19the%20udmark%19UUser-Defined%7Ctoxmark"), url);
|
||||
rView.JumpToSwMark(url.copy(1));
|
||||
rView.JumpToSwMark(url.subView(1));
|
||||
CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(CH_TXTATR_INWORD) + "udmark the 2nd"),
|
||||
rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
|
||||
rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
|
||||
@@ -803,7 +803,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
|
||||
rWrtShell.Push();
|
||||
OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("#__RefHeading___Toc105_706348105"), url);
|
||||
rView.JumpToSwMark(url.copy(1));
|
||||
rView.JumpToSwMark(url.subView(1));
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("foo"),
|
||||
rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
|
||||
rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
|
||||
@@ -823,7 +823,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
|
||||
rWrtShell.Push();
|
||||
OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("#1%19the%20udmark%19UNewUD!%7C%7Ctoxmark"), url);
|
||||
rView.JumpToSwMark(url.copy(1));
|
||||
rView.JumpToSwMark(url.subView(1));
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("the udmark"),
|
||||
rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
|
||||
rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
|
||||
|
||||
@@ -442,7 +442,7 @@ DocumentLinksAdministrationManager::~DocumentLinksAdministrationManager()
|
||||
{
|
||||
}
|
||||
|
||||
bool DocumentLinksAdministrationManager::SelectServerObj( const OUString& rStr, SwPaM*& rpPam, std::unique_ptr<SwNodeRange>& rpRange ) const
|
||||
bool DocumentLinksAdministrationManager::SelectServerObj( std::u16string_view rStr, SwPaM*& rpPam, std::unique_ptr<SwNodeRange>& rpRange ) const
|
||||
{
|
||||
// Do we actually have the Item?
|
||||
rpPam = nullptr;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <IDocumentLinksAdministration.hxx>
|
||||
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
namespace sfx2 { class LinkManager; }
|
||||
class SwDoc;
|
||||
@@ -61,7 +62,7 @@ public:
|
||||
bool LinksUpdated() const override;
|
||||
|
||||
//Non-Interface method
|
||||
bool SelectServerObj( const OUString& rStr, SwPaM*& rpPam, std::unique_ptr<SwNodeRange>& rpRange ) const;
|
||||
bool SelectServerObj( std::u16string_view rStr, SwPaM*& rpPam, std::unique_ptr<SwNodeRange>& rpRange ) const;
|
||||
|
||||
virtual ~DocumentLinksAdministrationManager() override;
|
||||
|
||||
|
||||
@@ -7131,7 +7131,7 @@ void DocxAttributeOutput::EmbedFontStyle( std::u16string_view name, int tag, Fon
|
||||
xOutStream->closeOutput();
|
||||
OString relId = OUStringToOString( GetExport().GetFilter().addRelation( m_pSerializer->getOutputStream(),
|
||||
oox::getRelationship(Relationship::FONT),
|
||||
"fonts/font" + OUString::number( m_nextFontId ) + ".odttf" ), RTL_TEXTENCODING_UTF8 );
|
||||
OUString("fonts/font" + OUString::number( m_nextFontId ) + ".odttf") ), RTL_TEXTENCODING_UTF8 );
|
||||
EmbeddedFontRef ref;
|
||||
ref.relId = relId;
|
||||
ref.fontKey = fontKeyStr;
|
||||
|
||||
@@ -216,7 +216,7 @@ void DocxExport::ExportGrfBullet(const SwTextNode&)
|
||||
CollectGrfsOfBullets();
|
||||
}
|
||||
|
||||
OString DocxExport::AddRelation( const OUString& rType, const OUString& rTarget )
|
||||
OString DocxExport::AddRelation( const OUString& rType, std::u16string_view rTarget )
|
||||
{
|
||||
OUString sId = m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
|
||||
rType, rTarget, true );
|
||||
@@ -474,7 +474,7 @@ std::pair<OString, OString> DocxExport::WriteActiveXObject(const uno::Reference<
|
||||
|
||||
const OUString sBinaryId = m_rFilter.addRelation( pActiveXFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::ACTIVEXCONTROLBINARY),
|
||||
sBinaryFileName.copy(sBinaryFileName.lastIndexOf("/") + 1) );
|
||||
sBinaryFileName.subView(sBinaryFileName.lastIndexOf("/") + 1) );
|
||||
|
||||
pActiveXFS->singleElementNS(XML_ax, XML_ocx,
|
||||
FSNS(XML_xmlns, XML_ax), m_rFilter.getNamespaceURL(OOX_NS(ax)),
|
||||
@@ -485,7 +485,7 @@ std::pair<OString, OString> DocxExport::WriteActiveXObject(const uno::Reference<
|
||||
|
||||
OString sXMLId = OUStringToOString(m_rFilter.addRelation(m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::CONTROL),
|
||||
sXMLFileName.copy(sBinaryFileName.indexOf("/") + 1)),
|
||||
sXMLFileName.subView(sBinaryFileName.indexOf("/") + 1)),
|
||||
RTL_TEXTENCODING_UTF8);
|
||||
|
||||
return std::pair<OString, OString>(sXMLId, sName);
|
||||
@@ -648,7 +648,7 @@ void DocxExport::InitStyles()
|
||||
// setup word/styles.xml and the relations + content type
|
||||
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::STYLES),
|
||||
"styles.xml" );
|
||||
u"styles.xml" );
|
||||
|
||||
::sax_fastparser::FSHelperPtr pStylesFS =
|
||||
m_rFilter.openFragmentStreamWithSerializer( "word/styles.xml",
|
||||
@@ -671,7 +671,7 @@ void DocxExport::WriteFootnotesEndnotes()
|
||||
// setup word/styles.xml and the relations + content type
|
||||
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::FOOTNOTES),
|
||||
"footnotes.xml" );
|
||||
u"footnotes.xml" );
|
||||
|
||||
::sax_fastparser::FSHelperPtr pFootnotesFS =
|
||||
m_rFilter.openFragmentStreamWithSerializer( "word/footnotes.xml",
|
||||
@@ -699,7 +699,7 @@ void DocxExport::WriteFootnotesEndnotes()
|
||||
// setup word/styles.xml and the relations + content type
|
||||
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::ENDNOTES),
|
||||
"endnotes.xml" );
|
||||
u"endnotes.xml" );
|
||||
|
||||
::sax_fastparser::FSHelperPtr pEndnotesFS =
|
||||
m_rFilter.openFragmentStreamWithSerializer( "word/endnotes.xml",
|
||||
@@ -728,7 +728,7 @@ void DocxExport::WritePostitFields()
|
||||
|
||||
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::COMMENTS),
|
||||
"comments.xml" );
|
||||
u"comments.xml" );
|
||||
|
||||
::sax_fastparser::FSHelperPtr pPostitFS =
|
||||
m_rFilter.openFragmentStreamWithSerializer( "word/comments.xml",
|
||||
@@ -745,7 +745,7 @@ void DocxExport::WritePostitFields()
|
||||
|
||||
m_rFilter.addRelation(m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::COMMENTSEXTENDED),
|
||||
"commentsExtended.xml");
|
||||
u"commentsExtended.xml");
|
||||
|
||||
pPostitFS = m_rFilter.openFragmentStreamWithSerializer(
|
||||
"word/commentsExtended.xml",
|
||||
@@ -768,7 +768,7 @@ void DocxExport::WriteNumbering()
|
||||
|
||||
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::NUMBERING),
|
||||
"numbering.xml" );
|
||||
u"numbering.xml" );
|
||||
|
||||
::sax_fastparser::FSHelperPtr pNumberingFS = m_rFilter.openFragmentStreamWithSerializer( "word/numbering.xml",
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml" );
|
||||
@@ -875,7 +875,7 @@ void DocxExport::WriteFonts()
|
||||
{
|
||||
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::FONTTABLE),
|
||||
"fontTable.xml" );
|
||||
u"fontTable.xml" );
|
||||
|
||||
::sax_fastparser::FSHelperPtr pFS = m_rFilter.openFragmentStreamWithSerializer(
|
||||
"word/fontTable.xml",
|
||||
@@ -993,7 +993,7 @@ void DocxExport::WriteSettings()
|
||||
|
||||
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::SETTINGS),
|
||||
"settings.xml" );
|
||||
u"settings.xml" );
|
||||
|
||||
::sax_fastparser::FSHelperPtr pFS = m_rFilter.openFragmentStreamWithSerializer(
|
||||
"word/settings.xml",
|
||||
@@ -1381,7 +1381,7 @@ void DocxExport::WriteTheme()
|
||||
|
||||
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::THEME),
|
||||
"theme/theme1.xml" );
|
||||
u"theme/theme1.xml" );
|
||||
|
||||
uno::Reference< xml::sax::XSAXSerializable > serializer( themeDom, uno::UNO_QUERY );
|
||||
uno::Reference< xml::sax::XWriter > writer = xml::sax::Writer::create( comphelper::getProcessComponentContext() );
|
||||
@@ -1428,7 +1428,7 @@ void DocxExport::WriteGlossary()
|
||||
|
||||
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::GLOSSARYDOCUMENT),
|
||||
"glossary/document.xml" );
|
||||
u"glossary/document.xml" );
|
||||
|
||||
uno::Reference< io::XOutputStream > xOutputStream = GetFilter().openFragmentStream( "word/glossary/document.xml",
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml" );
|
||||
@@ -1491,7 +1491,7 @@ void DocxExport::WriteCustomXml()
|
||||
{
|
||||
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
|
||||
oox::getRelationship(Relationship::CUSTOMXML),
|
||||
"../customXml/item"+OUString::number((j+1))+".xml" );
|
||||
OUString("../customXml/item"+OUString::number((j+1))+".xml" ));
|
||||
|
||||
uno::Reference< xml::sax::XSAXSerializable > serializer( customXmlDom, uno::UNO_QUERY );
|
||||
uno::Reference< xml::sax::XWriter > writer = xml::sax::Writer::create( comphelper::getProcessComponentContext() );
|
||||
@@ -1514,7 +1514,7 @@ void DocxExport::WriteCustomXml()
|
||||
m_rFilter.addRelation( GetFilter().openFragmentStream( "customXml/item"+OUString::number((j+1))+".xml",
|
||||
"application/xml" ) ,
|
||||
oox::getRelationship(Relationship::CUSTOMXMLPROPS),
|
||||
"itemProps"+OUString::number((j+1))+".xml" );
|
||||
OUString("itemProps"+OUString::number((j+1))+".xml" ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1548,7 +1548,7 @@ void DocxExport::WriteVBA()
|
||||
pOut->WriteStream(*pIn);
|
||||
|
||||
// Write the relationship.
|
||||
m_rFilter.addRelation(m_pDocumentFS->getOutputStream(), oox::getRelationship(Relationship::VBAPROJECT), "vbaProject.bin");
|
||||
m_rFilter.addRelation(m_pDocumentFS->getOutputStream(), oox::getRelationship(Relationship::VBAPROJECT), u"vbaProject.bin");
|
||||
}
|
||||
|
||||
OUString aDataName("_MS_VBA_Macros_XML");
|
||||
@@ -1575,7 +1575,7 @@ void DocxExport::WriteVBA()
|
||||
if (!xProjectStream.is())
|
||||
return;
|
||||
|
||||
m_rFilter.addRelation(xProjectStream, oox::getRelationship(Relationship::WORDVBADATA), "vbaData.xml");
|
||||
m_rFilter.addRelation(xProjectStream, oox::getRelationship(Relationship::WORDVBADATA), u"vbaData.xml");
|
||||
}
|
||||
|
||||
void DocxExport::WriteEmbeddings()
|
||||
@@ -1804,7 +1804,7 @@ DocxExport::DocxExport(DocxExportFilter& rFilter, SwDoc& rDocument,
|
||||
|
||||
// relations for the document
|
||||
m_rFilter.addRelation( oox::getRelationship(Relationship::OFFICEDOCUMENT),
|
||||
"word/document.xml" );
|
||||
u"word/document.xml" );
|
||||
|
||||
// Set media type depending of document type
|
||||
OUString aMediaType;
|
||||
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
virtual void ExportGrfBullet(const SwTextNode&) override;
|
||||
|
||||
/// Returns the relationd id
|
||||
OString AddRelation( const OUString& rType, const OUString& rTarget );
|
||||
OString AddRelation( const OUString& rType, std::u16string_view rTarget );
|
||||
|
||||
virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t()*/ ) override { /* FIXME no-op for docx, most probably should not even be in MSWordExportBase */ }
|
||||
virtual void WriteChar( sal_Unicode ) override { SAL_WARN("sw.ww8", "FIXME: WriteChar() has nothing to do for docx."); }
|
||||
|
||||
@@ -975,7 +975,7 @@ bool AttributeOutputBase::AnalyzeURL( const OUString& rUrl, const OUString& /*rT
|
||||
|
||||
if ( rUrl.getLength() > 1 && rUrl[0] == '#' )
|
||||
{
|
||||
sMark = BookmarkToWriter( rUrl.copy(1) );
|
||||
sMark = BookmarkToWriter( rUrl.subView(1) );
|
||||
|
||||
const sal_Int32 nPos = sMark.lastIndexOf( cMarkSeparator );
|
||||
|
||||
@@ -1221,7 +1221,7 @@ OUString BookmarkToWord(const OUString &rBookmark)
|
||||
return TruncateBookmark(sRet);
|
||||
}
|
||||
|
||||
OUString BookmarkToWriter(const OUString &rBookmark)
|
||||
OUString BookmarkToWriter(std::u16string_view rBookmark)
|
||||
{
|
||||
return INetURLObject::decode(rBookmark,
|
||||
INetURLObject::DecodeMechanism::Unambiguous, RTL_TEXTENCODING_ASCII_US);
|
||||
|
||||
@@ -3121,12 +3121,12 @@ void WW8Export::StoreDoc1()
|
||||
WriteFkpPlcUsw(); // FKP, PLC, ...
|
||||
}
|
||||
|
||||
void MSWordExportBase::AddLinkTarget(const OUString& rURL)
|
||||
void MSWordExportBase::AddLinkTarget(std::u16string_view rURL)
|
||||
{
|
||||
if( rURL.isEmpty() || rURL[0] != '#' )
|
||||
if( rURL.empty() || rURL[0] != '#' )
|
||||
return;
|
||||
|
||||
OUString aURL( BookmarkToWriter( rURL.copy( 1 ) ) );
|
||||
OUString aURL( BookmarkToWriter( rURL.substr( 1 ) ) );
|
||||
sal_Int32 nPos = aURL.lastIndexOf( cMarkSeparator );
|
||||
|
||||
if( nPos < 2 )
|
||||
@@ -3143,7 +3143,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
|
||||
if( sCmp == "outline" )
|
||||
{
|
||||
SwPosition aPos(*m_pCurPam->GetPoint());
|
||||
OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
|
||||
OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
|
||||
// If we can find the outline this bookmark refers to
|
||||
// save the name of the bookmark and the
|
||||
// node index number of where it points to
|
||||
@@ -3156,7 +3156,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
|
||||
else if( sCmp == "graphic" )
|
||||
{
|
||||
SwNodeIndex* pIdx;
|
||||
OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
|
||||
OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
|
||||
const SwFlyFrameFormat* pFormat = m_rDoc.FindFlyByName(aName, SwNodeType::Grf);
|
||||
if (pFormat && nullptr != (pIdx = const_cast<SwNodeIndex*>(pFormat->GetContent().GetContentIdx())))
|
||||
{
|
||||
@@ -3167,7 +3167,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
|
||||
else if( sCmp == "frame" )
|
||||
{
|
||||
SwNodeIndex* pIdx;
|
||||
OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
|
||||
OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
|
||||
const SwFlyFrameFormat* pFormat = m_rDoc.FindFlyByName(aName, SwNodeType::Text);
|
||||
if (pFormat && nullptr != (pIdx = const_cast<SwNodeIndex*>(pFormat->GetContent().GetContentIdx())))
|
||||
{
|
||||
@@ -3178,7 +3178,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
|
||||
else if( sCmp == "ole" )
|
||||
{
|
||||
SwNodeIndex* pIdx;
|
||||
OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
|
||||
OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
|
||||
const SwFlyFrameFormat* pFormat = m_rDoc.FindFlyByName(aName, SwNodeType::Ole);
|
||||
if (pFormat && nullptr != (pIdx = const_cast<SwNodeIndex*>(pFormat->GetContent().GetContentIdx())))
|
||||
{
|
||||
@@ -3189,7 +3189,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
|
||||
else if( sCmp == "region" )
|
||||
{
|
||||
SwNodeIndex* pIdx;
|
||||
OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
|
||||
OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
|
||||
for (const SwSectionFormat* pFormat : m_rDoc.GetSections())
|
||||
{
|
||||
if (aName == pFormat->GetSection()->GetSectionName()
|
||||
@@ -3203,7 +3203,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
|
||||
}
|
||||
else if( sCmp == "table" )
|
||||
{
|
||||
OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
|
||||
OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
|
||||
const SwTable* pTable = SwTable::FindTable(m_rDoc.FindTableFormatByName(aName));
|
||||
if (pTable)
|
||||
{
|
||||
|
||||
@@ -834,7 +834,7 @@ protected:
|
||||
/// Setup the chapter fields (maChapterFieldLocs).
|
||||
void GatherChapterFields();
|
||||
|
||||
void AddLinkTarget( const OUString& rURL );
|
||||
void AddLinkTarget( std::u16string_view rURL );
|
||||
void CollectOutlineBookmarks( const SwDoc &rDoc );
|
||||
|
||||
bool SetCurrentPageDescFromNode(const SwNode &rNd);
|
||||
|
||||
@@ -1837,7 +1837,7 @@ public: // really private, but can only be done public
|
||||
void Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, short nLen);
|
||||
tools::Long MapBookmarkVariables(const WW8FieldDesc* pF, OUString &rOrigName,
|
||||
const OUString &rData);
|
||||
OUString GetMappedBookmark(const OUString &rOrigName);
|
||||
OUString GetMappedBookmark(std::u16string_view rOrigName);
|
||||
|
||||
// fields
|
||||
eF_ResT Read_F_Input(WW8FieldDesc*, OUString& rStr);
|
||||
@@ -1932,7 +1932,7 @@ void SyncIndentWithList( SvxLRSpaceItem &rLR,
|
||||
const bool bFirstLineOfStSet,
|
||||
const bool bLeftIndentSet );
|
||||
tools::Long GetListFirstLineIndent(const SwNumFormat &rFormat);
|
||||
OUString BookmarkToWriter(const OUString &rBookmark);
|
||||
OUString BookmarkToWriter(std::u16string_view rBookmark);
|
||||
bool RTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth,
|
||||
sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft,
|
||||
SwTwips nPageRight, SwTwips nPageSize);
|
||||
|
||||
@@ -1341,7 +1341,7 @@ SwFltStackEntry *SwWW8FltRefStack::RefToVar(const SwField* pField,
|
||||
return pRet;
|
||||
}
|
||||
|
||||
OUString SwWW8ImplReader::GetMappedBookmark(const OUString &rOrigName)
|
||||
OUString SwWW8ImplReader::GetMappedBookmark(std::u16string_view rOrigName)
|
||||
{
|
||||
OUString sName(BookmarkToWriter(rOrigName));
|
||||
OSL_ENSURE(m_xPlcxMan, "no pPlcxMan");
|
||||
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
size_t GetArrPos() const { return m_nArrPos; }
|
||||
OUString GetFile() const;
|
||||
OUString GetSubRegion() const;
|
||||
void SetFile(OUString const& rFile);
|
||||
void SetFile(std::u16string_view rFile);
|
||||
void SetFilter(std::u16string_view rFilter);
|
||||
void SetSubRegion(std::u16string_view rSubRegion);
|
||||
|
||||
@@ -209,17 +209,17 @@ SectRepr::SectRepr( size_t nPos, SwSection& rSect )
|
||||
}
|
||||
}
|
||||
|
||||
void SectRepr::SetFile( const OUString& rFile )
|
||||
void SectRepr::SetFile( std::u16string_view rFile )
|
||||
{
|
||||
OUString sNewFile( INetURLObject::decode( rFile,
|
||||
INetURLObject::DecodeMechanism::Unambiguous ));
|
||||
const OUString sOldFileName( m_SectionData.GetLinkFileName() );
|
||||
const OUString sSub( sOldFileName.getToken( 2, sfx2::cTokenSeparator ) );
|
||||
|
||||
if( !rFile.isEmpty() || !sSub.isEmpty() )
|
||||
if( !rFile.empty() || !sSub.isEmpty() )
|
||||
{
|
||||
sNewFile += OUStringChar(sfx2::cTokenSeparator);
|
||||
if( !rFile.isEmpty() ) // Filter only with FileName
|
||||
if( !rFile.empty() ) // Filter only with FileName
|
||||
sNewFile += sOldFileName.getToken( 1, sfx2::cTokenSeparator );
|
||||
|
||||
sNewFile += OUStringChar(sfx2::cTokenSeparator) + sSub;
|
||||
@@ -227,7 +227,7 @@ void SectRepr::SetFile( const OUString& rFile )
|
||||
|
||||
m_SectionData.SetLinkFileName( sNewFile );
|
||||
|
||||
if( !rFile.isEmpty() || !sSub.isEmpty() )
|
||||
if( !rFile.empty() || !sSub.isEmpty() )
|
||||
{
|
||||
m_SectionData.SetType( SectionType::FileLink );
|
||||
}
|
||||
@@ -943,7 +943,7 @@ IMPL_LINK(SwEditRegionDlg, UseFileHdl, weld::ToggleButton&, rButton, void)
|
||||
pSectRepr->SetContent(false);
|
||||
else
|
||||
{
|
||||
pSectRepr->SetFile(OUString());
|
||||
pSectRepr->SetFile(u"");
|
||||
pSectRepr->SetSubRegion(std::u16string_view());
|
||||
pSectRepr->GetSectionData().SetLinkFilePassword(OUString());
|
||||
}
|
||||
@@ -1151,7 +1151,7 @@ IMPL_LINK(SwEditRegionDlg, DDEHdl, weld::ToggleButton&, rButton, void)
|
||||
m_xSubRegionED->hide();
|
||||
if (SectionType::FileLink == rData.GetType())
|
||||
{
|
||||
pSectRepr->SetFile(OUString());
|
||||
pSectRepr->SetFile(u"");
|
||||
m_xFileNameED->set_text(OUString());
|
||||
rData.SetLinkFilePassword(OUString());
|
||||
}
|
||||
@@ -1170,7 +1170,7 @@ IMPL_LINK(SwEditRegionDlg, DDEHdl, weld::ToggleButton&, rButton, void)
|
||||
if (SectionType::DdeLink == rData.GetType())
|
||||
{
|
||||
rData.SetType(SectionType::FileLink);
|
||||
pSectRepr->SetFile(OUString());
|
||||
pSectRepr->SetFile(u"");
|
||||
rData.SetLinkFilePassword(OUString());
|
||||
m_xFileNameED->set_text(OUString());
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ void RepaintPagePreview( SwViewShell const * pVwSh, const SwRect& rRect )
|
||||
pSwPagePreview->RepaintCoreRect(rRect);
|
||||
}
|
||||
|
||||
bool JumpToSwMark( SwViewShell const * pVwSh, const OUString& rMark )
|
||||
bool JumpToSwMark( SwViewShell const * pVwSh, std::u16string_view rMark )
|
||||
{
|
||||
SfxViewShell *pSfxViewShell = pVwSh->GetSfxViewShell();
|
||||
|
||||
|
||||
@@ -2155,10 +2155,10 @@ static auto JumpToTOXMark(SwWrtShell & rSh, OUString const& rName) -> bool
|
||||
}
|
||||
}
|
||||
|
||||
bool SwView::JumpToSwMark( const OUString& rMark )
|
||||
bool SwView::JumpToSwMark( std::u16string_view rMark )
|
||||
{
|
||||
bool bRet = false;
|
||||
if( !rMark.isEmpty() )
|
||||
if( !rMark.empty() )
|
||||
{
|
||||
// place bookmark at top-center
|
||||
bool bSaveCC = m_bCenterCursor;
|
||||
|
||||
Reference in New Issue
Block a user