summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorAttila Bakos <bakos.attilakaroly@nisz.hu>2020-08-03 10:45:14 +0200
committerLászló Németh <nemeth@numbertext.org>2020-08-19 10:11:21 +0200
commit1b03a449161af225302e4b4dd2bb2e69c6d8d170 (patch)
treeb3d274ccb3ab93824c2b29e11583e071a77f5cac /sw
parent8d1aaca8fea5b2330a2019b64188e66223cb35e3 (diff)
tdf#112290 sw: fix missing line break in small capital
Calculated hyphenation positions are skipped in the case small capital text, resulting long lines exceeding paragraph width, for example after wide images. Likely the reason of the problem is tdf#78527 "FORMATTING: automatic hyphenation doesn't work on text in small caps or all caps". Change-Id: Ia0121728bcc099f3ec19e01afd64e1594d6274be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99992 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/layout/data/tdf112290.docxbin0 -> 13174 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx8
-rw-r--r--sw/source/core/text/portxt.cxx3
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/layout/data/tdf112290.docx b/sw/qa/extras/layout/data/tdf112290.docx
new file mode 100644
index 000000000000..c49b5e384b4b
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf112290.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index d6b233ca6107..0ce860834445 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3474,6 +3474,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf115094)
CPPUNIT_ASSERT_LESS(nTopOfB2Anchored, nTopOfB2);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf112290)
+{
+ SwDoc* pDoc = createDoc("tdf112290.docx");
+ CPPUNIT_ASSERT(pDoc);
+ auto pXml = parseLayoutDump();
+ assertXPath(pXml, "/root/page/body/txt/LineBreak[2]", "Line", "Xxxx Xxxx");
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122607)
{
createDoc("tdf122607.odt");
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index ace126870b54..398b26e6706b 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -344,7 +344,8 @@ bool SwTextPortion::Format_( SwTextFormatInfo &rInf )
Insert( aGuess.ReleaseHangingPortion() );
}
// breakPos >= index
- else if (aGuess.BreakPos() >= rInf.GetIdx() && aGuess.BreakPos() != TextFrameIndex(COMPLETE_STRING))
+ else if (aGuess.BreakPos() >= rInf.GetIdx() && aGuess.BreakPos() != TextFrameIndex(COMPLETE_STRING)
+ && rInf.GetFont()->GetCaseMap() != SvxCaseMap::SmallCaps )
{
// case B1
if( aGuess.HyphWord().is() && aGuess.BreakPos() > rInf.GetLineStart()