core.git: Branch 'libreoffice-24-2' - sw/inc sw/qa sw/source writerfilter/source

2024-04-11 Thread Michael Stahl (via logerrit)
 sw/inc/IDocumentSettingAccess.hxx |1 
 sw/qa/core/text/data/A011-charheight.rtf  |   27 ++
 sw/qa/core/text/itrform2.cxx  |   18 +
 sw/source/core/doc/DocumentSettingManager.cxx |   11 ++
 sw/source/core/inc/DocumentSettingManager.hxx |1 
 sw/source/core/text/itrform2.cxx  |   13 +---
 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 
 10 files changed, 98 insertions(+), 3 deletions(-)

New commits:
commit 570a36ad5f76ea28e0653d1a7a43250432bf1afa
Author: Michael Stahl 
AuthorDate: Mon Apr 8 15:26:00 2024 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Apr 11 23:12:21 2024 +0200

tdf#88214 sw: text formatting: adapt empty line at end of para to Word

For an empty line at the end of an empty paragraph, Writer already uses
any existing text attribute in the paragraph, see for example
testEmptyTrailingSpans.

For an empty line at the end of a non-empty paragraph, Writer text
formatting uses only paragraph attributes, ignoring any text attributes,
whereas the UI will display the attributes from the text attributes
(such as font height) if you move the cursor there.

Word uses text attributes also in this case, so adapt the inconsistent
Writer behaviour: text formatting now uses text attributes too.

Apparently this can be achieved by calling SeekAndChgBefore() instead of
SeekAndChg().

Add another compat flag "ApplyTextAttrToEmptyLineAtEndOfParagraph" to
preserve the formatting of existing ODF documents.

Adapt test document fdo74110.docx, it has a line break with "Angsana
New" font.

Change-Id: I0863d3077e419404194b47110e4ad2bdda3d11c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165887
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 2b47fae7e3e23ee7c733708500cb0482ad7f8af1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165906
Reviewed-by: Thorsten Behrens 

diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index 74b123dc462e..0dd9467bdf13 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -98,6 +98,7 @@ enum class DocumentSettingId
 ALLOW_TEXT_AFTER_FLOATING_TABLE_BREAK,
 // tdf#119908 new paragraph justification
 JUSTIFY_LINES_WITH_SHRINKING,
+APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH,
 // COMPATIBILITY FLAGS END
 BROWSE_MODE,
 HTML_MODE,
