summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-12-25 12:51:53 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-12-25 18:44:09 +0100
commitbe5f70e2b8498345f2301598cba325d5524513f2 (patch)
tree4bb27a7e85d62a931db9229ecd9ef2e65f441e34 /tools
parenta7a1d8647a8e03675746d4cbbcf707422f4db888 (diff)
Simplify INetURLObject::parseHostOrNetBiosName a bit more
Change-Id: Ie22e7a142aabd2c0f12c34945ad0858f5bd868a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127451 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/fsys/urlobj.cxx20
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 67cb1f1cd024..1d08a5590eaa 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -2843,9 +2843,16 @@ bool INetURLObject::parseHostOrNetBiosName(
while (pBegin < pEnd)
{
EscapeType eEscapeType;
- sal_uInt32 nUTF32 = getUTF32(pBegin, pEnd, eMechanism, eCharset, eEscapeType);
- switch (nUTF32)
+ switch (sal_uInt32 nUTF32 = getUTF32(pBegin, pEnd, eMechanism, eCharset, eEscapeType))
{
+ default:
+ if (INetMIME::isVisible(nUTF32))
+ {
+ if (pCanonic)
+ appendUCS4(*pCanonic, nUTF32, eEscapeType, PART_URIC, eCharset, true);
+ break;
+ }
+ [[fallthrough]];
case '"':
case '*':
case '+':
@@ -2865,16 +2872,7 @@ bool INetURLObject::parseHostOrNetBiosName(
if (pCanonic)
pCanonic->setLength(nOriginalCanonicLength);
return false;
- default:
- if (!INetMIME::isVisible(nUTF32))
- {
- if (pCanonic)
- pCanonic->setLength(nOriginalCanonicLength);
- return false;
- }
}
- if (pCanonic)
- appendUCS4(*pCanonic, nUTF32, eEscapeType, PART_URIC, eCharset, true);
}
return true;
}