sw/inc/IDocumentSettingAccess.hxx             |    1 
 sw/qa/extras/layout/data/Hyphenated-link.fodt |  258 ++++++++++++++++++++++++++
 sw/qa/extras/layout/data/Hyphenated-link.rtf  |   41 ++++
 sw/qa/extras/layout/layout2.cxx               |   26 ++
 sw/source/core/doc/DocumentSettingManager.cxx |    9 
 sw/source/core/inc/DocumentSettingManager.hxx |    1 
 sw/source/core/text/guess.cxx                 |   30 +++
 sw/source/filter/ww8/ww8par.cxx               |    1 
 sw/source/filter/xml/xmlimp.cxx               |   10 +
 sw/source/uibase/uno/SwXDocumentSettings.cxx  |   18 +
 writerfilter/source/filter/WriterFilter.cxx   |    1 
 11 files changed, 396 insertions(+)

New commits:
commit de2b1a3a22a0a3bf5dfdd44c57c09e1fd0ba39d2
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Jan 12 14:24:11 2023 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri Jan 13 15:51:02 2023 +0000

    tdf#152952 sw: don't hyphenate URLs by default
    
    New compatibility flag HyphenateURLs, disabled by default for Word
    interop and enabled for old ODT documents.
    
    Change-Id: I1496819599deb5ed0fd736698d269ab9a22167fe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145415
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index 1f81ead70645..e891a2b8c058 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -92,6 +92,7 @@ enum class DocumentSettingId
     EMPTY_DB_FIELD_HIDES_PARA,
     // tdf#129448: Auto first-line indent should not be effected by line space
     AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE,
+    HYPHENATE_URLS, ///< tdf#152952
     // COMPATIBILITY FLAGS END
     BROWSE_MODE,
     HTML_MODE,
diff --git a/sw/qa/extras/layout/data/Hyphenated-link.fodt 
b/sw/qa/extras/layout/data/Hyphenated-link.fodt
new file mode 100644
index 000000000000..0371cf4406f1
--- /dev/null
+++ b/sw/qa/extras/layout/data/Hyphenated-link.fodt
@@ -0,0 +1,258 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:c
 alcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:
 meta:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:meta><meta:initial-creator>Gabor Kelemen 
LO</meta:initial-creator><meta:creation-date>2023-01-09T23:24:00</meta:creation-date><dc:date>2023-01-09T23:25:00</dc:date><meta:editing-cycles>3</meta:editing-cycles><meta:editing-duration>PT3S</meta:editing-duration><meta:document-statistic
 meta:table-count="0" meta:image-count="0" meta:object-count="0" 
meta:page-count="1" meta:paragraph-count="2" meta:word-count="101" 
meta:character-count="779" 
meta:non-whitespace-character-count="677"/><meta:generator>LibreOfficeDev/7.4.5.0.0$Linux_X86_64
 
LibreOffice_project/f2d3658697f22090ee138cebda4d10c3ede21230</meta:generator><meta:user-defined
 meta:name="Operator">Gábor Kelemen2010</meta:user-defined></office:meta>
