/* -*- 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/.
*/
void
ToxLinkProcessor::StartNewLink(sal_Int32 startPosition, const UIName& characterStyle)
{
SAL_INFO_IF(m_oStartedLink, "sw.core", "ToxLinkProcessor: LS without LE");
m_oStartedLink.emplace(startPosition, characterStyle);
}
void ToxLinkProcessor::CloseLink(sal_Int32 endPosition, const OUString& url, constOUString& sAltText, bool bRelative)
{ if (!m_oStartedLink)
{
SAL_INFO("sw.core", "ToxLinkProcessor: LE without LS"); return;
}
if (url.isEmpty()) { return;
}
OUString uri; if (bRelative)
{ // url contains '|' which must be encoded; also in some cases contains // arbitrary strings that need to be encoded
assert(url[0] == '#'); // all links are internal
uri = "#"
+ rtl::Uri::encode(url.copy(1), rtl_UriCharClassUricNoSlash,
rtl_UriEncodeIgnoreEscapes, RTL_TEXTENCODING_UTF8);
} else
{
uri = url;
}
std::unique_ptr<ClosedLink> pClosedLink( new ClosedLink(uri, m_oStartedLink->mStartPosition, endPosition));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.