[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 3 commits - cui/uiconfig editeng/source include/editeng include/sfx2 officecfg/registry sal/osl sfx2/source sw/qa sw/source
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 18 11:59:09 UTC 2019
cui/uiconfig/ui/acorexceptpage.ui | 6
editeng/source/misc/svxacorr.cxx | 8
include/editeng/svxacorr.hxx | 8
include/sfx2/docfile.hxx | 3
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 9 -
sal/osl/w32/file.cxx | 2
sfx2/source/doc/docfile.cxx | 108 ++++++++++++-
sw/qa/extras/ww8import/data/tdf122425_1.doc |binary
sw/qa/extras/ww8import/data/tdf122425_2.doc |binary
sw/qa/extras/ww8import/ww8import.cxx | 66 +++++++
sw/source/filter/ww8/ww8graf.cxx | 1
sw/source/filter/ww8/ww8par.cxx | 7
12 files changed, 200 insertions(+), 18 deletions(-)
New commits:
commit b833372df8d06c69809b656137826c3ca8dd53f8
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Dec 7 13:10:57 2018 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Jun 18 13:58:30 2019 +0200
tdf#121779: extend TWo CApitals list to also ignore sMALL iNITIALS
Now this list is used also in rules for capitalizing first letter of
every sentence, and for correcting accidental use of Caps Lock key.
Change-Id: I4fbdbccbae32743d5e9a6757344361eefd88e167
Reviewed-on: https://gerrit.libreoffice.org/64759
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <tietze.heiko at gmail.com>
Reviewed-by: Sophie Gautier <gautier.sophie at gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit 7bf6d0d9d8e3e2e07726ca6df246619ee1ead3a3)
Reviewed-on: https://gerrit.libreoffice.org/74258
Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/cui/uiconfig/ui/acorexceptpage.ui b/cui/uiconfig/ui/acorexceptpage.ui
index b1568fbd3bed..505457430969 100644
--- a/cui/uiconfig/ui/acorexceptpage.ui
+++ b/cui/uiconfig/ui/acorexceptpage.ui
@@ -289,7 +289,7 @@
<property name="use_stock">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="newdouble-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="acorexceptpage|newdouble-atkobject">New words with two initial capitals</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="acorexceptpage|newdouble-atkobject">New words with two initial capitals or small initial</property>
</object>
</child>
</object>
@@ -325,7 +325,7 @@
<property name="use_stock">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="deldouble-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="acorexceptpage|deldouble-atkobject">Delete words with two initial capitals</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="acorexceptpage|deldouble-atkobject">Delete words with two initial capitals or small initial</property>
</object>
</child>
</object>
@@ -394,7 +394,7 @@
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes" context="acorexceptpage|label2">Words With TWo INitial CApitals</property>
+ <property name="label" translatable="yes" context="acorexceptpage|label2">Words With TWo INitial CApitals or sMALL iNITIAL</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index e1a32bb154b5..0f06586be272 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -900,6 +900,10 @@ void SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
return; // no valid separator -> no replacement
}
+ // No replacement for words in TWo INitial CApitals or sMALL iNITIAL list
+ if (FindInWrdSttExceptList(eLang, OUString(pWordStt, pDelim - pWordStt)))
+ return;
+
if( bAtStart ) // at the beginning of a paragraph?
{
// Check out the previous paragraph, if it exists.
@@ -1114,6 +1118,10 @@ bool SvxAutoCorrect::FnCorrectCapsLock( SvxAutoCorrDoc& rDoc, const OUString& rT
aConverted.append( rCC.uppercase(OUString(rTxt[nSttPos])) );
aConverted.append( rCC.lowercase(OUString(rTxt[nSttPos+1])) );
+ // No replacement for words in TWo INitial CApitals or sMALL iNITIAL list
+ if (FindInWrdSttExceptList(eLang, rTxt.copy(nSttPos, nEndPos - nSttPos)))
+ return false;
+
for( sal_Int32 i = nSttPos+2; i < nEndPos; ++i )
{
if ( IsLowerLetter(rCC.getCharacterType(rTxt, i)) )
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 988680984e12..311ed4cfadf7 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -67,7 +67,7 @@ enum class ACFlags : sal_uInt32 {
Autocorrect = 0x00000080, // Call AutoCorrect
ChgQuotes = 0x00000100, // replace double quotes
SaveWordCplSttLst = 0x00000200, // Save Auto correction of Capital letter at beginning of sentence.
- SaveWordWrdSttLst = 0x00000400, // Save Auto correction of 2 Capital letter at beginning of word.
+ SaveWordWrdSttLst = 0x00000400, // Save Auto correction of TWo INitial CApitals or sMALL iNITIAL.
IgnoreDoubleSpace = 0x00000800, // Ignore 2 Spaces
ChgSglQuotes = 0x00001000, // Replace simple quotes
CorrectCapsLock = 0x00002000, // Correct accidental use of cAPS LOCK key
@@ -209,8 +209,7 @@ public:
SvStringsISortDtor* GetCplSttExceptList();
bool AddToCplSttExceptList(const OUString& rNew);
- // Load, Set, Get the exception list for 2 Capital letters at the
- // beginning of a word.
+ // Load, Set, Get the exception list for TWo INitial CApitals or sMALL iNITIAL
SvStringsISortDtor* LoadWrdSttExceptList();
void SaveWrdSttExceptList();
SvStringsISortDtor* GetWrdSttExceptList();
@@ -363,8 +362,7 @@ public:
// Adds a single word. The list will be immediately written to the file!
bool AddCplSttException( const OUString& rNew, LanguageType eLang );
- // Load, Set, Get the exception list for 2 Capital letters at the
- // beginning of a word.
+ // Load, Set, Get the exception list for TWo INitial CApitals or sMALL iNITIAL
void SaveWrdSttExceptList( LanguageType eLang );
SvStringsISortDtor* LoadWrdSttExceptList( LanguageType eLang )
{ return GetLanguageList_( eLang ).LoadWrdSttExceptList(); }
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index efb5503924d1..ecc913106447 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -1417,12 +1417,13 @@
<!-- OldPath: AutoCorrect/Options/All -->
<!-- OldLocation: Soffice.cfg -->
<!-- UIHints: Tools - AutoCorrect/AutoFormat - Exceptions - Words with
- 2 initial capitals -->
+ 2 initial capitals or small initial -->
<info>
<desc>Specifies if defined words with two initial capital letters
- should not be included in the AutoCorrect replacement.</desc>
- <label>Words with two initial capital letters - Add
- automatically</label>
+ or a small initial letter should not be included in the AutoCorrect
+ replacement.</desc>
+ <label>Words with two initial capital letters or a small initial -
+ Add automatically</label>
</info>
<value>true</value>
</prop>
commit 8f1ecdc9e874de1e49f6a47789bb0cceeea1221b
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Dec 4 10:00:51 2018 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Jun 18 13:58:13 2019 +0200
tdf#34171: check foreign lockfiles to tell who has locked document
MS Office (Word/Excel/PowerPoint) lockfiles are supported now.
Note that Excel does *not* create lockfiles for pre-OOXML files.
This changes osl_openFile implementation on Windows, to treat
osl_File_OpenFlag_NoLock to also include FILE_SHARE_DELETE flag
for CreateFileW. This is required to allow opening files created
with FILE_FLAG_DELETE_ON_CLOSE flag, such as Excel's owner files.
The shange should be consistent with the overall meaning of the
osl_File_OpenFlag_NoLock to not impose any locking constraints
to the file being opened.
Change-Id: I7b99012f4bd60ab3821fb91d5166a286031b7e93
Reviewed-on: https://gerrit.libreoffice.org/64496
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit 607b80ca3cddc239a35580470944a438ce144fc8)
Reviewed-on: https://gerrit.libreoffice.org/74259
Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 7022d51743d9..2f7d9454c1e5 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -295,7 +295,8 @@ public:
private:
enum class ShowLockResult { NoLock, Succeeded, Try };
- ShowLockResult ShowLockedDocumentDialog(const LockFileEntry& aData, bool bIsLoading, bool bOwnLock, bool bHandleSysLocked);
+ ShowLockResult ShowLockedDocumentDialog(const OUString& aDocURL, const LockFileEntry& aData,
+ bool bIsLoading, bool bOwnLock, bool bHandleSysLocked);
enum class MessageDlg { LockFileIgnore, LockFileCorrupt };
bool ShowLockFileProblemDialog(MessageDlg nWhichDlg);
diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx
index 1bc898eba4e4..0c3f3d9621fe 100644
--- a/sal/osl/w32/file.cxx
+++ b/sal/osl/w32/file.cxx
@@ -653,7 +653,7 @@ oslFileError SAL_CALL osl_openFile(
dwShare |= FILE_SHARE_WRITE;
if (uFlags & osl_File_OpenFlag_NoLock)
- dwShare |= FILE_SHARE_WRITE;
+ dwShare |= FILE_SHARE_WRITE | FILE_SHARE_DELETE;
if (uFlags & osl_File_OpenFlag_Create)
dwCreation |= CREATE_NEW;
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 144fe50aa64c..dd1ff394894b 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -885,8 +885,104 @@ void SfxMedium::SetEncryptionDataToStorage_Impl()
// that. Clearly the knowledge whether lock files should be used or
// not for some URL scheme belongs in UCB, not here.
+namespace
+{
+OUString tryMSOwnerFile(const INetURLObject& aLockfileURL)
+{
+ try
+ {
+ static osl::Mutex aMutex;
+ osl::MutexGuard aGuard(aMutex);
+ css::uno::Reference<css::ucb::XCommandEnvironment> xEnv;
+ ucbhelper::Content aSourceContent(
+ aLockfileURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), xEnv,
+ comphelper::getProcessComponentContext());
+
+ // Excel creates Owner Files with FILE_FLAG_DELETE_ON_CLOSE, so we need to open it with
+ // FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE share mode
+ css::uno::Reference<css::io::XInputStream> xStream = aSourceContent.openStreamNoLock();
+ if (!xStream)
+ return OUString();
+
+ const sal_Int32 nBufLen = 256;
+ css::uno::Sequence<sal_Int8> aBuf(nBufLen);
+ const sal_Int32 nRead = xStream->readBytes(aBuf, nBufLen);
+ xStream->closeInput();
+ if (nRead >= 162)
+ {
+ // Reverse engineering of MS Office Owner Files format (MS Office 2016 tested).
+ // It starts with a single byte with name length, after which characters of username go
+ // in current Windows 8-bit codepage.
+ // For Word lockfiles, the name is followed by zero bytes up to position 54.
+ // For PowerPoint lockfiles, the name is followed by a single zero byte, and then 0x20
+ // bytes up to position 55.
+ // For Excel lockfiles, the name is followed by 0x20 bytes up to position 55.
+ // At those positions in each type of lockfile, a name length 2-byte word goes, followed
+ // by UTF-16-LE-encoded copy of username. Spaces or some garbage follow up to the end of
+ // the lockfile (total 162 bytes for Word, 165 bytes for Excel/PowerPoint).
+ // Apparently MS Office does not allow username to be longer than 52 characters (trying
+ // to enter more in its options dialog results in error messages stating this limit).
+ const int nACPLen = aBuf[0];
+ if (nACPLen > 0 && nACPLen <= 52) // skip wrong format
+ {
+ const sal_Int8* pBuf = aBuf.getConstArray() + 54;
+ int nUTF16Len = *pBuf; // try Word position
+ // If UTF-16 length is 0x20, then ACP length is also less than maximal, which means
+ // that in Word lockfile case, at least two preceeding bytes would be zero. Both
+ // Excel and PowerPoint lockfiles would have at least one of those bytes non-zero.
+ if (nUTF16Len == 0x20 && (*(pBuf - 1) != 0 || *(pBuf - 2) != 0))
+ nUTF16Len = *++pBuf; // use Excel/PowerPoint position
+
+ if (nUTF16Len > 0 && nUTF16Len <= 52) // skip wrong format
+ return OUString(reinterpret_cast<const sal_Unicode*>(pBuf + 2), nUTF16Len);
+ }
+ }
+ }
+ catch (...) {} // we don't ever need to care about any exceptions here
+
+ return OUString();
+}
-SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog( const LockFileEntry& aData, bool bIsLoading, bool bOwnLock, bool bHandleSysLocked )
+OUString tryMSOwnerFiles(const OUString& sDocURL)
+{
+ INetURLObject aURL(sDocURL);
+ if (aURL.HasError())
+ return OUString();
+ const OUString sFileName = aURL.GetLastName(INetURLObject::DecodeMechanism::WithCharset);
+ if (sFileName.isEmpty())
+ return OUString();
+ const OUString sFileExt = aURL.GetFileExtension();
+ const sal_Int32 nFileNameLen
+ = sFileName.getLength() - sFileExt.getLength() - (sFileExt.isEmpty() ? 0 : 1);
+ // Word, Excel, PowerPoint all prepend the filename with "~$".
+ aURL.SetName("~$" + sFileName, INetURLObject::EncodeMechanism::All);
+ OUString sUserData = tryMSOwnerFile(aURL);
+ // Additionally, Word strips first chars of the filename: 1 for length 7, 2 for length >=8.
+ if (sUserData.isEmpty() && nFileNameLen > 6)
+ {
+ aURL.SetName("~$" + sFileName.copy((nFileNameLen == 7) ? 1 : 2),
+ INetURLObject::EncodeMechanism::All);
+ sUserData = tryMSOwnerFile(aURL);
+ }
+
+ if (!sUserData.isEmpty())
+ sUserData += " (MS Office)"; // Mention the used office suite
+
+ return sUserData;
+}
+
+OUString tryForeignLockfiles(const OUString& sDocURL)
+{
+ OUString sUserData = tryMSOwnerFiles(sDocURL);
+ // here we can test for empty result, and add other known applications' lockfile testing
+ return sUserData.trim();
+}
+}
+
+SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog(const OUString& aDocURL,
+ const LockFileEntry& aData,
+ bool bIsLoading, bool bOwnLock,
+ bool bHandleSysLocked)
{
ShowLockResult nResult = ShowLockResult::NoLock;
@@ -924,6 +1020,10 @@ SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog( const LockFileEnt
else
aInfo = aData[LockFileComponent::SYSUSERNAME];
+ if (aInfo.isEmpty() && !aDocURL.isEmpty())
+ // Try to get name of user who has locked the file using other applications
+ aInfo = tryForeignLockfiles(aDocURL);
+
if ( !aInfo.isEmpty() && !aData[LockFileComponent::EDITTIME].isEmpty() )
aInfo += " ( " + aData[LockFileComponent::EDITTIME] + " )";
@@ -1153,7 +1253,7 @@ SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand( bool bLoading, bool b
if ( !bResult && !bNoUI )
{
- bUIStatus = ShowLockedDocumentDialog( aLockData, bLoading, false , true );
+ bUIStatus = ShowLockedDocumentDialog("", aLockData, bLoading, false , true );
}
}
catch( ucb::InteractiveNetworkWriteException& )
@@ -1375,7 +1475,9 @@ SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand( bool bLoading, bool b
if ( !bResult && !bIoErr)
{
if (!bNoUI)
- bUIStatus = ShowLockedDocumentDialog(aData, bLoading, bOwnLock, bHandleSysLocked);
+ bUIStatus = ShowLockedDocumentDialog(
+ pImpl->m_aLogicName, aData, bLoading, bOwnLock,
+ bHandleSysLocked);
else if (bLoading && bTryIgnoreLockFile && !bHandleSysLocked)
bUIStatus = ShowLockResult::Succeeded;
commit 910c02e2b921ca82d268611022415f1c2bbb9df4
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sun Jan 6 19:35:41 2019 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Jun 18 13:58:00 2019 +0200
tdf#122425: explicitly remove borders for newly created flys
After commit d398e9248c183cf988b6d985b342b0cbff93ea02, it's necessary
to make sure that each created floating object has proper default
border and spacing values (empty and 0), to not inherit frame style's
non-0 values unintentionally.
This fixes two places for objects in headers/footers.
Change-Id: I2632bcd4066609c97aa15e39d69e9089ac691ff2
Reviewed-on: https://gerrit.libreoffice.org/65906
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit 2e189c2464de007b3d59ba37d4f3f1cfbe5b480c)
Reviewed-on: https://gerrit.libreoffice.org/74260
Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/sw/qa/extras/ww8import/data/tdf122425_1.doc b/sw/qa/extras/ww8import/data/tdf122425_1.doc
new file mode 100644
index 000000000000..f0e5b148d347
Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf122425_1.doc differ
diff --git a/sw/qa/extras/ww8import/data/tdf122425_2.doc b/sw/qa/extras/ww8import/data/tdf122425_2.doc
new file mode 100644
index 000000000000..8debcddc1690
Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf122425_2.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 0b68d83eb753..5068f7bbf38c 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -198,6 +198,72 @@ DECLARE_WW8IMPORT_TEST(testTdf110987, "tdf110987")
CPPUNIT_ASSERT(sFilterName != "MS Word 97 Vorlage");
}
+DECLARE_WW8IMPORT_TEST(testTdf122425_1, "tdf122425_1.doc")
+{
+ // This is for header text in case we use a hack for fixed-height headers
+ // (see SwWW8ImplReader::Read_HdFtTextAsHackedFrame)
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+ SwPosFlyFrames aPosFlyFrames = pDoc->GetAllFlyFormats(nullptr, false);
+ // There are two fly frames in the document: for first page's header, and for other pages'
+ CPPUNIT_ASSERT_EQUAL(size_t(2), aPosFlyFrames.size());
+ for (const auto& rPosFlyFrame : aPosFlyFrames)
+ {
+ const SwFrameFormat& rFormat = rPosFlyFrame->GetFormat();
+ const SfxPoolItem* pItem = nullptr;
+
+ // The LR and UL spacings and borders must all be set explicitly;
+ // spacings and border distances must be 0; borders must be absent
+
+ CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, rFormat.GetItemState(RES_LR_SPACE, false, &pItem));
+ auto pLR = static_cast<const SvxLRSpaceItem*>(pItem);
+ CPPUNIT_ASSERT(pLR);
+ CPPUNIT_ASSERT_EQUAL(long(0), pLR->GetLeft());
+ CPPUNIT_ASSERT_EQUAL(long(0), pLR->GetRight());
+
+ CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, rFormat.GetItemState(RES_UL_SPACE, false, &pItem));
+ auto pUL = static_cast<const SvxULSpaceItem*>(pItem);
+ CPPUNIT_ASSERT(pUL);
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pUL->GetUpper());
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pUL->GetLower());
+
+ CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, rFormat.GetItemState(RES_BOX, false, &pItem));
+ auto pBox = static_cast<const SvxBoxItem*>(pItem);
+ CPPUNIT_ASSERT(pBox);
+ for (auto eLine : { SvxBoxItemLine::TOP, SvxBoxItemLine::BOTTOM,
+ SvxBoxItemLine::LEFT, SvxBoxItemLine::RIGHT })
+ {
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pBox->GetDistance(eLine));
+ CPPUNIT_ASSERT(!pBox->GetLine(eLine));
+ }
+ }
+}
+
+DECLARE_WW8IMPORT_TEST(testTdf122425_2, "tdf122425_2.doc")
+{
+ // This is for graphic objects in headers/footers
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+ SwPosFlyFrames aPosFlyFrames = pDoc->GetAllFlyFormats(nullptr, false);
+ // There is one fly frame in the document: the text box
+ CPPUNIT_ASSERT_EQUAL(size_t(1), aPosFlyFrames.size());
+ for (const auto& rPosFlyFrame : aPosFlyFrames)
+ {
+ const SwFrameFormat& rFormat = rPosFlyFrame->GetFormat();
+ const SfxPoolItem* pItem = nullptr;
+
+ // Check for correct explicitly-set values of UL spacings. Previously this was "DEFAULT",
+ // and resulted in inherited values (114 = 2 mm) used.
+ CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, rFormat.GetItemState(RES_UL_SPACE, false, &pItem));
+ auto pUL = static_cast<const SvxULSpaceItem*>(pItem);
+ CPPUNIT_ASSERT(pUL);
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pUL->GetUpper());
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pUL->GetLower());
+ }
+}
+
// tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index ec4425b1da8c..866937a17c8f 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2553,6 +2553,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
// determine wrapping mode
SfxItemSet aFlySet(m_rDoc.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{});
+ Reader::ResetFrameFormatAttrs(aFlySet); // tdf#122425: Explicitly remove borders and spacing
css::text::WrapTextMode eSurround = css::text::WrapTextMode_PARALLEL;
bool bContour = false;
switch (pF->nwr)
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 00c57b690977..bc5b7a864c98 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2180,7 +2180,12 @@ void SwWW8ImplReader::Read_HdFtTextAsHackedFrame(WW8_CP nStart, WW8_CP nLen,
m_pPaM->GetPoint()->nNode = pSttIdx->GetIndex() + 1;
m_pPaM->GetPoint()->nContent.Assign(m_pPaM->GetContentNode(), 0);
- SwFlyFrameFormat *pFrame = m_rDoc.MakeFlySection(RndStdIds::FLY_AT_PARA, m_pPaM->GetPoint());
+ // tdf#122425: Explicitly remove borders and spacing
+ SfxItemSet aFlySet(m_rDoc.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1>{});
+ Reader::ResetFrameFormatAttrs(aFlySet);
+
+ SwFlyFrameFormat* pFrame
+ = m_rDoc.MakeFlySection(RndStdIds::FLY_AT_PARA, m_pPaM->GetPoint(), &aFlySet);
SwFormatAnchor aAnch( pFrame->GetAnchor() );
aAnch.SetType( RndStdIds::FLY_AT_PARA );
More information about the Libreoffice-commits
mailing list