+ <office:settings>
+  <config:config-item-set config:name="ooo:view-settings">
+   <config:config-item config:name="ViewAreaTop" 
config:type="long">0</config:config-item>
+   <config:config-item config:name="ViewAreaLeft" 
config:type="long">0</config:config-item>
+   <config:config-item config:name="ViewAreaWidth" 
config:type="long">0</config:config-item>
+   <config:config-item config:name="ViewAreaHeight" 
config:type="long">0</config:config-item>
+   <config:config-item config:name="ShowRedlineChanges" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="InBrowseMode" 
config:type="boolean">false</config:config-item>
+  </config:config-item-set>
+  <config:config-item-set config:name="ooo:configuration-settings">
+   <config:config-item config:name="PrintProspect" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintReversed" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintSingleJobs" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintLeftPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintTables" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintControls" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintPageBackground" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintDrawings" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintBlackFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintAnnotationMode" 
config:type="short">0</config:config-item>
+   <config:config-item config:name="PrintTextPlaceholder" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ProtectFields" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ProtectBookmarks" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmptyDbFieldHidesPara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="DisableOffPagePositioning" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="SubtractFlysAnchoredAtFlys" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PropLineSpacingShrinksFirstLine" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ApplyParagraphMarkFormatToNumbering" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="GutterAtTop" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TreatSingleColumnBreakAsPageBreak" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedSystemFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedComplexScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="EmbedAsianScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="EmbedLatinScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="EmbedOnlyUsedFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="WordLikeWrapForAsCharFlys" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ContinuousEndnotes" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ClippedPictures" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="FloattableNomargins" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UnbreakableNumberings" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="HeaderSpacingBelowLastPara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AllowPrintJobCancel" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="UseOldPrinterMetrics" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TabOverMargin" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TabsRelativeToIndent" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseOldNumbering" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="InvertBorderSpacing" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintPaperFromSetup" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UpdateFromTemplate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="CurrentDatabaseCommandType" 
config:type="int">0</config:config-item>
+   <config:config-item config:name="LinkUpdateMode" 
config:type="short">1</config:config-item>
+   <config:config-item config:name="AddParaSpacingToTableCells" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="FrameAutowidthWithMorePara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="CurrentDatabaseCommand" 
config:type="string"/>
+   <config:config-item config:name="PrinterIndependentLayout" 
config:type="string">high-resolution</config:config-item>
+   <config:config-item config:name="ApplyUserData" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintFaxName" config:type="string"/>
+   <config:config-item config:name="CurrentDatabaseDataSource" 
config:type="string"/>
+   <config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="IsKernAsianPunctuation" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="SaveThumbnail" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="UseFormerTextWrapping" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AutoFirstLineIndentDisregardLineSpace" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddExternalLeading" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddParaTableSpacing" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="StylesNoDefault" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ChartAutoUpdate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
+   <config:config-item config:name="AddParaTableSpacingAtStart" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="Rsid" 
config:type="int">1180787</config:config-item>
+   <config:config-item config:name="EmbeddedDatabaseName" 
config:type="string"/>
+   <config:config-item config:name="FieldAutoUpdate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="OutlineLevelYieldsNumbering" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="FootnoteInColumnToPageEnd" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AlignTabStopPosition" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="CharacterCompressionType" 
config:type="short">0</config:config-item>
+   <config:config-item config:name="PrinterName" config:type="string"/>
+   <config:config-item config:name="SaveGlobalDocumentLinks" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrinterPaperFromSetup" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseFormerLineSpacing" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AddParaLineSpacingToTableCells" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="UseFormerObjectPositioning" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintGraphics" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ImagePreferredDPI" 
config:type="int">0</config:config-item>
+   <config:config-item config:name="SurroundTextWrapSmall" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ConsiderTextWrapOnObjPos" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordCompTrailingBlanks" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TabAtLeftIndentForParagraphsInList" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintRightPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TabOverSpacing" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="IgnoreFirstLineIndentInNumbering" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="NoNumberingShowFollowBy" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="RedlineProtectionKey" 
config:type="base64Binary"/>
+   <config:config-item config:name="DoNotJustifyLinesWithManualBreak" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintProspectRTL" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintEmptyPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="DoNotResetParaAttrsForNumFont" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AddFrameOffsets" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="LoadReadonly" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="DoNotCaptureDrawObjsOnPage" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AddVerticalFrameOffsets" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UnxForceZeroExtLeading" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="IsLabelDocument" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TableRowKeep" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="RsidRoot" 
config:type="int">1180787</config:config-item>
+   <config:config-item config:name="PrintHiddenText" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ProtectForm" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordCompMinLineHeightByFly" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="BackgroundParaOverDrawings" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="SaveVersionOnClose" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MathBaselineAlignment" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="SmallCapsPercentage66" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CollapseEmptyCellPara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TabOverflow" 
config:type="boolean">true</config:config-item>
+  </config:config-item-set>
+ </office:settings>
+ <office:font-face-decls>
+  <style:font-face style:name="Calibri" svg:font-family="Calibri" 
style:font-family-generic="system" style:font-pitch="variable"/>
+  <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation 
Serif'" style:font-family-generic="roman" style:font-pitch="variable"/>
+  <style:font-face style:name="Lohit Devanagari1" svg:font-family="'Lohit 
Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/>
+  <style:font-face style:name="Source Han Serif CN" svg:font-family="'Source 
Han Serif CN'" style:font-family-generic="system" style:font-pitch="variable"/>
+  <style:font-face style:name="Times New Roman" svg:font-family="'Times New 
Roman'" style:font-family-generic="roman" style:font-pitch="variable"/>
+  <style:font-face style:name="Times New Roman1" svg:font-family="'Times New 
Roman'" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+  <style:default-style style:family="graphic">
+   <style:graphic-properties svg:stroke-color="#3465a4" 
draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" 
draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" 
draw:start-line-spacing-vertical="0.283cm" 
draw:end-line-spacing-horizontal="0.283cm" 
draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+   <style:paragraph-properties style:text-autospace="ideograph-alpha" 
style:line-break="strict" style:writing-mode="lr-tb" 
style:font-independent-line-spacing="false">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+   <style:text-properties style:use-window-font-color="true" 
loext:opacity="0%" loext:color-lum-mod="100%" loext:color-lum-off="0%" 
style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" 
fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han 
Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" 
style:country-asian="CN" style:font-name-complex="Lohit Devanagari1" 
style:font-size-complex="12pt" style:language-complex="hi" 
style:country-complex="IN"/>
+  </style:default-style>
+  <style:default-style style:family="paragraph">
+   <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" 
style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" 
style:line-break="strict" style:tab-stop-distance="1.249cm" 
style:writing-mode="page"/>
+   <style:text-properties style:use-window-font-color="true" 
loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" 
fo:language="de" fo:country="DE" style:letter-kerning="true" 
style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" 
style:language-asian="zh" style:country-asian="CN" 
style:font-name-complex="Lohit Devanagari1" style:font-size-complex="12pt" 
style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" 
fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" 
loext:hyphenation-no-caps="false" loext:hyphenation-no-last-word="false" 
loext:hyphenation-word-char-count="5" loext:hyphenation-zone="no-limit"/>
+  </style:default-style>
+  <style:default-style style:family="table">
+   <style:table-properties table:border-model="collapsing"/>
+  </style:default-style>
+  <style:default-style style:family="table-row">
+   <style:table-row-properties fo:keep-together="auto"/>
+  </style:default-style>
+  <style:style style:name="Standard" style:family="paragraph" 
style:class="text">
+   <style:paragraph-properties fo:text-align="start" 
style:justify-single-word="false" fo:orphans="2" fo:widows="2" 
fo:hyphenation-ladder-count="no-limit" style:vertical-align="auto"/>
+   <style:text-properties style:font-name="Times New Roman" 
fo:font-family="'Times New Roman'" style:font-family-generic="roman" 
style:font-pitch="variable" fo:font-size="12pt" fo:language="de" 
fo:country="DE" style:letter-kerning="true" style:font-name-asian="Calibri" 
style:font-family-asian="Calibri" style:font-family-generic-asian="system" 
style:font-pitch-asian="variable" style:font-size-asian="12pt" 
style:language-asian="de" style:country-asian="AT" 
style:font-name-complex="Times New Roman1" style:font-family-complex="'Times 
New Roman'" style:font-family-generic-complex="system" 
style:font-pitch-complex="variable" style:font-size-complex="12pt" 
style:language-complex="ar" style:country-complex="SA" fo:hyphenate="true" 
fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" 
loext:hyphenation-no-caps="false" loext:hyphenation-no-last-word="false" 
loext:hyphenation-word-char-count="5" loext:hyphenation-zone="no-limit"/>
+  </style:style>
+  <text:outline-style style:name="Outline">
+   <text:outline-level-style text:level="1" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="2" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="3" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="4" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="5" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="6" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="7" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="8" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="9" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="10" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+  </text:outline-style>
+  <text:notes-configuration text:note-class="footnote" style:num-format="1" 
text:start-value="0" text:footnotes-position="page" 
text:start-numbering-at="document"/>
+  <text:notes-configuration text:note-class="endnote" style:num-format="i" 
text:start-value="0"/>
+  <text:linenumbering-configuration text:number-lines="false" 
text:offset="0.499cm" style:num-format="1" text:number-position="left" 
text:increment="5"/>
+  <style:default-page-layout>
+   <style:page-layout-properties style:layout-grid-standard-mode="true"/>
+  </style:default-page-layout>
+ </office:styles>
+ <office:automatic-styles>
+  <style:style style:name="P1" style:family="paragraph" 
style:parent-style-name="Standard">
+   <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" 
fo:text-indent="0cm" style:auto-text-indent="false" style:writing-mode="lr-tb"/>
+  </style:style>
+  <style:style style:name="P2" style:family="paragraph" 
style:parent-style-name="Standard" style:master-page-name="First_20_Page">
+   <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" 
fo:text-indent="0cm" style:auto-text-indent="false" style:page-number="auto" 
style:writing-mode="lr-tb"/>
+  </style:style>
+  <style:style style:name="T1" style:family="text">
+   <style:text-properties style:font-name="Times New Roman"/>
+  </style:style>
+  <style:style style:name="T2" style:family="text">
+   <style:text-properties style:font-name="Times New Roman" 
fo:font-size="10pt" style:font-size-asian="10pt"/>
+  </style:style>
+  <style:style style:name="T3" style:family="text">
+   <style:text-properties style:font-name="Times New Roman" 
style:language-asian="hu" style:country-asian="HU"/>
+  </style:style>
+  <style:style style:name="T4" style:family="text">
+   <style:text-properties fo:color="#0563c1" loext:opacity="100%" 
style:font-name="Times New Roman" style:text-underline-style="solid" 
style:text-underline-width="auto" style:text-underline-color="font-color"/>
+  </style:style>
+  <style:page-layout style:name="pm1">
+   <style:page-layout-properties fo:page-width="21.001cm" 
fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" 
fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2.501cm" 
fo:margin-right="2.501cm" style:writing-mode="lr-tb" 
style:layout-grid-color="#c0c0c0" style:layout-grid-lines="25700" 
style:layout-grid-base-height="0.176cm" style:layout-grid-ruby-height="0cm" 
style:layout-grid-mode="none" style:layout-grid-ruby-below="false" 
style:layout-grid-print="false" style:layout-grid-display="false" 
style:layout-grid-base-width="0.423cm" style:layout-grid-snap-to="true" 
style:footnote-max-height="0cm" loext:margin-gutter="0cm">
+    <style:footnote-sep style:width="0.018cm" 
style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" 
style:line-style="solid" style:adjustment="left" style:rel-width="25%" 
style:color="#000000"/>
+   </style:page-layout-properties>
+   <style:header-style/>
+   <style:footer-style/>
+  </style:page-layout>
+  <style:style style:name="dp1" style:family="drawing-page">
+   <style:drawing-page-properties draw:background-size="full"/>
+  </style:style>
+ </office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Standard" style:page-layout-name="pm1" 
draw:style-name="dp1"/>
+  <style:master-page style:name="First_20_Page" style:display-name="First 
Page" style:page-layout-name="pm1" draw:style-name="dp1" 
style:next-style-name="Standard"/>
+ </office:master-styles>
+ <office:body>
+  <office:text>
+   <text:sequence-decls>
+    <text:sequence-decl text:display-outline-level="0" 
text:name="Illustration"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+   </text:sequence-decls>
+   <text:p text:style-name="P2"><text:s/><text:span 
text:style-name="T2">NNNNNNNNNN NNNNNNNNNNNNNNN </text:span><text:a 
xlink:type="simple" xlink:href="https://example.com/"; 
text:style-name="Default_20_Style" 
text:visited-style-name="Default_20_Style"><text:span 
text:style-name="T4">https://example.com/xxxxxxx/eeeeeeeeeeeeeeeeeee/sssssssssssssssss</text:span></text:a><text:span
 text:style-name="T1"> </text:span></text:p>
