summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2021-04-13 17:57:58 +0200
committerJustin Luth <justin_luth@sil.org>2021-04-14 12:23:25 +0200
commit4ed7a2c8af03bc0f45df1f03fd160ccbf045ed4f (patch)
treef42e057813ac74c94d9140400fa5e92ac090cf2c /sw
parent7526e77820956238a1a903d73ff15a49c082d6de (diff)
tdf#100961 rtf import: fldlock is FIXEDFLD
This depends on another fix in this bug report for exporting. I'm not sure why I even bother trying to work on RTF stuff. I'm not really into black magic. Change-Id: If596cae011a261a80ca13962932bf25561c0f63f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114062 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf100961_fixedDateTime.rtf38
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx12
2 files changed, 50 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf100961_fixedDateTime.rtf b/sw/qa/extras/rtfexport/data/tdf100961_fixedDateTime.rtf
new file mode 100644
index 000000000000..95f28e34ddbb
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf100961_fixedDateTime.rtf
@@ -0,0 +1,38 @@
+{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff1\deff0\stshfdbch42\stshfloch41\stshfhich41\stshfbi1\deflang2057\deflangfe2057{\fonttbl{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}{\f36\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Liberation Sans{\*\falt Arial};}
+{\f41\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Liberation Serif{\*\falt Times New Roman};}{\f42\fmodern\fcharset134\fprq1{\*\panose 02010609030101010101}NSimSun;}{\f43\fswiss\fcharset134\fprq2{\*\panose 020b0503020204020204}Microsoft YaHei;}
+{\f72\fmodern\fcharset134\fprq1{\*\panose 00000000000000000000}@NSimSun;}{\f73\fswiss\fcharset134\fprq2{\*\panose 00000000000000000000}@Microsoft YaHei;}{\f84\fswiss\fcharset238\fprq2 Arial CE;}{\f85\fswiss\fcharset204\fprq2 Arial Cyr;}
+{\f87\fswiss\fcharset161\fprq2 Arial Greek;}{\f88\fswiss\fcharset162\fprq2 Arial Tur;}{\f89\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f90\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}{\f91\fswiss\fcharset186\fprq2 Arial Baltic;}
+{\f92\fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f434\fswiss\fcharset238\fprq2 Liberation Sans CE{\*\falt Arial};}{\f435\fswiss\fcharset204\fprq2 Liberation Sans Cyr{\*\falt Arial};}
+{\f437\fswiss\fcharset161\fprq2 Liberation Sans Greek{\*\falt Arial};}{\f438\fswiss\fcharset162\fprq2 Liberation Sans Tur{\*\falt Arial};}{\f439\fbidi \fswiss\fcharset177\fprq2 Liberation Sans (Hebrew){\*\falt Arial};}
+{\f441\fswiss\fcharset186\fprq2 Liberation Sans Baltic{\*\falt Arial};}{\f442\fswiss\fcharset163\fprq2 Liberation Sans (Vietnamese){\*\falt Arial};}{\f484\froman\fcharset238\fprq2 Liberation Serif CE{\*\falt Times New Roman};}
+{\f485\froman\fcharset204\fprq2 Liberation Serif Cyr{\*\falt Times New Roman};}{\f487\froman\fcharset161\fprq2 Liberation Serif Greek{\*\falt Times New Roman};}{\f488\froman\fcharset162\fprq2 Liberation Serif Tur{\*\falt Times New Roman};}
+{\f489\fbidi \froman\fcharset177\fprq2 Liberation Serif (Hebrew){\*\falt Times New Roman};}{\f491\froman\fcharset186\fprq2 Liberation Serif Baltic{\*\falt Times New Roman};}
+{\f492\froman\fcharset163\fprq2 Liberation Serif (Vietnamese){\*\falt Times New Roman};}{\f74\froman\fcharset238\fprq2 Times New Roman CE;}{\f75\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f77\froman\fcharset161\fprq2 Times New Roman Greek;}
+{\f78\froman\fcharset162\fprq2 Times New Roman Tur;}{\f79\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f80\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f81\froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\f82\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\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;}{\stylesheet{
+\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af1\afs24\alang1081 \ltrch\fcs0 \fs24\lang1049\langfe2052\kerning2\loch\f41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052 \snext0 Normal;}{\*\cs10
+\additive \ssemihidden Default Paragraph Font;}{\*
+\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
+\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \fs20\lang1024\langfe1024\loch\f41\hich\af41\dbch\af42\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{
+\s15\ql \li0\ri0\sb240\sa120\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af1\afs28\alang1081 \ltrch\fcs0 \fs28\lang1049\langfe2052\kerning2\loch\f36\hich\af36\dbch\af43\cgrid\langnp1049\langfenp2052
+\sbasedon0 \snext16 Heading;}{\s16\ql \li0\ri0\sa140\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af1\afs24\alang1081 \ltrch\fcs0
+\fs24\lang1049\langfe2052\kerning2\loch\f41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052 \sbasedon0 \snext16 Body Text;}{\s17\ql \li0\ri0\sa140\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1
+\af1\afs24\alang1081 \ltrch\fcs0 \fs24\lang1049\langfe2052\kerning2\loch\f41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052 \sbasedon16 \snext17 List;}{
+\s18\ql \li0\ri0\sb120\sa120\widctlpar\noline\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ai\af1\afs24\alang1081 \ltrch\fcs0 \i\fs24\lang1049\langfe2052\kerning2\loch\f41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052
+\sbasedon0 \snext18 caption;}{\s19\ql \li0\ri0\widctlpar\noline\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af1\afs24\alang1081 \ltrch\fcs0
+\fs24\lang1049\langfe2052\kerning2\loch\f41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052 \sbasedon0 \snext19 Index;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid336885\rsid2430917\rsid2647374\rsid4946236}{\*\generator Microsoft Word
+11.0.0000;}{\info{\title 05}{\author Mike Kaganski}{\operator JLAutoBuild}{\creatim\yr2021\mo4\dy13\hr10\min21}{\revtim\yr2021\mo4\dy13\hr10\min21}{\version2}{\edmins1}{\nofpages1}{\nofwords8}{\nofchars50}{\nofcharsws57}{\vern24611}{\*\password 00000000}}
+{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw11906\paperh16838\margl1134\margr1134\margt1134\margb1134\gutter0\ltrsect
+\deftab709\widowctrl\ftnbj\aenddoc\donotembedsysfont1\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin
+\dghspace180\dgvspace180\dghorigin1134\dgvorigin1134\dghshow1\dgvshow1
+\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
+\asianbrkrule\rsidroot2647374\newtblstyruls\nogrowautofit \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\endnhere\sectunlocked1\sectexpand32768\sectlinegrid600\sectdefaultcl\sftnbj {\*\pnseclvl1
+\pnucrm\pnqc\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnqc\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnqc\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnqc\pnstart1\pnindent720\pnhang {\pntxta )}}
+{\*\pnseclvl5\pndec\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8
+\pnlcltr\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\rtlch\fcs1 \af1\afs24\alang1081 \ltrch\fcs0 \fs24\lang1049\langfe2052\kerning2\loch\af41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052 {\field\fldlock{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid336885 \hich\af41\dbch\af42\loch\f41 DATE \\
+@"dd.MM.yy"}}{\fldrslt {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid336885 \hich\af41\dbch\af42\loch\f41 05.01.19}}}\sectd \ltrsect\linex0\endnhere\sectunlocked1\sectexpand32768\sectlinegrid600\sectdefaultcl\sftnbj {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid336885
+\hich\af41\dbch\af42\loch\f41 }{\field\fldlock{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid336885 \hich\af41\dbch\af42\loch\f41 TIME \\@"HH:mm:ss"}}{\fldrslt {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid336885 \hich\af41\dbch\af42\loch\f41 04:06:08}}}
+\sectd \ltrsect\linex0\endnhere\sectunlocked1\sectexpand32768\sectlinegrid600\sectdefaultcl\sftnbj {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid2647374
+\par }} \ No newline at end of file
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 6f801bc3f8cc..4468a97650b5 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -14,6 +14,8 @@
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/text/XEndnotesSupplier.hpp>
+#include <com/sun/star/text/XTextField.hpp>
+#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
@@ -33,6 +35,16 @@ public:
}
};
+DECLARE_RTFEXPORT_TEST(testTdf100961_fixedDateTime, "tdf100961_fixedDateTime.rtf")
+{
+ // This should be a fixed date/time field, not the current time.
+ getParagraph(1, "05.01.19 04:06:08");
+
+ uno::Reference<text::XTextFieldsSupplier> xTFS(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xFields(xTFS->getTextFields()->createEnumeration());
+ CPPUNIT_ASSERT_MESSAGE("constant time", getProperty<bool>(xFields->nextElement(), "IsFixed"));
+}
+
DECLARE_RTFEXPORT_TEST(testTdf108949, "tdf108949_footnoteCharFormat.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());