diff --git a/sw/qa/core/text/data/A011-charheight.rtf 
b/sw/qa/core/text/data/A011-charheight.rtf
new file mode 100644
index ..4b56ecdd6a15
--- /dev/null
+++ b/sw/qa/core/text/data/A011-charheight.rtf
@@ -0,0 +1,27 @@
+{ 
tf1deflang1025nsinsicpg1252\uc1deff0\deff0\stshfdbch0\stshfloch31506\stshfhich31506\stshfbi31506\deflang3079\deflangfe3079
   hemelang3079hemelangfe0 hemelangcs0
+{onttbl{0bidi romancharset0prq2Times New Roman{\*alt Arial};}
+}
+{\*\defchp 0s22\lang3079\langfe1033\langfenp1033 }
+{\*\defpap \ql \li0 i0\sa200\sl276\slmult1
+\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 }
+
oqfpromote
+{\stylesheet
+{\ql \li0 i0\sa200\sl276\slmult1\widctlpar\wrapdefaultspalphaspnum
aautodjustright in0\lin0\itap0  tlchcs1 f0fs22lang1025 \ltrchcs0
+0s23\lang3079\langfe1033+{\s15\ql \li0 i0\widctlpar  qc  x4536   qr  
x9072\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0  tlchcs1 
f0fs22lang1025 \ltrchcs0 0s23\lang3079\langfe1033+\sbasedon0 \snext15 
\slink16 \sunhideused header;}
+{\*+}
+\paperw11906\paperh16838\margl1417\margr1417\margt1417\margb1134\gutter0\ltrsect
+\deftab708\widowctrltnbjenddoc\hyphhotz425   rackmoves0  
rackformatting1\donotembedsysfont1 elyonvml0\donotembedlingdata0\grfdocevents0
alidatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0
+\showxmlerrors1
oxlattoyenxpshrtn
oultrlspc\dntblnsbdb
ospaceforul
ormshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1417\dgvorigin1417\dghshow1\dgvshow1
+\jexpandiewkind1iewscale100\pgbrdrhead\pgbrdrfoot\splytwnine
tnlytwnine\htmautsp
olnhtadjtbl\useltbalnlntblind\lytcalctblwd\lyttblrtgr\lnbrkrule
obrkwrptbl\snaptogridincellllowfieldendsel\wrppunct
+sianbrkrule
ewtblstyruls
ogrowautofit\usenormstyforlist
oindnmbrtselnbrelev
ocxsptable\indrlsweleven
oafcnsttblfelev\utinl\hwelev\spltpgpar
otcvasp
otbrkcnstfrctbl
otvatxbx\krnprsnet+{\*\wgrffmtfilter 2450}
ofeaturethrottle1\ilfomacatclnup0
+
+\ltrpar \pard\plain \ltrpar\s15\qc \li0 i0\widctlpar
+   qc  x4536   qr  x9072\wrapdefaultspalphaspnum
aautodjustright in0\lin0\itap0 tlchcs1 f0fs22lang1025 \ltrchcs0 0
s23\lang3079\langfe1033+s16 \line \line 

core.git: Branch 'libreoffice-24-2' - sw/inc sw/qa sw/source writerfilter/source

2024-01-30 Thread Mike Kaganski (via logerrit)
 sw/inc/IDocumentSettingAccess.hxx |2 +-
 sw/qa/extras/odfexport/odfexport2.cxx |   22 +++---
 sw/source/core/doc/DocumentSettingManager.cxx |   12 ++--
 sw/source/core/inc/DocumentSettingManager.hxx |2 +-
 sw/source/core/text/porfld.cxx|2 +-
 sw/source/filter/ww8/ww8par.cxx   |2 +-
 sw/source/uibase/uno/SwXDocumentSettings.cxx  |   12 ++--
 writerfilter/source/dmapper/DomainMapper.cxx  |2 +-
 writerfilter/source/filter/WriterFilter.cxx   |2 +-
 9 files changed, 29 insertions(+), 29 deletions(-)

New commits:
commit dbb8a9c01fd6693df32f0a9c023b7be2c623cf7a
Author: Mike Kaganski 
AuthorDate: Sun Jan 28 20:30:03 2024 +0600
Commit: Michael Stahl 
CommitDate: Tue Jan 30 10:58:59 2024 +0100

Related: tdf#159382 Naming is hard: make initial monster shorter

Rename "NoSpaceAfterHangingFootnoteNumbering" and friends to
"NoGapAfterNoteNumber". This is cleaner, no less descriprive.

Change-Id: I87d3103e4ddfc05e5604eaa4fe707b1fd5711aae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162654
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162660
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index c58facf04d3d..74b123dc462e 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -59,7 +59,7 @@ enum class DocumentSettingId
 TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK,
 DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT,
 // tdf#159382: MS Word compatible handling of space between footnote 
number and text
-NO_SPACE_AFTER_HANGING_FOOTNOTE_NUMBER,
+NO_GAP_AFTER_NOTE_NUMBER,
 
 DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE,
 TABLE_ROW_KEEP,
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx 
b/sw/qa/extras/odfexport/odfexport2.cxx
index acb9226eff1d..37e744e9c852 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -1150,17 +1150,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150408_IsLegal)
 
 CPPUNIT_TEST_FIXTURE(Test, testTdf159382)
 {
-// Testing NoSpaceAfterHangingFootnoteNumbering compat option
+// Testing NoGapAfterNoteNumber compat option
 
 createSwDoc("footnote_spacing_hanging_para.docx");
-// 1. Make sure that DOCX import sets NoSpaceAfterHangingFootnoteNumbering 
option, and creates
+// 1. Make sure that DOCX import sets NoGapAfterNoteNumber option, and 
creates
 // correct layout
 {
 uno::Reference xFactory(mxComponent, 
uno::UNO_QUERY_THROW);
 uno::Reference xSettings(
 xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), 
uno::UNO_QUERY_THROW);
 CPPUNIT_ASSERT_EQUAL(uno::Any(true), xSettings->getPropertyValue(
- 
u"NoSpaceAfterHangingFootnoteNumbering"_ustr));
+ 
u"NoGapAfterNoteNumber"_ustr));
 
 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
 sal_Int32 width
@@ -1173,20 +1173,20 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159382)
 }
 
 saveAndReload(mpFilter);
-// 2. Make sure that exported document has 
NoSpaceAfterHangingFootnoteNumbering option set,
+// 2. Make sure that exported document has NoGapAfterNoteNumber option set,
 // and has correct layout
 {
 xmlDocUniquePtr pXmlDoc = parseExport("settings.xml");
 assertXPathContent(
 pXmlDoc,
-
"//config:config-item[@config:name='NoSpaceAfterHangingFootnoteNumbering']"_ostr,
+"//config:config-item[@config:name='NoGapAfterNoteNumber']"_ostr,
 "true");
 
 uno::Reference xFactory(mxComponent, 
uno::UNO_QUERY_THROW);
 uno::Reference xSettings(
 xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), 
uno::UNO_QUERY_THROW);
 CPPUNIT_ASSERT_EQUAL(uno::Any(true), xSettings->getPropertyValue(
- 
u"NoSpaceAfterHangingFootnoteNumbering"_ustr));
+ 
u"NoGapAfterNoteNumber"_ustr));
 
 pXmlDoc = parseLayoutDump();
 sal_Int32 width = getXPath(
@@ -1197,14 +1197,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159382)
 }
 
 createSwDoc("footnote_spacing_hanging_para.doc");