+   <text:p text:style-name="P1"><text:span text:style-name="T3">Napoleon III. 
(französisch Napoléon III; * 20. April 1808 in Paris; † 9. Januar 1873 in 
Chislehurst bei London) war unter seinem Geburtsnamen Charles-Louis-Napoléon 
Bonaparte (auch Louis-Napoléon Bonaparte) während der Zweiten Republik von 1848 
bis 1852 französischer Staatspräsident und von 1852 bis 1870 als Napoleon III. 
Kaiser der Franzosen. Mit dem Staatsstreich vom 2. Dezember 1851 hatte der aus 
einer Volkswahl hervorgegangene Präsident eine Diktatur errichtet. Ein Jahr 
darauf (1852) proklamierte er sich zum Kaiser und sein Land zum Zweiten 
Kaiserreich. Das Parlament wurde weitgehend entmachtet und erhielt erst ganz am 
Ende seiner Herrschaft wieder etwas mehr Kompetenzen.</text:span><text:span 
text:style-name="T1"> </text:span></text:p>
+  </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/layout/data/Hyphenated-link.rtf 
b/sw/qa/extras/layout/data/Hyphenated-link.rtf
new file mode 100644
index 000000000000..fde5bf2312f0
--- /dev/null
+++ b/sw/qa/extras/layout/data/Hyphenated-link.rtf
@@ -0,0 +1,41 @@
+{\rtf1\adeflang1025\ansi\ansicpg1250\uc1\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1038\deflangfe1038\themelang1038\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi
 \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt 
Times New Roman};}
+{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 
020b0604020202020204}Arial;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 
020b0604020202020204}Arial;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 
020f0502020204030204}Calibri;}
+{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0502040204020203}Segoe 
UI;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 
020b0604030504040204}Tahoma{\*\falt Times New Roman};}{\f40\fbidi 
\froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
+{\f41\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Liberation 
Serif{\*\falt Times New Roman};}{\f42\fbidi \fswiss\fcharset0\fprq2{\*\panose 
020b0604020202020204}Liberation Sans{\*\falt Arial};}
+{\f43\fbidi \fswiss\fcharset134\fprq2{\*\panose 020b0503020204020204}Microsoft 
YaHei;}{\f45\fbidi \fswiss\fcharset0\fprq2{\*\panose 
020b0602030504020204}Lucida Sans;}
+{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 
02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 
020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi 
\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt 
Times New Roman};}
+}{\colortbl;\red0\green0\blue0;
+\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;
+\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red5\green99\blue193;}{\*\defchp
 \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql 
\li0\ri0\sa160\sl259\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 
}\noqfpromote {\stylesheet{\ql 
\li0\ri0\widctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 
\af0\afs24\alang1025 \ltrch\fcs0 
+\fs24\lang1031\langfe3079\kerning1\cgrid\langnp1031\langfenp3079 \snext0 
\sqformat \spriority0 Normal;}{\*\cs10 \additive Default Paragraph 
Font;}{\*\cs32 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \f0\ul\cf17 \sbasedon10 
Internet Link;}
+}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0
+\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author Gabor 
Kelemen LO}{\operator G\'e1bor 
Kelemen2010}{\creatim\yr2023\mo1\dy9\hr23\min24}{\revtim\yr2023\mo1\dy9\hr23\min25}{\version3}{\edmins3}{\nofpages1}{\nofwords103}{\nofchars712}
+{\nofcharsws814}{\vern57455}}
+\paperw11906\paperh16838\margl1418\margr1418\margt1134\margb1134\gutter0\ltrsect
 
+\deftab708\widowctrl\ftnbj\aenddoc\hyphhotz425\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0
+\showxmlerrors0\hyphauto1\formshade\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100
 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0{\*\ftnsep \ltrpar \pard\plain 
\ltrpar
+\ql \li0\ri0\widctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 
\af0\afs24\alang1025 \ltrch\fcs0 
\fs24\lang1031\langfe3079\kerning1\cgrid\langnp1031\langfenp3079 {\rtlch\fcs1 
\af0 \ltrch\fcs0 
+\lang1038\langfe1038\kerning0\loch\af41\hich\af41\dbch\af31505\langnp1038\langfenp1038
 \chftnsep }{\rtlch\fcs1 \af0 \ltrch\fcs0  
+\par }}{\*\ftnsepc \ltrpar \pard\plain \ltrpar\ql 
\li0\ri0\widctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 
\af0\afs24\alang1025 \ltrch\fcs0 
\fs24\lang1031\langfe3079\kerning1\cgrid\langnp1031\langfenp3079 {\rtlch\fcs1 
\af0 \ltrch\fcs0  
+\chftnsepc 
+\par }}{\*\aftnsep \ltrpar \pard\plain \ltrpar\ql 
\li0\ri0\widctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 
\af0\afs24\alang1025 \ltrch\fcs0 
\fs24\lang1031\langfe3079\kerning1\cgrid\langnp1031\langfenp3079 {\rtlch\fcs1 
\af0 \ltrch\fcs0  
+\chftnsep 
+\par }}{\*\aftnsepc \ltrpar \pard\plain \ltrpar\ql 
\li0\ri0\widctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 
\af0\afs24\alang1025 \ltrch\fcs0 
\fs24\lang1031\langfe3079\kerning1\cgrid\langnp1031\langfenp3079 {\rtlch\fcs1 
\af0 \ltrch\fcs0 
+ \chftnsepc 
+\par }}\ltrpar \sectd 
\ltrsect\sbknone\linex0\headery709\footery737\colsx708\titlepg\sectunlocked1\sectdefaultcl\sftnbj
 {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta 
.}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3
+\pndec\pnstart1\pnindent720\pnhang {\pntxta 
.}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta 
)}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta 
)}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
+{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta 
)}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta 
)}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta 
)}}\pard\plain \ltrpar
+\ql \li0\ri0\widctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 
\af0\afs24\alang1025 \ltrch\fcs0 
\fs24\lang1033\langfe3079\kerning1\cgrid\langnp1033\langfenp3079 {\rtlch\fcs1 
\af0 \ltrch\fcs0 \fs20 NNNNNNNNNN NNNNNNNNNNNNNNN }
+{\field{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0  HYPERLINK 
"https://example.com/"; }{\rtlch\fcs1 \af0 \ltrch\fcs0  {\*\datafield 
+00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b42000000680074007400700073003a002f002f007700770077002e00770065006c0074002e00640065002f000000795881f43b1d7f48af2c825dc485276300000000a5ab0003}}}{\fldrslt
 {\rtlch\fcs1 \af0 
+\ltrch\fcs0 \ul\cf17 
https://example.com/xxxxxxx/eeeeeeeeeeeeeeeeeee/sssssssssssssssss}}}\sectd 
\ltrsect\sbknone\linex0\headery709\footery737\colsx708\titlepg\sectunlocked1\sectdefaultcl\sftnbj
 {\rtlch\fcs1 \af0 \ltrch\fcs0  
+
+\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\faauto\rin0\lin0\itap0 
{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1031\langfe1038\langfenp1038 Napoleon III. 
(franz\'f6sisch Napol\'e9
+on III; * 20. April 1808 in Paris; \'86 9. Januar 1873 in Chislehurst bei 
London) war unter seinem Geburtsnamen Charles-Louis-Napol\'e9on Bonaparte (auch 
Louis-Napol\'e9on Bonaparte) w\'e4hrend der Zweiten Republik von 1848 bis 1852 
franz\'f6
+sischer Staatspr\'e4sident und von 1852 bis 1870 als Napoleon\~III. Kaiser der 
Franzosen. Mit dem Staatsstreich vom 2. Dezember 1851 hatte der aus einer 
Volkswahl hervorgegangene Pr\'e4sident eine Diktatur errichte
+t. Ein Jahr darauf (1852) proklamierte er sich zum Kaiser und sein Land zum 
Zweiten Kaiserreich. Das Parlament wurde weitgehend entmachtet und erhielt erst 
ganz am Ende seiner Herrschaft wieder etwas mehr Kompetenzen.}{\rtlch\fcs1 \af0 
\ltrch\fcs0 
+ 
+\par }
+}
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index c5b4bbecf24a..e8bf08dee037 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -691,6 +691,32 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf151954)
     assertXPath(pXmlDoc, "/root/page[1]/body/txt", 2);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152952)