-// 3. Make sure that DOC import sets NoSpaceAfterHangingFootnoteNumbering 
option, and creates
+// 3. Make sure that DOC import sets NoGapAfterNoteNumber option, and 
creates
 // correct layout
 {
 uno::Reference xFactory(mxComponent, 
uno::UNO_QUERY_THROW);
 uno::Reference xSettings(
 xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), 
uno::UNO_QUERY_THROW);
 CPPUNIT_ASSERT_EQUAL(uno::Any(true), xSettings->getPropertyValue(
- 

core.git: Branch 'libreoffice-24-2' - sw/inc sw/qa sw/source writerfilter/source

2024-01-30 Thread Mike Kaganski (via logerrit)
 sw/inc/IDocumentSettingAccess.hxx  |2 
 sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.doc  |binary
 sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.docx |binary
 sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.rtf  |  209 
++
 sw/qa/extras/odfexport/odfexport2.cxx  |   99 
 sw/source/core/doc/DocumentSettingManager.cxx  |   11 
 sw/source/core/inc/DocumentSettingManager.hxx  |1 
 sw/source/core/text/porfld.cxx |7 
 sw/source/filter/ww8/ww8par.cxx|1 
 sw/source/uibase/uno/SwXDocumentSettings.cxx   |   13 
 writerfilter/source/dmapper/DomainMapper.cxx   |2 
 writerfilter/source/filter/WriterFilter.cxx|1 
 12 files changed, 344 insertions(+), 2 deletions(-)

New commits:
commit 87f11c2961cd4bb8be6bc8f62442a706da0420b7
Author: Mike Kaganski 
AuthorDate: Fri Jan 26 19:03:05 2024 +0600
Commit: Michael Stahl 
CommitDate: Tue Jan 30 10:57:39 2024 +0100

tdf#159382: introduce a Word compat flag for hanging footnote number spacing

The new 'NoSpaceAfterHangingFootnoteNumbering' compatibility option is false
for ODF documents by default. Word file format filters set it to true. Its
purpose is to avoid extra spacing between the footnote number and its text,
when the paragraph has hanging first line, as in MS Word.

Change-Id: I42d9353865498137ab99e1d2c031f5b207cbc220
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162603
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162636
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index b8088440163d..c58facf04d3d 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -58,6 +58,8 @@ enum class DocumentSettingId
 DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK,
 TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK,
 DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT,
+// tdf#159382: MS Word compatible handling of space between footnote 
number and text
+NO_SPACE_AFTER_HANGING_FOOTNOTE_NUMBER,
 
 DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE,
 TABLE_ROW_KEEP,
diff --git a/sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.doc 
b/sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.doc
new file mode 100644
index ..b381ba9b6169
Binary files /dev/null and 
b/sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.doc differ
diff --git a/sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.docx 
b/sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.docx
new file mode 100644
index ..8e3958983bcb
Binary files /dev/null and 
b/sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.docx differ
diff --git a/sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.rtf 
b/sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.rtf
new file mode 100644
index ..07bbc0eb43f9
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/footnote_spacing_hanging_para.rtf
@@ -0,0 +1,209 @@
+{
tf1deflang1025nsinsicpg1252\uc1deff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe2052
  hemelang1033hemelangfe2052  hemelangcs1025{onttbl{0bidi roman
charset204prq2{\*\panose 02020603050405020304}Times New Roman;}
+{13bidi nilcharset134prq2{\*\panose 02010600030101010101}SimSun{\*alt 
\'cb\'ce\'cc\'e5};}{34bidi romancharset204prq2{\*\panose 
02040503050406030204}Cambria Math;}
+{44bidi swisscharset204prq2{\*\panose 020b0604020202020204}Liberation 
Sans;}{45bidi nilcharset134prq2{\*\panose 02010600030101010101}@SimSun;}
+{lomajor31500bidi romancharset204prq2{\*\panose 
02020603050405020304}Times New Roman;}{dbmajor31501bidi moderncharset134
prq1{\*\panose 02010600030101010101}SimHei{\*alt \'ba\'da\'cc\'e5};}
+{himajor31502bidi swisscharset204prq2{\*\panose 
020b0604020202020204}Liberation Sans;}{bimajor31503bidi romancharset204
prq2{\*\panose 02020603050405020304}Times New Roman;}
+{lominor31504bidi romancharset204prq2{\*\panose 
02020603050405020304}Times New Roman;}{dbminor31505bidi nilcharset134
prq2{\*\panose 02010600030101010101}SimSun{\*alt \'cb\'ce\'cc\'e5};}
+{himinor31506bidi swisscharset204prq2{\*\panose 
020b0604020202020204}Liberation Sans;}{biminor31507bidi romancharset204
prq2{\*\panose 02020603050405020304}Times New Roman;}{48bidi romancharset0
prq2 Times New Roman;}
+{46bidi romancharset238prq2 Times New Roman CE;}{49bidi roman
charset161prq2 Times New Roman Greek;}{50bidi romancharset162prq2 Times 
New Roman Tur;}{51bidi romancharset177prq2 Times New Roman (Hebrew);}
+{52bidi romancharset178prq2 Times New Roman (Arabic);}{53