+{
+    createSwDoc("Hyphenated-link.rtf");
+    xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+    // URL should not be hyphenated
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion",
+                " NNNNNNNNNN NNNNNNNNNNNNNNN ");
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion",
+                
"https://example.com/xxxxxxx/eeeeeeeeeeeeeeeeeee/sssssssssssssssss ");
+}
+
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152952_compat)
+{
+    uno::Reference<linguistic2::XHyphenator> xHyphenator = 
LinguMgr::GetHyphenator();
+    if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString())))
+        return;
+
+    createSwDoc("Hyphenated-link.fodt");
+    xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+    // URL hyphenated for backward compatibility
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion",
+                " NNNNNNNNNN NNNNNNNNNNNNNNN 
https://example.com/xxxxxxx/eeeeeeeeeeeeeeeeeee/ss";);
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion",
+                "sssssssssssssss ");
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInFootnote)
 {
     createSwDoc("tdf85610.fodt");
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index 9dbea91ac4a0..da04446c1271 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -247,6 +247,7 @@ bool sw::DocumentSettingManager::get(/*[in]*/ 
DocumentSettingId id) const
         case DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND: return 
mbFootnoteInColumnToPageEnd;
         case DocumentSettingId::AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE:
             return mbAutoFirstLineIndentDisregardLineSpace;
+        case DocumentSettingId::HYPHENATE_URLS: return mbHyphenateURLs;
         case DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML: return 
mbWrapAsCharFlysLikeInOOXML;
         case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY: return 
mbNoNumberingShowFollowBy;
         case DocumentSettingId::DROP_CAP_PUNCTUATION: return 
mbDropCapPunctuation;
@@ -428,6 +429,10 @@ void sw::DocumentSettingManager::set(/*[in]*/ 
DocumentSettingId id, /*[in]*/ boo
             mbAutoFirstLineIndentDisregardLineSpace = value;
             break;
 
+        case DocumentSettingId::HYPHENATE_URLS:
+            mbHyphenateURLs = value;
+            break;
+
         case DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML:
             mbWrapAsCharFlysLikeInOOXML = value;
             break;
@@ -1035,6 +1040,10 @@ void 
sw::DocumentSettingManager::dumpAsXml(xmlTextWriterPtr pWriter) const
     (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
                                 
BAD_CAST(OString::boolean(mbFootnoteInColumnToPageEnd).getStr()));
 
+    (void)xmlTextWriterStartElement(pWriter, BAD_CAST("mbHyphenateURLs"));
+    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
+                                
BAD_CAST(OString::boolean(mbHyphenateURLs).getStr()));
+
     (void)xmlTextWriterStartElement(pWriter, BAD_CAST("mnImagePreferredDPI"));
     (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
                                 
BAD_CAST(OString::number(mnImagePreferredDPI).getStr()));
diff --git a/sw/source/core/inc/DocumentSettingManager.hxx 
b/sw/source/core/inc/DocumentSettingManager.hxx
index 0cde949ecf94..07a12e3f1a6b 100644
--- a/sw/source/core/inc/DocumentSettingManager.hxx
+++ b/sw/source/core/inc/DocumentSettingManager.hxx
@@ -174,6 +174,7 @@ class DocumentSettingManager final :
     bool mbFootnoteInColumnToPageEnd;
     sal_Int32 mnImagePreferredDPI;
     bool mbAutoFirstLineIndentDisregardLineSpace;
+    bool mbHyphenateURLs = false;
     // If this is on as_char flys wrapping will be handled the same like in 
Word
     bool mbWrapAsCharFlysLikeInOOXML;
     bool mbNoNumberingShowFollowBy;
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 23b7319b5b14..7902e5a8e2c9 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -28,6 +28,7 @@
 #include <com/sun/star/i18n/WordType.hpp>
 #include <com/sun/star/i18n/XBreakIterator.hpp>
 #include <unotools/charclass.hxx>
+#include <svl/urihelper.hxx>
 #include "porfld.hxx"
 #include <paratr.hxx>
 #include <doc.hxx>
@@ -234,6 +235,35 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, 
SwTextFormatInfo &rInf,
             }
         }
 
+        if (!rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
+                    DocumentSettingId::HYPHENATE_URLS))
+        {
+            // check URL from preceding space - similar to what AutoFormat does
+            const CharClass& rCC = GetAppCharClass();
+            sal_Int32 begin(m_nCutPos == TextFrameIndex(COMPLETE_STRING) ? 
rInf.GetText().getLength() : sal_Int32(m_nCutPos));
+            sal_Int32 end(begin);
+            for (; 0 < begin; --begin)
+            {
+                sal_Unicode cChar = rInf.GetText()[begin - 1];
+                if (cChar == CH_BLANK || cChar == CH_FULL_BLANK || cChar == 
CH_SIX_PER_EM)
+                {
+                    break;
+                }
+            }
+            for (; end < rInf.GetText().getLength(); ++end)
+            {
+                sal_Unicode cChar = rInf.GetText()[end];
+                if (cChar == CH_BLANK || cChar == CH_FULL_BLANK || cChar == 
CH_SIX_PER_EM)
+                {
+                    break;
+                }
+            }
+            if (!URIHelper::FindFirstURLInText(rInf.GetText(), begin, end, 
rCC).isEmpty())
+            {
+                bHyph = false;
+            }
+        }
+
         // search start of the last word, if needed
         if ( bHyph )
         {
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index dca389d937a8..448057636fab 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1891,6 +1891,7 @@ void SwWW8ImplReader::ImportDop()
     
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::PROP_LINE_SPACING_SHRINKS_FIRST_LINE,
 true);
     
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::CONTINUOUS_ENDNOTES, 
true);
     
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY,
 true);
+    // rely on default for HYPHENATE_URLS=false
 
     // COMPATIBILITY FLAGS END
 
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 01c22fa9ec30..2cb58cf2aa47 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1306,6 +1306,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence 
< PropertyValue > & aC
     bool bEmptyDbFieldHidesPara = false;
     bool bCollapseEmptyCellPara = false;
     bool bAutoFirstLineIndentDisregardLineSpace = false;
+    bool bHyphenateURLs = false;
     bool bDropCapPunctuation = false;
 
     const PropertyValue* currentDatabaseDataSource = nullptr;
@@ -1400,6 +1401,10 @@ void SwXMLImport::SetConfigurationSettings(const 
Sequence < PropertyValue > & aC
                     bCollapseEmptyCellPara = true;
                 else if (rValue.Name == 
"AutoFirstLineIndentDisregardLineSpace")
                     bAutoFirstLineIndentDisregardLineSpace = true;
+                else if (rValue.Name == "HyphenateURLs")
+                {
+                    bHyphenateURLs = true;
+                }
                 else if ( rValue.Name == "DropCapPunctuation" )
                     bDropCapPunctuation = true;
             }
@@ -1564,6 +1569,11 @@ void SwXMLImport::SetConfigurationSettings(const 
Sequence < PropertyValue > & aC
     if (!bAutoFirstLineIndentDisregardLineSpace)
         xProps->setPropertyValue("AutoFirstLineIndentDisregardLineSpace", 
Any(false));
 
+    if (!bHyphenateURLs)
+    {
+        xProps->setPropertyValue("HyphenateURLs", Any(true));
+    }
+
     // LO 7.4 and previous versions had different drop cap punctuation: very 
long dashes.
     // In order to keep backwards compatibility, DropCapPunctuation option is 
written to .odt
     // files, and the default for new documents is 'true'. Files without this 
option
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx 
b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index 2f53b0f1aff3..9ce8dda4d5fd 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -152,6 +152,7 @@ enum SwDocumentSettingsPropertyHandles
     HANDLE_FOOTNOTE_IN_COLUMN_TO_PAGEEND,
     HANDLE_IMAGE_PREFERRED_DPI,
     HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE,
+    HANDLE_HYPHENATE_URLS,
     HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS,
     HANDLE_NO_NUMBERING_SHOW_FOLLOWBY,
     HANDLE_DROP_CAP_PUNCTUATION
@@ -253,6 +254,7 @@ static rtl::Reference<MasterPropertySetInfo> 
lcl_createSettingsInfo()
         { OUString("FootnoteInColumnToPageEnd"), 
HANDLE_FOOTNOTE_IN_COLUMN_TO_PAGEEND, cppu::UnoType<bool>::get(), 0 },
         { OUString("ImagePreferredDPI"), HANDLE_IMAGE_PREFERRED_DPI, 
cppu::UnoType<sal_Int32>::get(), 0 },
         { OUString("AutoFirstLineIndentDisregardLineSpace"), 
HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE, cppu::UnoType<bool>::get(), 
0 },
+        { OUString("HyphenateURLs"), HANDLE_HYPHENATE_URLS, 
cppu::UnoType<bool>::get(), 0 },
         { OUString("WordLikeWrapForAsCharFlys"), 
HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS, cppu::UnoType<bool>::get(), 0 },
         { OUString("NoNumberingShowFollowBy"), 
HANDLE_NO_NUMBERING_SHOW_FOLLOWBY, cppu::UnoType<bool>::get(), 0 },
         { OUString("DropCapPunctuation"), HANDLE_DROP_CAP_PUNCTUATION, 
cppu::UnoType<bool>::get(), 0 },
@@ -1056,6 +1058,16 @@ void SwXDocumentSettings::_setSingleValue( const 
comphelper::PropertyInfo & rInf
             }
         }
         break;
+        case HANDLE_HYPHENATE_URLS:
+        {
+            bool bTmp;
+            if (rValue >>= bTmp)
+            {
+                mpDoc->getIDocumentSettingAccess().set(
+                    DocumentSettingId::HYPHENATE_URLS, bTmp);
+            }
+        }
+        break;
         case HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS:
         {
             bool bTmp;
@@ -1602,6 +1614,12 @@ void SwXDocumentSettings::_getSingleValue( const 
comphelper::PropertyInfo & rInf
                 
DocumentSettingId::AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE);
         }
         break;
+        case HANDLE_HYPHENATE_URLS:
+        {
+            rValue <<= mpDoc->getIDocumentSettingAccess().get(
+                DocumentSettingId::HYPHENATE_URLS);
+        }
+        break;
         case HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS:
         {
             rValue <<= mpDoc->getIDocumentSettingAccess().get(
diff --git a/writerfilter/source/filter/WriterFilter.cxx 
b/writerfilter/source/filter/WriterFilter.cxx
index 1975f04de115..3ac82d766c6a 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -333,6 +333,7 @@ void WriterFilter::setTargetDocument(const 
uno::Reference<lang::XComponent>& xDo
     xSettings->setPropertyValue("DisableOffPagePositioning", uno::Any(true));
     xSettings->setPropertyValue("WordLikeWrapForAsCharFlys", uno::Any(true));
     xSettings->setPropertyValue("DropCapPunctuation", uno::Any(true));
+    // rely on default for HyphenateURLs=false
 }
 
 void WriterFilter::setSourceDocument(const uno::Reference<lang::XComponent>& 
xDoc)

Reply via email to