core.git: Changes to 'refs/tags/cib_contract49c-24.2.5.2.M1'
Tag 'cib_contract49c-24.2.5.2.M1' created by Thorsten Behrens at 2024-07-24 22:58 + cib_contract49c-24.2.5.2.M1 -BEGIN PGP SIGNATURE- iNUEABYKAH0WIQRV78SO268/dhkw1IIeB5amgXyR5gUCZqGHDF8UgAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0NTVF RkM0OEVEQkFGM0Y3NjE5MzBENDgyMUUwNzk2QTY4MTdDOTFFNgAKCRAeB5amgXyR 5iVjAP9XO0bx8JEbIOqW8EyEKWK2zmBE4s9VRcQqpLjAiSuWDgD/R79w+nKlvKvg DKyNodI5lCuEXCx2cE9Q2u3QqY5+bgA= =UK1+ -END PGP SIGNATURE- Changes since cib_contract49c-24.2.4.3.M1-176: --- 0 files changed ---
core.git: Branch 'feature/cib_contract49c' - sw/qa writerfilter/source
sw/qa/extras/rtfimport/data/tdf160553.rtf| 20 sw/qa/extras/rtfimport/rtfimport.cxx |8 writerfilter/source/dmapper/DomainMapper.cxx |3 ++- 3 files changed, 30 insertions(+), 1 deletion(-) New commits: commit 99125ebab06f776cc8d44f063d6bed76d51996ff Author: Vasily Melenchuk AuthorDate: Mon Mar 25 16:01:48 2024 +0300 Commit: Thorsten Behrens CommitDate: Wed Jul 24 21:47:26 2024 +0200 tdf#160553: writerfilter: RTF import: fix problem with first table in section Handles section properties between tables. JUnit test included Change-Id: I1db8b80749d18c0e73112e4fd1d13d6331aa7291 Change-Id: I8b00bfeb260af024f48ba8a3e6e6ac38e834b684 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170924 Tested-by: Thorsten Behrens Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/rtfimport/data/tdf160553.rtf b/sw/qa/extras/rtfimport/data/tdf160553.rtf new file mode 100755 index ..2e7b26db4e70 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf160553.rtf @@ -0,0 +1,20 @@ +{ tf1 + + + rowd +\intbl 1+\intbl 2+rowd + ow +\pard HELLO\par + +\sect\sectd + + rowd +\intbl 1+\intbl 2+rowd + ow +\pard + +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 58a6857cffd2..4feef4bd113c 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1837,6 +1837,14 @@ CPPUNIT_TEST_FIXTURE(Test, test158044Tdf) CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, fillStyle); } } + +CPPUNIT_TEST_FIXTURE(Test, test160553Tdf) +{ +createSwDoc("tdf160553.rtf"); +// new section should create second page +CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + // tests should only be added to rtfIMPORT *if* they fail round-tripping in rtfEXPORT CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index d2fcefced9aa..01e2f043390a 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3350,7 +3350,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) } break; case NS_ooxml::LN_tblEnd: -m_pImpl->m_StreamStateStack.top().nTableDepth--; +if (m_pImpl->m_StreamStateStack.top().nTableDepth > 0) +m_pImpl->m_StreamStateStack.top().nTableDepth--; break; case NS_ooxml::LN_tcStart: m_pImpl->m_nTableCellDepth++;
core.git: include/vcl vcl/inc vcl/source vcl/win
include/vcl/vclenum.hxx | 14 +++ include/vcl/window.hxx|3 ++ vcl/inc/salframe.hxx |3 ++ vcl/inc/win/salframe.h|5 +++ vcl/source/window/layout.cxx |3 ++ vcl/source/window/window3.cxx | 16 vcl/win/window/salframe.cxx | 53 ++ 7 files changed, 97 insertions(+) New commits: commit 0c6642ed3a2dbcd54456f61706606fa3371b70ba Author: Vasily Melenchuk AuthorDate: Sat Apr 27 14:23:12 2024 +0200 Commit: Thorsten Behrens CommitDate: Wed Jul 17 21:05:15 2024 +0200 vcl: support for Windows ITaskbarList3 interface And a demo implementation for these features as a taskbar window will become red once LO is displaying any error message. Change-Id: Ifc04026c699059da2e457de2c69e7363e756109c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166740 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx index c8f27fb9da52..f1938105a996 100644 --- a/include/vcl/vclenum.hxx +++ b/include/vcl/vclenum.hxx @@ -196,6 +196,20 @@ enum class VclPackType LAST = End }; +enum class VclTaskBarStates { +// Default, no specifics +Normal, +// Display some progress defined by SetTaskBarProgress +Progress, +// Something going on, but no exact progress scale +ProgressUnknown, +// Process on pause +Paused, +// Some error did happen +Error +}; + + // Return Values from Dialog::Execute //!!! in case of changes adjust /basic/source/runtime/methods.cxx msgbox diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index c78c214a5b60..95aba300f41e 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1122,6 +1122,9 @@ public: /// Use OS specific way to bring user attention to current window virtual void FlashWindow() const; +virtual void SetTaskBarProgress(int nCurrentProgress); +virtual void SetTaskBarState(VclTaskBarStates eTaskBarState); + /** @name Accessibility */ ///@{ diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index bce015ee4f73..ab2ce4d0430f 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -316,6 +316,9 @@ public: // in nOffset, nChars. static SelectionCalcDeleteSurroundingSelection(std::u16string_view rSurroundingText, sal_Int32 nCursorIndex, int nOffset, int nChars); + +virtual void SetTaskBarProgress(int /*nCurrentProgress*/) {} +virtual void SetTaskBarState(VclTaskBarStates /*eTaskBarState*/) {} }; #ifdef _WIN32 diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h index b9ddea89476a..e2f41822be0a 100644 --- a/vcl/inc/win/salframe.h +++ b/vcl/inc/win/salframe.h @@ -29,10 +29,12 @@ #include class WinSalGraphics; +struct ITaskbarList3; class WinSalFrame final: public SalFrame { vcl::WindowState m_eState; +ITaskbarList3* m_pTaskbarList3; public: HWNDmhWnd; // Window handle @@ -146,6 +148,9 @@ public: constexpr vcl::WindowState state() const { return m_eState; } void UpdateFrameState(); constexpr bool isFullScreen() const { return bool(m_eState & vcl::WindowState::FullScreen); } + +virtual void SetTaskBarProgress(int nCurrentProgress) override; +virtual void SetTaskBarState(VclTaskBarStates eTaskBarState) override; }; void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect ); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 2d42d305498e..14c7c9ade823 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -2563,6 +2563,7 @@ MessageDialog::MessageDialog(vcl::Window* pParent, break; case VclMessageType::Error: SetText(GetStandardErrorBoxText()); +SetTaskBarState(VclTaskBarStates::Error); break; case VclMessageType::Other: SetText(Application::GetDisplayName()); @@ -2572,6 +2573,8 @@ MessageDialog::MessageDialog(vcl::Window* pParent, void MessageDialog::dispose() { +SetTaskBarState(VclTaskBarStates::Normal); + disposeOwnedButtons(); m_pPrimaryMessage.disposeAndClear(); m_pSecondaryMessage.disposeAndClear(); diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx index 002c892f592c..ce1f3ff9030c 100644 --- a/vcl/source/window/window3.cxx +++ b/vcl/source/window/window3.cxx @@ -224,6 +224,22 @@ void Window::FlashWindow() const pMyParent->mpWindowImpl->mpFrame->FlashWindow(); } +void Window::SetTaskBarProgress(int nCurrentProgress) +{ +vcl::Window* pMyParent = ImplGetTopmostFrameWindow(); + +if (pMyParent && pMyParent->mpWindowImpl) +pMyParent->mpWindowImpl->mpFrame->SetTaskBarProgress(nCurrentProgress); +} + +void Window::SetTaskBarSta
RE: VS 2022 version 17.9.1 has a bug preventing building cli_ure
New version of Visual Studio 17.10.0 has exactly the same issue again. Do not hurry with update. LINK : error LNK2034: metadata inconsistent with COFF symbol table: symbol '? rtl_ustr_asciil_reverseEquals_WithLength@@$$J0YAEPEB_SPEBDJ@Z' (06000589) has inconsistent metadata with(0A000A14) in climaker_emit.o climaker_emit.o : error LNK2020: unresolved token (0A000A14) "extern "C" unsigned char __cdecl rtl_ustr_asciil_reverseEquals_WithLength(char16_t const *,char const *,long)" (? rtl_ustr_asciil_reverseEquals_WithLength@@$$J0YAEPEB_SPEBDJ@Z) D:\libreoffice\master\instdir\sdk\bin\climaker.exe : fatal error LNK1120: 1 unresolved externals -Original Message- From: LibreOffice On Behalf Of Oliver Brinzing Sent: Thursday, March 21, 2024 10:58 PM To: libreoffice@lists.freedesktop.org Subject: Re: VS 2022 version 17.9.1 has a bug preventing building cli_ure Am 20.03.2024 um 06:01 schrieb Mike Kaganski: > On 24.02.2024 21:50, Mike Kaganski wrote: >> After upgrading my VS v.17.9.0 to v.17.9.1, building cli_ure started to fail >> like this: >> >>> LINK : error LNK2034: metadata inconsistent with COFF symbol table: >>> symbol >>> '?rtl_ustr_asciil_reverseEquals_WithLength@@$$J0YAEPEB_SPEBDJ@Z' >>> (06000579) has inconsistent metadata with (0A000A1A) in >>> climaker_emit.o climaker_emit.o : error LNK2020: unresolved token >>> (0A000A1A) "extern "C" unsigned char __cdecl >>> rtl_ustr_asciil_reverseEquals_WithLength(char16_t const *,char const >>> *,long)" >>> (?rtl_ustr_asciil_reverseEquals_WithLength@@$$J0YAEPEB_SPEBDJ@Z) >>> C:\lo\build\instdir\sdk\bin\climaker.exe : fatal error LNK1120: 1 >>> unresolved externals >> >> I have filed a bug to Microsoft: >> >> https://deu01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdev >> elopercommunity.visualstudio.com%2Ft%2FLINK-%3A-error-LNK2034%3A-meta >> data-inconsis%2F10599604%3Fport%3D1025%26fsid%3Dfdff4046-995a-4c06-8c >> 64-1c14b9752c8f&data=05%7C02%7Cvasily.melenchuk%40cib.de%7C18f799eaae >> bb4c97b38108dc49e142af%7C00dd3e38f5434e1a88b93dbb13d75c49%7C0%7C0%7C6 >> 38466479173686144%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjo >> iV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C4%7C%7C%7C&sdata=5yAjhj >> 9ym%2FhxgKpBUeYmnNftJ2md%2F8D82udjjOOKr%2BY%3D&reserved=0 > > This problem is fixed in VS 2022 version 17.9.4: > https://deu01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flear > n.microsoft.com%2Fen-us%2Fvisualstudio%2Freleases%2F2022%2Frelease-not > es%2317.9.4&data=05%7C02%7Cvasily.melenchuk%40cib.de%7C18f799eaaebb4c9 > 7b38108dc49e142af%7C00dd3e38f5434e1a88b93dbb13d75c49%7C0%7C0%7C6384664 > 79173695033%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMz > IiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C4%7C%7C%7C&sdata=%2FvnkJSIPmEMe > S4bWkRU%2B3sSDSJ0BzdEZ2ERpL8Lh%2F6Y%3D&reserved=0 > yes, it works again with VS 2022 btw: i had a build break after a "clean build": cd /cygdrive/d/sources/libo-core ./g checkout master ./g fetch --tags ./g pull -r /opt/lo/bin/make clean gb_COLOR=1 gb_TITLES=1 /cygdrive/d/sources/libo-core/autogen.sh \ --with-external-tar=/cygdrive/d/sources/lo-externalsrc \ --with-junit=/cygdrive/d/sources/junit-4.10.jar \ --with-ant-home=/cygdrive/d/sources/apache-ant-1.9.5 \ --with-jdk-home=/cygdrive/d/Programme/Java/jdk-17 \ --enable-pch \ --disable-ccache \ --enable-debug \ --disable-odk \ --disable-online-update \ --with-visual-studio=2022 /opt/lo/bin/make build gb_COLOR=1 gb_TITLES=1 2>&1 | tee build.log [...] [PAT] icu [BIN] dragonbox [MOD] frozen [BIN] glm Configuring OpenSSL version 3.0.13 for target VC-WIN64A Using os-specific seed configuration /cygdrive/d/sources/libo-core/workdir/UnpackedTarball/openssl/crypto/sha/../providers: No such file or directory at Configure line 3419. make[1]: *** [D:/sources/libo-core/external/openssl/ExternalProject_openssl.mk:67: D:/sources/libo-core/workdir/ExternalProject/openssl/build] Error 1 make[1]: *** Waiting for unfinished jobs but folder "providers" is located at: /cygdrive/d/sources/libo-core/workdir/UnpackedTarball/openssl/providers workaround: copy folder "providers" to: /cygdrive/d/sources/libo-core/workdir/UnpackedTarball/openssl/crypto
core.git: framework/source include/vcl vcl/inc vcl/source
framework/source/loadenv/loadenv.cxx |8 +--- include/vcl/ctrl.hxx |2 ++ include/vcl/window.hxx |4 ++-- vcl/inc/brdwin.hxx |2 -- vcl/source/window/brdwin.cxx | 12 vcl/source/window/stacking.cxx |4 ++-- vcl/source/window/window.cxx | 18 -- vcl/source/window/window3.cxx|9 - 8 files changed, 31 insertions(+), 28 deletions(-) New commits: commit e0b930e1ddf008d202c3620fdc6652483f914835 Author: Vasily Melenchuk AuthorDate: Sat Apr 27 14:14:04 2024 +0200 Commit: Samuel Mehrbrodt CommitDate: Thu May 16 12:50:31 2024 +0200 VCL: Windows: more usecases for FlashWindow() API to inform on changes FlashWindow() can be used to bring user attention to application in background. Right now in LO it has implementation only for Windows. Here some new cases were added when flashing is used: * dialog window did open * document loaded * LO started Some redesign of previous solution is also performed: no manual search for top window, let's reuse existing code. Changed behavior for bringing LO window to foreground: it is made always and not depending on current value of NewDocumentHandling:ForceFocusAndToFront. It has no sense to tweak this behavior: if user clicks on document in file explorer, LO should came to foreground, no exceptions. Change-Id: I22b5b4e2b170cd25632083a55b3e9f0358bcae03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166615 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 40b9917064ee..299b0fcd5ba4 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -1596,11 +1596,11 @@ void LoadEnv::impl_reactForLoadingState() css::uno::Reference< css::awt::XWindow > xWindow = m_xTargetFrame->getContainerWindow(); bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN, false); bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED, false); +VclPtr pWindow = VCLUnoHelper::GetWindow(xWindow); if (bMinimized) { SolarMutexGuard aSolarGuard; -VclPtr pWindow = VCLUnoHelper::GetWindow(xWindow); // check for system window is necessary to guarantee correct pointer cast! if (pWindow && pWindow->IsSystemWindow()) static_cast(pWindow.get())->Minimize(); @@ -1612,6 +1612,9 @@ void LoadEnv::impl_reactForLoadingState() impl_makeFrameWindowVisible(xWindow, !m_bFocusedAndToFront && shouldFocusAndToFront()); } +if (pWindow) +pWindow->FlashWindow(); + // Note: Only if an existing property "FrameName" is given by this media descriptor, // it should be used. Otherwise we should do nothing. May be the outside code has already // set a frame name on the target! @@ -1700,8 +1703,7 @@ bool LoadEnv::shouldFocusAndToFront() const { bool const preview( m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW, false)); -return !preview - && officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(); +return !preview; } // static diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx index 3f838aba1a70..4e61822abf7a 100644 --- a/include/vcl/ctrl.hxx +++ b/include/vcl/ctrl.hxx @@ -230,6 +230,8 @@ public: /// Notify the LOK client about an invalidated area. virtual void LogicInvalidate( const tools::Rectangle* pRectangle ) override; + +virtual void FlashWindow() const override {}; }; #endif // INCLUDED_VCL_CTRL_HXX diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index c71c0891c572..c78c214a5b60 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -694,7 +694,7 @@ private: // retrieves the list of owner draw decorated windows for this window hierarchy SAL_DLLPRIVATE ::std::vector >& ImplGetOwnerDrawList(); -SAL_DLLPRIVATE vcl::Window* ImplGetTopmostFrameWindow(); +SAL_DLLPRIVATE vcl::Window* ImplGetTopmostFrameWindow() const; SAL_DLLPRIVATE bool ImplStopDnd(); SAL_DLLPRIVATE void ImplStartDnd(); @@ -1119,7 +1119,7 @@ public: /// Dumps itself and potentially its children to a property tree, to be written easily to JSON. virtual void DumpAsPropertyTree(tools::JsonWriter&); - +/// Use OS specific way to bring user attention to current window virtual void FlashWindow() const; /** @name Accessibility dif
core.git: sw/source
sw/source/uibase/utlui/navipi.cxx | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) New commits: commit 084882a66c4e612f207024be301631102be31ca6 Author: Vasily Melenchuk AuthorDate: Thu Apr 25 10:12:41 2024 +0200 Commit: Vasily Melenchuk CommitDate: Mon Apr 29 12:06:00 2024 +0200 sw: fixed crash on GetCreateView() returning nullptr Change-Id: Id0cb44ac7d805a1736fa8170aaffb97b54211707 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166617 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index bb8338e3fe9e..e86e51c30d11 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -73,6 +73,8 @@ OUString SwNavigationPI::CleanEntry(const OUString& rEntry) void SwNavigationPI::MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget) { SwView *pView = GetCreateView(); +if (!pView) +return; SwWrtShell &rSh = pView->GetWrtShell(); if(nTarget < nSource || nTarget == SwOutlineNodes::npos) nTarget ++; @@ -575,7 +577,7 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, //Open Headings by default SwView *pView = GetCreateView(); -if (pView->m_nNaviExpandedStatus < 0) +if (pView && pView->m_nNaviExpandedStatus < 0) { pView->m_nNaviExpandedStatus = 1; m_xContentTree->ExpandAllHeadings(); @@ -684,13 +686,16 @@ void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/, if (SwView::GetMoveType() == NID_PGE) { SwView *pView = GetCreateView(); -SwWrtShell &rSh = pView->GetWrtShell(); -// GetPageNum - return current page number: -// true: in which cursor is located. -// false: which is visible at the upper margin. -sal_uInt16 nPhyNum, nVirtNum; -rSh.GetPageNum(nPhyNum, nVirtNum, false); -m_xGotoPageSpinButton->set_text(OUString::number(nPhyNum)); +if (pView) +{ +SwWrtShell& rSh = pView->GetWrtShell(); +// GetPageNum - return current page number: +// true: in which cursor is located. +// false: which is visible at the upper margin. +sal_uInt16 nPhyNum, nVirtNum; +rSh.GetPageNum(nPhyNum, nVirtNum, false); +m_xGotoPageSpinButton->set_text(OUString::number(nPhyNum)); +} } } }
core.git: Branch 'libreoffice-24-2' - configure.ac
configure.ac |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit bed3fa30f442c9045264f34fd6abf940215c637b Author: Vasily Melenchuk AuthorDate: Fri Apr 19 13:14:13 2024 +0300 Commit: Thorsten Behrens CommitDate: Mon Apr 22 22:13:07 2024 +0200 configure: cygwin issue with date fixed previous variant was causing: "bash: /dev/null: ambiguous redirect" and value was written Change-Id: Ic8762a98f11ef2fee669478b5694ae1c5fb0b8ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166294 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 5d3e3790e15cd05bea463bc4ff14d523163832fc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166431 diff --git a/configure.ac b/configure.ac index 5505bfed8b5b..a435fdc89a1e 100644 --- a/configure.ac +++ b/configure.ac @@ -519,7 +519,7 @@ AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR) AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO) AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH) -git_date=`git log -1 --pretty=format:"%cd" --date=format:'%Y' 2>&/dev/null` +git_date=`git log -1 --pretty=format:"%cd" --date=format:'%Y' 2>/dev/null` LIBO_THIS_YEAR=${git_date:-2024} AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
core.git: configure.ac
configure.ac |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 07137ccd7fbbf3afb1cabfc6ca71375293910a3a Author: Vasily Melenchuk AuthorDate: Fri Apr 19 13:14:13 2024 +0300 Commit: Thorsten Behrens CommitDate: Mon Apr 22 14:38:34 2024 +0200 configure: cygwin issue with date fixed previous variant was causing: "bash: /dev/null: ambiguous redirect" and value was written Change-Id: Ic8762a98f11ef2fee669478b5694ae1c5fb0b8ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166294 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/configure.ac b/configure.ac index 4d96c1e90cf5..8c434dd5243e 100644 --- a/configure.ac +++ b/configure.ac @@ -519,7 +519,7 @@ AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR) AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO) AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH) -git_date=`git log -1 --pretty=format:"%cd" --date=format:'%Y' 2>&/dev/null` +git_date=`git log -1 --pretty=format:"%cd" --date=format:'%Y' 2>/dev/null` LIBO_THIS_YEAR=${git_date:-2024} AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
core.git: Branch 'distro/cib/libreoffice-6-4' - include/vcl vcl/inc vcl/source vcl/win
include/vcl/window.hxx |3 +++ vcl/inc/brdwin.hxx |2 ++ vcl/inc/salframe.hxx |2 ++ vcl/inc/win/salframe.h |1 + vcl/source/window/brdwin.cxx | 15 +++ vcl/source/window/window.cxx |4 vcl/win/window/salframe.cxx |8 7 files changed, 35 insertions(+) New commits: commit ab0d6e455b7b67bd9e9c719dc4e564ee52e3b5e8 Author: Vasily Melenchuk AuthorDate: Wed Oct 25 22:26:14 2023 +0300 Commit: Thorsten Behrens CommitDate: Tue Mar 12 18:45:08 2024 +0100 vcl: interface for WinAPI FlashWindow() function To improve LibreOffice UX it will be great to have possibility to signal user on some event did happen, but without capuring focus and bringing LO to foreground, like it is happenings sometimes. It can be annoying. For example, if dialog window is opening slowly and user did switch to another application, this is used to inform user that there are some updates in LO window: dialog finally alive. There are somewhat confusing implementation of this feature: VCL dialog window became visible and actual Windows window should use ::FlashWindow() are very different in hierarchies, so it is somewhat challenging to find window to flash or even decide shoud we flash window or not. Change-Id: I6ca6706d2dda8902aea273ebe6e318ec9bf4beda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158472 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164719 Tested-by: Thorsten Behrens Reviewed-by: Thorsten Behrens diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index d23b34e397dd..1c55dea078b5 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1215,6 +1215,9 @@ public: /// Same as MouseMove(), but coordinates are in logic unit. used for LOK virtual void LogicMouseMove(const MouseEvent&) {}; + +virtual void FlashWindow() const {}; + /** @name Accessibility */ ///@{ diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx index 0510006fa3ea..057415ce4a7c 100644 --- a/vcl/inc/brdwin.hxx +++ b/vcl/inc/brdwin.hxx @@ -171,6 +171,8 @@ public: tools::Rectangle GetMenuRect() const; virtual SizeGetOptimalSize() const override; + +virtual void FlashWindow() const override; }; struct ImplBorderFrameData diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index 4b540d61ca0e..74d4946eb262 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -208,6 +208,8 @@ public: virtual voidBeep() = 0; +virtual voidFlashWindow() const {}; + // returns system data (most prominent: window handle) virtual const SystemEnvData* GetSystemData() const = 0; diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h index 25c6819bb7e2..f7bf988de410 100644 --- a/vcl/inc/win/salframe.h +++ b/vcl/inc/win/salframe.h @@ -126,6 +126,7 @@ public: virtual LanguageTypeGetInputLanguage() override; virtual voidUpdateSettings( AllSettings& rSettings ) override; virtual voidBeep() override; +virtual voidFlashWindow() const override; virtual const SystemEnvData*GetSystemData() const override; virtual SalPointerState GetPointerState() override; virtual KeyIndicatorState GetIndicatorState() override; diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 1b436b544700..f6d06f5073ba 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -2070,4 +2071,18 @@ void ImplBorderWindow::queue_resize(StateChangedType eReason) vcl::Window::queue_resize(eReason); } +void ImplBorderWindow::FlashWindow() const +{ +// We are showing top level window without focus received. Let's flash it +// Use OS features to bring user attention to this window: find topmost one and FlashWindow +vcl::Window* pMyParent = mpWindowImpl->mpParent; +while (pMyParent && pMyParent->mpWindowImpl && pMyParent->mpWindowImpl->mpParent) +{ +pMyParent = pMyParent->mpWindowImpl->mpParent; +} +if (pMyParent) { +pMyParent->mpWindowImpl->mpFrame->FlashWindow(); +} +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 9a5a6cde533b..d10674274cff 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2277,6 +2277,10 @@ void Window::Show(bool bVisible, ShowFlags nFlags) ImplFocusToTop( ToTopFlags::NONE, false ); } +if (!HasFocus() && GetParent()) { +GetParent()->
core.git: include/vcl vcl/inc vcl/source vcl/win
include/vcl/window.hxx |3 +++ vcl/inc/brdwin.hxx |2 ++ vcl/inc/salframe.hxx |2 ++ vcl/inc/win/salframe.h |1 + vcl/source/window/brdwin.cxx | 15 +++ vcl/source/window/window.cxx |4 vcl/win/window/salframe.cxx |8 7 files changed, 35 insertions(+) New commits: commit 68f55fc9a1aa8c0f403761e39e7531ae298ea79e Author: Vasily Melenchuk AuthorDate: Wed Oct 25 22:26:14 2023 +0300 Commit: Samuel Mehrbrodt CommitDate: Mon Mar 4 15:30:22 2024 +0100 vcl: interface for WinAPI FlashWindow() function To improve LibreOffice UX it will be great to have possibility to signal user on some event did happen, but without capuring focus and bringing LO to foreground, like it is happenings sometimes. It can be annoying. For example, if dialog window is opening slowly and user did switch to another application, this is used to inform user that there are some updates in LO window: dialog finally alive. There are somewhat confusing implementation of this feature: VCL dialog window became visible and actual Windows window should use ::FlashWindow() are very different in hierarchies, so it is somewhat challenging to find window to flash or even decide shoud we flash window or not. Change-Id: I6ca6706d2dda8902aea273ebe6e318ec9bf4beda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158472 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 74f1d395e9ad..f451d6f3038b 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1119,6 +1119,9 @@ public: /// Dumps itself and potentially its children to a property tree, to be written easily to JSON. virtual void DumpAsPropertyTree(tools::JsonWriter&); + +virtual void FlashWindow() const {}; + /** @name Accessibility */ ///@{ diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx index f9c8a8edb894..dbaa52ed02b2 100644 --- a/vcl/inc/brdwin.hxx +++ b/vcl/inc/brdwin.hxx @@ -169,6 +169,8 @@ public: tools::Rectangle GetMenuRect() const; virtual SizeGetOptimalSize() const override; + +virtual void FlashWindow() const override; }; struct ImplBorderFrameData diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index f25f8de92777..a2ce50202b92 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -211,6 +211,8 @@ public: virtual voidBeep() = 0; +virtual voidFlashWindow() const {}; + // returns system data (most prominent: window handle) virtual const SystemEnvData* GetSystemData() const = 0; diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h index de72c089b57b..b9ddea89476a 100644 --- a/vcl/inc/win/salframe.h +++ b/vcl/inc/win/salframe.h @@ -126,6 +126,7 @@ public: virtual LanguageTypeGetInputLanguage() override; virtual voidUpdateSettings( AllSettings& rSettings ) override; virtual voidBeep() override; +virtual voidFlashWindow() const override; virtual const SystemEnvData*GetSystemData() const override; virtual SalPointerState GetPointerState() override; virtual KeyIndicatorState GetIndicatorState() override; diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index e7b569364021..d1de4daffac5 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -2000,4 +2001,18 @@ void ImplBorderWindow::queue_resize(StateChangedType eReason) vcl::Window::queue_resize(eReason); } +void ImplBorderWindow::FlashWindow() const +{ +// We are showing top level window without focus received. Let's flash it +// Use OS features to bring user attention to this window: find topmost one and FlashWindow +vcl::Window* pMyParent = mpWindowImpl->mpParent; +while (pMyParent && pMyParent->mpWindowImpl && pMyParent->mpWindowImpl->mpParent) +{ +pMyParent = pMyParent->mpWindowImpl->mpParent; +} +if (pMyParent) { +pMyParent->mpWindowImpl->mpFrame->FlashWindow(); +} +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 1e661c4151d1..62bc5029f84d 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2322,6 +2322,10 @@ void Window::Show(bool bVisible, ShowFlags nFlags) ImplFocusToTop( ToTopFlags::NONE, false ); } +if (!HasFocus() && GetParent()) { +GetParent()->FlashWindow(); +} + // adjust mpWindowImpl->mbReallyVisible bRealVisibilityChang
core.git: Branch 'libreoffice-24-2' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf158409.rtf | 12 sw/qa/extras/rtfexport/rtfexport3.cxx |9 + writerfilter/source/rtftok/rtfdocumentimpl.cxx |4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) New commits: commit e52d61431b43336eca338d4afe061433fb7c97a2 Author: Vasily Melenchuk AuthorDate: Wed Dec 6 14:40:15 2023 +0300 Commit: Xisco Fauli CommitDate: Tue Feb 6 16:51:25 2024 +0100 tdf#158409: RTF import: use current run props for fields Fields import was not using current run properties causing fallback to used style or default style what is wrong for RTF. Change-Id: I0189c6122b703a23ff910ee38da78aa05ac4d9f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160387 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163057 diff --git a/sw/qa/extras/rtfexport/data/tdf158409.rtf b/sw/qa/extras/rtfexport/data/tdf158409.rtf new file mode 100644 index ..a89a5ba95d8a --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf158409.rtf @@ -0,0 +1,12 @@ +{ tf1 +{\info +{ itle DocTitle} +} +{\stylesheet +{\qls72 Normal;} +} + +\pards16 {ield{\*ldinst TITLE}}\par +\pards72 { tfchs16{ield{\*ldinst TITLE}}}\par + +} diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 435242308a0e..fd25e7e5758d 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -707,6 +707,15 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableOverlapNeverRTFExport) CPPUNIT_ASSERT(!pFly->GetAttrSet().GetWrapInfluenceOnObjPos().GetAllowOverlap()); } +DECLARE_RTFEXPORT_TEST(testTdf158409, "tdf158409.rtf") +{ +uno::Reference xRun = getRun(getParagraph(1), 1, "DocTitle"); +CPPUNIT_ASSERT_EQUAL(8.0, getProperty(xRun, "CharHeight")); + +xRun = getRun(getParagraph(2), 1, "DocTitle"); +CPPUNIT_ASSERT_EQUAL(8.0, getProperty(xRun, "CharHeight")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 52c8311fcb96..cc85a48ae27b 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2342,7 +2342,7 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& rState) if (m_aStates.top().isFieldLocked()) singleChar(cFieldLock); -singleChar(cFieldSep); +singleChar(cFieldSep, true); } break; case Destination::FIELDRESULT: @@ -2569,7 +2569,7 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& rState) str = OUString::Concat(field) + " \"" + str.replaceAll("\"", "\\"") + "\""; singleChar(cFieldStart); Mapper().utext(str.getStr(), str.getLength()); -singleChar(cFieldSep); +singleChar(cFieldSep, true); // no result singleChar(cFieldEnd); }
core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf158409.rtf | 12 sw/qa/extras/rtfexport/rtfexport3.cxx |9 + writerfilter/source/rtftok/rtfdocumentimpl.cxx |4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) New commits: commit 1b0b11db497f76faf576d28e11860c3502f8deb2 Author: Vasily Melenchuk AuthorDate: Wed Dec 6 14:40:15 2023 +0300 Commit: Vasily Melenchuk CommitDate: Tue Feb 6 13:27:06 2024 +0100 tdf#158409: RTF import: use current run props for fields Fields import was not using current run properties causing fallback to used style or default style what is wrong for RTF. Change-Id: I0189c6122b703a23ff910ee38da78aa05ac4d9f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160387 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/sw/qa/extras/rtfexport/data/tdf158409.rtf b/sw/qa/extras/rtfexport/data/tdf158409.rtf new file mode 100644 index ..a89a5ba95d8a --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf158409.rtf @@ -0,0 +1,12 @@ +{ tf1 +{\info +{ itle DocTitle} +} +{\stylesheet +{\qls72 Normal;} +} + +\pards16 {ield{\*ldinst TITLE}}\par +\pards72 { tfchs16{ield{\*ldinst TITLE}}}\par + +} diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 0c7365260b56..e88461102dfb 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -709,6 +709,15 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableOverlapNeverRTFExport) CPPUNIT_ASSERT(!pFly->GetAttrSet().GetWrapInfluenceOnObjPos().GetAllowOverlap()); } +DECLARE_RTFEXPORT_TEST(testTdf158409, "tdf158409.rtf") +{ +uno::Reference xRun = getRun(getParagraph(1), 1, "DocTitle"); +CPPUNIT_ASSERT_EQUAL(8.0, getProperty(xRun, "CharHeight")); + +xRun = getRun(getParagraph(2), 1, "DocTitle"); +CPPUNIT_ASSERT_EQUAL(8.0, getProperty(xRun, "CharHeight")); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 2da578e181c4..0853cfa1b600 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2359,7 +2359,7 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& rState) if (m_aStates.top().isFieldLocked()) singleChar(cFieldLock); -singleChar(cFieldSep); +singleChar(cFieldSep, true); } break; case Destination::FIELDRESULT: @@ -2586,7 +2586,7 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& rState) str = OUString::Concat(field) + " \"" + str.replaceAll("\"", "\\"") + "\""; singleChar(cFieldStart); Mapper().utext(str.getStr(), str.getLength()); -singleChar(cFieldSep); +singleChar(cFieldSep, true); // no result singleChar(cFieldEnd); }
core.git: Branch 'feature/cib_contract8161' - 2 commits - include/vcl sc/source vcl/inc vcl/source vcl/win
Rebased ref, commits from common ancestor: commit d9db9167ec711bfef14542851bc0060306abf771 Author: Vasily Melenchuk AuthorDate: Wed Oct 25 22:26:14 2023 +0300 Commit: Thorsten Behrens CommitDate: Sun Dec 10 21:57:11 2023 +0100 vcl: use Windows FlshWindow() feature For improving UX of LibreOffice it will be great to bring attention to it's windows without hard window switch. For example, if dialog window is opening slowly and user did switch to another application this could be a signal to user that there are some updates in LO window. Change-Id: I6ca6706d2dda8902aea273ebe6e318ec9bf4beda diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index d23b34e397dd..1c55dea078b5 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1215,6 +1215,9 @@ public: /// Same as MouseMove(), but coordinates are in logic unit. used for LOK virtual void LogicMouseMove(const MouseEvent&) {}; + +virtual void FlashWindow() const {}; + /** @name Accessibility */ ///@{ diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx index 0510006fa3ea..057415ce4a7c 100644 --- a/vcl/inc/brdwin.hxx +++ b/vcl/inc/brdwin.hxx @@ -171,6 +171,8 @@ public: tools::Rectangle GetMenuRect() const; virtual SizeGetOptimalSize() const override; + +virtual void FlashWindow() const override; }; struct ImplBorderFrameData diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index 4b540d61ca0e..74d4946eb262 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -208,6 +208,8 @@ public: virtual voidBeep() = 0; +virtual voidFlashWindow() const {}; + // returns system data (most prominent: window handle) virtual const SystemEnvData* GetSystemData() const = 0; diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h index 25c6819bb7e2..f7bf988de410 100644 --- a/vcl/inc/win/salframe.h +++ b/vcl/inc/win/salframe.h @@ -126,6 +126,7 @@ public: virtual LanguageTypeGetInputLanguage() override; virtual voidUpdateSettings( AllSettings& rSettings ) override; virtual voidBeep() override; +virtual voidFlashWindow() const override; virtual const SystemEnvData*GetSystemData() const override; virtual SalPointerState GetPointerState() override; virtual KeyIndicatorState GetIndicatorState() override; diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 1b436b544700..329dd96f7535 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -2070,4 +2071,18 @@ void ImplBorderWindow::queue_resize(StateChangedType eReason) vcl::Window::queue_resize(eReason); } +void ImplBorderWindow::FlashWindow() const +{ +// We are showing top level window without focus received. Let's flash it +// Use OS features to bring user attention to this window: find topmost one and FlashWindow +vcl::Window* pMyParent = mpWindowImpl->mpParent; +while (pMyParent && pMyParent->mpWindowImpl && pMyParent->mpWindowImpl->mpParent) +{ +pMyParent = pMyParent->mpWindowImpl->mpParent; +} +if (pMyParent) { +pMyParent->mpWindowImpl->mpFrame->FlashWindow(); +} +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 9a5a6cde533b..b44749d3236b 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2277,6 +2277,11 @@ void Window::Show(bool bVisible, ShowFlags nFlags) ImplFocusToTop( ToTopFlags::NONE, false ); } +if (!HasFocus() && GetParent()) { +SAL_WARN("vcl", "yeah, flashing"); +GetParent()->FlashWindow(); +} + // adjust mpWindowImpl->mbReallyVisible bRealVisibilityChanged = !mpWindowImpl->mbReallyVisible; ImplSetReallyVisible(); diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index ab6db6aa41b3..5e85a0d86f40 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -2843,6 +2843,25 @@ void WinSalFrame::Beep() MessageBeep( 0 ); } +void WinSalFrame::FlashWindow() const +{ +if (GetForegroundWindow() != mhWnd) +{ +/*FLASHWINFO flash = { +sizeof(FLASHWINFO), +mhWnd, +FLASHW_ALL, // dwFlags +10, // uCount +0 // dwTimeout +}; +::FlashWindowEx(&flash);*/ +::FlashWindow(mhWnd, TRUE); +SAL_WARN("vcl", "superflash!"); +} +/*else +::Flas
core.git: Changes to 'feature/cib_contract8161'
New branch 'feature/cib_contract8161' available with the following commits: commit b4208c3c2bd5175da50fbee7ee232daf69a39071 Author: Vasily Melenchuk Date: Wed Oct 25 22:26:14 2023 +0300 vcl: use Windows FlshWindow() feature For improving UX of LibreOffice it will be great to bring attention to it's windows without hard window switch. For example, if dialog window is opening slowly and user did switch to another application this could be a signal to user that there are some updates in LO window. Change-Id: I6ca6706d2dda8902aea273ebe6e318ec9bf4beda
[Libreoffice-commits] core.git: Branch 'feature/cib_contract49' - 2 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/rtfimport/data/tdf158044.rtf | 20 + sw/qa/extras/rtfimport/rtfimport.cxx | 54 +++ sw/source/filter/ww8/rtfattributeoutput.cxx| 37 -- writerfilter/source/dmapper/DomainMapper.cxx | 89 + writerfilter/source/rtftok/rtfdocumentimpl.cxx |1 writerfilter/source/rtftok/rtfsprm.cxx |9 +- 6 files changed, 172 insertions(+), 38 deletions(-) New commits: commit b6aaddde6e283cb43c79e64fa924ea1d95143b93 Author: Vasily Melenchuk AuthorDate: Thu Oct 26 17:09:44 2023 +0300 Commit: Thorsten Behrens CommitDate: Sat Nov 11 21:44:44 2023 +0100 tdf#104288: rtf export: drop \nonshppict on export - these days hard to find a reader not able to read shapes - RTF file will became compact without pictures duplication - WordPad nowadays is able to display shape pict, no reason for fallback - Fixing possible rtf file bloat on exporting some WMFs Change-Id: Icc8b60da6541acef939f42021d8d5e81bbcd1ae4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158507 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159313 Reviewed-by: Thorsten Behrens diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 5c20be552480..c8ac5b4cadf4 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -4459,21 +4459,8 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat } } -/* - If the graphic is not of type WMF then we will have to store two - graphics, one in the native format wrapped in shppict, and the other in - the wmf format wrapped in nonshppict, so as to keep wordpad happy. If it's - a wmf already then we don't need any such wrapping - */ -bool bIsWMF = pBLIPType && std::strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE) == 0; const SwAttrSet* pAttrSet = pGrfNode->GetpSwAttrSet(); -if (!pFrame || pFrame->IsInline()) -{ -if (!bIsWMF) -m_rExport.Strm().WriteOString( -"{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT); -} -else +if (pFrame && !pFrame->IsInline()) { m_rExport.Strm().WriteOString( "{" OOO_STRING_SVTOOLS_RTF_SHP @@ -4566,27 +4553,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat m_rExport, &m_rExport.Strm(), bWritePicProp, pAttrSet); } -if (!pFrame || pFrame->IsInline()) -{ -if (!bIsWMF) -{ -m_rExport.Strm().WriteOString("}" - "{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT); - -aStream.Seek(0); -if (GraphicConverter::Export(aStream, rGraphic, ConvertDataFormat::WMF) != ERRCODE_NONE) -SAL_WARN("sw.rtf", "failed to export the graphic"); -pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; -nSize = aStream.TellEnd(); -pGraphicAry = static_cast(aStream.GetData()); - -ExportPICT(pFlyFrameFormat, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, - nSize, m_rExport, &m_rExport.Strm()); - -m_rExport.Strm().WriteChar('}'); -} -} -else +if (pFrame && !pFrame->IsInline()) m_rExport.Strm().WriteOString(""); // Close SV, SP, SHPINST and SHP. m_rExport.Strm().WriteOString(SAL_NEWLINE_STRING); commit 72a9b16c5c618e475757121e6771f381e5953190 Author: Oliver Specht AuthorDate: Thu Nov 2 16:34:50 2023 +0100 Commit: Thorsten Behrens CommitDate: Sat Nov 11 20:54:55 2023 +0100 tdf#158044 handling of paragraph attributes in RTF import style attributes need to be repeated at the paragraph if not repeated then defaults have to be applied This includes: Fix Windows 64-bit build using VS 2022 Change-Id: Id976fe515287a4aa12d7ff8ca0ca09c31c65309f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159316 and Make the unit test linear and more explicit Change-Id: Ic28d059ed41f88c9264743034a5ce5397fff0b2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159317 Change-Id: I4ee567e8006c240c046b7e7bb75eae92e5563776 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158839 Tested-by: Jenkins Co-authored-by: Mike Kaganski Reviewed-by: Thorsten Behrens Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159328 diff --git a/sw/qa/extras/rtfimport/data/tdf158044.rtf b/sw/qa/extras/rtfimport/data/tdf158044.rtf new file mode 100755 index 00
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sw/source
sw/source/filter/ww8/rtfattributeoutput.cxx | 37 +--- 1 file changed, 2 insertions(+), 35 deletions(-) New commits: commit 906377ef12bcf75da871b0c3dab1decaf5b20b32 Author: Vasily Melenchuk AuthorDate: Thu Oct 26 17:09:44 2023 +0300 Commit: Thorsten Behrens CommitDate: Sat Nov 11 21:44:11 2023 +0100 tdf#104288: rtf export: drop \nonshppict on export - these days hard to find a reader not able to read shapes - RTF file will became compact without pictures duplication - WordPad nowadays is able to display shape pict, no reason for fallback - Fixing possible rtf file bloat on exporting some WMFs Change-Id: Icc8b60da6541acef939f42021d8d5e81bbcd1ae4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158507 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159313 Reviewed-by: Thorsten Behrens diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 5c20be552480..c8ac5b4cadf4 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -4459,21 +4459,8 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat } } -/* - If the graphic is not of type WMF then we will have to store two - graphics, one in the native format wrapped in shppict, and the other in - the wmf format wrapped in nonshppict, so as to keep wordpad happy. If it's - a wmf already then we don't need any such wrapping - */ -bool bIsWMF = pBLIPType && std::strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE) == 0; const SwAttrSet* pAttrSet = pGrfNode->GetpSwAttrSet(); -if (!pFrame || pFrame->IsInline()) -{ -if (!bIsWMF) -m_rExport.Strm().WriteOString( -"{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT); -} -else +if (pFrame && !pFrame->IsInline()) { m_rExport.Strm().WriteOString( "{" OOO_STRING_SVTOOLS_RTF_SHP @@ -4566,27 +4553,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat m_rExport, &m_rExport.Strm(), bWritePicProp, pAttrSet); } -if (!pFrame || pFrame->IsInline()) -{ -if (!bIsWMF) -{ -m_rExport.Strm().WriteOString("}" - "{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT); - -aStream.Seek(0); -if (GraphicConverter::Export(aStream, rGraphic, ConvertDataFormat::WMF) != ERRCODE_NONE) -SAL_WARN("sw.rtf", "failed to export the graphic"); -pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; -nSize = aStream.TellEnd(); -pGraphicAry = static_cast(aStream.GetData()); - -ExportPICT(pFlyFrameFormat, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, - nSize, m_rExport, &m_rExport.Strm()); - -m_rExport.Strm().WriteChar('}'); -} -} -else +if (pFrame && !pFrame->IsInline()) m_rExport.Strm().WriteOString(""); // Close SV, SP, SHPINST and SHP. m_rExport.Strm().WriteOString(SAL_NEWLINE_STRING);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - editeng/source include/svtools svtools/source sw/source
editeng/source/editeng/eertfpar.cxx |1 include/svtools/rtfkeywd.hxx|1 include/svtools/rtftoken.h |1 svtools/source/svrtf/rtfkeywd.cxx |1 sw/source/core/doc/docfmt.cxx |6 +--- sw/source/filter/ww8/rtfexport.cxx | 48 sw/source/filter/ww8/rtfexport.hxx |2 - 7 files changed, 2 insertions(+), 58 deletions(-) New commits: commit 1d16c19c47a5d0c679e88281e08d1548867170a1 Author: Vasily Melenchuk AuthorDate: Mon Nov 6 13:05:47 2023 +0300 Commit: Thorsten Behrens CommitDate: Sat Nov 11 18:29:33 2023 +0100 tdf#158083: RTF: drop export for \pgdsctbl This table is not standard extension to RTF format. It is not described in RTF specification and even is not used by Writer on import these days. Change-Id: I52f27dfd30877d461ad535b7847f40dd4c6f4ea5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158986 Tested-by: Jenkins Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen Reviewed-by: Miklos Vajna Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159314 Reviewed-by: Thorsten Behrens diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index a5737b4c923a..948216f33dbe 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -203,7 +203,6 @@ void EditRTFParser::NextToken( int nToken ) SkipGroup(); } break; -case RTF_PGDSCTBL: // #i29453# ignore \*\pgdsctbl destination case RTF_LISTTEXT: { SkipGroup(); diff --git a/include/svtools/rtfkeywd.hxx b/include/svtools/rtfkeywd.hxx index fa6346922437..44bbd12a4454 100644 --- a/include/svtools/rtfkeywd.hxx +++ b/include/svtools/rtfkeywd.hxx @@ -1110,7 +1110,6 @@ #define OOO_STRING_SVTOOLS_RTF_SHDWSTYLE "\\shdwstyle" #define OOO_STRING_SVTOOLS_RTF_SHDWCOL "\\shdwcol" #define OOO_STRING_SVTOOLS_RTF_SHDWFCOL "\\shdwfcol" -#define OOO_STRING_SVTOOLS_RTF_PGDSCTBL "\\pgdsctbl" #define OOO_STRING_SVTOOLS_RTF_PGDSC "\\pgdsc" #define OOO_STRING_SVTOOLS_RTF_PGDSCUSE "\\pgdscuse" #define OOO_STRING_SVTOOLS_RTF_PGDSCNXT "\\pgdscnxt" diff --git a/include/svtools/rtftoken.h b/include/svtools/rtftoken.h index 11c96a2f75e6..20d271107443 100644 --- a/include/svtools/rtftoken.h +++ b/include/svtools/rtftoken.h @@ -1238,7 +1238,6 @@ enum RTF_TOKEN_IDS { RTF_SHDW_STYLE, RTF_SHDW_COL, RTF_SHDW_FCOL, -RTF_PGDSCTBL, RTF_PGDSC, RTF_PGDSCUSE, RTF_PGDSCNXT, diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx index e805b3cd9359..91f2669ea98d 100644 --- a/svtools/source/svrtf/rtfkeywd.cxx +++ b/svtools/source/svrtf/rtfkeywd.cxx @@ -1120,7 +1120,6 @@ static RTF_TokenEntry aRTFTokenTab[] = { {std::u16string_view(u"" OOO_STRING_SVTOOLS_RTF_FLYINPARA), RTF_FLY_INPARA}, -{std::u16string_view(u"" OOO_STRING_SVTOOLS_RTF_PGDSCTBL), RTF_PGDSCTBL}, {std::u16string_view(u"" OOO_STRING_SVTOOLS_RTF_PGDSC), RTF_PGDSC}, {std::u16string_view(u"" OOO_STRING_SVTOOLS_RTF_PGDSCUSE), RTF_PGDSCUSE}, {std::u16string_view(u"" OOO_STRING_SVTOOLS_RTF_PGDSCNXT), RTF_PGDSCNXT}, diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 5119bf15c04b..9f0de6aa1e06 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1565,12 +1565,10 @@ void SwDoc::ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles ) &SwDoc::MakeTextFormatColl_, *mpDfltTextFormatColl ); //To-Do: -// a) in rtf export don't export our hideous pgdsctbl -// extension to rtf anymore -// b) in sd rtf import (View::InsertData) don't use +// a) in sd rtf import (View::InsertData) don't use // a super-fragile test for mere presence of \trowd to // indicate import of rtf into a table -// c) then drop use of bIncludePageStyles +// b) then drop use of bIncludePageStyles if (bIncludePageStyles) { // and now the page templates diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 96f0f628f6a9..3ee8947d690e 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -729,51 +729,6 @@ void RtfExport::WriteDocVars() } } -void RtfExport::WritePageDescTable() -{ -// Write page descriptions (page styles) -std::size_t nSize = m_rDoc.GetPageDescCnt(); -if (!nSize) -return; - -Strm().WriteOString(SAL_NEWLINE_STRING); -m_bOutPageDescs = true; -Strm() -.WriteChar('{') -.WriteOString(OOO_STRING_SVTOOLS_RTF_IGNORE) -.WriteOString(OOO_STRING_SVTOOLS_RTF_PGDSCTBL); -
[Libreoffice-commits] core.git: editeng/source include/svtools svtools/source sw/source
editeng/source/editeng/eertfpar.cxx |1 include/svtools/rtfkeywd.hxx|1 include/svtools/rtftoken.h |1 svtools/source/svrtf/rtfkeywd.cxx |1 sw/source/core/doc/docfmt.cxx |6 +--- sw/source/filter/ww8/rtfexport.cxx | 48 sw/source/filter/ww8/rtfexport.hxx |2 - 7 files changed, 2 insertions(+), 58 deletions(-) New commits: commit b6a7d8201bdb6c28e18472326b2328507a6b1e4e Author: Vasily Melenchuk AuthorDate: Mon Nov 6 13:05:47 2023 +0300 Commit: Miklos Vajna CommitDate: Tue Nov 7 14:59:46 2023 +0100 tdf#158083: RTF: drop export for \pgdsctbl This table is not standard extension to RTF format. It is not described in RTF specification and even is not used by Writer on import these days. Change-Id: I52f27dfd30877d461ad535b7847f40dd4c6f4ea5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158986 Tested-by: Jenkins Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen Reviewed-by: Miklos Vajna diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index a5737b4c923a..948216f33dbe 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -203,7 +203,6 @@ void EditRTFParser::NextToken( int nToken ) SkipGroup(); } break; -case RTF_PGDSCTBL: // #i29453# ignore \*\pgdsctbl destination case RTF_LISTTEXT: { SkipGroup(); diff --git a/include/svtools/rtfkeywd.hxx b/include/svtools/rtfkeywd.hxx index fa6346922437..44bbd12a4454 100644 --- a/include/svtools/rtfkeywd.hxx +++ b/include/svtools/rtfkeywd.hxx @@ -1110,7 +1110,6 @@ #define OOO_STRING_SVTOOLS_RTF_SHDWSTYLE "\\shdwstyle" #define OOO_STRING_SVTOOLS_RTF_SHDWCOL "\\shdwcol" #define OOO_STRING_SVTOOLS_RTF_SHDWFCOL "\\shdwfcol" -#define OOO_STRING_SVTOOLS_RTF_PGDSCTBL "\\pgdsctbl" #define OOO_STRING_SVTOOLS_RTF_PGDSC "\\pgdsc" #define OOO_STRING_SVTOOLS_RTF_PGDSCUSE "\\pgdscuse" #define OOO_STRING_SVTOOLS_RTF_PGDSCNXT "\\pgdscnxt" diff --git a/include/svtools/rtftoken.h b/include/svtools/rtftoken.h index f530c8e5ba33..ab637a4e1fb8 100644 --- a/include/svtools/rtftoken.h +++ b/include/svtools/rtftoken.h @@ -1234,7 +1234,6 @@ enum RTF_TOKEN_IDS { RTF_SHDW_STYLE, RTF_SHDW_COL, RTF_SHDW_FCOL, -RTF_PGDSCTBL, RTF_PGDSC, RTF_PGDSCUSE, RTF_PGDSCNXT, diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx index e805b3cd9359..91f2669ea98d 100644 --- a/svtools/source/svrtf/rtfkeywd.cxx +++ b/svtools/source/svrtf/rtfkeywd.cxx @@ -1120,7 +1120,6 @@ static RTF_TokenEntry aRTFTokenTab[] = { {std::u16string_view(u"" OOO_STRING_SVTOOLS_RTF_FLYINPARA), RTF_FLY_INPARA}, -{std::u16string_view(u"" OOO_STRING_SVTOOLS_RTF_PGDSCTBL), RTF_PGDSCTBL}, {std::u16string_view(u"" OOO_STRING_SVTOOLS_RTF_PGDSC), RTF_PGDSC}, {std::u16string_view(u"" OOO_STRING_SVTOOLS_RTF_PGDSCUSE), RTF_PGDSCUSE}, {std::u16string_view(u"" OOO_STRING_SVTOOLS_RTF_PGDSCNXT), RTF_PGDSCNXT}, diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index edacd4455b70..c7deb91478b9 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1562,12 +1562,10 @@ void SwDoc::ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles ) &SwDoc::MakeTextFormatColl_, *mpDfltTextFormatColl ); //To-Do: -// a) in rtf export don't export our hideous pgdsctbl -// extension to rtf anymore -// b) in sd rtf import (View::InsertData) don't use +// a) in sd rtf import (View::InsertData) don't use // a super-fragile test for mere presence of \trowd to // indicate import of rtf into a table -// c) then drop use of bIncludePageStyles +// b) then drop use of bIncludePageStyles if (bIncludePageStyles) { // and now the page templates diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 278e9c271e0e..616533b4dd5a 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -729,51 +729,6 @@ void RtfExport::WriteDocVars() } } -void RtfExport::WritePageDescTable() -{ -// Write page descriptions (page styles) -std::size_t nSize = m_rDoc.GetPageDescCnt(); -if (!nSize) -return; - -Strm().WriteOString(SAL_NEWLINE_STRING); -m_bOutPageDescs = true; -Strm() -.WriteChar('{') -.WriteOString(OOO_STRING_SVTOOLS_RTF_IGNORE) -.WriteOString(OOO_STRING_SVTOOLS_RTF_PGDSCTBL); -for (std::size_t n = 0; n < nSize; ++n) -{ -const SwPageDesc& rPageDesc = m_rDoc.GetPageDesc(n); - -
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/window.cxx |3 --- 1 file changed, 3 deletions(-) New commits: commit 3d83bdb94a43b7d77c5a2362cb8204caf47a6b54 Author: Vasily Melenchuk AuthorDate: Wed Oct 25 13:48:39 2023 +0300 Commit: Vasily Melenchuk CommitDate: Thu Nov 2 09:41:06 2023 +0100 vcl: removed redundant check Change-Id: Iec2c344df9eb1fa61bb04355c3eee38499edcdac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158422 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 35b17761e2c4..437a8b14dcb6 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2398,9 +2398,6 @@ void Window::Show(bool bVisible, ShowFlags nFlags) // now only notify with a NULL data pointer, for all other clients except the access bridge. if ( !bRealVisibilityChanged ) CallEventListeners( mpWindowImpl->mbVisible ? VclEventId::WindowShow : VclEventId::WindowHide ); -if( xWindow->isDisposed() ) -return; - } Size Window::GetSizePixel() const
[Libreoffice-commits] core.git: sw/source
sw/source/filter/ww8/rtfattributeoutput.cxx | 37 +--- 1 file changed, 2 insertions(+), 35 deletions(-) New commits: commit 24ee09ab41924fd339835cbc7a54a5ba27f5c67e Author: Vasily Melenchuk AuthorDate: Thu Oct 26 17:09:44 2023 +0300 Commit: Vasily Melenchuk CommitDate: Thu Nov 2 09:38:05 2023 +0100 tdf#104288: rtf export: drop \nonshppict on export - these days hard to find a reader not able to read shapes - RTF file will became compact without pictures duplication - WordPad nowadays is able to display shape pict, no reason for fallback - Fixing possible rtf file bloat on exporting some WMFs Change-Id: Icc8b60da6541acef939f42021d8d5e81bbcd1ae4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158507 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index afcdbdf0e761..baefd752e1c0 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -4461,21 +4461,8 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat } } -/* - If the graphic is not of type WMF then we will have to store two - graphics, one in the native format wrapped in shppict, and the other in - the wmf format wrapped in nonshppict, so as to keep wordpad happy. If it's - a wmf already then we don't need any such wrapping - */ -bool bIsWMF = pBLIPType && std::strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE) == 0; const SwAttrSet* pAttrSet = pGrfNode->GetpSwAttrSet(); -if (!pFrame || pFrame->IsInline()) -{ -if (!bIsWMF) -m_rExport.Strm().WriteOString( -"{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT); -} -else +if (pFrame && !pFrame->IsInline()) { m_rExport.Strm().WriteOString( "{" OOO_STRING_SVTOOLS_RTF_SHP @@ -4568,27 +4555,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat m_rExport, &m_rExport.Strm(), bWritePicProp, pAttrSet); } -if (!pFrame || pFrame->IsInline()) -{ -if (!bIsWMF) -{ -m_rExport.Strm().WriteOString("}" - "{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT); - -aStream.Seek(0); -if (GraphicConverter::Export(aStream, rGraphic, ConvertDataFormat::WMF) != ERRCODE_NONE) -SAL_WARN("sw.rtf", "failed to export the graphic"); -pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; -nSize = aStream.TellEnd(); -pGraphicAry = static_cast(aStream.GetData()); - -ExportPICT(pFlyFrameFormat, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, - nSize, m_rExport, &m_rExport.Strm()); - -m_rExport.Strm().WriteChar('}'); -} -} -else +if (pFrame && !pFrame->IsInline()) m_rExport.Strm().WriteOString(""); // Close SV, SP, SHPINST and SHP. m_rExport.Strm().WriteOString(SAL_NEWLINE_STRING);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf156030.rtf | 11 ++ sw/qa/extras/rtfexport/rtfexport7.cxx | 38 ++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 30 - 3 files changed, 78 insertions(+), 1 deletion(-) New commits: commit 8081bbcb2dd42508f8c306fe3b302392358fe892 Author: Vasily Melenchuk AuthorDate: Thu Jul 6 12:45:11 2023 +0300 Commit: Thorsten Behrens CommitDate: Tue Jul 18 22:14:40 2023 +0200 tdf#156030: sw: better import of IF field for RTF and DOCX Since long time IF field was converted to ConditionalText, but no parameters were given. So condition, then text and else text were lost during import. Change-Id: I9b45e8ab394f3c53bb34370bf3ea15a939a400fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154101 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit d434104497fa1bea5744d5ce4e9447f75834ba55) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154530 diff --git a/sw/qa/extras/rtfexport/data/tdf156030.rtf b/sw/qa/extras/rtfexport/data/tdf156030.rtf new file mode 100644 index ..db501d5bffac --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf156030.rtf @@ -0,0 +1,11 @@ +{\rtf1 +{\field{\*\fldinst IF 1 = 2 "true value 1" "false value 1"}}\par +{\field{\*\fldinst IF 1 == 2 "true value 2" "false value 2"}}\par +{\field{\*\fldinst IF 1 != 2 "true value 3" "false value 3"}}\par +{\field{\*\fldinst IF 1 <> 2 "true value 4" "false value 4"}}\par +{\field{\*\fldinst IF 1 > 2 "true value 5" "false value 5"}}\par +{\field{\*\fldinst IF 1 < 2 "true value 6" "false value 6"}}\par +{\field{\*\fldinst IF 1 1 = 1 2 1 true value 7 false value 7}}\par +{\field{\*\fldinst IF 1 1 = "1 2 1 true value 8 fal"se "value 8}}\par +{\field{\*\fldinst IF a}}\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport7.cxx b/sw/qa/extras/rtfexport/rtfexport7.cxx index 11eaadee6a88..ad9249bedeb8 100644 --- a/sw/qa/extras/rtfexport/rtfexport7.cxx +++ b/sw/qa/extras/rtfexport/rtfexport7.cxx @@ -683,6 +683,44 @@ DECLARE_RTFEXPORT_TEST(testTdf113202, "tdf113202.rtf") CPPUNIT_ASSERT(getProperty(getParagraph(4), "ParaContextMargin")); } +DECLARE_RTFEXPORT_TEST(testTdf156030, "tdf156030.rtf") +{ +uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xFieldsAccess( +xTextFieldsSupplier->getTextFields()); +uno::Reference xFields(xFieldsAccess->createEnumeration()); + +// As usual, fields given by FieldsAccess are not in same order as in the document +std::vector> aExpectedValues = { +{ "1 FORMULA 2", "true value 1", "false value 1" }, // #1, condition should be 1 = 2 +{ "", "", "" }, // #9, not enough field params +{ "1 1 FORMULA 1 2 1 true value 8 fal", "se", "value 8" }, // #8, nonsense in field params +{ "1 1 FORMULA 1 2 1 true value 7 false", "value", "7" }, // #7, another parse error +{ "1 < 2", "true value 6", "false value 6" }, // #6 +{ "1 > 2", "true value 5", "false value 5" }, // #5 +{ "1 <> 2", "true value 4", "false value 4" }, // #4 +{ "1 != 2", "true value 3", "false value 3" }, // #3 +{ "1 FORMULA FORMULA 2", "true value 2", "false value 2" }, // #2, condition expected 1 == 2 +}; +uno::Reference xPropertySet; +OUString sValue; + +for (const auto& aValues : aExpectedValues) +{ +xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY_THROW); +CPPUNIT_ASSERT(xPropertySet.is()); +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Condition") >>= sValue); +CPPUNIT_ASSERT_EQUAL(aValues[0], sValue); +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("TrueContent") >>= sValue); +CPPUNIT_ASSERT_EQUAL(aValues[1], sValue); +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("FalseContent") >>= sValue); +CPPUNIT_ASSERT_EQUAL(aValues[2], sValue); +} + +// No more fields +CPPUNIT_ASSERT(!xFields->hasMoreElements()); +} + DECLARE_RTFEXPORT_TEST(testTdf153195, "tdf153195.rtf") { uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index f849a5246bf4..4a32891f2503 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/Domain
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf156030.rtf | 11 ++ sw/qa/extras/rtfexport/rtfexport7.cxx | 38 ++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 30 - 3 files changed, 78 insertions(+), 1 deletion(-) New commits: commit da2e7b1e0b58aed20d44b7c588ee86d922d614a8 Author: Vasily Melenchuk AuthorDate: Thu Jul 6 12:45:11 2023 +0300 Commit: Thorsten Behrens CommitDate: Mon Jul 17 15:56:14 2023 +0200 tdf#156030: sw: better import of IF field for RTF and DOCX Since long time IF field was converted to ConditionalText, but no parameters were given. So condition, then text and else text were lost during import. Change-Id: I9b45e8ab394f3c53bb34370bf3ea15a939a400fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154101 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/rtfexport/data/tdf156030.rtf b/sw/qa/extras/rtfexport/data/tdf156030.rtf new file mode 100644 index ..db501d5bffac --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf156030.rtf @@ -0,0 +1,11 @@ +{\rtf1 +{\field{\*\fldinst IF 1 = 2 "true value 1" "false value 1"}}\par +{\field{\*\fldinst IF 1 == 2 "true value 2" "false value 2"}}\par +{\field{\*\fldinst IF 1 != 2 "true value 3" "false value 3"}}\par +{\field{\*\fldinst IF 1 <> 2 "true value 4" "false value 4"}}\par +{\field{\*\fldinst IF 1 > 2 "true value 5" "false value 5"}}\par +{\field{\*\fldinst IF 1 < 2 "true value 6" "false value 6"}}\par +{\field{\*\fldinst IF 1 1 = 1 2 1 true value 7 false value 7}}\par +{\field{\*\fldinst IF 1 1 = "1 2 1 true value 8 fal"se "value 8}}\par +{\field{\*\fldinst IF a}}\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport7.cxx b/sw/qa/extras/rtfexport/rtfexport7.cxx index 11eaadee6a88..ad9249bedeb8 100644 --- a/sw/qa/extras/rtfexport/rtfexport7.cxx +++ b/sw/qa/extras/rtfexport/rtfexport7.cxx @@ -683,6 +683,44 @@ DECLARE_RTFEXPORT_TEST(testTdf113202, "tdf113202.rtf") CPPUNIT_ASSERT(getProperty(getParagraph(4), "ParaContextMargin")); } +DECLARE_RTFEXPORT_TEST(testTdf156030, "tdf156030.rtf") +{ +uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xFieldsAccess( +xTextFieldsSupplier->getTextFields()); +uno::Reference xFields(xFieldsAccess->createEnumeration()); + +// As usual, fields given by FieldsAccess are not in same order as in the document +std::vector> aExpectedValues = { +{ "1 FORMULA 2", "true value 1", "false value 1" }, // #1, condition should be 1 = 2 +{ "", "", "" }, // #9, not enough field params +{ "1 1 FORMULA 1 2 1 true value 8 fal", "se", "value 8" }, // #8, nonsense in field params +{ "1 1 FORMULA 1 2 1 true value 7 false", "value", "7" }, // #7, another parse error +{ "1 < 2", "true value 6", "false value 6" }, // #6 +{ "1 > 2", "true value 5", "false value 5" }, // #5 +{ "1 <> 2", "true value 4", "false value 4" }, // #4 +{ "1 != 2", "true value 3", "false value 3" }, // #3 +{ "1 FORMULA FORMULA 2", "true value 2", "false value 2" }, // #2, condition expected 1 == 2 +}; +uno::Reference xPropertySet; +OUString sValue; + +for (const auto& aValues : aExpectedValues) +{ +xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY_THROW); +CPPUNIT_ASSERT(xPropertySet.is()); +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Condition") >>= sValue); +CPPUNIT_ASSERT_EQUAL(aValues[0], sValue); +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("TrueContent") >>= sValue); +CPPUNIT_ASSERT_EQUAL(aValues[1], sValue); +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("FalseContent") >>= sValue); +CPPUNIT_ASSERT_EQUAL(aValues[2], sValue); +} + +// No more fields +CPPUNIT_ASSERT(!xFields->hasMoreElements()); +} + DECLARE_RTFEXPORT_TEST(testTdf153195, "tdf153195.rtf") { uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 491c755206b7..bf433e2b8d33 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -7447,7 +7447,35 @@ void DomainMapper_Impl::CloseFieldCommand() pContext->SetHyperlinkTarget(sT
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - writerfilter/source
writerfilter/source/dmapper/DomainMapper.cxx | 45 +++ 1 file changed, 25 insertions(+), 20 deletions(-) New commits: commit 5d508772a6567325f5ea3749d16f5cea4cceea43 Author: Vasily Melenchuk AuthorDate: Wed Apr 26 18:03:18 2023 +0300 Commit: Michael Stahl CommitDate: Fri May 5 10:50:14 2023 +0200 tdf#151974: writerfilter: apply props only to new document Properties applied to document shoudl be a case only for new doc, but DomainMapper can be called during pasing of RTF and cause modifications to props in already open document. Tested only for "NoNumberingShowFollowBy" but I assume this is a case for all compatibility props. Change-Id: I4558d809ca477918373b15fa05500ed985e170a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151069 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 2d0a87f97e2c9ac50cd6ce329ca8256daf94ead4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151288 Reviewed-by: Stéphane Guillou Reviewed-by: Michael Stahl diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 3565b131084d..cbdba51a1556 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -114,26 +114,31 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon mbHasControls(false), mbWasShapeInPara(false) { -// #i24363# tab stops relative to indent -m_pImpl->SetDocumentSettingsProperty( -getPropertyName( PROP_TABS_RELATIVE_TO_INDENT ), -uno::Any( false ) ); -m_pImpl->SetDocumentSettingsProperty( -getPropertyName( PROP_SURROUND_TEXT_WRAP_SMALL ), -uno::Any( true ) ); -m_pImpl->SetDocumentSettingsProperty( -getPropertyName( PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING ), -uno::Any( true ) ); - -// Don't load the default style definitions to avoid weird mix -m_pImpl->SetDocumentSettingsProperty("StylesNoDefault", uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("MsWordCompTrailingBlanks", uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("HeaderSpacingBelowLastPara", - uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("FrameAutowidthWithMorePara", uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("FootnoteInColumnToPageEnd", uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("TabAtLeftIndentForParagraphsInList", uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("NoNumberingShowFollowBy", uno::Any(true)); +if (m_pImpl->IsNewDoc()) +{ +// #i24363# tab stops relative to indent +m_pImpl->SetDocumentSettingsProperty( +getPropertyName(PROP_TABS_RELATIVE_TO_INDENT), +uno::Any(false)); +m_pImpl->SetDocumentSettingsProperty( +getPropertyName(PROP_SURROUND_TEXT_WRAP_SMALL), +uno::Any(true)); +m_pImpl->SetDocumentSettingsProperty( +getPropertyName(PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING), +uno::Any(true)); + +// Don't load the default style definitions to avoid weird mix +m_pImpl->SetDocumentSettingsProperty("StylesNoDefault", uno::Any(true)); +m_pImpl->SetDocumentSettingsProperty("MsWordCompTrailingBlanks", uno::Any(true)); +m_pImpl->SetDocumentSettingsProperty("HeaderSpacingBelowLastPara", +uno::Any(true)); +m_pImpl->SetDocumentSettingsProperty("FrameAutowidthWithMorePara", uno::Any(true)); +m_pImpl->SetDocumentSettingsProperty("FootnoteInColumnToPageEnd", uno::Any(true)); + m_pImpl->SetDocumentSettingsProperty("TabAtLeftIndentForParagraphsInList", uno::Any(true)); + +// Enable only for new documents, since pasting from clipboard can influence existing doc +m_pImpl->SetDocumentSettingsProperty("NoNumberingShowFollowBy", uno::Any(true)); +} // Initialize RDF metadata, to be able to add statements during the import. try
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/dmapper/DomainMapper.cxx | 45 +++ 1 file changed, 25 insertions(+), 20 deletions(-) New commits: commit 2d0a87f97e2c9ac50cd6ce329ca8256daf94ead4 Author: Vasily Melenchuk AuthorDate: Wed Apr 26 18:03:18 2023 +0300 Commit: Thorsten Behrens CommitDate: Wed May 3 01:16:52 2023 +0200 tdf#151974: writerfilter: apply props only to new document Properties applied to document shoudl be a case only for new doc, but DomainMapper can be called during pasing of RTF and cause modifications to props in already open document. Tested only for "NoNumberingShowFollowBy" but I assume this is a case for all compatibility props. Change-Id: I4558d809ca477918373b15fa05500ed985e170a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151069 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 9da64ce6921a..3db5c2970705 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -116,26 +116,31 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon mbHasControls(false), mbWasShapeInPara(false) { -// #i24363# tab stops relative to indent -m_pImpl->SetDocumentSettingsProperty( -getPropertyName( PROP_TABS_RELATIVE_TO_INDENT ), -uno::Any( false ) ); -m_pImpl->SetDocumentSettingsProperty( -getPropertyName( PROP_SURROUND_TEXT_WRAP_SMALL ), -uno::Any( true ) ); -m_pImpl->SetDocumentSettingsProperty( -getPropertyName( PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING ), -uno::Any( true ) ); - -// Don't load the default style definitions to avoid weird mix -m_pImpl->SetDocumentSettingsProperty("StylesNoDefault", uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("MsWordCompTrailingBlanks", uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("HeaderSpacingBelowLastPara", - uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("FrameAutowidthWithMorePara", uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("FootnoteInColumnToPageEnd", uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("TabAtLeftIndentForParagraphsInList", uno::Any(true)); -m_pImpl->SetDocumentSettingsProperty("NoNumberingShowFollowBy", uno::Any(true)); +if (m_pImpl->IsNewDoc()) +{ +// #i24363# tab stops relative to indent +m_pImpl->SetDocumentSettingsProperty( +getPropertyName(PROP_TABS_RELATIVE_TO_INDENT), +uno::Any(false)); +m_pImpl->SetDocumentSettingsProperty( +getPropertyName(PROP_SURROUND_TEXT_WRAP_SMALL), +uno::Any(true)); +m_pImpl->SetDocumentSettingsProperty( +getPropertyName(PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING), +uno::Any(true)); + +// Don't load the default style definitions to avoid weird mix +m_pImpl->SetDocumentSettingsProperty("StylesNoDefault", uno::Any(true)); +m_pImpl->SetDocumentSettingsProperty("MsWordCompTrailingBlanks", uno::Any(true)); +m_pImpl->SetDocumentSettingsProperty("HeaderSpacingBelowLastPara", +uno::Any(true)); +m_pImpl->SetDocumentSettingsProperty("FrameAutowidthWithMorePara", uno::Any(true)); +m_pImpl->SetDocumentSettingsProperty("FootnoteInColumnToPageEnd", uno::Any(true)); + m_pImpl->SetDocumentSettingsProperty("TabAtLeftIndentForParagraphsInList", uno::Any(true)); + +// Enable only for new documents, since pasting from clipboard can influence existing doc +m_pImpl->SetDocumentSettingsProperty("NoNumberingShowFollowBy", uno::Any(true)); +} // Initialize RDF metadata, to be able to add statements during the import. try
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf150542.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport16.cxx| 21 + writerfilter/source/dmapper/SettingsTable.cxx | 58 +- writerfilter/source/ooxml/model.xml |3 + 4 files changed, 81 insertions(+), 1 deletion(-) New commits: commit 184a805bc50c593cde950fb0b3253665cc748999 Author: Vasily Melenchuk AuthorDate: Tue Mar 28 13:15:09 2023 +0300 Commit: Thorsten Behrens CommitDate: Tue Apr 4 08:54:46 2023 +0200 tdf#150542: DOCX import: support for document varibles Writer does insert document variables only if they are in document body as DOCVARIABLE fields. But ones given in settings.xml (w:docVars/w:docVar) were ignored. Moreover variables in settings should have priority and overwrite ones in fields. Word by default does show only field results, but refreshing field values will override values with ones from settings. Change-Id: I7103c90eef59ab18f8a25e616dcf8a8b1c6dcb08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149646 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 992d86b1b67a6bd28bbf5e63b2d2406881f476b7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149889 diff --git a/sw/qa/extras/ooxmlexport/data/tdf150542.docx b/sw/qa/extras/ooxmlexport/data/tdf150542.docx new file mode 100644 index ..3f115fa69370 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf150542.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index d7dfbf73890e..044c6f3055fd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -976,6 +976,27 @@ CPPUNIT_TEST_FIXTURE(Test, Test_ShadowDirection) "rotWithShape", "0"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf150542) +{ +loadAndSave("tdf150542.docx"); + +xmlDocUniquePtr pSettingsDoc = parseExport("word/settings.xml"); +// Ensure that all docvars from input are written back and with correct values. +// Order of document variables is not checked. So this can fail at some time if order is changed. +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[1]", "name", u"LocalChars\u00C1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0054\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070"); +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[1]", "val", u"Correct value (\u00E1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0020\u0074\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070)"); +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[2]", "name", "DocVar1"); +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[2]", "val", "DocVar1 Value"); +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[3]", "name", "DocVar3"); +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[3]", "val", "DocVar3 Value"); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf139549) { loadAndSave("tdf139549.docx"); diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx index 45dc67b9f43b..d24dae617c01 100644 --- a/writerfilter/source/dmapper/SettingsTable.cxx +++ b/writerfilter/source/dmapper/SettingsTable.cxx @@ -26,6 +26,8 @@ #include #include +#include +#include #include #include #include @@ -95,6 +97,7 @@ struct SettingsTable_Impl boolm_bNoLeading = false; OUStringm_sDecimalSymbol; OUStringm_sListSeparator; +std::vector> m_aDocVars; uno::Sequence m_pThemeFontLangProps; @@ -136,7 +139,6 @@ struct SettingsTable_Impl , m_pThemeFontLangProps(3) , m_pCurrentCompatSetting(3) {} - }; SettingsTable::SettingsTable(const DomainMapper& rDomainMapper) @@ -187,6 +189,12 @@ void SettingsTable::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_View_val: m_pImpl->m_nView = nIntValue; break; +case NS_ooxml::LN_CT_DocVar_name: +m_pImpl->m_aDocVars.back().first = sStringValue; +break; +case NS_ooxml::LN_CT_DocVar_val: +m_pImpl->m_aDocVars.back().second = sStringValue; +break; case NS_ooxml::LN_CT_CompatSetting_name: m_pImpl->m_pCurrentCompatSetting.getArray()[0] = comphelper::makePropertyValue("name", sStringValue); @@ -342,6 +350,25 @@ void SettingsTable::lcl_sprm(Sprm& rSprm) } } break; +case NS_ooxml::LN_CT_Settings_docVars:
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf150542.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport16.cxx| 21 + writerfilter/source/dmapper/SettingsTable.cxx | 58 +- writerfilter/source/ooxml/model.xml |3 + 4 files changed, 81 insertions(+), 1 deletion(-) New commits: commit 992d86b1b67a6bd28bbf5e63b2d2406881f476b7 Author: Vasily Melenchuk AuthorDate: Tue Mar 28 13:15:09 2023 +0300 Commit: Thorsten Behrens CommitDate: Fri Mar 31 12:57:59 2023 + tdf#150542: DOCX import: support for document varibles Writer does insert document variables only if they are in document body as DOCVARIABLE fields. But ones given in settings.xml (w:docVars/w:docVar) were ignored. Moreover variables in settings should have priority and overwrite ones in fields. Word by default does show only field results, but refreshing field values will override values with ones from settings. Change-Id: I7103c90eef59ab18f8a25e616dcf8a8b1c6dcb08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149646 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/ooxmlexport/data/tdf150542.docx b/sw/qa/extras/ooxmlexport/data/tdf150542.docx new file mode 100644 index ..3f115fa69370 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf150542.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 0394c03495a6..6d501548ad25 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -994,6 +994,27 @@ CPPUNIT_TEST_FIXTURE(Test, Test_ShadowDirection) "rotWithShape", "0"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf150542) +{ +loadAndSave("tdf150542.docx"); + +xmlDocUniquePtr pSettingsDoc = parseExport("word/settings.xml"); +// Ensure that all docvars from input are written back and with correct values. +// Order of document variables is not checked. So this can fail at some time if order is changed. +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[1]", "name", u"LocalChars\u00C1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0054\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070"); +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[1]", "val", u"Correct value (\u00E1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0020\u0074\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070)"); +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[2]", "name", "DocVar1"); +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[2]", "val", "DocVar1 Value"); +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[3]", "name", "DocVar3"); +assertXPath(pSettingsDoc, +"/w:settings/w:docVars/w:docVar[3]", "val", "DocVar3 Value"); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf139549) { loadAndSave("tdf139549.docx"); diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx index 45dc67b9f43b..d24dae617c01 100644 --- a/writerfilter/source/dmapper/SettingsTable.cxx +++ b/writerfilter/source/dmapper/SettingsTable.cxx @@ -26,6 +26,8 @@ #include #include +#include +#include #include #include #include @@ -95,6 +97,7 @@ struct SettingsTable_Impl boolm_bNoLeading = false; OUStringm_sDecimalSymbol; OUStringm_sListSeparator; +std::vector> m_aDocVars; uno::Sequence m_pThemeFontLangProps; @@ -136,7 +139,6 @@ struct SettingsTable_Impl , m_pThemeFontLangProps(3) , m_pCurrentCompatSetting(3) {} - }; SettingsTable::SettingsTable(const DomainMapper& rDomainMapper) @@ -187,6 +189,12 @@ void SettingsTable::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_View_val: m_pImpl->m_nView = nIntValue; break; +case NS_ooxml::LN_CT_DocVar_name: +m_pImpl->m_aDocVars.back().first = sStringValue; +break; +case NS_ooxml::LN_CT_DocVar_val: +m_pImpl->m_aDocVars.back().second = sStringValue; +break; case NS_ooxml::LN_CT_CompatSetting_name: m_pImpl->m_pCurrentCompatSetting.getArray()[0] = comphelper::makePropertyValue("name", sStringValue); @@ -342,6 +350,25 @@ void SettingsTable::lcl_sprm(Sprm& rSprm) } } break; +case NS_ooxml::LN_CT_Settings_docVars: +{ +writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); +if (pProperties) +{ +
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - compilerplugins/clang writerfilter/source
compilerplugins/clang/unusedenumconstants.writeonly.results |2 -- writerfilter/source/dmapper/DomainMapperTableHandler.cxx|9 ++--- writerfilter/source/dmapper/PropertyMap.hxx |1 - 3 files changed, 2 insertions(+), 10 deletions(-) New commits: commit d5ffc4d5feba3c72f5af688b65edbb0e280581b4 Author: Vasily Melenchuk AuthorDate: Thu Jan 5 18:32:39 2023 +0300 Commit: Thorsten Behrens CommitDate: Mon Jan 23 08:57:39 2023 + writerfilter: removed remains of GAP_HALF define and its usage Change-Id: I8dee16f923686f557c8213d9a7870392bd5fe9bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145090 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk (cherry picked from commit f011a13b3e9d3edf85fa8cb17d612934e589e672) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145943 Reviewed-by: Thorsten Behrens diff --git a/compilerplugins/clang/unusedenumconstants.writeonly.results b/compilerplugins/clang/unusedenumconstants.writeonly.results index e78ed74414cd..d88a2c0a3c16 100644 --- a/compilerplugins/clang/unusedenumconstants.writeonly.results +++ b/compilerplugins/clang/unusedenumconstants.writeonly.results @@ -5884,8 +5884,6 @@ writerfilter/source/dmapper/PropertyMap.hxx:563 enum writerfilter::dmapper::TablePropertyMap::TablePropertyMapTarget TABLE_WIDTH writerfilter/source/dmapper/PropertyMap.hxx:564 enum writerfilter::dmapper::TablePropertyMap::TablePropertyMapTarget TABLE_WIDTH_TYPE -writerfilter/source/dmapper/PropertyMap.hxx:565 -enum writerfilter::dmapper::TablePropertyMap::TablePropertyMapTarget GAP_HALF writerfilter/source/dmapper/PropertyMap.hxx:566 enum writerfilter::dmapper::TablePropertyMap::TablePropertyMapTarget LEFT_MARGIN writerfilter/source/dmapper/PropertyMap.hxx:567 diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 97fea78eba2a..58d96a9cd8f5 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -354,9 +354,6 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo if( m_aTableProperties ) { //create properties from the table attributes -//...pPropMap->Insert( PROP_LEFT_MARGIN, uno::makeAny( m_nLeftMargin - m_nGapHalf )); -//pPropMap->Insert( PROP_HORI_ORIENT, uno::makeAny( text::HoriOrientation::RIGHT )); -sal_Int32 nGapHalf = 0; sal_Int32 nLeftMargin = 0; comphelper::SequenceAsHashMap aGrabBag; @@ -509,8 +506,6 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo m_aTableProperties->Insert( PROP_TABLE_INTEROP_GRAB_BAG, uno::Any( aGrabBag.getAsConstPropertyValueList() ) ); } -m_aTableProperties->getValue( TablePropertyMap::GAP_HALF, nGapHalf ); - std::optional oLeftMarginFromStyle = m_aTableProperties->getProperty(PROP_LEFT_MARGIN); if (oLeftMarginFromStyle) { @@ -622,7 +617,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo if (0 < nMode && nMode <= 14 && rInfo.nNestLevel == 1) { -const sal_Int32 nAdjustedMargin = nLeftMargin - nGapHalf - rInfo.nLeftBorderDistance; +const sal_Int32 nAdjustedMargin = nLeftMargin - rInfo.nLeftBorderDistance; m_aTableProperties->Insert( PROP_LEFT_MARGIN, uno::Any( nAdjustedMargin ) ); } else @@ -632,7 +627,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo // so emulate that by adding the half the width. (also see docxattributeoutput) if ( rInfo.nNestLevel > 1 && nLeftMargin < 0 ) nLeftMargin = 0; -const sal_Int32 nAdjustedMargin = nLeftMargin - nGapHalf + (aLeftBorder.LineWidth / 2); +const sal_Int32 nAdjustedMargin = nLeftMargin + (aLeftBorder.LineWidth / 2); m_aTableProperties->Insert( PROP_LEFT_MARGIN, uno::Any( nAdjustedMargin ) ); } diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx index f9f66e3dcc0b..719233d1ee73 100644 --- a/writerfilter/source/dmapper/PropertyMap.hxx +++ b/writerfilter/source/dmapper/PropertyMap.hxx @@ -575,7 +575,6 @@ public: CELL_MAR_BOTTOM, TABLE_WIDTH, TABLE_WIDTH_TYPE, -GAP_HALF, LEFT_MARGIN, HORI_ORIENT, TablePropertyMapTarget_MAX
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf103956.rtf |8 + sw/qa/extras/rtfexport/rtfexport4.cxx | 37 writerfilter/source/rtftok/rtfdispatchvalue.cxx | 13 ++-- 3 files changed, 55 insertions(+), 3 deletions(-) New commits: commit 84aea0a29962cf11a63bdb550f522b3d5574cf64 Author: Vasily Melenchuk AuthorDate: Fri Jan 6 17:31:16 2023 +0300 Commit: Xisco Fauli CommitDate: Wed Jan 11 07:57:41 2023 + tdf#103956: RTF import: fix for \cellx0 or no params. If cell width is not given or zero lets not confuse it with too narrow cell. Lets keep zero to allow domain mapper define some width. This patch does not solves autofit issue completely, but finally tables with autofit are visible somehow and do not contain cells with minimal almost invisible width (41). Change-Id: I640228ed117f1d65dde9753a00b8403dda45dd40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145148 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk (cherry picked from commit 26d74a57d54327b9fd562065d04d867852ce8e8a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145227 Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/rtfexport/data/tdf103956.rtf b/sw/qa/extras/rtfexport/data/tdf103956.rtf new file mode 100644 index ..f41be5b54aba --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf103956.rtf @@ -0,0 +1,8 @@ +{\rtf\ansi\deff0 + +\trowd\trautofit0\cellx \cellx \pard \intbl 1 \cell \pard \intbl 2 \cell \row +\pard\par +\trowd\trautofit0\trgaph100\cellx0 \cellx0 \pard \intbl 1 \cell \pard \intbl 2 \cell \row +\pard\par +\trowd\trautofit0\cellx500 \cellx1000 \pard \intbl 1 \cell \pard \intbl 2 \cell \row +} \ No newline at end of file diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index c55c74a4f6b3..6912948c57db 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -784,6 +784,43 @@ DECLARE_RTFEXPORT_TEST(testTdf139948, "tdf139948.rtf") sal_uInt32(0), getProperty(getParagraph(5), "BottomBorder").LineWidth); } +DECLARE_RTFEXPORT_TEST(testTdf103956, "tdf103956.rtf") +{ +// Ensure that RTF tables without column width (\cellx or \cellx0) are displayed with some +// suitable width. Currently there is no good support for autofit for RTF docs, so ensure +// that table cells are somehow visible. Width for it is not clear, so here we will check +// table & cell widths are more than default minimal value of 41. +CPPUNIT_ASSERT_MESSAGE( +"Table #1 is too narrow!", +82 < parseDump("/root/page/body/tab[1]/row/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #1 cell#1 is too narrow!", +41 < parseDump("/root/page/body/tab[1]/row/cell[1]/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #1 cell#2 is too narrow!", +41 < parseDump("/root/page/body/tab[1]/row/cell[2]/infos/bounds", "width").toInt32()); + +CPPUNIT_ASSERT_MESSAGE( +"Table #2 is too narrow!", +82 < parseDump("/root/page/body/tab[2]/row/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #2 cell#1 is too narrow!", +41 < parseDump("/root/page/body/tab[2]/row/cell[1]/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #2 cell#2 is too narrow!", +41 < parseDump("/root/page/body/tab[2]/row/cell[2]/infos/bounds", "width").toInt32()); + +CPPUNIT_ASSERT_MESSAGE( +"Table #3 is too narrow!", +82 < parseDump("/root/page/body/tab[3]/row/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #3 cell#1 is too narrow!", +41 < parseDump("/root/page/body/tab[3]/row/cell[1]/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #3 cell#2 is too narrow!", +41 < parseDump("/root/page/body/tab[3]/row/cell[2]/infos/bounds", "width").toInt32()); +} + DECLARE_RTFEXPORT_TEST(testTdf148515, "tdf148515.rtf") { uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx index 2bea9dc9ec8f..a56d8e00d819 100644 --- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx +++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx @@ -393,10 +393,17 @@ bool RTFDocumentImpl::dispatchTableValue(RTFKeyword nKeyword, int nParam) ? m_nNestedCurrentCellX : m_nTopLevelCurrentCellX);
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf103956.rtf |8 + sw/qa/extras/rtfexport/rtfexport4.cxx | 37 writerfilter/source/rtftok/rtfdispatchvalue.cxx | 13 ++-- 3 files changed, 55 insertions(+), 3 deletions(-) New commits: commit 26d74a57d54327b9fd562065d04d867852ce8e8a Author: Vasily Melenchuk AuthorDate: Fri Jan 6 17:31:16 2023 +0300 Commit: Vasily Melenchuk CommitDate: Tue Jan 10 08:05:43 2023 + tdf#103956: RTF import: fix for \cellx0 or no params. If cell width is not given or zero lets not confuse it with too narrow cell. Lets keep zero to allow domain mapper define some width. This patch does not solves autofit issue completely, but finally tables with autofit are visible somehow and do not contain cells with minimal almost invisible width (41). Change-Id: I640228ed117f1d65dde9753a00b8403dda45dd40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145148 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/sw/qa/extras/rtfexport/data/tdf103956.rtf b/sw/qa/extras/rtfexport/data/tdf103956.rtf new file mode 100644 index ..f41be5b54aba --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf103956.rtf @@ -0,0 +1,8 @@ +{\rtf\ansi\deff0 + +\trowd\trautofit0\cellx \cellx \pard \intbl 1 \cell \pard \intbl 2 \cell \row +\pard\par +\trowd\trautofit0\trgaph100\cellx0 \cellx0 \pard \intbl 1 \cell \pard \intbl 2 \cell \row +\pard\par +\trowd\trautofit0\cellx500 \cellx1000 \pard \intbl 1 \cell \pard \intbl 2 \cell \row +} \ No newline at end of file diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index c55c74a4f6b3..6912948c57db 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -784,6 +784,43 @@ DECLARE_RTFEXPORT_TEST(testTdf139948, "tdf139948.rtf") sal_uInt32(0), getProperty(getParagraph(5), "BottomBorder").LineWidth); } +DECLARE_RTFEXPORT_TEST(testTdf103956, "tdf103956.rtf") +{ +// Ensure that RTF tables without column width (\cellx or \cellx0) are displayed with some +// suitable width. Currently there is no good support for autofit for RTF docs, so ensure +// that table cells are somehow visible. Width for it is not clear, so here we will check +// table & cell widths are more than default minimal value of 41. +CPPUNIT_ASSERT_MESSAGE( +"Table #1 is too narrow!", +82 < parseDump("/root/page/body/tab[1]/row/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #1 cell#1 is too narrow!", +41 < parseDump("/root/page/body/tab[1]/row/cell[1]/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #1 cell#2 is too narrow!", +41 < parseDump("/root/page/body/tab[1]/row/cell[2]/infos/bounds", "width").toInt32()); + +CPPUNIT_ASSERT_MESSAGE( +"Table #2 is too narrow!", +82 < parseDump("/root/page/body/tab[2]/row/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #2 cell#1 is too narrow!", +41 < parseDump("/root/page/body/tab[2]/row/cell[1]/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #2 cell#2 is too narrow!", +41 < parseDump("/root/page/body/tab[2]/row/cell[2]/infos/bounds", "width").toInt32()); + +CPPUNIT_ASSERT_MESSAGE( +"Table #3 is too narrow!", +82 < parseDump("/root/page/body/tab[3]/row/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #3 cell#1 is too narrow!", +41 < parseDump("/root/page/body/tab[3]/row/cell[1]/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_MESSAGE( +"Table #3 cell#2 is too narrow!", +41 < parseDump("/root/page/body/tab[3]/row/cell[2]/infos/bounds", "width").toInt32()); +} + DECLARE_RTFEXPORT_TEST(testTdf148515, "tdf148515.rtf") { uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx index 2bea9dc9ec8f..a56d8e00d819 100644 --- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx +++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx @@ -393,10 +393,17 @@ bool RTFDocumentImpl::dispatchTableValue(RTFKeyword nKeyword, int nParam) ? m_nNestedCurrentCellX : m_nTopLevelCurrentCellX); int nCellX = nParam - rCurrentCellX; -const int COL_DFLT_WIDTH -= 41; // sw/source/filter/inc/wrtswtbl.hxx, minimal possible width of
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf152784_1.rtf | 20 sw/qa/extras/rtfexport/rtfexport3.cxx |9 + writerfilter/source/rtftok/rtfsprm.cxx |4 ++-- 3 files changed, 31 insertions(+), 2 deletions(-) New commits: commit 588ff9a228f4894142264c68392ed1e9800a4d7d Author: Vasily Melenchuk AuthorDate: Tue Dec 27 15:31:37 2022 +0300 Commit: Miklos Vajna CommitDate: Tue Jan 10 07:15:00 2023 + tdf#152784: RTF import: more default paragraph params If numbering is not explicitly mentioned in para properties it should not be used from referred paragraph style. So default value of 0 (no numbering) is used by default. Change-Id: If8e8f2aaf19190f64a557444188f67b24a699b54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144839 Tested-by: Jenkins Reviewed-by: Miklos Vajna Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145195 diff --git a/sw/qa/extras/rtfexport/data/tdf152784_1.rtf b/sw/qa/extras/rtfexport/data/tdf152784_1.rtf new file mode 100644 index ..19dcaa36e4df --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf152784_1.rtf @@ -0,0 +1,20 @@ +{\rtf1 + +{\stylesheet +{\s3 \ls1\outlinelevel2 heading 3;}} +{\*\listtable +{\list\listtemplateid-374154644 +{\listlevel{\leveltext\'02\'00.;}{\levelnumbers\'01;}} +{\listlevel{\leveltext\'02\'01.;}{\levelnumbers\'01;}} +{\listlevel{\leveltext\'02\'02.;}{\levelnumbers\'01;}} +{\listname ;}\listid773479173} +} +{\*\listoverridetable +{\listoverride\listid773479173\listoverridecount0\ls1} +} + +\pard\s3 Here should be no numbering! +\par + +} + diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 5cbf173d35fb..8fcddf78dbb6 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -544,6 +544,15 @@ DECLARE_RTFEXPORT_TEST(testInvalidParagraphStyle, "invalidParagraphStyle.rtf") CPPUNIT_ASSERT_EQUAL(style::NumberingType::ARABIC, numFormat); } +DECLARE_RTFEXPORT_TEST(testTdf152784_1, "tdf152784_1.rtf") +{ +// Ensure that paragraph having style with numbering does not have numbering +// since it is not explitly defined in paragraph properties +uno::Reference xPara(getParagraph(1, "Here should be no numbering!"), + uno::UNO_QUERY); +CPPUNIT_ASSERT(getProperty(xPara, "NumberingStyleName").isEmpty()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx index 90bc97001d27..7a3e4d454687 100644 --- a/writerfilter/source/rtftok/rtfsprm.cxx +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -192,13 +192,13 @@ static RTFValue::Pointer_t getDefaultSPRM(Id const id, Id nStyleType) case NS_ooxml::LN_CT_Ind_right: case NS_ooxml::LN_CT_Ind_firstLine: return new RTFValue(0); - case NS_ooxml::LN_CT_Spacing_lineRule: return new RTFValue(NS_ooxml::LN_Value_doc_ST_LineSpacingRule_auto); case NS_ooxml::LN_CT_Spacing_line: // presumably this means 100%, cf. static const int nSingleLineSpacing = 240; return new RTFValue(240); - +case NS_ooxml::LN_CT_NumPr_numId: +return new RTFValue(0); case NS_ooxml::LN_CT_PrBase_pBdr: { // tdf#150382 default all paragraph borders to none RTFSprms attributes;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf148578.rtf| 12 sw/qa/extras/rtfexport/rtfexport3.cxx| 21 +++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx |5 --- 3 files changed, 34 insertions(+), 4 deletions(-) New commits: commit 78e91fd2bf7fe7d92020e7d9d9a2c6c25c8da830 Author: Vasily Melenchuk AuthorDate: Thu Jan 5 18:17:12 2023 +0300 Commit: Thorsten Behrens CommitDate: Mon Jan 9 23:45:03 2023 + tdf#148578: Do not apply table shift for RTF Table shift based on cell lect margin should be applied for DOCX (earlier compat options) but not actual for RTF. Maybe earlier RTF version did behave this way, but nowadays this behavior does not match MS Word 365. Change-Id: Icdc4fa6298167fe5f263c85164d7c4c4176be25f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145088 Tested-by: Jenkins Reviewed-by: Thorsten Behrens Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145196 diff --git a/sw/qa/extras/rtfexport/data/tdf148578.rtf b/sw/qa/extras/rtfexport/data/tdf148578.rtf new file mode 100644 index ..256d63898770 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf148578.rtf @@ -0,0 +1,12 @@ +{\rtf1 + +\trowd +\trgaph567 +\cellx1851 +\cellx9206 +\pard\plain\intbl 1000\cell +\pard\plain\intbl XX_XX_XXX1\cell +\row + +\pard +} diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 6c1a4d524b7f..5cbf173d35fb 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -514,6 +514,27 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127806) CPPUNIT_ASSERT_EQUAL(static_cast(635), aSize.Width); } +DECLARE_RTFEXPORT_TEST(testTdf148578, "tdf148578.rtf") +{ +// \trgaph567 should affect only table cell margings (~1cm), +// but do not shift table, since \trleft is not provided +uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); + +CPPUNIT_ASSERT_EQUAL(static_cast(0), getProperty(xTable, "LeftMargin")); + +uno::Reference xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(static_cast(1000), + getProperty(xCell, "LeftBorderDistance")); +CPPUNIT_ASSERT_EQUAL(static_cast(1000), + getProperty(xCell, "RightBorderDistance")); + +xCell.set(xTable->getCellByName("B1"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(static_cast(1000), + getProperty(xCell, "LeftBorderDistance")); +CPPUNIT_ASSERT_EQUAL(static_cast(1000), + getProperty(xCell, "RightBorderDistance")); +} + DECLARE_RTFEXPORT_TEST(testInvalidParagraphStyle, "invalidParagraphStyle.rtf") { // Given test has character style #30, but referred as paragraph style #30 diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 2e962260c79c..97fea78eba2a 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -618,12 +618,9 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo // tdf#106742: since MS Word 2013 (compatibilityMode >= 15), top-level tables are handled the same as nested tables; // the default behavior when DOCX doesn't define "compatibilityMode" option is to add the cell spacing - -// Undefined should not be possible any more for DOCX, but it is for RTF. -// In any case, continue to treat undefined as version 12 during import. sal_Int32 nMode = m_rDMapper_Impl.GetSettingsTable()->GetWordCompatibilityMode(); -if (((nMode < 0) || (0 < nMode && nMode <= 14)) && rInfo.nNestLevel == 1) +if (0 < nMode && nMode <= 14 && rInfo.nNestLevel == 1) { const sal_Int32 nAdjustedMargin = nLeftMargin - nGapHalf - rInfo.nLeftBorderDistance; m_aTableProperties->Insert( PROP_LEFT_MARGIN, uno::Any( nAdjustedMargin ) );
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/invalidParagraphStyle.rtf | 14 ++ sw/qa/extras/rtfexport/rtfexport3.cxx |9 + writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 +- 3 files changed, 32 insertions(+), 1 deletion(-) New commits: commit 466cc615de49a646c82af14657a05e240e4a640c Author: Vasily Melenchuk AuthorDate: Wed Dec 28 23:52:10 2022 +0300 Commit: Thorsten Behrens CommitDate: Mon Jan 9 23:44:41 2023 + ms format import: better handling for invalid styles If referred paragraph style is not found or it is not a paragraph style, this can lead to exceptions in writer core and thus current paragraph can be not corretly initialized. For example, numbering can be not applied because of exception of not found style earlier. This is not a critical error, we should just not apply a style we could not resolve. Of course such documents are invalid but bit more tolerance to errors will not harm. Change-Id: I9150786e6357a7d6098440bac29ec501fc6aa802 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144852 Tested-by: Jenkins Reviewed-by: Thorsten Behrens Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145194 diff --git a/sw/qa/extras/rtfexport/data/invalidParagraphStyle.rtf b/sw/qa/extras/rtfexport/data/invalidParagraphStyle.rtf new file mode 100644 index ..cb5ec80eb3cf --- /dev/null +++ b/sw/qa/extras/rtfexport/data/invalidParagraphStyle.rtf @@ -0,0 +1,14 @@ +{\rtf1 + +{\stylesheet +{\cs30\fs72 Super Duper Style;}} + +{\*\listtable +{\list +{\listlevel\levelstartat1{\leveltext\'02\'00.;}{\levelnumbers\'01;}} +{\listname ;}\listid1235362366}} +{\*\listoverridetable{\listoverride\listid1235362366\listoverridecount0\ls1}} + +\pard\s30\ls1\fs24 AAA BBB CCC\par + +} diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 90adb69f2bf7..6c1a4d524b7f 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -514,6 +514,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127806) CPPUNIT_ASSERT_EQUAL(static_cast(635), aSize.Width); } +DECLARE_RTFEXPORT_TEST(testInvalidParagraphStyle, "invalidParagraphStyle.rtf") +{ +// Given test has character style #30, but referred as paragraph style #30 +// This was causing exception in finishParagraph(), so numbering and other +// properties were not applied. Ensure numbering is still here +sal_Int16 numFormat = getNumberingTypeOfParagraph(1); +CPPUNIT_ASSERT_EQUAL(style::NumberingType::ARABIC, numFormat); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index f0fbd05209c5..bcfcbc7c72dd 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1934,13 +1934,21 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con #endif const StyleSheetEntryPtr pEntry = GetStyleSheetTable()->FindStyleSheetByConvertedStyleName( GetCurrentParaStyleName() ); -OSL_ENSURE( pEntry, "no style sheet found" ); +SAL_WARN_IF(!pEntry, "writerfilter.dmapper", "no style sheet found"); const StyleSheetPropertyMap* pStyleSheetProperties = pEntry ? pEntry->pProperties.get() : nullptr; sal_Int32 nListId = pParaContext ? pParaContext->props().GetListId() : -1; bool isNumberingViaStyle(false); bool isNumberingViaRule = nListId > -1; if ( !bRemove && pStyleSheetProperties && pParaContext ) { +if (!pEntry || pEntry->nStyleTypeCode != StyleType::STYLE_TYPE_PARA) { +// We could not resolve paragraph style or it is not a paragraph style +// Remove this style reference, otherwise it will cause exceptions during further +// processing and not all paragraph styles will be initialized. +SAL_WARN("writerfilter.dmapper", "Paragraph style is incorrect. Ignored"); +pParaContext->Erase(PROP_PARA_STYLE_NAME); +} + bool bNumberingFromBaseStyle = false; if (!isNumberingViaRule) nListId = lcl_getListId(pEntry, GetStyleSheetTable(), bNumberingFromBaseStyle);
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf148578.rtf| 12 sw/qa/extras/rtfexport/rtfexport3.cxx| 21 +++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx |5 --- 3 files changed, 34 insertions(+), 4 deletions(-) New commits: commit 788cc6ff3b186ceb8f265e53b5482f808f6536f4 Author: Vasily Melenchuk AuthorDate: Thu Jan 5 18:17:12 2023 +0300 Commit: Thorsten Behrens CommitDate: Mon Jan 9 07:54:51 2023 + tdf#148578: Do not apply table shift for RTF Table shift based on cell lect margin should be applied for DOCX (earlier compat options) but not actual for RTF. Maybe earlier RTF version did behave this way, but nowadays this behavior does not match MS Word 365. Change-Id: Icdc4fa6298167fe5f263c85164d7c4c4176be25f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145088 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/rtfexport/data/tdf148578.rtf b/sw/qa/extras/rtfexport/data/tdf148578.rtf new file mode 100644 index ..256d63898770 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf148578.rtf @@ -0,0 +1,12 @@ +{\rtf1 + +\trowd +\trgaph567 +\cellx1851 +\cellx9206 +\pard\plain\intbl 1000\cell +\pard\plain\intbl XX_XX_XXX1\cell +\row + +\pard +} diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 55f5a0362174..a79e92814222 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -514,6 +514,27 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127806) CPPUNIT_ASSERT_EQUAL(static_cast(635), aSize.Width); } +DECLARE_RTFEXPORT_TEST(testTdf148578, "tdf148578.rtf") +{ +// \trgaph567 should affect only table cell margings (~1cm), +// but do not shift table, since \trleft is not provided +uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); + +CPPUNIT_ASSERT_EQUAL(static_cast(0), getProperty(xTable, "LeftMargin")); + +uno::Reference xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(static_cast(1000), + getProperty(xCell, "LeftBorderDistance")); +CPPUNIT_ASSERT_EQUAL(static_cast(1000), + getProperty(xCell, "RightBorderDistance")); + +xCell.set(xTable->getCellByName("B1"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(static_cast(1000), + getProperty(xCell, "LeftBorderDistance")); +CPPUNIT_ASSERT_EQUAL(static_cast(1000), + getProperty(xCell, "RightBorderDistance")); +} + DECLARE_RTFEXPORT_TEST(testInvalidParagraphStyle, "invalidParagraphStyle.rtf") { // Given test has character style #30, but referred as paragraph style #30 diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 47a2424c298a..58d96a9cd8f5 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -613,12 +613,9 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo // tdf#106742: since MS Word 2013 (compatibilityMode >= 15), top-level tables are handled the same as nested tables; // the default behavior when DOCX doesn't define "compatibilityMode" option is to add the cell spacing - -// Undefined should not be possible any more for DOCX, but it is for RTF. -// In any case, continue to treat undefined as version 12 during import. sal_Int32 nMode = m_rDMapper_Impl.GetSettingsTable()->GetWordCompatibilityMode(); -if (((nMode < 0) || (0 < nMode && nMode <= 14)) && rInfo.nNestLevel == 1) +if (0 < nMode && nMode <= 14 && rInfo.nNestLevel == 1) { const sal_Int32 nAdjustedMargin = nLeftMargin - rInfo.nLeftBorderDistance; m_aTableProperties->Insert( PROP_LEFT_MARGIN, uno::Any( nAdjustedMargin ) );
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf152784_1.rtf | 20 sw/qa/extras/rtfexport/rtfexport3.cxx |9 + writerfilter/source/rtftok/rtfsprm.cxx |4 ++-- 3 files changed, 31 insertions(+), 2 deletions(-) New commits: commit e8d18b471ea5063bc0b2c94afc1b94017e8e66bc Author: Vasily Melenchuk AuthorDate: Tue Dec 27 15:31:37 2022 +0300 Commit: Miklos Vajna CommitDate: Fri Jan 6 14:47:23 2023 + tdf#152784: RTF import: more default paragraph params If numbering is not explicitly mentioned in para properties it should not be used from referred paragraph style. So default value of 0 (no numbering) is used by default. Change-Id: If8e8f2aaf19190f64a557444188f67b24a699b54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144839 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/rtfexport/data/tdf152784_1.rtf b/sw/qa/extras/rtfexport/data/tdf152784_1.rtf new file mode 100644 index ..19dcaa36e4df --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf152784_1.rtf @@ -0,0 +1,20 @@ +{\rtf1 + +{\stylesheet +{\s3 \ls1\outlinelevel2 heading 3;}} +{\*\listtable +{\list\listtemplateid-374154644 +{\listlevel{\leveltext\'02\'00.;}{\levelnumbers\'01;}} +{\listlevel{\leveltext\'02\'01.;}{\levelnumbers\'01;}} +{\listlevel{\leveltext\'02\'02.;}{\levelnumbers\'01;}} +{\listname ;}\listid773479173} +} +{\*\listoverridetable +{\listoverride\listid773479173\listoverridecount0\ls1} +} + +\pard\s3 Here should be no numbering! +\par + +} + diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 6c1a4d524b7f..f12ab74bef59 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -523,6 +523,15 @@ DECLARE_RTFEXPORT_TEST(testInvalidParagraphStyle, "invalidParagraphStyle.rtf") CPPUNIT_ASSERT_EQUAL(style::NumberingType::ARABIC, numFormat); } +DECLARE_RTFEXPORT_TEST(testTdf152784_1, "tdf152784_1.rtf") +{ +// Ensure that paragraph having style with numbering does not have numbering +// since it is not explitly defined in paragraph properties +uno::Reference xPara(getParagraph(1, "Here should be no numbering!"), + uno::UNO_QUERY); +CPPUNIT_ASSERT(getProperty(xPara, "NumberingStyleName").isEmpty()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx index 90bc97001d27..7a3e4d454687 100644 --- a/writerfilter/source/rtftok/rtfsprm.cxx +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -192,13 +192,13 @@ static RTFValue::Pointer_t getDefaultSPRM(Id const id, Id nStyleType) case NS_ooxml::LN_CT_Ind_right: case NS_ooxml::LN_CT_Ind_firstLine: return new RTFValue(0); - case NS_ooxml::LN_CT_Spacing_lineRule: return new RTFValue(NS_ooxml::LN_Value_doc_ST_LineSpacingRule_auto); case NS_ooxml::LN_CT_Spacing_line: // presumably this means 100%, cf. static const int nSingleLineSpacing = 240; return new RTFValue(240); - +case NS_ooxml::LN_CT_NumPr_numId: +return new RTFValue(0); case NS_ooxml::LN_CT_PrBase_pBdr: { // tdf#150382 default all paragraph borders to none RTFSprms attributes;
[Libreoffice-commits] core.git: compilerplugins/clang writerfilter/source
compilerplugins/clang/unusedenumconstants.writeonly.results |2 -- writerfilter/source/dmapper/DomainMapperTableHandler.cxx|9 ++--- writerfilter/source/dmapper/PropertyMap.hxx |1 - 3 files changed, 2 insertions(+), 10 deletions(-) New commits: commit f011a13b3e9d3edf85fa8cb17d612934e589e672 Author: Vasily Melenchuk AuthorDate: Thu Jan 5 18:32:39 2023 +0300 Commit: Vasily Melenchuk CommitDate: Fri Jan 6 07:26:15 2023 + writerfilter: removed remains of GAP_HALF define and its usage Change-Id: I8dee16f923686f557c8213d9a7870392bd5fe9bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145090 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/compilerplugins/clang/unusedenumconstants.writeonly.results b/compilerplugins/clang/unusedenumconstants.writeonly.results index e78ed74414cd..d88a2c0a3c16 100644 --- a/compilerplugins/clang/unusedenumconstants.writeonly.results +++ b/compilerplugins/clang/unusedenumconstants.writeonly.results @@ -5884,8 +5884,6 @@ writerfilter/source/dmapper/PropertyMap.hxx:563 enum writerfilter::dmapper::TablePropertyMap::TablePropertyMapTarget TABLE_WIDTH writerfilter/source/dmapper/PropertyMap.hxx:564 enum writerfilter::dmapper::TablePropertyMap::TablePropertyMapTarget TABLE_WIDTH_TYPE -writerfilter/source/dmapper/PropertyMap.hxx:565 -enum writerfilter::dmapper::TablePropertyMap::TablePropertyMapTarget GAP_HALF writerfilter/source/dmapper/PropertyMap.hxx:566 enum writerfilter::dmapper::TablePropertyMap::TablePropertyMapTarget LEFT_MARGIN writerfilter/source/dmapper/PropertyMap.hxx:567 diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 2e962260c79c..47a2424c298a 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -354,9 +354,6 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo if( m_aTableProperties ) { //create properties from the table attributes -//...pPropMap->Insert( PROP_LEFT_MARGIN, uno::makeAny( m_nLeftMargin - m_nGapHalf )); -//pPropMap->Insert( PROP_HORI_ORIENT, uno::makeAny( text::HoriOrientation::RIGHT )); -sal_Int32 nGapHalf = 0; sal_Int32 nLeftMargin = 0; comphelper::SequenceAsHashMap aGrabBag; @@ -509,8 +506,6 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo m_aTableProperties->Insert( PROP_TABLE_INTEROP_GRAB_BAG, uno::Any( aGrabBag.getAsConstPropertyValueList() ) ); } -m_aTableProperties->getValue( TablePropertyMap::GAP_HALF, nGapHalf ); - std::optional oLeftMarginFromStyle = m_aTableProperties->getProperty(PROP_LEFT_MARGIN); if (oLeftMarginFromStyle) { @@ -625,7 +620,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo if (((nMode < 0) || (0 < nMode && nMode <= 14)) && rInfo.nNestLevel == 1) { -const sal_Int32 nAdjustedMargin = nLeftMargin - nGapHalf - rInfo.nLeftBorderDistance; +const sal_Int32 nAdjustedMargin = nLeftMargin - rInfo.nLeftBorderDistance; m_aTableProperties->Insert( PROP_LEFT_MARGIN, uno::Any( nAdjustedMargin ) ); } else @@ -635,7 +630,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo // so emulate that by adding the half the width. (also see docxattributeoutput) if ( rInfo.nNestLevel > 1 && nLeftMargin < 0 ) nLeftMargin = 0; -const sal_Int32 nAdjustedMargin = nLeftMargin - nGapHalf + (aLeftBorder.LineWidth / 2); +const sal_Int32 nAdjustedMargin = nLeftMargin + (aLeftBorder.LineWidth / 2); m_aTableProperties->Insert( PROP_LEFT_MARGIN, uno::Any( nAdjustedMargin ) ); } diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx index f9f66e3dcc0b..719233d1ee73 100644 --- a/writerfilter/source/dmapper/PropertyMap.hxx +++ b/writerfilter/source/dmapper/PropertyMap.hxx @@ -575,7 +575,6 @@ public: CELL_MAR_BOTTOM, TABLE_WIDTH, TABLE_WIDTH_TYPE, -GAP_HALF, LEFT_MARGIN, HORI_ORIENT, TablePropertyMapTarget_MAX
[Libreoffice-commits] core.git: officecfg/registry sfx2/source sw/CppunitTest_sw_odfimport.mk sw/qa
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 125 sfx2/source/doc/docmacromode.cxx | 57 + sw/CppunitTest_sw_odfimport.mk |8 sw/qa/extras/odfimport/data/ZoneMacroTest.odt |binary sw/qa/extras/odfimport/odfimport.cxx | 130 + 5 files changed, 320 insertions(+) New commits: commit b22bbfa25ab1f0b9cfa1dedc85b8f9874f0a5e5b Author: Vasily Melenchuk AuthorDate: Mon Dec 5 20:32:41 2022 +0300 Commit: Thorsten Behrens CommitDate: Fri Dec 30 04:24:27 2022 + Related: tdf#125093 Check Windows Security Zones for macros In Windows, files get assigned security zones (local, from intranet, from internet, etc) after download via browser or email client. This is used by MS Word to decide in which mode it is safe to open file. This patch implements basic support for similar feature: by default there are no changes in macro behavior. But it is possible to use expert configuration options to tweak default behavior, and for example disable macros automatically, if a file is downloaded from Internet or other unsafe locations. Change-Id: I0bf1ae4e54d75dd5d07cab309124a67a85ef2d4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143680 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 023ed391bfe1..f333657151f5 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -2814,6 +2814,131 @@ List with trusted authors. + + +Contains security settings regarding Basic scripts. + + + + Action needed for opening document with macro with Windows zone + identifier URLZONE_LOCAL_MACHINE (0, local machine). + + + + + Ask + + + + + Allow + + + + + Deny + + + +0 + + + + Action needed for opening document with macro with Windows zone + identifier URLZONE_INTRANET (1, local machine). + + + + + Ask + + + + + Allow + + + + + Deny + + + +0 + + + + Action needed for opening document with macro with Windows zone + identifier URLZONE_TRUSTED (2, trusted). + + + + + Ask + + + + + Allow + + + + + Deny + + + +0 + + + + Action needed for opening document with macro with Windows zone + identifier URLZONE_INTERNET (3, internet). + + + + + Ask + + + + + Allow + + + + + Deny + + + +0 + + + + Action needed for opening document with macro with Windows zone + identifier URLZONE_UNTRUSTED (3, untrusted source). + + + + + Ask + + + + + Allow + + + + + Deny + + + +0 + + diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index bdae350b22f5..cbd720132323 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -38,6 +38,10 @@ #include #include +#if defined(_WIN32) +#include +#include +#endif namespace sfx2 { @@ -284,6 +288,59 @@ namespace sfx2 } } +#if defined(_WIN32) +// Windows specific: try to decide macros loading depending on Windows Security Zones
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/invalidParagraphStyle.rtf | 14 ++ sw/qa/extras/rtfexport/rtfexport3.cxx |9 + writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 +- 3 files changed, 32 insertions(+), 1 deletion(-) New commits: commit d5a9722874871576b864feb7bd815f9f8bfaac48 Author: Vasily Melenchuk AuthorDate: Wed Dec 28 23:52:10 2022 +0300 Commit: Thorsten Behrens CommitDate: Thu Dec 29 22:39:55 2022 + ms format import: better handling for invalid styles If referred paragraph style is not found or it is not a paragraph style, this can lead to exceptions in writer core and thus current paragraph can be not corretly initialized. For example, numbering can be not applied because of exception of not found style earlier. This is not a critical error, we should just not apply a style we could not resolve. Of course such documents are invalid but bit more tolerance to errors will not harm. Change-Id: I9150786e6357a7d6098440bac29ec501fc6aa802 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144852 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/rtfexport/data/invalidParagraphStyle.rtf b/sw/qa/extras/rtfexport/data/invalidParagraphStyle.rtf new file mode 100644 index ..cb5ec80eb3cf --- /dev/null +++ b/sw/qa/extras/rtfexport/data/invalidParagraphStyle.rtf @@ -0,0 +1,14 @@ +{\rtf1 + +{\stylesheet +{\cs30\fs72 Super Duper Style;}} + +{\*\listtable +{\list +{\listlevel\levelstartat1{\leveltext\'02\'00.;}{\levelnumbers\'01;}} +{\listname ;}\listid1235362366}} +{\*\listoverridetable{\listoverride\listid1235362366\listoverridecount0\ls1}} + +\pard\s30\ls1\fs24 AAA BBB CCC\par + +} diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 90adb69f2bf7..6c1a4d524b7f 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -514,6 +514,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127806) CPPUNIT_ASSERT_EQUAL(static_cast(635), aSize.Width); } +DECLARE_RTFEXPORT_TEST(testInvalidParagraphStyle, "invalidParagraphStyle.rtf") +{ +// Given test has character style #30, but referred as paragraph style #30 +// This was causing exception in finishParagraph(), so numbering and other +// properties were not applied. Ensure numbering is still here +sal_Int16 numFormat = getNumberingTypeOfParagraph(1); +CPPUNIT_ASSERT_EQUAL(style::NumberingType::ARABIC, numFormat); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 377c133c8192..668f7f6758fe 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1946,13 +1946,21 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con #endif const StyleSheetEntryPtr pEntry = GetStyleSheetTable()->FindStyleSheetByConvertedStyleName( GetCurrentParaStyleName() ); -OSL_ENSURE( pEntry, "no style sheet found" ); +SAL_WARN_IF(!pEntry, "writerfilter.dmapper", "no style sheet found"); const StyleSheetPropertyMap* pStyleSheetProperties = pEntry ? pEntry->pProperties.get() : nullptr; sal_Int32 nListId = pParaContext ? pParaContext->props().GetListId() : -1; bool isNumberingViaStyle(false); bool isNumberingViaRule = nListId > -1; if ( !bRemove && pStyleSheetProperties && pParaContext ) { +if (!pEntry || pEntry->nStyleTypeCode != StyleType::STYLE_TYPE_PARA) { +// We could not resolve paragraph style or it is not a paragraph style +// Remove this style reference, otherwise it will cause exceptions during further +// processing and not all paragraph styles will be initialized. +SAL_WARN("writerfilter.dmapper", "Paragraph style is incorrect. Ignored"); +pParaContext->Erase(PROP_PARA_STYLE_NAME); +} + bool bNumberingFromBaseStyle = false; if (!isNumberingViaRule) nListId = lcl_getListId(pEntry, GetStyleSheetTable(), bNumberingFromBaseStyle);
[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - officecfg/registry sfx2/source
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 125 + sfx2/source/doc/docmacromode.cxx | 54 + 2 files changed, 179 insertions(+) New commits: commit a8017a020430857524138ff0ee72c425e8c7486d Author: Vasily Melenchuk AuthorDate: Mon Dec 5 20:32:41 2022 +0300 Commit: Thorsten Behrens CommitDate: Wed Dec 7 07:33:52 2022 + Support for Windows Security Zones for macro enable/disable In Windows, files have security zones (local, from intranet, from internet, etc) used by MS Word to decide in which mode it is safe to open file. This patch implements basic support for similar feature: it is now possible to use expert configuration options to set up default behavior and configure for example automatic disabling of macros, if a file is downloaded from Internet or other unsafe location. Changed defaults: files from untrusted zones, or the internet, get macros disabled unconditionally. Can be overridden via officecfg::Office::Common::Security::Scripting::WindowsSecurityZone.* in the expert config dialog. Change-Id: I0bf1ae4e54d75dd5d07cab309124a67a85ef2d4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143750 Tested-by: Thorsten Behrens Reviewed-by: Thorsten Behrens diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index e57d26ab3366..75416223f135 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -2751,6 +2751,131 @@ List with trusted authors. + + +Contains security settings regarding Basic scripts. + + + + Action needed for opening document with macro with Windows zone + identifier URLZONE_LOCAL_MACHINE (0, local machine). + + + + + Ask + + + + + Allow + + + + + Deny + + + +0 + + + + Action needed for opening document with macro with Windows zone + identifier URLZONE_INTRANET (1, local machine). + + + + + Ask + + + + + Allow + + + + + Deny + + + +0 + + + + Action needed for opening document with macro with Windows zone + identifier URLZONE_TRUSTED (2, trusted). + + + + + Ask + + + + + Allow + + + + + Deny + + + +0 + + + + Action needed for opening document with macro with Windows zone + identifier URLZONE_INTERNET (3, internet). + + + + + Ask + + + + + Allow + + + + + Deny + + + +2 + + + + Action needed for opening document with macro with Windows zone + identifier URLZONE_UNTRUSTED (3, untrusted source). + + + + + Ask + + + + + Allow + + + + + Deny + + + +2 + + diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index 2fa7b968fc41..4d15ad30cb01 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -40,6 +40,10 @@ #include #include +#if defined(_WIN32) +#include +#include +#endif namespace sfx2 { @@ -288,6 +292,56 @@ namespace sfx2 } } +#if defined(_WIN32) +// Windows specific: try to decide macros loading depending on Windows Security Zones +// (file is local, or it was downloaded from internet, etc
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf151912.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport18.cxx |5 +++ writerfilter/source/dmapper/SdtHelper.cxx| 36 --- 3 files changed, 32 insertions(+), 9 deletions(-) New commits: commit b15c82e02c0a97d3523b6e46cb4ba4c958ea38d0 Author: Vasily Melenchuk AuthorDate: Tue Nov 8 14:55:40 2022 +0300 Commit: Vasily Melenchuk CommitDate: Mon Nov 14 09:20:42 2022 +0100 tdf#151912: sw: suppress exceptions during SDT evluation Failure in XPath processing during retrieving fresh value from data source is not a critical problem and should not cancel document loading. Just put warning in log and continue to eval further. Change-Id: I76ecf0e0e227f46a270db3e77d86c19f7e9ad21a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142428 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/sw/qa/extras/ooxmlexport/data/tdf151912.docx b/sw/qa/extras/ooxmlexport/data/tdf151912.docx new file mode 100644 index ..65e8d5a93f87 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf151912.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index 1ce78f262eef..6f76391d75dd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -101,6 +101,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149551_mongolianVert) assertXPath(pXmlDoc, "//wps:bodyPr", "vert", "mongolianVert"); } +DECLARE_OOXMLEXPORT_TEST(testTdf151912, "tdf151912.docx") +{ +// For now just ensure roundtrip is successful +} + DECLARE_OOXMLEXPORT_TEST(testTdf147724, "tdf147724.docx") { const auto& pLayout = parseLayoutDump(); diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index d8f48ef7ffe2..cf86a629219b 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include namespace writerfilter::dmapper @@ -225,25 +226,42 @@ std::optional SdtHelper::getValueFromDataBinding() const auto& aSourceIt = m_xPropertiesXMLs.find(m_sDataBindingStoreItemID); if (aSourceIt != m_xPropertiesXMLs.end()) { -uno::Reference xResult -= xXpathAPI->eval(aSourceIt->second, m_sDataBindingXPath); +try +{ +uno::Reference xResult += xXpathAPI->eval(aSourceIt->second, m_sDataBindingXPath); -if (xResult.is() && xResult->getNodeList() && xResult->getNodeList()->getLength() -&& xResult->getString().getLength()) +if (xResult.is() && xResult->getNodeList() && xResult->getNodeList()->getLength() +&& xResult->getString().getLength()) +{ +return xResult->getString(); +} +} +catch (const XPathException& e) { -return xResult->getString(); +// XPath failed? Log and continue with next data document +SAL_WARN("writerfilter", "SdtHelper::failed running XPath: " << e.Message); } } // Nothing found? Try to iterate storages and eval xpath for (const auto& aSource : m_xPropertiesXMLs) { -uno::Reference xResult = xXpathAPI->eval(aSource.second, m_sDataBindingXPath); +try +{ +uno::Reference xResult += xXpathAPI->eval(aSource.second, m_sDataBindingXPath); -if (xResult.is() && xResult->getNodeList() && xResult->getNodeList()->getLength() -&& xResult->getString().getLength()) +if (xResult.is() && xResult->getNodeList() && xResult->getNodeList()->getLength() +&& xResult->getString().getLength()) +{ +return xResult->getString(); +} +} +catch (const XPathException& e) { -return xResult->getString(); +// XPath failed? Log and continue with next data document +SAL_WARN("writerfilter", "SdtHelper::failed running XPath: " << e.Message); } }
[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - 2 commits - external/poppler sdext/source
external/poppler/StaticLibrary_poppler.mk |5 external/poppler/UnpackedTarball_poppler.mk |6 external/poppler/poppler-vs2015-buildfix.patch.1 | 1707 ++ sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | 30 sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx| 10 5 files changed, 1757 insertions(+), 1 deletion(-) New commits: commit cbbfa1f5ad26eee61f3b4d0e8628fc278f86b638 Author: Vasily Melenchuk AuthorDate: Mon Sep 19 09:31:04 2022 +0200 Commit: Thorsten Behrens CommitDate: Sat Oct 29 15:13:02 2022 +0200 Fix poppler 22.09.0 for winodws VS2015 misses a few c++11 features, patch them out. Change-Id: Iba1faaefb03275e944bf577ec3abe1b4275f9869 diff --git a/external/poppler/StaticLibrary_poppler.mk b/external/poppler/StaticLibrary_poppler.mk index 7eb541650373..cc43e873c4f2 100644 --- a/external/poppler/StaticLibrary_poppler.mk +++ b/external/poppler/StaticLibrary_poppler.mk @@ -11,7 +11,10 @@ $(eval $(call gb_StaticLibrary_StaticLibrary,poppler)) $(eval $(call gb_StaticLibrary_use_unpacked,poppler,poppler)) -$(eval $(call gb_StaticLibrary_use_external,poppler,libjpeg)) +$(eval $(call gb_StaticLibrary_use_externals,poppler,\ +libjpeg \ +boost_headers \ +)) $(eval $(call gb_StaticLibrary_set_warnings_not_errors,poppler)) diff --git a/external/poppler/UnpackedTarball_poppler.mk b/external/poppler/UnpackedTarball_poppler.mk index c08daa992060..ca7989c5ecaa 100644 --- a/external/poppler/UnpackedTarball_poppler.mk +++ b/external/poppler/UnpackedTarball_poppler.mk @@ -20,6 +20,12 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\ external/poppler/gcc7-EntityInfo.patch.1 \ )) +ifeq ($(OS),WNT) +$(eval $(call gb_UnpackedTarball_add_patches,poppler,\ + external/poppler/poppler-vs2015-buildfix.patch.1 \ +)) +endif + # std::make_unique is only available in C++14 # use "env -i" to avoid Cygwin "environment is too large for exec" # Mac OS X sed says "sed: RE error: illegal byte sequence"; Apple clang should diff --git a/external/poppler/poppler-vs2015-buildfix.patch.1 b/external/poppler/poppler-vs2015-buildfix.patch.1 new file mode 100644 index ..573eae32f7b1 --- /dev/null +++ b/external/poppler/poppler-vs2015-buildfix.patch.1 @@ -0,0 +1,1707 @@ +Remove a few c++11-isms to fix build on VS201 + +diff -ur workdir/UnpackedTrball/poppler/glib/poppler-document.cc poppler/glib/poppler-document.cc +--- poppler/glib/poppler-document.cc 2022-09-16 21:58:38.029530600 +0300 poppler/glib/poppler-document.cc 2022-09-16 16:27:33.387683800 +0300 +@@ -159,7 +159,7 @@ + return document; + } + +-static std::optional poppler_password_to_latin1(const gchar *password) ++static boost::optional poppler_password_to_latin1(const gchar *password) + { + gchar *password_latin; + +@@ -168,7 +168,7 @@ + } + + password_latin = g_convert(password, -1, "ISO-8859-1", "UTF-8", nullptr, nullptr, nullptr); +-std::optional password_g = GooString(password_latin); ++boost::optional password_g = GooString(password_latin); + g_free(password_latin); + + return password_g; +@@ -198,7 +198,7 @@ + return nullptr; + } + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + + #ifdef G_OS_WIN32 + wchar_t *filenameW; +@@ -262,7 +262,7 @@ + // create stream + str = new MemStream(data, 0, length, Object(objNull)); + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { + /* Try again with original password (which comes from GTK in UTF8) Issue #824 */ +@@ -327,7 +327,7 @@ + // create stream + str = new BytesStream(bytes, Object(objNull)); + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { + /* Try again with original password (which comes from GTK in UTF8) Issue #824 */ +@@ -391,7 +391,7 @@ + str = new CachedFileStream(cachedFile, 0, false, cachedFile->getLength(), Object(objNull)); + } + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { +
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf151370.rtf |3 +++ sw/qa/extras/rtfexport/rtfexport5.cxx | 18 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 +- writerfilter/source/rtftok/rtfdocumentimpl.hxx |2 +- 4 files changed, 23 insertions(+), 2 deletions(-) New commits: commit 564ec69c3d2cf591c80dbb561bf04fe3c6180f31 Author: Vasily Melenchuk AuthorDate: Thu Oct 6 12:37:31 2022 +0300 Commit: Thorsten Behrens CommitDate: Mon Oct 10 10:39:02 2022 +0200 tdf#151370: RTF import: docvar name/value can have several sequences In case of unicode used there can be tokens, replacements, etc. So it is better to collect and join all received strings, not overwrite with just last received. Change-Id: I2b6ce465d87db4ee30987cbe0ecce1470386242f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141007 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit fb7da82cac17f05fce13cdd0094bbd5159f5404d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141058 Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/rtfexport/data/tdf151370.rtf b/sw/qa/extras/rtfexport/data/tdf151370.rtf new file mode 100644 index ..e555d5c58cd2 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf151370.rtf @@ -0,0 +1,3 @@ +{\rtf1\adeflang1025\ansi\ansicpg1250 +{\*\docvar {LocalChars\'c1rv\'edzturoT\'fck\'f6rf\'far\'f3g\'e9p}{\'e1rv\'edzturot\'fck\'f6rf\'far\'f3g\'e9p}} +} \ No newline at end of file diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 1dbacde70bea..6c3d6c6c8471 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -848,6 +848,24 @@ DECLARE_RTFEXPORT_TEST(testTdf150267, "tdf150267.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Hello World"), getProperty(xFieldMaster, "Content")); } +DECLARE_RTFEXPORT_TEST(testTdf151370, "tdf151370.rtf") +{ +uno::Reference xModel(mxComponent, uno::UNO_QUERY); +uno::Reference xSupplier(xModel, uno::UNO_QUERY); +uno::Reference xTextFieldMasters = xSupplier->getTextFieldMasters(); +// Here we try to read/write docvar having non-ascii name and value. So it is encoded in Unicode +OUString sFieldName(u"com.sun.star.text.fieldmaster.User." + "LocalChars\u00c1\u0072\u0076\u00ed\u007a\u0074\u0075\u0072\u006f\u0054" + "\u00fc\u006b\u00f6\u0072\u0066\u00fa\u0072\u00f3\u0067\u00e9\u0070"); +CPPUNIT_ASSERT_EQUAL(sal_True, xTextFieldMasters->hasByName(sFieldName)); + +auto xFieldMaster = xTextFieldMasters->getByName(sFieldName); +CPPUNIT_ASSERT_EQUAL( + OUString(u"\u00e1\u0072\u0076\u00ed\u007a\u0074\u0075\u0072\u006f\u0074\u00fc" + "\u006b\u00f6\u0072\u0066\u00fa\u0072\u00f3\u0067\u00e9\u0070"), +getProperty(xFieldMaster, "Content")); +} + DECLARE_RTFEXPORT_TEST(testTdf108416, "tdf108416.rtf") { uno::Reference xCharacterStyles(getStyles("CharacterStyles")); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index f4844765fc68..4011a17d5ecb 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1502,7 +1502,7 @@ void RTFDocumentImpl::text(OUString& rString) break; case Destination::DOCVAR: { -m_aStates.top().setDocVar(rString); +m_aStates.top().appendDocVar(rString); } break; case Destination::FONTTABLE: diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 3e1caf7d0322..e859c01c9992 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -524,7 +524,7 @@ public: RTFInternalState getInternalState() const { return m_nInternalState; } RTFDocumentImpl* getDocumentImpl() { return m_pDocumentImpl; } OUString getDocVar() { return m_aDocVar; } -void setDocVar(OUString& aDocVar) { m_aDocVar = aDocVar; }; +void appendDocVar(OUString& aDocVar) { m_aDocVar += aDocVar; }; OUString getDocVarName() { return m_aDocVarName; } void setDocVarName(OUString& aDocVarName) { m_aDocVarName = aDocVarName; } void clearDocVarName() { m_aDocVarName = ""; }
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf151370.rtf |3 +++ sw/qa/extras/rtfexport/rtfexport5.cxx | 18 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 +- writerfilter/source/rtftok/rtfdocumentimpl.hxx |2 +- 4 files changed, 23 insertions(+), 2 deletions(-) New commits: commit 0d545f1f0afc93bd568f8172a134ab9196529809 Author: Vasily Melenchuk AuthorDate: Thu Oct 6 12:37:31 2022 +0300 Commit: Vasily Melenchuk CommitDate: Fri Oct 7 11:06:48 2022 +0200 tdf#151370: RTF import: docvar name/value can have several sequences In case of unicode used there can be tokens, replacements, etc. So it is better to collect and join all received strings, not overwrite with just last received. Change-Id: I2b6ce465d87db4ee30987cbe0ecce1470386242f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141007 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/qa/extras/rtfexport/data/tdf151370.rtf b/sw/qa/extras/rtfexport/data/tdf151370.rtf new file mode 100644 index ..e555d5c58cd2 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf151370.rtf @@ -0,0 +1,3 @@ +{\rtf1\adeflang1025\ansi\ansicpg1250 +{\*\docvar {LocalChars\'c1rv\'edzturoT\'fck\'f6rf\'far\'f3g\'e9p}{\'e1rv\'edzturot\'fck\'f6rf\'far\'f3g\'e9p}} +} \ No newline at end of file diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 1dbacde70bea..6c3d6c6c8471 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -848,6 +848,24 @@ DECLARE_RTFEXPORT_TEST(testTdf150267, "tdf150267.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Hello World"), getProperty(xFieldMaster, "Content")); } +DECLARE_RTFEXPORT_TEST(testTdf151370, "tdf151370.rtf") +{ +uno::Reference xModel(mxComponent, uno::UNO_QUERY); +uno::Reference xSupplier(xModel, uno::UNO_QUERY); +uno::Reference xTextFieldMasters = xSupplier->getTextFieldMasters(); +// Here we try to read/write docvar having non-ascii name and value. So it is encoded in Unicode +OUString sFieldName(u"com.sun.star.text.fieldmaster.User." + "LocalChars\u00c1\u0072\u0076\u00ed\u007a\u0074\u0075\u0072\u006f\u0054" + "\u00fc\u006b\u00f6\u0072\u0066\u00fa\u0072\u00f3\u0067\u00e9\u0070"); +CPPUNIT_ASSERT_EQUAL(sal_True, xTextFieldMasters->hasByName(sFieldName)); + +auto xFieldMaster = xTextFieldMasters->getByName(sFieldName); +CPPUNIT_ASSERT_EQUAL( + OUString(u"\u00e1\u0072\u0076\u00ed\u007a\u0074\u0075\u0072\u006f\u0074\u00fc" + "\u006b\u00f6\u0072\u0066\u00fa\u0072\u00f3\u0067\u00e9\u0070"), +getProperty(xFieldMaster, "Content")); +} + DECLARE_RTFEXPORT_TEST(testTdf108416, "tdf108416.rtf") { uno::Reference xCharacterStyles(getStyles("CharacterStyles")); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 7fa664ea26b1..8a888d8348f6 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1503,7 +1503,7 @@ void RTFDocumentImpl::text(OUString& rString) break; case Destination::DOCVAR: { -m_aStates.top().setDocVar(rString); +m_aStates.top().appendDocVar(rString); } break; case Destination::FONTTABLE: diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 208812fd4237..ac1263a41531 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -524,7 +524,7 @@ public: RTFInternalState getInternalState() const { return m_nInternalState; } RTFDocumentImpl* getDocumentImpl() { return m_pDocumentImpl; } OUString getDocVar() { return m_aDocVar; } -void setDocVar(OUString& aDocVar) { m_aDocVar = aDocVar; }; +void appendDocVar(OUString& aDocVar) { m_aDocVar += aDocVar; }; OUString getDocVarName() { return m_aDocVarName; } void setDocVarName(OUString& aDocVarName) { m_aDocVarName = aDocVarName; } void clearDocVarName() { m_aDocVarName = ""; }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf147724.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 13 + writerfilter/source/dmapper/SdtHelper.cxx| 64 ++- writerfilter/source/dmapper/SdtHelper.hxx|3 - 4 files changed, 69 insertions(+), 11 deletions(-) New commits: commit 316549de11552a6e719b3d7231fcc4adbfda27f3 Author: Vasily Melenchuk AuthorDate: Sun Sep 11 15:46:09 2022 +0300 Commit: Thorsten Behrens CommitDate: Fri Sep 30 08:41:15 2022 +0200 tdf#147724: DOCX STD import: use storeid to indetify custom XML We need to identify XML document to use by storeid in sdt block and in properties of external XML file. Otherwise are possible content collisions when same xpath can evaluate successfully absolutely unrelated custom XML. Change-Id: I6d201a539130b110046deb1818340513cc47a061 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139771 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140702 Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/ooxmlexport/data/tdf147724.docx b/sw/qa/extras/ooxmlexport/data/tdf147724.docx new file mode 100644 index ..97f05c921b89 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf147724.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index 1bf487a1f3bc..8a7009805f13 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -70,6 +70,19 @@ CPPUNIT_TEST_FIXTURE(Test, testCellSdtRedline) loadAndSave("cell-sdt-redline.docx"); } +DECLARE_OOXMLEXPORT_TEST(testTdf147724, "tdf147724.docx") +{ +const auto& pLayout = parseLayoutDump(); + +// Ensure we load field value from external XML correctly (it was "HERUNTERLADEN") +assertXPathContent(pLayout, "/root/page[1]/body/txt[1]", "Placeholder -> *ABC*"); + +// This SDT has no storage id, it is not an error, but content can be taken from any suitable XML +// There 2 variants possible, both are acceptable +OUString sFieldResult = getXPathContent(pLayout, "/root/page[1]/body/txt[2]"); +CPPUNIT_ASSERT(sFieldResult == "Placeholder -> *HERUNTERLADEN*" || sFieldResult == "Placeholder -> *ABC*"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 8f5e809efdec..31c83d5a3ea6 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -103,13 +103,13 @@ void SdtHelper::loadPropertiesXMLs() if (!xDomBuilder.is()) return; -std::vector> aPropDocs; - // Load core properties try { auto xCorePropsStream = xImporter->getCorePropertiesStream(m_rDM_Impl.m_xDocumentStorage); -aPropDocs.push_back(xDomBuilder->parse(xCorePropsStream)); +m_xPropertiesXMLs.insert( +{ OUString("{6C3C8BC8-F283-45AE-878A-BAB7291924A1}"), // hardcoded id for core props + xDomBuilder->parse(xCorePropsStream) }); } catch (const uno::Exception&) { @@ -122,7 +122,9 @@ void SdtHelper::loadPropertiesXMLs() { auto xExtPropsStream = xImporter->getExtendedPropertiesStream(m_rDM_Impl.m_xDocumentStorage); -aPropDocs.push_back(xDomBuilder->parse(xExtPropsStream)); +m_xPropertiesXMLs.insert( +{ OUString("{6668398D-A668-4E3E-A5EB-62B293D839F1}"), // hardcoded id for extended props + xDomBuilder->parse(xExtPropsStream) }); } catch (const uno::Exception&) { @@ -135,12 +137,40 @@ void SdtHelper::loadPropertiesXMLs() // Add custom XMLs uno::Sequence> aCustomXmls = m_rDM_Impl.getDocumentReference()->getCustomXmlDomList(); -for (const auto& xDoc : aCustomXmls) +uno::Sequence> aCustomXmlProps += m_rDM_Impl.getDocumentReference()->getCustomXmlDomPropsList(); +if (aCustomXmls.getLength()) { -aPropDocs.push_back(xDoc); +uno::Reference xXpathAPI = XPathAPI::create(m_xComponentContext); +xXpathAPI->registerNS("ds", + "http://schemas.openxmlformats.org/officeDocument/2006/customXml";); +sal_Int32 nItem = 0; +// Hereby we assume that items from getCustomXmlDomList() and getCustomXmlDomPropsList() +// are matching each other: +// item1.xml -> itemProps1.xml, item2.xml -> itemProps2.xml +// This does works practically, but is it true in general? +for (const auto& xDoc : aCustomXmls) +{ +// Retrieve s
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf147724.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 13 + writerfilter/source/dmapper/SdtHelper.cxx| 64 ++- writerfilter/source/dmapper/SdtHelper.hxx|3 - 4 files changed, 69 insertions(+), 11 deletions(-) New commits: commit da100343e5416e1040f8f6d83fd73d8d0577112e Author: Vasily Melenchuk AuthorDate: Sun Sep 11 15:46:09 2022 +0300 Commit: Vasily Melenchuk CommitDate: Wed Sep 28 09:58:00 2022 +0200 tdf#147724: DOCX STD import: use storeid to indetify custom XML We need to identify XML document to use by storeid in sdt block and in properties of external XML file. Otherwise are possible content collisions when same xpath can evaluate successfully absolutely unrelated custom XML. Change-Id: I6d201a539130b110046deb1818340513cc47a061 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139771 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/sw/qa/extras/ooxmlexport/data/tdf147724.docx b/sw/qa/extras/ooxmlexport/data/tdf147724.docx new file mode 100644 index ..97f05c921b89 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf147724.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index 6c4eaa09fa34..b9932f7c199d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -104,6 +104,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149551_mongolianVert) assertXPath(pXmlDoc, "//wps:bodyPr", "vert", "mongolianVert"); } +DECLARE_OOXMLEXPORT_TEST(testTdf147724, "tdf147724.docx") +{ +const auto& pLayout = parseLayoutDump(); + +// Ensure we load field value from external XML correctly (it was "HERUNTERLADEN") +assertXPathContent(pLayout, "/root/page[1]/body/txt[1]", "Placeholder -> *ABC*"); + +// This SDT has no storage id, it is not an error, but content can be taken from any suitable XML +// There 2 variants possible, both are acceptable +OUString sFieldResult = getXPathContent(pLayout, "/root/page[1]/body/txt[2]"); +CPPUNIT_ASSERT(sFieldResult == "Placeholder -> *HERUNTERLADEN*" || sFieldResult == "Placeholder -> *ABC*"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 50ddf4b99b21..8225a6a04bca 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -104,13 +104,13 @@ void SdtHelper::loadPropertiesXMLs() if (!xDomBuilder.is()) return; -std::vector> aPropDocs; - // Load core properties try { auto xCorePropsStream = xImporter->getCorePropertiesStream(m_rDM_Impl.m_xDocumentStorage); -aPropDocs.push_back(xDomBuilder->parse(xCorePropsStream)); +m_xPropertiesXMLs.insert( +{ OUString("{6C3C8BC8-F283-45AE-878A-BAB7291924A1}"), // hardcoded id for core props + xDomBuilder->parse(xCorePropsStream) }); } catch (const uno::Exception&) { @@ -123,7 +123,9 @@ void SdtHelper::loadPropertiesXMLs() { auto xExtPropsStream = xImporter->getExtendedPropertiesStream(m_rDM_Impl.m_xDocumentStorage); -aPropDocs.push_back(xDomBuilder->parse(xExtPropsStream)); +m_xPropertiesXMLs.insert( +{ OUString("{6668398D-A668-4E3E-A5EB-62B293D839F1}"), // hardcoded id for extended props + xDomBuilder->parse(xExtPropsStream) }); } catch (const uno::Exception&) { @@ -136,12 +138,40 @@ void SdtHelper::loadPropertiesXMLs() // Add custom XMLs uno::Sequence> aCustomXmls = m_rDM_Impl.getDocumentReference()->getCustomXmlDomList(); -for (const auto& xDoc : aCustomXmls) +uno::Sequence> aCustomXmlProps += m_rDM_Impl.getDocumentReference()->getCustomXmlDomPropsList(); +if (aCustomXmls.getLength()) { -aPropDocs.push_back(xDoc); +uno::Reference xXpathAPI = XPathAPI::create(m_xComponentContext); +xXpathAPI->registerNS("ds", + "http://schemas.openxmlformats.org/officeDocument/2006/customXml";); +sal_Int32 nItem = 0; +// Hereby we assume that items from getCustomXmlDomList() and getCustomXmlDomPropsList() +// are matching each other: +// item1.xml -> itemProps1.xml, item2.xml -> itemProps2.xml +// This does works practically, but is it true in general? +for (const auto& xDoc : aCustomXmls) +{ +// Retrieve storeid from properties xml +OUString a
[Libreoffice-commits] core.git: Changes to 'refs/tags/cib-6.1-37'
Tag 'cib-6.1-37' created by Thorsten Behrens at 2022-09-26 07:46 + Release CIB Office 6.1-37 -BEGIN PGP SIGNATURE- iQKTBAABCgB9FiEEF13c36gxow74AXmeM3dpmHHuF/gFAmMxWL1fFIAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDE3 NUREQ0RGQTgzMUEzMEVGODAxNzk5RTMzNzc2OTk4NzFFRTE3RjgACgkQM3dpmHHu F/ggLA//f11Iv6eJJvR06zFm5K8IL1ZEp1OEXl54QR4CQ9IpEh7ffx2oAfxuj5u1 x1M4Au5n13zzenj0SnqrLK665lM5MRitJV8NontlMOM+7Okt33zwJ/fPHduhNsgs aJxu15/GyXEFWY+KQN1514JFfxgMxHlo9LBcKzUQ6CkjqumVA7eslt3BL+i696E1 10BLI/CW9yZeIQi38R5QRTEVarvH+trhNTeNOtrnlO0lLiFGqj/xpOvg/DbLtzlm YgXOfUCq9VYcVcqgmwU5JutnQbLc1BV7FVzvbZ1N/4Z7P1afmq91XGxbb0K6KRMP xSUHGuAxaYivg0Q7uQhB4ZfgJ5g0vdRXAnKG7sHuECHTVMzckEt8wvSkINAu8Qz7 gDA1feImxLGbiaY6EuE+ceeuOwdMbnFlRb/f2M2zOpqoL3a5cxl2GrqlJMvE6xM+ HVjUGn4st6mUtf6W1XorHNvCmtkrO7VKlzf0Mwm0MdfAiScTpa3YXK65Kg00rMs6 v8ymfUh12vXUvxWnkWaITZX7BjSN/OLTVKp+QHLenUoZP8AaUM1DdClFztC5hgH3 Bc80TtjXNsUrDQs9AW/RdeHLZPdpv3jmB8K7qBqrBKBAo62szNYUo9r1nbLLsa54 DYigxqYCS9B73NNSW0qD3YnVpwOd7sCwjeWGLMb+jRPbcgmbHzo= =TxV3 -END PGP SIGNATURE- Changes since cib-6.1-36-10: --- 0 files changed ---
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-1' - external/poppler sdext/source
Rebased ref, commits from common ancestor: commit 9457530f9638d61ca8974bc337892ee094cc2277 Author: Vasily Melenchuk AuthorDate: Mon Sep 19 09:31:04 2022 +0200 Commit: Thorsten Behrens CommitDate: Mon Sep 19 16:09:12 2022 +0200 Fix poppler 22.09.0 for winodws VS2015 misses a few c++11 features, patch them out. Change-Id: Iba1faaefb03275e944bf577ec3abe1b4275f9869 diff --git a/external/poppler/StaticLibrary_poppler.mk b/external/poppler/StaticLibrary_poppler.mk index 7eb541650373..cc43e873c4f2 100644 --- a/external/poppler/StaticLibrary_poppler.mk +++ b/external/poppler/StaticLibrary_poppler.mk @@ -11,7 +11,10 @@ $(eval $(call gb_StaticLibrary_StaticLibrary,poppler)) $(eval $(call gb_StaticLibrary_use_unpacked,poppler,poppler)) -$(eval $(call gb_StaticLibrary_use_external,poppler,libjpeg)) +$(eval $(call gb_StaticLibrary_use_externals,poppler,\ +libjpeg \ +boost_headers \ +)) $(eval $(call gb_StaticLibrary_set_warnings_not_errors,poppler)) diff --git a/external/poppler/UnpackedTarball_poppler.mk b/external/poppler/UnpackedTarball_poppler.mk index c08daa992060..ca7989c5ecaa 100644 --- a/external/poppler/UnpackedTarball_poppler.mk +++ b/external/poppler/UnpackedTarball_poppler.mk @@ -20,6 +20,12 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\ external/poppler/gcc7-EntityInfo.patch.1 \ )) +ifeq ($(OS),WNT) +$(eval $(call gb_UnpackedTarball_add_patches,poppler,\ + external/poppler/poppler-vs2015-buildfix.patch.1 \ +)) +endif + # std::make_unique is only available in C++14 # use "env -i" to avoid Cygwin "environment is too large for exec" # Mac OS X sed says "sed: RE error: illegal byte sequence"; Apple clang should diff --git a/external/poppler/poppler-vs2015-buildfix.patch.1 b/external/poppler/poppler-vs2015-buildfix.patch.1 new file mode 100644 index ..573eae32f7b1 --- /dev/null +++ b/external/poppler/poppler-vs2015-buildfix.patch.1 @@ -0,0 +1,1707 @@ +Remove a few c++11-isms to fix build on VS201 + +diff -ur workdir/UnpackedTrball/poppler/glib/poppler-document.cc poppler/glib/poppler-document.cc +--- poppler/glib/poppler-document.cc 2022-09-16 21:58:38.029530600 +0300 poppler/glib/poppler-document.cc 2022-09-16 16:27:33.387683800 +0300 +@@ -159,7 +159,7 @@ + return document; + } + +-static std::optional poppler_password_to_latin1(const gchar *password) ++static boost::optional poppler_password_to_latin1(const gchar *password) + { + gchar *password_latin; + +@@ -168,7 +168,7 @@ + } + + password_latin = g_convert(password, -1, "ISO-8859-1", "UTF-8", nullptr, nullptr, nullptr); +-std::optional password_g = GooString(password_latin); ++boost::optional password_g = GooString(password_latin); + g_free(password_latin); + + return password_g; +@@ -198,7 +198,7 @@ + return nullptr; + } + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + + #ifdef G_OS_WIN32 + wchar_t *filenameW; +@@ -262,7 +262,7 @@ + // create stream + str = new MemStream(data, 0, length, Object(objNull)); + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { + /* Try again with original password (which comes from GTK in UTF8) Issue #824 */ +@@ -327,7 +327,7 @@ + // create stream + str = new BytesStream(bytes, Object(objNull)); + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { + /* Try again with original password (which comes from GTK in UTF8) Issue #824 */ +@@ -391,7 +391,7 @@ + str = new CachedFileStream(cachedFile, 0, false, cachedFile->getLength(), Object(objNull)); + } + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { + /* Try again with original password (which comes from GTK in UTF8) Issue #824 */ +@@ -515,7 +515,7 @@ + stream = new OwningFileStream(GooFile::open(fd), Object(objNull)); + } + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + n
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-1' - 2 commits - configure.ac external/poppler sdext/source
configure.ac |2 external/poppler/StaticLibrary_poppler.mk |5 external/poppler/UnpackedTarball_poppler.mk |5 external/poppler/poppler-vs2015-buildfix.patch.1 | 1707 ++ sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx |4 sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx|8 6 files changed, 1723 insertions(+), 8 deletions(-) New commits: commit 50c5487b2cebcd70fc361e0046f16f7f81db Author: Vasily Melenchuk AuthorDate: Mon Sep 19 09:31:04 2022 +0200 Commit: Thorsten Behrens CommitDate: Mon Sep 19 12:10:51 2022 +0200 Fix poppler 22.09.0 for winodws VS2015 misses a few c++11 features, patch them out. Change-Id: Iba1faaefb03275e944bf577ec3abe1b4275f9869 diff --git a/external/poppler/StaticLibrary_poppler.mk b/external/poppler/StaticLibrary_poppler.mk index 7eb541650373..cc43e873c4f2 100644 --- a/external/poppler/StaticLibrary_poppler.mk +++ b/external/poppler/StaticLibrary_poppler.mk @@ -11,7 +11,10 @@ $(eval $(call gb_StaticLibrary_StaticLibrary,poppler)) $(eval $(call gb_StaticLibrary_use_unpacked,poppler,poppler)) -$(eval $(call gb_StaticLibrary_use_external,poppler,libjpeg)) +$(eval $(call gb_StaticLibrary_use_externals,poppler,\ +libjpeg \ +boost_headers \ +)) $(eval $(call gb_StaticLibrary_set_warnings_not_errors,poppler)) diff --git a/external/poppler/UnpackedTarball_poppler.mk b/external/poppler/UnpackedTarball_poppler.mk index c08daa992060..92db42b20c40 100644 --- a/external/poppler/UnpackedTarball_poppler.mk +++ b/external/poppler/UnpackedTarball_poppler.mk @@ -20,6 +20,11 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\ external/poppler/gcc7-EntityInfo.patch.1 \ )) +ifeq ($(OS),WNT) +$(eval $(call gb_UnpackedTarball_add_patches,poppler,\ + external/poppler/poppler-vs2015-buildfix.patch.1 \ +endif + # std::make_unique is only available in C++14 # use "env -i" to avoid Cygwin "environment is too large for exec" # Mac OS X sed says "sed: RE error: illegal byte sequence"; Apple clang should diff --git a/external/poppler/poppler-vs2015-buildfix.patch.1 b/external/poppler/poppler-vs2015-buildfix.patch.1 new file mode 100644 index ..e56ae000cfea --- /dev/null +++ b/external/poppler/poppler-vs2015-buildfix.patch.1 @@ -0,0 +1,1707 @@ +Remove a few c++11-isms to fix build on VS201 + +diff -ur workdir/UnpackedTrball/poppler/glib/poppler-document.cc poppler/glib/poppler-document.cc +--- poppler/glib/poppler-document.cc 2022-09-16 21:58:38.029530600 +0300 poppler/glib/poppler-document.cc 2022-09-16 16:27:33.387683800 +0300 +@@ -159,7 +159,7 @@ + return document; + } + +-static std::optional poppler_password_to_latin1(const gchar *password) ++static boost::optional poppler_password_to_latin1(const gchar *password) + { + gchar *password_latin; + +@@ -168,7 +168,7 @@ + } + + password_latin = g_convert(password, -1, "ISO-8859-1", "UTF-8", nullptr, nullptr, nullptr); +-std::optional password_g = GooString(password_latin); ++boost::optional password_g = GooString(password_latin); + g_free(password_latin); + + return password_g; +@@ -198,7 +198,7 @@ + return nullptr; + } + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + + #ifdef G_OS_WIN32 + wchar_t *filenameW; +@@ -262,7 +262,7 @@ + // create stream + str = new MemStream(data, 0, length, Object(objNull)); + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { + /* Try again with original password (which comes from GTK in UTF8) Issue #824 */ +@@ -327,7 +327,7 @@ + // create stream + str = new BytesStream(bytes, Object(objNull)); + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { + /* Try again with original password (which comes from GTK in UTF8) Issue #824 */ +@@ -391,7 +391,7 @@ + str = new CachedFileStream(cachedFile, 0, false, cachedFile->getLength(), Object(objNull)); + } + +-const std::optional password_g = poppler_password_to_latin1(password); ++const boost::optional password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErr
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 9 commits - desktop/source drawinglayer/source include/drawinglayer readlicense_oo/license sfx2/source sw/inc sw/qa sw/source wizar
desktop/source/app/cmdlineargs.cxx | 10 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |6 include/drawinglayer/geometry/viewinformation2d.hxx |2 readlicense_oo/license/CREDITS.fodt | 4499 sfx2/source/appl/macroloader.cxx|9 sfx2/source/doc/iframe.cxx | 20 sfx2/source/inc/macroloader.hxx |2 sw/inc/crsrsh.hxx |2 sw/qa/extras/htmlexport/htmlexport.cxx | 57 sw/source/core/crsr/crsrsh.cxx |9 sw/source/core/text/porfld.cxx |3 sw/source/core/text/porfld.hxx |2 sw/source/filter/html/htmlplug.cxx |7 sw/source/filter/html/wrthtml.cxx |3 sw/source/filter/xml/xmltexti.cxx |9 sw/source/uibase/docvw/PageBreakWin.cxx |1 sw/source/uibase/docvw/edtwin.cxx |5 sw/source/uibase/inc/wrtsh.hxx |1 sw/source/uibase/wrtsh/wrtsh1.cxx |9 wizards/source/access2base/DoCmd.xba|2 wizards/source/scriptforge/SF_Session.xba |2 21 files changed, 2422 insertions(+), 2238 deletions(-) New commits: commit b36c05c8359493f025a1e107c3d6bf331e1d9084 Author: Vasily Melenchuk AuthorDate: Fri Aug 26 16:32:57 2022 +0300 Commit: Andras Timar CommitDate: Tue Sep 6 16:36:25 2022 +0200 tdf#114769: sw html export: better handling for relative URLs Usage of INetURLObject makes sense only in case of full URLs, but once relative one is provided it will contain invalid data. Change-Id: Icc5e191e2337a3dd9a76c660b1c7709551099a1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138875 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 599da3fa69805ebf8dee4517855fd8706e19d11d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138979 Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139409 diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 21feaa0b5e73..45e44186d69b 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -2280,6 +2280,63 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testImageKeepRatio) assertXPath(pDoc, "/html/body/p/img", "height", "auto"); } +CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf114769) +{ +// Create document from scratch since relative urls to filesystem can be replaced +// by absolute during save/load +SwDoc* pDoc = createSwDoc(); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); +pWrtShell->Insert("Hyperlink1"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink2"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink3"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink4"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink5"); +pWrtShell->SplitNode(); + +// Normal external URL +uno::Reference xRun(getRun(getParagraph(1), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("http://libreoffice.org/";))); + +// Bookmark reference +xRun.set(getRun(getParagraph(2), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("#some_bookmark"))); + +// Filesystem absolute link +xRun.set(getRun(getParagraph(3), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("C:\\test.txt"))); + +// Filesystem relative link +xRun.set(getRun(getParagraph(4), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("..\\..\\test.odt"))); + +// Filesystem relative link +xRun.set(getRun(getParagraph(5), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString(".\\another.odt"))); + +// Export +uno::Reference xStorable(mxComponent, uno::UNO_QUERY); +uno::Sequence aStoreProperties += { comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")) }; +xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties); + +htmlDocUniquePtr pHtmlDoc = parseHtml(maTempFile); +CPPUNIT_ASSERT(pHtmlDoc); + +CPPUNIT_ASSERT_EQUAL(OUString("http://libreoffice.org/";), + getXPath(pHtmlDoc, "/html/body/p[1]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString("#some_bookmark&
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf127806.rtf | 86 + sw/qa/extras/rtfexport/rtfexport3.cxx | 23 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 23 -- writerfilter/source/rtftok/rtfsdrimport.cxx| 38 +-- 4 files changed, 144 insertions(+), 26 deletions(-) New commits: commit 8a3c37ad5d39fb48e259edb13dc2934d5ae4986c Author: Vasily Melenchuk AuthorDate: Tue Aug 30 15:42:44 2022 +0300 Commit: Xisco Fauli CommitDate: Mon Sep 5 15:04:58 2022 +0200 tdf#127806: RTF import: use shape dimensions for pib picture If RTF shape contains pib (embedded picture) we should override any picture sizes by values from shape. Values provided inside \pict are ignored by MS Word; only shape values matter. To achieve this we need to know shape dimensions so it's calculation is moved to earlier step before internal picture eval. Change-Id: I99c1af7ba62c343b64b3db734b837ff101483ad8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139043 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit 57d9cc81b058757421cd082e5dbe32a919716807) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139417 Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/rtfexport/data/tdf127806.rtf b/sw/qa/extras/rtfexport/data/tdf127806.rtf new file mode 100644 index ..2cc165f4110a --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf127806.rtf @@ -0,0 +1,86 @@ +{\rtf1\ansi\ansicpg1252 +{\shpgrp{\*\shpinst +\shplid67 +\shpleft0\shptop21\shpright11906\shpbottom16137\shpfhdr0 +\shpbxpage\shpbypage\shpwr3\shpwrk0\shpfblwtxt1\shpz0 +\shpwr3\shpfblwtxt1 +{\sp{\sn groupLeft}{\sv 0}} +{\sp{\sn groupTop}{\sv 21}} +{\sp{\sn groupRight}{\sv 11906}} +{\sp{\sn groupBottom}{\sv 16137}} +{\sp{\sn fFlipH}{\sv 0}} +{\sp{\sn fFlipV}{\sv 0}} +{\sp{\sn posrelh}{\sv 1}} +{\sp{\sn posrelv}{\sv 1}} +{\sp{\sn fBehindDocument}{\sv 1}} + +{\shp{\*\shpinst\shplid70 +{\sp{\sn relLeft}{\sv 979}} +{\sp{\sn relTop}{\sv 14827}} +{\sp{\sn relRight}{\sv 10918}} +{\sp{\sn relBottom}{\sv 15176}} +{\sp{\sn fRelFlipH}{\sv 0}} +{\sp{\sn fRelFlipV}{\sv 0}} +{\sp{\sn shapeType}{\sv 0}} +{\sp{\sn rotation}{\sv 0}} +{\sp{\sn geoRight}{\sv 9939}} +{\sp{\sn geoBottom}{\sv 349}} +{\sp{\sn shapePath}{\sv 4}} +{\sp{\sn pVerticies}{\sv 8;5;(9938,0);(0,0);(0,348);(9938,348);(9938,0)}} +{\sp{\sn pSegmentInfo}{\sv 2;12;16384;45824;1;45824;1;45824;1;45824;1;45824;24577;32768}} +{\sp{\sn fFillOK}{\sv 1}} +{\sp{\sn fFilled}{\sv 1}} +{\sp{\sn fillColor}{\sv 5987168}} +{\sp{\sn fLine}{\sv 0}}{\sp{\sn lineType}{\sv 0}} +{\sp{\sn posrelh}{\sv 1}} +{\sp{\sn posrelv}{\sv 1}} +{\sp{\sn fArrowheadsOK}{\sv 1}} +{\sp{\sn fBehindDocument}{\sv 1}} +}} + +{\shp{\*\shpinst\shplid72 +{\sp{\sn relLeft}{\sv 830}} +{\sp{\sn relTop}{\sv 816}} +{\sp{\sn relRight}{\sv 1190}} +{\sp{\sn relBottom}{\sv 1156}} +{\sp{\sn pib}{\sv{\pict\picscalex500\picscaley9\piccropl0\piccropr0\piccropt0\piccropb0\picw1270\pich1243\picwgoal720\pichgoal705 +\pngblip{\*\blipuid c0d486c26efd24459c14592d8249a32b} +89504e470d0a1a0a000d494844520030002f080600a58249 +c90006624b474400ff00ff00ffa0bda7930009704859730ec400 +000ec401952b0e1b041e494441546881cd984d6c1b4514c7ff33ebf5b7e3 +943a6da2a290402528a5520f9168f9101c00b5a71e2ace9c7be28022242e1542 +e28038708023070e1c901007041c8a904088b6082808921450212d4e9438561c +3bb1d7ebddd9791ce275b7eeaee38f59dbbfd3ee7b3b6fe6bff366e6ed322282 +8bf5fb4b5764f9eb17110276310ae3a72c00a62c66e4686a87bb37246d5deefe +f0b4b2e81e9c3d0dc6af1350397800489fbbbc785740f5e7054823a9b40700d2 +62307ec902821ffc700fe8c7260bb113af7cd88a2acbdf3da7b407002401e346 +16d288a80e8df4f9b75f0580bb022adf3eafb20322a0be9481538aaa0c0b00d0 +e7a6f2d1e3173f019a028875fe5bb713b0d7122a43b6489f7ff7927bbd2f +c0f8f33138d5b4aa0eecad28cc9bcac2dd83968bef461f3af7a57bbf2fa0b6f4 +84aa0e9c5a383b8e4bfcd40b5f78ef3900c8da1fa754042702cc9534e0a8dd71 +5a3042e2cc1b97bda6e60ca811200a3188624c45285ff4071fd8d4b28fdcf2da +94092001d457c2c97b97f8e98b1fb7db3889bd0c356ecf0d1abc712b0532b541 +c304a311e20b8b6fb59b3999ff3e3c686ca7aaa1b1aafc10bf87c8e15499c726 +2bed764ed6fab141021301f5e50c40e1ec3a2e9199f9bffdec9c1a8309b03762 +70b6d59fb6ede8b367bff7b3730c300324586807563bd1e3173ef5b30f3403d6 +5a1cd40871e1366131483eb5f0a39faf6f01448075279c5aa79d486eb2c83927 +3f1f27bb38d54f50a7a443d6d497c97ef0c9231b813ec87a5fafb131a4b70f00 +3c91dd09f4f523409a1ca2105ec9d00e4b1e2a05f938f521c0cac743dff7bdf0 +646e2bd0d7eb0c9004acfcf0d2070078eae866a00f4e6f02c45634dc9ac7079e +9e590ff4811a3d25b37527dc9ac70f96c815837c1c2c6a751b886c06b1adab19 +550f50a37c28c8c7c1e366b781444947589f8a9d90b5c274908f8327eadd0612 +3bc37ffb004046f148908fb31e66208c7f3cdd20ebdb81d542d7294402702ac3 +291deeebdb281d0ef27168a95a37419cb23ed4c3cb8b344ab9201f67d1e9c043 +c28b1851fa008028aecd07f938d3bb1430a2050c004ea9d22185623381a5aa0b +49c019a10032c19dd2ca493f5f5733e05422801c4dfebb58ab5f5df0b37
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa sw/source
sw/qa/extras/htmlexport/htmlexport.cxx | 57 + sw/source/filter/html/wrthtml.cxx |3 + 2 files changed, 59 insertions(+), 1 deletion(-) New commits: commit f5003b9b1b44a16e28b1c3080d11347e5b365e1e Author: Vasily Melenchuk AuthorDate: Fri Aug 26 16:32:57 2022 +0300 Commit: Xisco Fauli CommitDate: Mon Sep 5 14:44:07 2022 +0200 tdf#114769: sw html export: better handling for relative URLs Usage of INetURLObject makes sense only in case of full URLs, but once relative one is provided it will contain invalid data. Change-Id: Icc5e191e2337a3dd9a76c660b1c7709551099a1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138875 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 599da3fa69805ebf8dee4517855fd8706e19d11d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138979 Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139409 diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index cc30027f906d..51af126b9bb1 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -2237,6 +2237,63 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testImageKeepRatio) assertXPath(pDoc, "/html/body/p/img", "height", "auto"); } +CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf114769) +{ +// Create document from scratch since relative urls to filesystem can be replaced +// by absolute during save/load +SwDoc* pDoc = createSwDoc(); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); +pWrtShell->Insert("Hyperlink1"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink2"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink3"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink4"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink5"); +pWrtShell->SplitNode(); + +// Normal external URL +uno::Reference xRun(getRun(getParagraph(1), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("http://libreoffice.org/";))); + +// Bookmark reference +xRun.set(getRun(getParagraph(2), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("#some_bookmark"))); + +// Filesystem absolute link +xRun.set(getRun(getParagraph(3), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("C:\\test.txt"))); + +// Filesystem relative link +xRun.set(getRun(getParagraph(4), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("..\\..\\test.odt"))); + +// Filesystem relative link +xRun.set(getRun(getParagraph(5), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString(".\\another.odt"))); + +// Export +uno::Reference xStorable(mxComponent, uno::UNO_QUERY); +uno::Sequence aStoreProperties += { comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")) }; +xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties); + +htmlDocUniquePtr pHtmlDoc = parseHtml(maTempFile); +CPPUNIT_ASSERT(pHtmlDoc); + +CPPUNIT_ASSERT_EQUAL(OUString("http://libreoffice.org/";), + getXPath(pHtmlDoc, "/html/body/p[1]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString("#some_bookmark"), + getXPath(pHtmlDoc, "/html/body/p[2]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString("C:\\test.txt"), getXPath(pHtmlDoc, "/html/body/p[3]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString("..\\..\\test.odt"), + getXPath(pHtmlDoc, "/html/body/p[4]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString(".\\another.odt"), + getXPath(pHtmlDoc, "/html/body/p[5]/a", "href")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index df4cef472ca2..0dafeb86c8d1 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1266,7 +1266,8 @@ OUString SwHTMLWriter::convertHyperlinkHRefValue(const OUString& rURL) { // Link is not started from "#", so looks like external link. Encode this URL. INetURLObject aURL(sURL); -sURL = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); +if (!aURL.HasError()) +sURL = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); } return URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), sURL ); }
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf127806.rtf | 86 + sw/qa/extras/rtfexport/rtfexport3.cxx | 23 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 23 -- writerfilter/source/rtftok/rtfsdrimport.cxx| 38 +-- 4 files changed, 144 insertions(+), 26 deletions(-) New commits: commit 57d9cc81b058757421cd082e5dbe32a919716807 Author: Vasily Melenchuk AuthorDate: Tue Aug 30 15:42:44 2022 +0300 Commit: Miklos Vajna CommitDate: Thu Sep 1 20:35:28 2022 +0200 tdf#127806: RTF import: use shape dimensions for pib picture If RTF shape contains pib (embedded picture) we should override any picture sizes by values from shape. Values provided inside \pict are ignored by MS Word; only shape values matter. To achieve this we need to know shape dimensions so it's calculation is moved to earlier step before internal picture eval. Change-Id: I99c1af7ba62c343b64b3db734b837ff101483ad8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139043 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/rtfexport/data/tdf127806.rtf b/sw/qa/extras/rtfexport/data/tdf127806.rtf new file mode 100644 index ..2cc165f4110a --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf127806.rtf @@ -0,0 +1,86 @@ +{\rtf1\ansi\ansicpg1252 +{\shpgrp{\*\shpinst +\shplid67 +\shpleft0\shptop21\shpright11906\shpbottom16137\shpfhdr0 +\shpbxpage\shpbypage\shpwr3\shpwrk0\shpfblwtxt1\shpz0 +\shpwr3\shpfblwtxt1 +{\sp{\sn groupLeft}{\sv 0}} +{\sp{\sn groupTop}{\sv 21}} +{\sp{\sn groupRight}{\sv 11906}} +{\sp{\sn groupBottom}{\sv 16137}} +{\sp{\sn fFlipH}{\sv 0}} +{\sp{\sn fFlipV}{\sv 0}} +{\sp{\sn posrelh}{\sv 1}} +{\sp{\sn posrelv}{\sv 1}} +{\sp{\sn fBehindDocument}{\sv 1}} + +{\shp{\*\shpinst\shplid70 +{\sp{\sn relLeft}{\sv 979}} +{\sp{\sn relTop}{\sv 14827}} +{\sp{\sn relRight}{\sv 10918}} +{\sp{\sn relBottom}{\sv 15176}} +{\sp{\sn fRelFlipH}{\sv 0}} +{\sp{\sn fRelFlipV}{\sv 0}} +{\sp{\sn shapeType}{\sv 0}} +{\sp{\sn rotation}{\sv 0}} +{\sp{\sn geoRight}{\sv 9939}} +{\sp{\sn geoBottom}{\sv 349}} +{\sp{\sn shapePath}{\sv 4}} +{\sp{\sn pVerticies}{\sv 8;5;(9938,0);(0,0);(0,348);(9938,348);(9938,0)}} +{\sp{\sn pSegmentInfo}{\sv 2;12;16384;45824;1;45824;1;45824;1;45824;1;45824;24577;32768}} +{\sp{\sn fFillOK}{\sv 1}} +{\sp{\sn fFilled}{\sv 1}} +{\sp{\sn fillColor}{\sv 5987168}} +{\sp{\sn fLine}{\sv 0}}{\sp{\sn lineType}{\sv 0}} +{\sp{\sn posrelh}{\sv 1}} +{\sp{\sn posrelv}{\sv 1}} +{\sp{\sn fArrowheadsOK}{\sv 1}} +{\sp{\sn fBehindDocument}{\sv 1}} +}} + +{\shp{\*\shpinst\shplid72 +{\sp{\sn relLeft}{\sv 830}} +{\sp{\sn relTop}{\sv 816}} +{\sp{\sn relRight}{\sv 1190}} +{\sp{\sn relBottom}{\sv 1156}} +{\sp{\sn pib}{\sv{\pict\picscalex500\picscaley9\piccropl0\piccropr0\piccropt0\piccropb0\picw1270\pich1243\picwgoal720\pichgoal705 +\pngblip{\*\blipuid c0d486c26efd24459c14592d8249a32b} +89504e470d0a1a0a000d494844520030002f080600a58249 +c90006624b474400ff00ff00ffa0bda7930009704859730ec400 +000ec401952b0e1b041e494441546881cd984d6c1b4514c7ff33ebf5b7e3 +943a6da2a290402528a5520f9168f9101c00b5a71e2ace9c7be28022242e1542 +e28038708023070e1c901007041c8a904088b6082808921450212d4e9438561c +3bb1d7ebddd9791ce275b7eeaee38f59dbbfd3ee7b3b6fe6bff366e6ed322282 +8bf5fb4b5764f9eb17110276310ae3a72c00a62c66e4686a87bb37246d5deefe +f0b4b2e81e9c3d0dc6af1350397800489fbbbc785740f5e7054823a9b40700d2 +62307ec902821ffc700fe8c7260bb113af7cd88a2acbdf3da7b407002401e346 +16d288a80e8df4f9b75f0580bb022adf3eafb20322a0be9481538aaa0c0b00d0 +e7a6f2d1e3173f019a028875fe5bb713b0d7122a43b6489f7ff7927bbd2f +c0f8f33138d5b4aa0eecad28cc9bcac2dd83968bef461f3af7a57bbf2fa0b6f4 +84aa0e9c5a383b8e4bfcd40b5f78ef3900c8da1fa754042702cc9534e0a8dd71 +5a3042e2cc1b97bda6e60ca811200a3188624c45285ff4071fd8d4b28fdcf2da +94092001d457c2c97b97f8e98b1fb7db3889bd0c356ecf0d1abc712b0532b541 +c304a311e20b8b6fb59b3999ff3e3c686ca7aaa1b1aafc10bf87c8e15499c726 +2bed764ed6fab141021301f5e50c40e1ec3a2e9199f9bffdec9c1a8309b03762 +70b6d59fb6ede8b367bff7b3730c300324586807563bd1e3173ef5b30f3403d6 +5a1cd40871e1366131483eb5f0a39faf6f01448075279c5aa79d486eb2c83927 +3f1f27bb38d54f50a7a443d6d497c97ef0c9231b813ec87a5fafb131a4b70f00 +3c91dd09f4f523409a1ca2105ec9d00e4b1e2a05f938f521c0cac743dff7bdf0 +646e2bd0d7eb0c9004acfcf0d2070078eae866a00f4e6f02c45634dc9ac7079e +9e590ff4811a3d25b37527dc9ac70f96c815837c1c2c6a751b886c06b1adab19 +550f50a37c28c8c7c1e366b781444947589f8a9d90b5c274908f8327eadd0612 +3bc37ffb004046f148908fb31e66208c7f3cdd20ebdb81d542d7294402702ac3 +291deeebdb281d0ef27168a95a37419cb23ed4c3cb8b344ab9201f67d1e9c043 +c28b1851fa008028aecd07f938d3bb1430a2050c004ea9d22185623381a5aa0b +49c019a10032c19dd2ca493f5f5733e05422801c4dfebb58ab5f5df0b377b506 +a431dcdac70f91bff6ac9f9db3f8fcea418dc90ae95f670fd8ebcba7fdec9c25 +1ffdeba0c6648f8380d2b4acd9cb9996ae2236fb5fa7c6648d36ff010092 +c1bcf1deebed660e003c79e266c7b663904200602e7dfe72bb8d03003b4
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/qa sw/source
sw/qa/extras/htmlexport/htmlexport.cxx | 57 + sw/source/filter/html/wrthtml.cxx |3 + 2 files changed, 59 insertions(+), 1 deletion(-) New commits: commit 184a9eec62058dcbe185d74cfd40a3772d3b801d Author: Vasily Melenchuk AuthorDate: Fri Aug 26 16:32:57 2022 +0300 Commit: Thorsten Behrens CommitDate: Wed Aug 31 03:48:51 2022 +0200 tdf#114769: sw html export: better handling for relative URLs Usage of INetURLObject makes sense only in case of full URLs, but once relative one is provided it will contain invalid data. Change-Id: Icc5e191e2337a3dd9a76c660b1c7709551099a1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138875 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 599da3fa69805ebf8dee4517855fd8706e19d11d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138979 diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 5e5af5e70a17..ab4d71a7d02e 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -2392,6 +2392,63 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testSectionDir) assertXPath(pXmlDoc, "//reqif-xhtml:div[@id='mysect']", "style", "dir: ltr"); } +CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf114769) +{ +// Create document from scratch since relative urls to filesystem can be replaced +// by absolute during save/load +SwDoc* pDoc = createSwDoc(); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); +pWrtShell->Insert("Hyperlink1"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink2"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink3"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink4"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink5"); +pWrtShell->SplitNode(); + +// Normal external URL +uno::Reference xRun(getRun(getParagraph(1), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("http://libreoffice.org/";))); + +// Bookmark reference +xRun.set(getRun(getParagraph(2), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("#some_bookmark"))); + +// Filesystem absolute link +xRun.set(getRun(getParagraph(3), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("C:\\test.txt"))); + +// Filesystem relative link +xRun.set(getRun(getParagraph(4), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("..\\..\\test.odt"))); + +// Filesystem relative link +xRun.set(getRun(getParagraph(5), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString(".\\another.odt"))); + +// Export +uno::Reference xStorable(mxComponent, uno::UNO_QUERY); +uno::Sequence aStoreProperties += { comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")) }; +xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties); + +htmlDocUniquePtr pHtmlDoc = parseHtml(maTempFile); +CPPUNIT_ASSERT(pHtmlDoc); + +CPPUNIT_ASSERT_EQUAL(OUString("http://libreoffice.org/";), + getXPath(pHtmlDoc, "/html/body/p[1]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString("#some_bookmark"), + getXPath(pHtmlDoc, "/html/body/p[2]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString("C:\\test.txt"), getXPath(pHtmlDoc, "/html/body/p[3]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString("..\\..\\test.odt"), + getXPath(pHtmlDoc, "/html/body/p[4]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString(".\\another.odt"), + getXPath(pHtmlDoc, "/html/body/p[5]/a", "href")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 0cede88912d3..f0a963972859 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1334,7 +1334,8 @@ OUString SwHTMLWriter::convertHyperlinkHRefValue(const OUString& rURL) { // Link is not started from "#", so looks like external link. Encode this URL. INetURLObject aURL(sURL); -sURL = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); +if (!aURL.HasError()) +sURL = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); } return URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), sURL ); }
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/htmlexport/htmlexport.cxx | 57 + sw/source/filter/html/wrthtml.cxx |3 + 2 files changed, 59 insertions(+), 1 deletion(-) New commits: commit 599da3fa69805ebf8dee4517855fd8706e19d11d Author: Vasily Melenchuk AuthorDate: Fri Aug 26 16:32:57 2022 +0300 Commit: Thorsten Behrens CommitDate: Tue Aug 30 09:30:07 2022 +0200 tdf#114769: sw html export: better handling for relative URLs Usage of INetURLObject makes sense only in case of full URLs, but once relative one is provided it will contain invalid data. Change-Id: Icc5e191e2337a3dd9a76c660b1c7709551099a1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138875 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 957517e03c95..19a3b8276afd 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -2387,6 +2387,63 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testSectionDir) assertXPath(pXmlDoc, "//reqif-xhtml:div[@id='mysect']", "style", "dir: ltr"); } +CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf114769) +{ +// Create document from scratch since relative urls to filesystem can be replaced +// by absolute during save/load +SwDoc* pDoc = createSwDoc(); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); +pWrtShell->Insert("Hyperlink1"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink2"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink3"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink4"); +pWrtShell->SplitNode(); +pWrtShell->Insert("Hyperlink5"); +pWrtShell->SplitNode(); + +// Normal external URL +uno::Reference xRun(getRun(getParagraph(1), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("http://libreoffice.org/";))); + +// Bookmark reference +xRun.set(getRun(getParagraph(2), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("#some_bookmark"))); + +// Filesystem absolute link +xRun.set(getRun(getParagraph(3), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("C:\\test.txt"))); + +// Filesystem relative link +xRun.set(getRun(getParagraph(4), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString("..\\..\\test.odt"))); + +// Filesystem relative link +xRun.set(getRun(getParagraph(5), 1), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString(".\\another.odt"))); + +// Export +uno::Reference xStorable(mxComponent, uno::UNO_QUERY); +uno::Sequence aStoreProperties += { comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")) }; +xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties); + +htmlDocUniquePtr pHtmlDoc = parseHtml(maTempFile); +CPPUNIT_ASSERT(pHtmlDoc); + +CPPUNIT_ASSERT_EQUAL(OUString("http://libreoffice.org/";), + getXPath(pHtmlDoc, "/html/body/p[1]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString("#some_bookmark"), + getXPath(pHtmlDoc, "/html/body/p[2]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString("C:\\test.txt"), getXPath(pHtmlDoc, "/html/body/p[3]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString("..\\..\\test.odt"), + getXPath(pHtmlDoc, "/html/body/p[4]/a", "href")); +CPPUNIT_ASSERT_EQUAL(OUString(".\\another.odt"), + getXPath(pHtmlDoc, "/html/body/p[5]/a", "href")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 002f0191bd30..e17f24c8cf59 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1348,7 +1348,8 @@ OUString SwHTMLWriter::convertHyperlinkHRefValue(const OUString& rURL) { // Link is not started from "#", so looks like external link. Encode this URL. INetURLObject aURL(sURL); -sURL = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); +if (!aURL.HasError()) +sURL = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); } return URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), sURL ); }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa sw/source writerfilter/source
sw/qa/extras/odfexport/odfexport.cxx |6 +- sw/qa/extras/ooxmlexport/ooxmlexport13.cxx|4 - sw/source/core/doc/doclay.cxx | 11 +++- sw/source/core/doc/textboxhelper.cxx |3 - sw/source/core/unocore/unotext.cxx| 21 +++-- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 49 +++--- writerfilter/source/dmapper/GraphicImport.cxx | 11 ++-- 7 files changed, 61 insertions(+), 44 deletions(-) New commits: commit 679e3e050e4b08bfad335b86d23572518d82ff34 Author: Vasily Melenchuk AuthorDate: Mon Dec 27 13:54:23 2021 +0300 Commit: Thorsten Behrens CommitDate: Fri Aug 5 01:26:34 2022 +0200 tdf#143703 sw: always assign name for fly section Previously generated name was assigned only if not in doc reading mode. But there is no guarantee that it will be assigned later. Better to insert any name in SwDoc::MakeFlySection_() and later it can be overwritten, but fly will definitely have any unique name. * Some test failed because GraphicImport_Impl::applyName() overwrote the name with a different generated one. * This breaks chaining of VML shapes, see test testTDF87348. The code introduced in commit 091fe76b6329b4bb974987554369cbfadd8f2401 in DomainMapper_Impl::ChainTextFrames() breaks if the text frame already has a name; it's a bit confusing which names there come from the file and which come from the API, and it also mixes 2 different cases of VML chaining and DrawingML chaining that look like they should be using different data. * This also breaks moving flys anchored at-char in flys into them in SwXText::convertToTextFrame(), see ooxmlexport13 testFlyInFly. This kind of worked by accident before: the fly is copied and then the original deleted, keeping the same name (with help of SwDoc::mbCopyIsMove); with no name it would compare the SdrObject pointer, which is different for the new copy, now the name is the same. Fix this by only moving flys anchored at the edge of the selection back inoto the body; it turns out that Word actually supports at-char anchors in text frames, but only if it's a VML shape or Compatibility Mode or whatever; i wasn't able to do it in a document created from scratch. This is a bit tricky to ignore the nodes added for floating tables as seen in ooxmlexport10 testFloatingTablesAnchor. * Another change is required in SwDoc::SetFlyName() because of testTdf127732, as it would rename a frame named "Frame1" to "Frame2" when called to rename it to "Frame1". * Some tests failed because after MakeFlySection_() assigns a name it is immediately unconditionally overwritten; replace that with asserts Change-Id: I46752a4413ba3a9e981eccd1e153b3aaf8053781 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127556 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 4d6243693c228703394c00164276f8326447beb9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137764 Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 87e2aead4997..a907a3981cce 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -941,7 +941,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx") OUString aMediaType; // checking first object (formula) { -uno::Reference xEOSupplier(xAccess->getByName("1"), uno::UNO_QUERY); +uno::Reference xEOSupplier(xAccess->getByName("Object1"), uno::UNO_QUERY); uno::Reference xObj(xEOSupplier->getEmbeddedObject()); CPPUNIT_ASSERT(xObj.is()); @@ -955,7 +955,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx") } // checking second object (chart) { -uno::Reference xEOSupplier(xAccess->getByName("2"), uno::UNO_QUERY); +uno::Reference xEOSupplier(xAccess->getByName("Object2"), uno::UNO_QUERY); uno::Reference xObj(xEOSupplier->getEmbeddedObject()); CPPUNIT_ASSERT(xObj.is()); @@ -969,7 +969,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx") } // checking third object (chart) { -uno::Reference xEOSupplier(xAccess->getByName("3"), uno::UNO_QUERY); +uno::Reference xEOSupplier(xAccess->getByName("Object3"), uno::UNO_QUERY); uno::Reference xObj(xEOSupplier->getEmbeddedObject()); CPPUNIT_ASSERT(xObj.is()); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 609d3f7f30b6..045c1e1d405b 100644 ---
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/qa sw/source writerfilter/source
sw/qa/extras/odfexport/odfexport.cxx |6 +- sw/qa/extras/ooxmlexport/ooxmlexport13.cxx|4 - sw/source/core/doc/doclay.cxx | 11 +++- sw/source/core/doc/textboxhelper.cxx |6 +- sw/source/core/unocore/unotext.cxx| 21 +++-- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 49 +++--- writerfilter/source/dmapper/GraphicImport.cxx | 11 ++-- 7 files changed, 63 insertions(+), 45 deletions(-) New commits: commit d0a8f6857e93f1f4a26f05615618ff733bfb4851 Author: Vasily Melenchuk AuthorDate: Mon Dec 27 13:54:23 2021 +0300 Commit: Thorsten Behrens CommitDate: Fri Aug 5 01:26:20 2022 +0200 tdf#143703 sw: always assign name for fly section Previously generated name was assigned only if not in doc reading mode. But there is no guarantee that it will be assigned later. Better to insert any name in SwDoc::MakeFlySection_() and later it can be overwritten, but fly will definitely have any unique name. * Some test failed because GraphicImport_Impl::applyName() overwrote the name with a different generated one. * This breaks chaining of VML shapes, see test testTDF87348. The code introduced in commit 091fe76b6329b4bb974987554369cbfadd8f2401 in DomainMapper_Impl::ChainTextFrames() breaks if the text frame already has a name; it's a bit confusing which names there come from the file and which come from the API, and it also mixes 2 different cases of VML chaining and DrawingML chaining that look like they should be using different data. * This also breaks moving flys anchored at-char in flys into them in SwXText::convertToTextFrame(), see ooxmlexport13 testFlyInFly. This kind of worked by accident before: the fly is copied and then the original deleted, keeping the same name (with help of SwDoc::mbCopyIsMove); with no name it would compare the SdrObject pointer, which is different for the new copy, now the name is the same. Fix this by only moving flys anchored at the edge of the selection back inoto the body; it turns out that Word actually supports at-char anchors in text frames, but only if it's a VML shape or Compatibility Mode or whatever; i wasn't able to do it in a document created from scratch. This is a bit tricky to ignore the nodes added for floating tables as seen in ooxmlexport10 testFloatingTablesAnchor. * Another change is required in SwDoc::SetFlyName() because of testTdf127732, as it would rename a frame named "Frame1" to "Frame2" when called to rename it to "Frame1". * Some tests failed because after MakeFlySection_() assigns a name it is immediately unconditionally overwritten; replace that with asserts Change-Id: I46752a4413ba3a9e981eccd1e153b3aaf8053781 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127556 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 4d6243693c228703394c00164276f8326447beb9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137762 Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index e58b772b8cdf..3fb14b220c69 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -936,7 +936,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx") OUString aMediaType; // checking first object (formula) { -uno::Reference xEOSupplier(xAccess->getByName("1"), uno::UNO_QUERY); +uno::Reference xEOSupplier(xAccess->getByName("Object1"), uno::UNO_QUERY); uno::Reference xObj(xEOSupplier->getEmbeddedObject()); CPPUNIT_ASSERT(xObj.is()); @@ -950,7 +950,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx") } // checking second object (chart) { -uno::Reference xEOSupplier(xAccess->getByName("2"), uno::UNO_QUERY); +uno::Reference xEOSupplier(xAccess->getByName("Object2"), uno::UNO_QUERY); uno::Reference xObj(xEOSupplier->getEmbeddedObject()); CPPUNIT_ASSERT(xObj.is()); @@ -964,7 +964,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx") } // checking third object (chart) { -uno::Reference xEOSupplier(xAccess->getByName("3"), uno::UNO_QUERY); +uno::Reference xEOSupplier(xAccess->getByName("Object3"), uno::UNO_QUERY); uno::Reference xObj(xEOSupplier->getEmbeddedObject()); CPPUNIT_ASSERT(xObj.is()); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index b97b6c241093..51634dcd8a00 100644 ---
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - 2 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/ooxmlexport13.cxx|4 sw/source/core/doc/doclay.cxx | 11 + sw/source/core/doc/textboxhelper.cxx |3 sw/source/core/unocore/unotext.cxx| 21 ++- sw/source/filter/xml/xmlexp.hxx |5 sw/source/filter/xml/xmlfmte.cxx | 12 + sw/source/filter/xml/xmliteme.cxx |2 sw/source/filter/xml/xmltble.cxx | 149 +++--- sw/source/filter/xml/xmltexte.hxx | 12 + writerfilter/source/dmapper/DomainMapper_Impl.cxx | 49 +++ writerfilter/source/dmapper/GraphicImport.cxx | 11 - 11 files changed, 161 insertions(+), 118 deletions(-) New commits: commit d83a82d872417a0c50d38c54f95af512136f6d94 Author: Vasily Melenchuk AuthorDate: Mon Dec 27 13:54:23 2021 +0300 Commit: Michael Stahl CommitDate: Thu Aug 4 13:04:11 2022 +0200 tdf#143703 sw: always assign name for fly section Previously generated name was assigned only if not in doc reading mode. But there is no guarantee that it will be assigned later. Better to insert any name in SwDoc::MakeFlySection_() and later it can be overwritten, but fly will definitely have any unique name. * Some test failed because GraphicImport_Impl::applyName() overwrote the name with a different generated one. * This breaks chaining of VML shapes, see test testTDF87348. The code introduced in commit 091fe76b6329b4bb974987554369cbfadd8f2401 in DomainMapper_Impl::ChainTextFrames() breaks if the text frame already has a name; it's a bit confusing which names there come from the file and which come from the API, and it also mixes 2 different cases of VML chaining and DrawingML chaining that look like they should be using different data. * This also breaks moving flys anchored at-char in flys into them in SwXText::convertToTextFrame(), see ooxmlexport13 testFlyInFly. This kind of worked by accident before: the fly is copied and then the original deleted, keeping the same name (with help of SwDoc::mbCopyIsMove); with no name it would compare the SdrObject pointer, which is different for the new copy, now the name is the same. Fix this by only moving flys anchored at the edge of the selection back inoto the body; it turns out that Word actually supports at-char anchors in text frames, but only if it's a VML shape or Compatibility Mode or whatever; i wasn't able to do it in a document created from scratch. This is a bit tricky to ignore the nodes added for floating tables as seen in ooxmlexport10 testFloatingTablesAnchor. * Another change is required in SwDoc::SetFlyName() because of testTdf127732, as it would rename a frame named "Frame1" to "Frame2" when called to rename it to "Frame1". * Some tests failed because after MakeFlySection_() assigns a name it is immediately unconditionally overwritten; replace that with asserts Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127556 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 4d6243693c228703394c00164276f8326447beb9) Change-Id: I46752a4413ba3a9e981eccd1e153b3aaf8053781 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137766 Tested-by: Thorsten Behrens Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 8f457f89bc16..62ad331a8c64 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -44,11 +44,11 @@ DECLARE_SW_EXPORT_TEST(testFlyInFly, "ooo39250-1-min.rtf", nullptr, Test) // check that anchor of text frame is in other text frame uno::Reference const xAnchored(getShape(3), uno::UNO_QUERY); CPPUNIT_ASSERT(xAnchored.is()); -CPPUNIT_ASSERT_EQUAL(OUString(""), uno::Reference(xAnchored, uno::UNO_QUERY_THROW)->getName()); +CPPUNIT_ASSERT_EQUAL(OUString("Frame1")/*generated name*/, uno::Reference(xAnchored, uno::UNO_QUERY_THROW)->getName()); uno::Reference const xAnchorText(xAnchored->getAnchor()->getText()); uno::Reference const xAnchorFrame(xAnchorText, uno::UNO_QUERY); CPPUNIT_ASSERT(xAnchorFrame.is()); -CPPUNIT_ASSERT_EQUAL(OUString("Frame2"), uno::Reference(xAnchorFrame, uno::UNO_QUERY_THROW)->getName()); +CPPUNIT_ASSERT_EQUAL(OUString("Frame3"), uno::Reference(xAnchorFrame, uno::UNO_QUERY_THROW)->getName()); } DECLARE_OOXMLEXPORT_TEST(testTdf125778_lostPageBreakTOX, "tdf125778_lostPageBreakTOX.docx") diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index ec4861fe39b2..5b3dc0e
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/inc sw/qa sw/source writerfilter/source
sw/inc/IDocumentSettingAccess.hxx |4 +++- sw/qa/extras/ooxmlexport/data/tdf148360.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx| 15 +++ sw/source/core/doc/DocumentSettingManager.cxx |9 +++-- sw/source/core/inc/DocumentSettingManager.hxx |1 + sw/source/core/text/txtfld.cxx|3 ++- sw/source/core/txtnode/ndtxt.cxx | 18 -- sw/source/uibase/uno/SwXDocumentSettings.cxx | 18 +- writerfilter/source/dmapper/DomainMapper.cxx |2 +- 9 files changed, 58 insertions(+), 12 deletions(-) New commits: commit 49b432d2c42000a561494c82fa56646424f3d288 Author: Vasily Melenchuk AuthorDate: Thu May 26 12:05:58 2022 +0300 Commit: Thorsten Behrens CommitDate: Wed Aug 3 21:56:29 2022 +0200 tdf#148360: sw: do not ignore list label followed by ...even if numbering is empty. Since this is a core change to avoid impact on other formats (mostly ODT) it is implemented as a new document setting. Change-Id: I35e1cec97eb40f9f3411e3ba74cb553bd8afac59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134989 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit a7d9837a8aa6d1233f4c21e4db5d32428a3ffc58) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137717 diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx index eee38ef7678e..548419576168 100644 --- a/sw/inc/IDocumentSettingAccess.hxx +++ b/sw/inc/IDocumentSettingAccess.hxx @@ -121,7 +121,9 @@ enum class DocumentSettingId FOOTNOTE_IN_COLUMN_TO_PAGEEND, // AsChar anchored flys wrapped differently in ooxml than normally so in case of // docx enable this flag. For details see ticket tdf#100680. -WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML +WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML, +// Should we display follow by symbol for numbered paragraph if numbering exists, but "None"? +NO_NUMBERING_SHOW_FOLLOWBY }; /** Provides access to settings of a document diff --git a/sw/qa/extras/ooxmlexport/data/tdf148360.docx b/sw/qa/extras/ooxmlexport/data/tdf148360.docx new file mode 100644 index ..8f09f685d26f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148360.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 9ab04a6aa8c3..0ff6256fc3b8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -1016,6 +1016,21 @@ DECLARE_OOXMLEXPORT_TEST(testTdf149313, "tdf149313.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(8000), getXPath(pXmlDoc, "/root/page[2]/infos/bounds", "width").toInt32()); } +#include +#include +#include +#include + +DECLARE_OOXMLEXPORT_TEST(testTdf148360, "tdf148360.docx") +{ +const auto& pLayout = parseLayoutDump(); + +// Ensure first element is a tab +assertXPath(pLayout, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::TabLeft"); +// and only then goes content +assertXPath(pLayout, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); +} + DECLARE_OOXMLEXPORT_TEST(testTdf135923, "tdf135923-min.docx") { uno::Reference xShape(getShape(1), uno::UNO_QUERY); diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx index 851aec5b9e10..5f2a57099938 100644 --- a/sw/source/core/doc/DocumentSettingManager.cxx +++ b/sw/source/core/doc/DocumentSettingManager.cxx @@ -106,8 +106,8 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc) mbFootnoteInColumnToPageEnd(false), mnImagePreferredDPI(0), mbAutoFirstLineIndentDisregardLineSpace(true), -mbWrapAsCharFlysLikeInOOXML(false) - +mbWrapAsCharFlysLikeInOOXML(false), +mbNoNumberingShowFollowBy(false) // COMPATIBILITY FLAGS END { // COMPATIBILITY FLAGS START @@ -246,6 +246,7 @@ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const case DocumentSettingId::AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE: return mbAutoFirstLineIndentDisregardLineSpace; case DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML: return mbWrapAsCharFlysLikeInOOXML; +case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY: return mbNoNumberingShowFollowBy; default: OSL_FAIL("Invalid setting id"); } @@ -428,6 +429,10 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo mbWrapAsCharFlysLikeInOOXML = value; break; +case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY: +mbNoNumberingShowFollowBy = value; +break; + // COMPATIBILITY FLAGS END case DocumentSettingId::BROWSE_MODE: //can be
[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/ooxmlexport13.cxx|4 - sw/source/core/doc/doclay.cxx | 11 +++- sw/source/core/doc/textboxhelper.cxx |3 - sw/source/core/unocore/unotext.cxx| 21 +++-- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 49 +++--- writerfilter/source/dmapper/GraphicImport.cxx | 11 ++-- 6 files changed, 58 insertions(+), 41 deletions(-) New commits: commit 4562036996e98ef33f42889abe78cfb975341776 Author: Vasily Melenchuk AuthorDate: Mon Dec 27 13:54:23 2021 +0300 Commit: Thorsten Behrens CommitDate: Wed Aug 3 21:54:36 2022 +0200 tdf#143703 sw: always assign name for fly section Previously generated name was assigned only if not in doc reading mode. But there is no guarantee that it will be assigned later. Better to insert any name in SwDoc::MakeFlySection_() and later it can be overwritten, but fly will definitely have any unique name. * Some test failed because GraphicImport_Impl::applyName() overwrote the name with a different generated one. * This breaks chaining of VML shapes, see test testTDF87348. The code introduced in commit 091fe76b6329b4bb974987554369cbfadd8f2401 in DomainMapper_Impl::ChainTextFrames() breaks if the text frame already has a name; it's a bit confusing which names there come from the file and which come from the API, and it also mixes 2 different cases of VML chaining and DrawingML chaining that look like they should be using different data. * This also breaks moving flys anchored at-char in flys into them in SwXText::convertToTextFrame(), see ooxmlexport13 testFlyInFly. This kind of worked by accident before: the fly is copied and then the original deleted, keeping the same name (with help of SwDoc::mbCopyIsMove); with no name it would compare the SdrObject pointer, which is different for the new copy, now the name is the same. Fix this by only moving flys anchored at the edge of the selection back inoto the body; it turns out that Word actually supports at-char anchors in text frames, but only if it's a VML shape or Compatibility Mode or whatever; i wasn't able to do it in a document created from scratch. This is a bit tricky to ignore the nodes added for floating tables as seen in ooxmlexport10 testFloatingTablesAnchor. * Another change is required in SwDoc::SetFlyName() because of testTdf127732, as it would rename a frame named "Frame1" to "Frame2" when called to rename it to "Frame1". * Some tests failed because after MakeFlySection_() assigns a name it is immediately unconditionally overwritten; replace that with asserts Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127556 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 4d6243693c228703394c00164276f8326447beb9) Change-Id: I46752a4413ba3a9e981eccd1e153b3aaf8053781 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137766 Tested-by: Thorsten Behrens Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 5ad0a4ece74c..6305de3577a2 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -44,11 +44,11 @@ DECLARE_SW_EXPORT_TEST(testFlyInFly, "ooo39250-1-min.rtf", nullptr, Test) // check that anchor of text frame is in other text frame uno::Reference const xAnchored(getShape(3), uno::UNO_QUERY); CPPUNIT_ASSERT(xAnchored.is()); -CPPUNIT_ASSERT_EQUAL(OUString(""), uno::Reference(xAnchored, uno::UNO_QUERY_THROW)->getName()); +CPPUNIT_ASSERT_EQUAL(OUString("Frame1")/*generated name*/, uno::Reference(xAnchored, uno::UNO_QUERY_THROW)->getName()); uno::Reference const xAnchorText(xAnchored->getAnchor()->getText()); uno::Reference const xAnchorFrame(xAnchorText, uno::UNO_QUERY); CPPUNIT_ASSERT(xAnchorFrame.is()); -CPPUNIT_ASSERT_EQUAL(OUString("Frame2"), uno::Reference(xAnchorFrame, uno::UNO_QUERY_THROW)->getName()); +CPPUNIT_ASSERT_EQUAL(OUString("Frame3"), uno::Reference(xAnchorFrame, uno::UNO_QUERY_THROW)->getName()); } DECLARE_OOXMLEXPORT_TEST(testTdf125778_lostPageBreakTOX, "tdf125778_lostPageBreakTOX.docx") diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index ec4861fe39b2..5b3dc0ef3687 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -157,13 +157,12 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos, pFrameFormat = getIDocumentStylePoolAccess().GetFrameFormatFromPool( RES_POOLFRM_FRAME );
[Libreoffice-commits] core.git: sw/qa sw/source writerfilter/source
sw/qa/extras/odfexport/odfexport.cxx |6 +- sw/qa/extras/ooxmlexport/ooxmlexport13.cxx|4 - sw/source/core/doc/doclay.cxx | 11 +++- sw/source/core/doc/textboxhelper.cxx |6 +- sw/source/core/unocore/unotext.cxx| 21 +++-- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 49 +++--- writerfilter/source/dmapper/GraphicImport.cxx | 11 ++-- 7 files changed, 63 insertions(+), 45 deletions(-) New commits: commit 4d6243693c228703394c00164276f8326447beb9 Author: Vasily Melenchuk AuthorDate: Mon Dec 27 13:54:23 2021 +0300 Commit: Michael Stahl CommitDate: Wed Aug 3 17:57:50 2022 +0200 tdf#143703 sw: always assign name for fly section Previously generated name was assigned only if not in doc reading mode. But there is no guarantee that it will be assigned later. Better to insert any name in SwDoc::MakeFlySection_() and later it can be overwritten, but fly will definitely have any unique name. * Some test failed because GraphicImport_Impl::applyName() overwrote the name with a different generated one. * This breaks chaining of VML shapes, see test testTDF87348. The code introduced in commit 091fe76b6329b4bb974987554369cbfadd8f2401 in DomainMapper_Impl::ChainTextFrames() breaks if the text frame already has a name; it's a bit confusing which names there come from the file and which come from the API, and it also mixes 2 different cases of VML chaining and DrawingML chaining that look like they should be using different data. * This also breaks moving flys anchored at-char in flys into them in SwXText::convertToTextFrame(), see ooxmlexport13 testFlyInFly. This kind of worked by accident before: the fly is copied and then the original deleted, keeping the same name (with help of SwDoc::mbCopyIsMove); with no name it would compare the SdrObject pointer, which is different for the new copy, now the name is the same. Fix this by only moving flys anchored at the edge of the selection back inoto the body; it turns out that Word actually supports at-char anchors in text frames, but only if it's a VML shape or Compatibility Mode or whatever; i wasn't able to do it in a document created from scratch. This is a bit tricky to ignore the nodes added for floating tables as seen in ooxmlexport10 testFloatingTablesAnchor. * Another change is required in SwDoc::SetFlyName() because of testTdf127732, as it would rename a frame named "Frame1" to "Frame2" when called to rename it to "Frame1". * Some tests failed because after MakeFlySection_() assigns a name it is immediately unconditionally overwritten; replace that with asserts Change-Id: I46752a4413ba3a9e981eccd1e153b3aaf8053781 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127556 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index e58b772b8cdf..3fb14b220c69 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -936,7 +936,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx") OUString aMediaType; // checking first object (formula) { -uno::Reference xEOSupplier(xAccess->getByName("1"), uno::UNO_QUERY); +uno::Reference xEOSupplier(xAccess->getByName("Object1"), uno::UNO_QUERY); uno::Reference xObj(xEOSupplier->getEmbeddedObject()); CPPUNIT_ASSERT(xObj.is()); @@ -950,7 +950,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx") } // checking second object (chart) { -uno::Reference xEOSupplier(xAccess->getByName("2"), uno::UNO_QUERY); +uno::Reference xEOSupplier(xAccess->getByName("Object2"), uno::UNO_QUERY); uno::Reference xObj(xEOSupplier->getEmbeddedObject()); CPPUNIT_ASSERT(xObj.is()); @@ -964,7 +964,7 @@ DECLARE_ODFEXPORT_TEST(testTdf134987, "tdf134987.docx") } // checking third object (chart) { -uno::Reference xEOSupplier(xAccess->getByName("3"), uno::UNO_QUERY); +uno::Reference xEOSupplier(xAccess->getByName("Object3"), uno::UNO_QUERY); uno::Reference xObj(xEOSupplier->getEmbeddedObject()); CPPUNIT_ASSERT(xObj.is()); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 21d85580ecb9..751ebdcf8167 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -41,11 +41,11 @@ DECLARE_SW_EXPORT_TEST(testFlyInFly, "ooo39250-1-min.rtf&
[Libreoffice-commits] core.git: sw/inc sw/qa sw/source writerfilter/source
sw/inc/IDocumentSettingAccess.hxx |4 +++- sw/qa/extras/ooxmlexport/data/tdf148360.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx| 15 +++ sw/source/core/doc/DocumentSettingManager.cxx |9 +++-- sw/source/core/inc/DocumentSettingManager.hxx |1 + sw/source/core/text/txtfld.cxx|3 ++- sw/source/core/txtnode/ndtxt.cxx | 18 -- sw/source/uibase/uno/SwXDocumentSettings.cxx | 18 +- writerfilter/source/dmapper/DomainMapper.cxx |2 +- 9 files changed, 58 insertions(+), 12 deletions(-) New commits: commit a7d9837a8aa6d1233f4c21e4db5d32428a3ffc58 Author: Vasily Melenchuk AuthorDate: Thu May 26 12:05:58 2022 +0300 Commit: Thorsten Behrens CommitDate: Tue Aug 2 15:59:35 2022 +0200 tdf#148360: sw: do not ignore list label followed by ...even if numbering is empty. Since this is a core change to avoid impact on other formats (mostly ODT) it is implemented as a new document setting. Change-Id: I35e1cec97eb40f9f3411e3ba74cb553bd8afac59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134989 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx index eee38ef7678e..548419576168 100644 --- a/sw/inc/IDocumentSettingAccess.hxx +++ b/sw/inc/IDocumentSettingAccess.hxx @@ -121,7 +121,9 @@ enum class DocumentSettingId FOOTNOTE_IN_COLUMN_TO_PAGEEND, // AsChar anchored flys wrapped differently in ooxml than normally so in case of // docx enable this flag. For details see ticket tdf#100680. -WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML +WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML, +// Should we display follow by symbol for numbered paragraph if numbering exists, but "None"? +NO_NUMBERING_SHOW_FOLLOWBY }; /** Provides access to settings of a document diff --git a/sw/qa/extras/ooxmlexport/data/tdf148360.docx b/sw/qa/extras/ooxmlexport/data/tdf148360.docx new file mode 100644 index ..8f09f685d26f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148360.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index ee5b0dd19b14..bb9d30fc97d0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -1054,6 +1054,21 @@ DECLARE_OOXMLEXPORT_TEST(testTdf149313, "tdf149313.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(8000), getXPath(pXmlDoc, "/root/page[2]/infos/bounds", "width").toInt32()); } +#include +#include +#include +#include + +DECLARE_OOXMLEXPORT_TEST(testTdf148360, "tdf148360.docx") +{ +const auto& pLayout = parseLayoutDump(); + +// Ensure first element is a tab +assertXPath(pLayout, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::TabLeft"); +// and only then goes content +assertXPath(pLayout, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); +} + DECLARE_OOXMLEXPORT_TEST(testTdf135923, "tdf135923-min.docx") { uno::Reference xShape(getShape(1), uno::UNO_QUERY); diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx index 851aec5b9e10..5f2a57099938 100644 --- a/sw/source/core/doc/DocumentSettingManager.cxx +++ b/sw/source/core/doc/DocumentSettingManager.cxx @@ -106,8 +106,8 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc) mbFootnoteInColumnToPageEnd(false), mnImagePreferredDPI(0), mbAutoFirstLineIndentDisregardLineSpace(true), -mbWrapAsCharFlysLikeInOOXML(false) - +mbWrapAsCharFlysLikeInOOXML(false), +mbNoNumberingShowFollowBy(false) // COMPATIBILITY FLAGS END { // COMPATIBILITY FLAGS START @@ -246,6 +246,7 @@ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const case DocumentSettingId::AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE: return mbAutoFirstLineIndentDisregardLineSpace; case DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML: return mbWrapAsCharFlysLikeInOOXML; +case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY: return mbNoNumberingShowFollowBy; default: OSL_FAIL("Invalid setting id"); } @@ -428,6 +429,10 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo mbWrapAsCharFlysLikeInOOXML = value; break; +case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY: +mbNoNumberingShowFollowBy = value; +break; + // COMPATIBILITY FLAGS END case DocumentSettingId::BROWSE_MODE: //can be used temporary (load/save) when no SwViewShell is available diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - shell/source
shell/source/win32/simplemail/smplmailclient.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 1d00416c04921d0d3182d8d59113db6f4bbbf116 Author: Vasily Melenchuk AuthorDate: Tue Jul 26 20:41:34 2022 +0300 Commit: Vasily Melenchuk CommitDate: Thu Jul 28 10:03:58 2022 +0200 tdf#150161: senddoc: use corrected name url: original can be a file path ...and in this case file name will be not parsed and --attach-name parameter will be empty. This leads to missing file name of attachment. In case of Thunderbird it is not a big problem, but Outlook does not want to attach .tmp files: it is "potentially unsafe attachment". Change-Id: I7c2f696391e1183211a169b08004c6668771f288 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137480 Tested-by: Gabor Kelemen Reviewed-by: Mike Kaganski Reviewed-by: Thorsten Behrens (cherry picked from commit 772f7a2dc3508bdebb53b6de4a43685d517cf1ef) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137514 Tested-by: Vasily Melenchuk Reviewed-by: Vasily Melenchuk diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx index ff4b7443ef73..254de4bb49a0 100644 --- a/shell/source/win32/simplemail/smplmailclient.cxx +++ b/shell/source/win32/simplemail/smplmailclient.cxx @@ -214,7 +214,7 @@ OUString CSmplMailClient::CopyAttachment(const OUString& sOrigAttachURL, OUStrin osl::FileBase::getFileURLFromSystemPath(sCorrectedOrigAttachURL, sCorrectedOrigAttachURL); if (osl::File::copy(sCorrectedOrigAttachURL, sNewAttachmentURL) == osl::FileBase::RC::E_None) { -INetURLObject url(sOrigAttachURL, INetURLObject::EncodeMechanism::WasEncoded); +INetURLObject url(sCorrectedOrigAttachURL, INetURLObject::EncodeMechanism::WasEncoded); sUserVisibleName = url.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset); nodelete = false;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - shell/source
shell/source/win32/simplemail/smplmailclient.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6837355d51430f66950f8b5b6f0b714ca15de1c5 Author: Vasily Melenchuk AuthorDate: Tue Jul 26 20:41:34 2022 +0300 Commit: Xisco Fauli CommitDate: Wed Jul 27 17:48:18 2022 +0200 tdf#150161: senddoc: use corrected name url: original can be a file path ...and in this case file name will be not parsed and --attach-name parameter will be empty. This leads to missing file name of attachment. In case of Thunderbird it is not a big problem, but Outlook does not want to attach .tmp files: it is "potentially unsafe attachment". Change-Id: I7c2f696391e1183211a169b08004c6668771f288 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137480 Tested-by: Gabor Kelemen Reviewed-by: Mike Kaganski Reviewed-by: Thorsten Behrens (cherry picked from commit 772f7a2dc3508bdebb53b6de4a43685d517cf1ef) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137516 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx index 075eaa34579d..8e85ca0868ee 100644 --- a/shell/source/win32/simplemail/smplmailclient.cxx +++ b/shell/source/win32/simplemail/smplmailclient.cxx @@ -201,7 +201,7 @@ OUString CSmplMailClient::CopyAttachment(const OUString& sOrigAttachURL, OUStrin osl::FileBase::getFileURLFromSystemPath(sCorrectedOrigAttachURL, sCorrectedOrigAttachURL); if (osl::File::copy(sCorrectedOrigAttachURL, sNewAttachmentURL) == osl::FileBase::RC::E_None) { -INetURLObject url(sOrigAttachURL, INetURLObject::EncodeMechanism::WasEncoded); +INetURLObject url(sCorrectedOrigAttachURL, INetURLObject::EncodeMechanism::WasEncoded); sUserVisibleName = url.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset); nodelete = false;
[Libreoffice-commits] core.git: shell/source
shell/source/win32/simplemail/smplmailclient.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 772f7a2dc3508bdebb53b6de4a43685d517cf1ef Author: Vasily Melenchuk AuthorDate: Tue Jul 26 20:41:34 2022 +0300 Commit: Thorsten Behrens CommitDate: Wed Jul 27 14:27:03 2022 +0200 tdf#150161: senddoc: use corrected name url: original can be a file path ...and in this case file name will be not parsed and --attach-name parameter will be empty. This leads to missing file name of attachment. In case of Thunderbird it is not a big problem, but Outlook does not want to attach .tmp files: it is "potentially unsafe attachment". Change-Id: I7c2f696391e1183211a169b08004c6668771f288 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137480 Tested-by: Gabor Kelemen Reviewed-by: Mike Kaganski Reviewed-by: Thorsten Behrens diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx index 075eaa34579d..8e85ca0868ee 100644 --- a/shell/source/win32/simplemail/smplmailclient.cxx +++ b/shell/source/win32/simplemail/smplmailclient.cxx @@ -201,7 +201,7 @@ OUString CSmplMailClient::CopyAttachment(const OUString& sOrigAttachURL, OUStrin osl::FileBase::getFileURLFromSystemPath(sCorrectedOrigAttachURL, sCorrectedOrigAttachURL); if (osl::File::copy(sCorrectedOrigAttachURL, sNewAttachmentURL) == osl::FileBase::RC::E_None) { -INetURLObject url(sOrigAttachURL, INetURLObject::EncodeMechanism::WasEncoded); +INetURLObject url(sCorrectedOrigAttachURL, INetURLObject::EncodeMechanism::WasEncoded); sUserVisibleName = url.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset); nodelete = false;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf149313.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport12.cxx |2 ++ sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 13 + writerfilter/source/dmapper/DomainMapper.cxx | 14 -- 4 files changed, 27 insertions(+), 2 deletions(-) New commits: commit 00d26e055d97706961032416b2a3de4d518d987b Author: Vasily Melenchuk AuthorDate: Thu Jun 16 12:16:33 2022 +0300 Commit: Xisco Fauli CommitDate: Mon Jul 18 12:08:18 2022 +0200 tdf#149313: DOCX import: improved conditions for removeparagraph Quite complex conditions to define if current paragraph can be removed for document were forcing to keep paragraphs after page break with only section definition. Usually these pars are removed, but since tdf#103975 fix they were kept. It looks like to resolve that problem will be enough to ensure current break is a column break: they are bit different and processed in a different way unlike other break types. So this condition part instead of "do not remove par with section info after any break" it is right now "do not remove par after column break". Change-Id: Ib6290dc6254430883a598bef3ecd1f7ab7063922 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135969 Tested-by: Jenkins Reviewed-by: Justin Luth (cherry picked from commit a4ab155ae15e9e6d4deb157634f8b86c87fcbde4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136985 Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/ooxmlexport/data/tdf149313.docx b/sw/qa/extras/ooxmlexport/data/tdf149313.docx new file mode 100644 index ..4c0c454b42a6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf149313.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 2ba905a82c62..46d7a87a83fd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -689,6 +689,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112202, "090716_Studentische_Arbeit_VWS.docx") assertXPath(pXmlDoc, "/root/page[3]/header/tab", 1); assertXPath(pXmlDoc, "/root/page[3]/header/tab/row/cell/txt/Text", 0); assertXPath(pXmlDoc, "/root/page[3]/header//anchored", 0); +// tdf#149313: ensure 3rd page does not have extra empty paragraph at top +assertXPathContent(pXmlDoc, "/root/page[3]/body//txt", "AUFGABENSTELLUNG"); // page 4 header: 1 table, 1 paragraph, with text assertXPath(pXmlDoc, "/root/page[4]/header/txt", 1); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index f7035eb1d073..74ff724dbbd3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -1003,6 +1003,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149200) CPPUNIT_ASSERT_EQUAL(OUString("dark1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:color", "themeColor")); } +DECLARE_OOXMLEXPORT_TEST(testTdf149313, "tdf149313.docx") +{ +// only 2, but not 3 pages in document +CPPUNIT_ASSERT_EQUAL(2, getPages()); + +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +// And ensure that pages are with correct sections (have correct dimensions) +CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "height").toInt32()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[2]/infos/bounds", "height").toInt32()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(8000), getXPath(pXmlDoc, "/root/page[2]/infos/bounds", "width").toInt32()); +} + DECLARE_OOXMLEXPORT_TEST(testTdf135923, "tdf135923-min.docx") { uno::Reference xShape(getShape(1), uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 224f8c2aa902..cc05d84cef4a 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3892,13 +3892,23 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) // If the paragraph contains only the section properties and it has // no runs, we should not create a paragraph for it in Writer, unless that would remove the whole section. -SectionPropertyMap* pSectionContext = m_pImpl->GetSectionContext(); +// Also do not remove here column breaks: they are treated in a different way and place. +bool bIsColumnBreak = false; +if (pContext->isSet(PROP_BREAK_TYPE)) +{ +const uno::Any aBr
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf149313.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport12.cxx |2 ++ sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 13 + writerfilter/source/dmapper/DomainMapper.cxx | 14 -- 4 files changed, 27 insertions(+), 2 deletions(-) New commits: commit a4ab155ae15e9e6d4deb157634f8b86c87fcbde4 Author: Vasily Melenchuk AuthorDate: Thu Jun 16 12:16:33 2022 +0300 Commit: Thorsten Behrens CommitDate: Tue Jul 12 21:16:48 2022 +0200 tdf#149313: DOCX import: improved conditions for removeparagraph Quite complex conditions to define if current paragraph can be removed for document were forcing to keep paragraphs after page break with only section definition. Usually these pars are removed, but since tdf#103975 fix they were kept. It looks like to resolve that problem will be enough to ensure current break is a column break: they are bit different and processed in a different way unlike other break types. So this condition part instead of "do not remove par with section info after any break" it is right now "do not remove par after column break". Change-Id: Ib6290dc6254430883a598bef3ecd1f7ab7063922 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135969 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sw/qa/extras/ooxmlexport/data/tdf149313.docx b/sw/qa/extras/ooxmlexport/data/tdf149313.docx new file mode 100644 index ..4c0c454b42a6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf149313.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 5573a1b1adf2..d027706de65d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -689,6 +689,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112202, "090716_Studentische_Arbeit_VWS.docx") assertXPath(pXmlDoc, "/root/page[3]/header/tab", 1); assertXPath(pXmlDoc, "/root/page[3]/header/tab/row/cell/txt/Text", 0); assertXPath(pXmlDoc, "/root/page[3]/header//anchored", 0); +// tdf#149313: ensure 3rd page does not have extra empty paragraph at top +assertXPathContent(pXmlDoc, "/root/page[3]/body//txt", "AUFGABENSTELLUNG"); // page 4 header: 1 table, 1 paragraph, with text assertXPath(pXmlDoc, "/root/page[4]/header/txt", 1); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 496a7cfaed02..93ad3abf2da6 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -1018,6 +1018,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149200) CPPUNIT_ASSERT_EQUAL(OUString("dark1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:color", "themeColor")); } +DECLARE_OOXMLEXPORT_TEST(testTdf149313, "tdf149313.docx") +{ +// only 2, but not 3 pages in document +CPPUNIT_ASSERT_EQUAL(2, getPages()); + +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +// And ensure that pages are with correct sections (have correct dimensions) +CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "height").toInt32()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "width").toInt32()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[2]/infos/bounds", "height").toInt32()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(8000), getXPath(pXmlDoc, "/root/page[2]/infos/bounds", "width").toInt32()); +} + DECLARE_OOXMLEXPORT_TEST(testTdf135923, "tdf135923-min.docx") { uno::Reference xShape(getShape(1), uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 713412ccfa94..d940d09ffd34 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3892,13 +3892,23 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) // If the paragraph contains only the section properties and it has // no runs, we should not create a paragraph for it in Writer, unless that would remove the whole section. -SectionPropertyMap* pSectionContext = m_pImpl->GetSectionContext(); +// Also do not remove here column breaks: they are treated in a different way and place. +bool bIsColumnBreak = false; +if (pContext->isSet(PROP_BREAK_TYPE)) +{ +const uno::Any aBreakType = pContext->getProperty(PROP_BREAK_TYPE)->second; +bIsColumnBreak = +aBreakType == style::BreakType_COLUMN_BEFORE || +
[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf148361.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 16 writerfilter/source/dmapper/SdtHelper.cxx| 17 - writerfilter/source/dmapper/SdtHelper.hxx|3 +++ 4 files changed, 31 insertions(+), 5 deletions(-) New commits: commit 3ddf0f924b2b5fbb5f409e0c6cb59cf2e82e4854 Author: Vasily Melenchuk AuthorDate: Mon Apr 4 18:05:18 2022 +0300 Commit: Thorsten Behrens CommitDate: Tue Jun 21 01:18:48 2022 +0200 tdf#148361: docx sdt: cleanup databinding data after inserting Databinding data is used only for current sdt block. It should be clean up after usage to avoid impact on next sdt blocks. Change-Id: I53f47dd655ed027d40eb518784dcae69813e612f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132524 Tested-by: Jenkins Tested-by: Xisco Fauli Reviewed-by: Vasily Melenchuk Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132634 Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens diff --git a/sw/qa/extras/ooxmlexport/data/tdf148361.docx b/sw/qa/extras/ooxmlexport/data/tdf148361.docx new file mode 100644 index ..ecf9a5f0087c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148361.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index f63b5aa5a5fe..3867254edb69 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -211,6 +211,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148111, "tdf148111.docx") CPPUNIT_ASSERT(!xFields->hasMoreElements()); } +DECLARE_OOXMLEXPORT_TEST(testTdf148361, "tdf148361.docx") +{ +// Refresh fields and ensure cross-reference to numbered para is okay +uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); + +uno::Reference xFields(xFieldsAccess->createEnumeration()); +CPPUNIT_ASSERT(xFields->hasMoreElements()); + +uno::Reference xTextField1(xFields->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("itadmin"), xTextField1->getPresentation(false)); + +uno::Reference xTextField2(xFields->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("[Type text]"), xTextField2->getPresentation(false)); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 71d1ffd7fc9f..8a5e769ad011 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -268,8 +268,7 @@ void SdtHelper::createDropDownControl() } // clean up -m_aDropDownItems.clear(); -setControlType(SdtControlType::unknown); +clear(); } void SdtHelper::createPlainTextControl() @@ -300,8 +299,7 @@ void SdtHelper::createPlainTextControl() uno::makeAny(getInteropGrabBagAndClear())); // clean up -m_aDropDownItems.clear(); -setControlType(SdtControlType::unknown); +clear(); } void SdtHelper::createDateContentControl() @@ -374,7 +372,7 @@ void SdtHelper::createDateContentControl() } } -setControlType(SdtControlType::unknown); +clear(); } void SdtHelper::createControlShape(awt::Size aSize, @@ -423,6 +421,15 @@ bool SdtHelper::containedInInteropGrabBag(const OUString& rValueName) return false; } +void SdtHelper::clear() +{ +m_aDropDownItems.clear(); +setControlType(SdtControlType::unknown); +m_sDataBindingPrefixMapping.clear(); +m_sDataBindingXPath.clear(); +m_sDataBindingStoreItemID.clear(); +m_aGrabBag.clear(); +} } // namespace dmapper } // namespace writerfilter diff --git a/writerfilter/source/dmapper/SdtHelper.hxx b/writerfilter/source/dmapper/SdtHelper.hxx index 330ffbbca88c..863c449a211e 100644 --- a/writerfilter/source/dmapper/SdtHelper.hxx +++ b/writerfilter/source/dmapper/SdtHelper.hxx @@ -111,6 +111,9 @@ class SdtHelper final : public virtual SvRefBase void loadPropertiesXMLs(); +/// Clear all collected attributes for futher reuse +void clear(); + public: explicit SdtHelper(DomainMapper_Impl& rDM_Impl, css::uno::Reference const& xContext);
[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf148111.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 29 +++ writerfilter/source/dmapper/SdtHelper.cxx|3 +- 3 files changed, 31 insertions(+), 1 deletion(-) New commits: commit 873b52f4c46c47ebe7d70374586a00488f3a4037 Author: Vasily Melenchuk AuthorDate: Fri Mar 25 11:14:10 2022 +0300 Commit: Thorsten Behrens CommitDate: Tue Jun 21 01:18:27 2022 +0200 tdf#148111: docx std fields: use placeholder text for empty data It is quite unexpected Word behavior: if data source for sdt field exists but contains empty string it is not used. Placeholder is inserted instead. In general behavior is more complex: logic of replacement is defined by property and results can vary (see testcase). But LO does not support this property correctly yet. Change-Id: I2ec8efe05f79a01af5d74d21bfcd05f3b19e3970 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132096 Tested-by: Jenkins Reviewed-by: Thorsten Behrens Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132574 Tested-by: Thorsten Behrens diff --git a/sw/qa/extras/ooxmlexport/data/tdf148111.docx b/sw/qa/extras/ooxmlexport/data/tdf148111.docx new file mode 100644 index ..a46fb508dc0e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148111.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 95359aebf820..f63b5aa5a5fe 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -12,6 +12,7 @@ #include #include #include +#include char const DATA_DIRECTORY[] = "/sw/qa/extras/ooxmlexport/data/"; @@ -182,6 +183,34 @@ DECLARE_OOXMLEXPORT_TEST(testTdf137466, "tdf137466.docx") CPPUNIT_ASSERT_EQUAL(OUString("FF"), sColor); } +DECLARE_OOXMLEXPORT_TEST(testTdf148111, "tdf148111.docx") +{ +uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); + +uno::Reference xFields(xFieldsAccess->createEnumeration()); +std::vector aExpectedValues = { +// These field values are NOT in order in document: getTextFields did provide +// fields in a strange but fixed order +"Title", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Title", "Title", "Title", +"Title", "Title", "Title", "Title" +}; + +sal_uInt16 nIndex = 0; +while (xFields->hasMoreElements()) +{ +uno::Reference xTextField(xFields->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(aExpectedValues[nIndex++], xTextField->getPresentation(false)); +} + +// No more fields +CPPUNIT_ASSERT(!xFields->hasMoreElements()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 8a2356051a21..71d1ffd7fc9f 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -201,7 +201,8 @@ std::optional SdtHelper::getValueFromDataBinding() { uno::Reference xResult = xXpathAPI->eval(xDocument, m_sDataBindingXPath); -if (xResult.is() && xResult->getNodeList() && xResult->getNodeList()->getLength()) +if (xResult.is() && xResult->getNodeList() && xResult->getNodeList()->getLength() +&& xResult->getString().getLength()) { return xResult->getString(); }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa sw/source
sw/qa/extras/ooxmlexport/data/tdf149200.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 15 +++ sw/source/filter/ww8/docxattributeoutput.cxx |2 +- 3 files changed, 16 insertions(+), 1 deletion(-) New commits: commit de0312e81c86d3a9a1fdf1e4be4df32e2a4c6546 Author: Vasily Melenchuk AuthorDate: Wed May 25 17:15:53 2022 +0300 Commit: Xisco Fauli CommitDate: Mon May 30 13:14:41 2022 +0200 tdf#149200: docx export: transparent color fix If there is no color value we should not also try to write transparency information: otherwise w:srgbClr will have no parameter value and MS Word won't open such documents. Change-Id: Id67f174c5ae9aadf90ae54c126aef9a43ff3ba17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134945 Tested-by: Jenkins Reviewed-by: Thorsten Behrens Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135121 diff --git a/sw/qa/extras/ooxmlexport/data/tdf149200.docx b/sw/qa/extras/ooxmlexport/data/tdf149200.docx new file mode 100644 index ..811f594b64f4 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf149200.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 7915ade87d6d..90b923d0a612 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -393,6 +393,21 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148132, "tdf148132.docx") } } +CPPUNIT_TEST_FIXTURE(Test, testTdf149200) +{ +loadAndSave("tdf149200.docx"); +CPPUNIT_ASSERT_EQUAL(1, getPages()); +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + +// Ensure there is no unexpected invalid structure +// There is just one run property +xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "count(/w:document/w:body/w:p[1]/w:r[1]/w:rPr/*)"); +CPPUNIT_ASSERT(pXmlObj); +CPPUNIT_ASSERT_EQUAL(double(1), pXmlObj->floatval); +// And it is a color definition with themeColor +CPPUNIT_ASSERT_EQUAL(OUString("dark1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:color", "themeColor")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf148273_sectionBulletFormatLeak, "tdf148273_sectionBulletFormatLeak.docx") { // get a paragraph with bullet point after section break diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index a6da6244898a..f31342d3074d 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3064,7 +3064,7 @@ void DocxAttributeOutput::WriteCollectedRunProperties() { const char* pVal = nullptr; m_pColorAttrList->getAsChar(FSNS(XML_w, XML_val), pVal); -if (pVal == nullptr || std::string_view("auto") != pVal) +if (pVal != nullptr && std::string_view("auto") != pVal) { m_pSerializer->startElementNS(XML_w14, XML_textFill); m_pSerializer->startElementNS(XML_w14, XML_solidFill);
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/tdf149200.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 15 +++ sw/source/filter/ww8/docxattributeoutput.cxx |2 +- 3 files changed, 16 insertions(+), 1 deletion(-) New commits: commit e4e03e79fac598a9fafb0da8ab50da9a67c6978e Author: Vasily Melenchuk AuthorDate: Wed May 25 17:15:53 2022 +0300 Commit: Thorsten Behrens CommitDate: Mon May 30 11:52:44 2022 +0200 tdf#149200: docx export: transparent color fix If there is no color value we should not also try to write transparency information: otherwise w:srgbClr will have no parameter value and MS Word won't open such documents. Change-Id: Id67f174c5ae9aadf90ae54c126aef9a43ff3ba17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134945 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/ooxmlexport/data/tdf149200.docx b/sw/qa/extras/ooxmlexport/data/tdf149200.docx new file mode 100644 index ..811f594b64f4 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf149200.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index da72f770151b..67f3c838e759 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -949,6 +949,21 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148132, "tdf148132.docx") } } +CPPUNIT_TEST_FIXTURE(Test, testTdf149200) +{ +loadAndSave("tdf149200.docx"); +CPPUNIT_ASSERT_EQUAL(1, getPages()); +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + +// Ensure there is no unexpected invalid structure +// There is just one run property +xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "count(/w:document/w:body/w:p[1]/w:r[1]/w:rPr/*)"); +CPPUNIT_ASSERT(pXmlObj); +CPPUNIT_ASSERT_EQUAL(double(1), pXmlObj->floatval); +// And it is a color definition with themeColor +CPPUNIT_ASSERT_EQUAL(OUString("dark1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:color", "themeColor")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf135923, "tdf135923-min.docx") { uno::Reference xShape(getShape(1), uno::UNO_QUERY); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index f6f542ad4b39..769f120e97a8 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3184,7 +3184,7 @@ void DocxAttributeOutput::WriteCollectedRunProperties() { const char* pVal = nullptr; m_pColorAttrList->getAsChar(FSNS(XML_w, XML_val), pVal); -if (pVal == nullptr || std::string_view("auto") != pVal) +if (pVal != nullptr && std::string_view("auto") != pVal) { m_pSerializer->startElementNS(XML_w14, XML_textFill); m_pSerializer->startElementNS(XML_w14, XML_solidFill);
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf148132.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx| 33 ++ sw/qa/extras/rtfexport/data/numbering-font.rtf|8 -- sw/qa/extras/rtfexport/rtfexport.cxx |3 writerfilter/source/dmapper/DomainMapper.cxx | 14 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 67 -- writerfilter/source/dmapper/DomainMapper_Impl.hxx |2 writerfilter/source/rtftok/rtfdispatchvalue.cxx |9 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx|9 ++ 9 files changed, 55 insertions(+), 90 deletions(-) New commits: commit dd9f6ae3ab0d06afef0d1c9d1c27fb9ab82d8947 Author: Vasily Melenchuk AuthorDate: Wed May 11 09:44:22 2022 +0300 Commit: Andras Timar CommitDate: Wed May 25 11:13:59 2022 +0200 tdf#148132: Revert "n#758883 dmapper: paragraph-level..." Seems original problem is no longer reprodicible with recent builds but ovewriting of numbering style params with inline values leads to another problems. Removing this mechanics do some impact on RTF filter: it tries to modify numbering styles, so this was also corrected. It is not ideal yet but looks better in support numbering char properties different from paragraph ones. This reverts commit 2123ede032ca64f696ef54af4ad3238974ca2b5d. Change-Id: If8c79d6191de13b2f09c128b59d17efcfdb1a4ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133877 Reviewed-by: Michael Stahl Reviewed-by: Miklos Vajna Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134636 diff --git a/sw/qa/extras/ooxmlexport/data/tdf148132.docx b/sw/qa/extras/ooxmlexport/data/tdf148132.docx new file mode 100644 index ..6ee2359795a3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148132.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 0b359f3d2555..c428d0225611 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -18,9 +18,13 @@ #include #include #include +#include +#include + #include #include +#include #include #include @@ -552,6 +556,35 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978enhancedPathABVW) } } +DECLARE_OOXMLEXPORT_TEST(testTdf148132, "tdf148132.docx") +{ +{ +uno::Reference xParagraph = getParagraph(1); +auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); +// Get level 2 char style +comphelper::SequenceAsHashMap levelProps(xLevels->getByIndex(1)); +OUString aCharStyleName = levelProps["CharStyleName"].get(); +// Ensure that numbering in this paragraph is 24pt bold italic +// Previously it got overriden by paragraph properties and became 6pt, no bold, no italic +uno::Reference xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(24.f, getProperty(xStyle, "CharHeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty(xStyle, "CharWeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontSlant_ITALIC, getProperty(xStyle, "CharPosture")); +} +// And do the same for second paragraph. Numbering should be identical +{ +uno::Reference xParagraph = getParagraph(2); +auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); +comphelper::SequenceAsHashMap levelProps(xLevels->getByIndex(1)); +OUString aCharStyleName = levelProps["CharStyleName"].get(); + +uno::Reference xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(24.f, getProperty(xStyle, "CharHeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty(xStyle, "CharWeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontSlant_ITALIC, getProperty(xStyle, "CharPosture")); +} +} + DECLARE_OOXMLEXPORT_TEST(testTdf148273_sectionBulletFormatLeak, "tdf148273_sectionBulletFormatLeak.docx") { // get a paragraph with bullet point after section break diff --git a/sw/qa/extras/rtfexport/data/numbering-font.rtf b/sw/qa/extras/rtfexport/data/numbering-font.rtf index 46fdb7ed4d1e..8b57875c29bc 100644 --- a/sw/qa/extras/rtfexport/data/numbering-font.rtf +++ b/sw/qa/extras/rtfexport/data/numbering-font.rtf @@ -1,7 +1,7 @@ {\rtf1\adeflang1025\ansi\ansicpg1252\uc1\deff0\deflang1033 {\fonttbl {\f0\fbidi \froman\fcharset238\fprq2 Times New Roman;} -{\f40\fbidi \fswiss\fcharset238\fprq2 Verdana;} +{\f40\fbidi \fswiss\fcharset238\fprq2 Impact;} } {\*\listtable {\list\listtemplateid645944990 @@ -9,14 +9,12 @@ \level
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf148132.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx| 32 ++ sw/qa/extras/rtfexport/data/numbering-font.rtf|8 -- sw/qa/extras/rtfexport/rtfexport.cxx |3 writerfilter/source/dmapper/DomainMapper.cxx | 14 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 67 -- writerfilter/source/dmapper/DomainMapper_Impl.hxx |2 writerfilter/source/rtftok/rtfdispatchvalue.cxx |9 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx|9 ++ 9 files changed, 54 insertions(+), 90 deletions(-) New commits: commit a309c671b5f7ac536d7624a2bbc95e23f19bb42d Author: Vasily Melenchuk AuthorDate: Wed May 11 09:44:22 2022 +0300 Commit: Miklos Vajna CommitDate: Thu May 19 17:08:00 2022 +0200 tdf#148132: Revert "n#758883 dmapper: paragraph-level..." Seems original problem is no longer reprodicible with recent builds but ovewriting of numbering style params with inline values leads to another problems. Removing this mechanics do some impact on RTF filter: it tries to modify numbering styles, so this was also corrected. It is not ideal yet but looks better in support numbering char properties different from paragraph ones. This reverts commit 2123ede032ca64f696ef54af4ad3238974ca2b5d. Change-Id: If8c79d6191de13b2f09c128b59d17efcfdb1a4ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133877 Reviewed-by: Michael Stahl Reviewed-by: Miklos Vajna Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134636 diff --git a/sw/qa/extras/ooxmlexport/data/tdf148132.docx b/sw/qa/extras/ooxmlexport/data/tdf148132.docx new file mode 100644 index ..6ee2359795a3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148132.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 9e17190c0260..7915ade87d6d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -16,9 +16,12 @@ #include #include #include +#include +#include #include #include +#include #include #include @@ -361,6 +364,35 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978enhancedPathABVW) } } +DECLARE_OOXMLEXPORT_TEST(testTdf148132, "tdf148132.docx") +{ +{ +uno::Reference xParagraph = getParagraph(1); +auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); +// Get level 2 char style +comphelper::SequenceAsHashMap levelProps(xLevels->getByIndex(1)); +OUString aCharStyleName = levelProps["CharStyleName"].get(); +// Ensure that numbering in this paragraph is 24pt bold italic +// Previously it got overriden by paragraph properties and became 6pt, no bold, no italic +uno::Reference xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(24.f, getProperty(xStyle, "CharHeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty(xStyle, "CharWeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontSlant_ITALIC, getProperty(xStyle, "CharPosture")); +} +// And do the same for second paragraph. Numbering should be identical +{ +uno::Reference xParagraph = getParagraph(2); +auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); +comphelper::SequenceAsHashMap levelProps(xLevels->getByIndex(1)); +OUString aCharStyleName = levelProps["CharStyleName"].get(); + +uno::Reference xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(24.f, getProperty(xStyle, "CharHeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty(xStyle, "CharWeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontSlant_ITALIC, getProperty(xStyle, "CharPosture")); +} +} + DECLARE_OOXMLEXPORT_TEST(testTdf148273_sectionBulletFormatLeak, "tdf148273_sectionBulletFormatLeak.docx") { // get a paragraph with bullet point after section break diff --git a/sw/qa/extras/rtfexport/data/numbering-font.rtf b/sw/qa/extras/rtfexport/data/numbering-font.rtf index 46fdb7ed4d1e..8b57875c29bc 100644 --- a/sw/qa/extras/rtfexport/data/numbering-font.rtf +++ b/sw/qa/extras/rtfexport/data/numbering-font.rtf @@ -1,7 +1,7 @@ {\rtf1\adeflang1025\ansi\ansicpg1252\uc1\deff0\deflang1033 {\fonttbl {\f0\fbidi \froman\fcharset238\fprq2 Times New Roman;} -{\f40\fbidi \fswiss\fcharset238\fprq2 Verdana;} +{\f40\fbidi \fswiss\fcharset238\fprq2 Impact;} } {\*\listtable {\list\listtemplateid645944990 @@ -9,14 +9,12 @@ \level
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf148132.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx| 32 ++ sw/qa/extras/rtfexport/data/numbering-font.rtf|8 -- sw/qa/extras/rtfexport/rtfexport.cxx |3 writerfilter/source/dmapper/DomainMapper.cxx | 14 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 67 -- writerfilter/source/dmapper/DomainMapper_Impl.hxx |2 writerfilter/source/rtftok/rtfdispatchvalue.cxx |9 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx|9 ++ 9 files changed, 54 insertions(+), 90 deletions(-) New commits: commit 02f53bd61222d7999b847a22fd24d65195f129e5 Author: Vasily Melenchuk AuthorDate: Wed May 11 09:44:22 2022 +0300 Commit: Miklos Vajna CommitDate: Thu May 19 11:58:24 2022 +0200 tdf#148132: Revert "n#758883 dmapper: paragraph-level..." Seems original problem is no longer reprodicible with recent builds but ovewriting of numbering style params with inline values leads to another problems. Removing this mechanics do some impact on RTF filter: it tries to modify numbering styles, so this was also corrected. It is not ideal yet but looks better in support numbering char properties different from paragraph ones. This reverts commit 2123ede032ca64f696ef54af4ad3238974ca2b5d. Change-Id: If8c79d6191de13b2f09c128b59d17efcfdb1a4ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133877 Reviewed-by: Michael Stahl Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/extras/ooxmlexport/data/tdf148132.docx b/sw/qa/extras/ooxmlexport/data/tdf148132.docx new file mode 100644 index ..6ee2359795a3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148132.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 5c25a3b5d369..8146e942ce5d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -15,8 +15,11 @@ #include #include #include +#include +#include #include +#include #include #include #include @@ -824,6 +827,35 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978enhancedPathABVW) } } +DECLARE_OOXMLEXPORT_TEST(testTdf148132, "tdf148132.docx") +{ +{ +uno::Reference xParagraph = getParagraph(1); +auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); +// Get level 2 char style +comphelper::SequenceAsHashMap levelProps(xLevels->getByIndex(1)); +OUString aCharStyleName = levelProps["CharStyleName"].get(); +// Ensure that numbering in this paragraph is 24pt bold italic +// Previously it got overriden by paragraph properties and became 6pt, no bold, no italic +uno::Reference xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(24.f, getProperty(xStyle, "CharHeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty(xStyle, "CharWeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontSlant_ITALIC, getProperty(xStyle, "CharPosture")); +} +// And do the same for second paragraph. Numbering should be identical +{ +uno::Reference xParagraph = getParagraph(2); +auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); +comphelper::SequenceAsHashMap levelProps(xLevels->getByIndex(1)); +OUString aCharStyleName = levelProps["CharStyleName"].get(); + +uno::Reference xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(24.f, getProperty(xStyle, "CharHeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty(xStyle, "CharWeight")); +CPPUNIT_ASSERT_EQUAL(awt::FontSlant_ITALIC, getProperty(xStyle, "CharPosture")); +} +} + DECLARE_OOXMLEXPORT_TEST(testTdf135923, "tdf135923-min.docx") { uno::Reference xShape(getShape(1), uno::UNO_QUERY); diff --git a/sw/qa/extras/rtfexport/data/numbering-font.rtf b/sw/qa/extras/rtfexport/data/numbering-font.rtf index 46fdb7ed4d1e..8b57875c29bc 100644 --- a/sw/qa/extras/rtfexport/data/numbering-font.rtf +++ b/sw/qa/extras/rtfexport/data/numbering-font.rtf @@ -1,7 +1,7 @@ {\rtf1\adeflang1025\ansi\ansicpg1252\uc1\deff0\deflang1033 {\fonttbl {\f0\fbidi \froman\fcharset238\fprq2 Times New Roman;} -{\f40\fbidi \fswiss\fcharset238\fprq2 Verdana;} +{\f40\fbidi \fswiss\fcharset238\fprq2 Impact;} } {\*\listtable {\list\listtemplateid645944990 @@ -9,14 +9,12 @@ \levelfollow0\levelstartat1 {\leveltext\'02\'00.;} {\levelnumbers\'01;} -\rtlch \af0\afs18 \ltrch \fs18 \fi-360\li720\lin720 } +\f40\fs144\b0\i0\fi-360\
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf148455_1.docx|binary sw/qa/extras/ooxmlexport/data/tdf148455_2.docx|binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx| 24 ++ sw/source/filter/ww8/docxattributeoutput.cxx |9 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 +++-- 5 files changed, 41 insertions(+), 2 deletions(-) New commits: commit 270e8967a720166205263cf695aedb00f8f7ecd9 Author: Vasily Melenchuk AuthorDate: Mon May 16 21:21:51 2022 +0300 Commit: Xisco Fauli CommitDate: Wed May 18 16:46:56 2022 +0200 tdf#148455 docx import/export: improvements to lvlOverride On save LO was just emitting w:lvlOverride to actual level where override does happen. But MS Word won't accept override for next level if there are no overrides for previous ones. For example, if we are overriding level 3 we should also emit empty lvlOverride for levels 0-2. Provided fix did cause some problems on DOCX import: overrides were applied to current level, but in this context current != actual level where override did happen. Change-Id: Ia00dd9a5990f7f122027e8126f411642c32da189 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134411 Tested-by: Jenkins Tested-by: Gabor Kelemen Reviewed-by: Thorsten Behrens (cherry picked from commit 198381eb32edcc3e82d0f23df65f0804a08b44e6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134452 Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/ooxmlexport/data/tdf148455_1.docx b/sw/qa/extras/ooxmlexport/data/tdf148455_1.docx new file mode 100644 index ..295d3ee744c7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148455_1.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf148455_2.docx b/sw/qa/extras/ooxmlexport/data/tdf148455_2.docx new file mode 100644 index ..3cde58ce5a77 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148455_2.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 41c188a3532e..9e17190c0260 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -321,6 +321,30 @@ DECLARE_OOXMLEXPORT_TEST(testTdf144668, "tdf144668.odt") CPPUNIT_ASSERT_EQUAL(OUString("[001]"), getProperty(xPara2, "ListLabelString")); } +DECLARE_OOXMLEXPORT_TEST(testTdf148455_1, "tdf148455_1.docx") +{ +uno::Reference xPara2(getParagraph(3, u"1.1.1"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("1.1.1."), getProperty(xPara2, "ListLabelString")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf148455_2, "tdf148455_2.docx") +{ +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); +if (!pXmlDoc) + return; // initial import, no further checks + +// Find list id for restarted list +sal_Int32 nListId = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:numPr/w:numId", "val").toInt32(); + +xmlDocUniquePtr pNumberingDoc = parseExport("word/numbering.xml"); + +// Ensure we have empty lvlOverride for levels 0 - 1 +getXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='0']", ""); +getXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='1']", ""); +// And normal overrride for level 2 +getXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='2']/w:startOverride", "val"); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf147978enhancedPathABVW) { load(DATA_DIRECTORY, "tdf147978_enhancedPath_commandABVW.odt"); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 7bddf3121813..6f8a24acd255 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -7715,6 +7715,7 @@ void DocxAttributeOutput::OverrideNumberingDefinition( SwNumRule const& rAbstractRule = *(*m_rExport.m_pUsedNumTable)[nAbstractNum - 1]; sal_uInt8 const nLevels = static_cast(rRule.IsContinusNum() ? WW8ListManager::nMinLevel : WW8ListManager::nMaxLevel); +sal_uInt8 nPreviousOverrideLevel = 0; for (sal_uInt8 nLevel = 0; nLevel < nLevels; ++nLevel) { const auto levelOverride = rLevelOverrides.find(nLevel); @@ -7724,6 +7725,14 @@ void DocxAttributeOutput::OverrideNumberingDefinition( // or we have a level numbering override if (bListsAreDifferent || levelOverride != rLevelOverrides.end()) { +// If there are "gap
[Libreoffice-commits] core.git: sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf148455_1.docx|binary sw/qa/extras/ooxmlexport/data/tdf148455_2.docx|binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx| 24 ++ sw/source/filter/ww8/docxattributeoutput.cxx |9 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 +++-- 5 files changed, 41 insertions(+), 2 deletions(-) New commits: commit 198381eb32edcc3e82d0f23df65f0804a08b44e6 Author: Vasily Melenchuk AuthorDate: Mon May 16 21:21:51 2022 +0300 Commit: Thorsten Behrens CommitDate: Wed May 18 14:59:58 2022 +0200 tdf#148455 docx import/export: improvements to lvlOverride On save LO was just emitting w:lvlOverride to actual level where override does happen. But MS Word won't accept override for next level if there are no overrides for previous ones. For example, if we are overriding level 3 we should also emit empty lvlOverride for levels 0-2. Provided fix did cause some problems on DOCX import: overrides were applied to current level, but in this context current != actual level where override did happen. Change-Id: Ia00dd9a5990f7f122027e8126f411642c32da189 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134411 Tested-by: Jenkins Tested-by: Gabor Kelemen Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/ooxmlexport/data/tdf148455_1.docx b/sw/qa/extras/ooxmlexport/data/tdf148455_1.docx new file mode 100644 index ..295d3ee744c7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148455_1.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf148455_2.docx b/sw/qa/extras/ooxmlexport/data/tdf148455_2.docx new file mode 100644 index ..3cde58ce5a77 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148455_2.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 5c911887c29d..c02926ac60af 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -725,6 +725,30 @@ DECLARE_OOXMLEXPORT_TEST(testTdf144668, "tdf144668.odt") CPPUNIT_ASSERT_EQUAL(OUString("[001]"), getProperty(xPara2, "ListLabelString")); } +DECLARE_OOXMLEXPORT_TEST(testTdf148455_1, "tdf148455_1.docx") +{ +uno::Reference xPara2(getParagraph(3, u"1.1.1"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("1.1.1."), getProperty(xPara2, "ListLabelString")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf148455_2, "tdf148455_2.docx") +{ +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); +if (!pXmlDoc) + return; // initial import, no further checks + +// Find list id for restarted list +sal_Int32 nListId = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:numPr/w:numId", "val").toInt32(); + +xmlDocUniquePtr pNumberingDoc = parseExport("word/numbering.xml"); + +// Ensure we have empty lvlOverride for levels 0 - 1 +getXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='0']", ""); +getXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='1']", ""); +// And normal overrride for level 2 +getXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='2']/w:startOverride", "val"); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf147978enhancedPathABVW) { load(DATA_DIRECTORY, "tdf147978_enhancedPath_commandABVW.odt"); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 6f111b645c2d..4e46b456c602 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -7738,6 +7738,7 @@ void DocxAttributeOutput::OverrideNumberingDefinition( SwNumRule const& rAbstractRule = *(*m_rExport.m_pUsedNumTable)[nAbstractNum - 1]; sal_uInt8 const nLevels = static_cast(rRule.IsContinusNum() ? WW8ListManager::nMinLevel : WW8ListManager::nMaxLevel); +sal_uInt8 nPreviousOverrideLevel = 0; for (sal_uInt8 nLevel = 0; nLevel < nLevels; ++nLevel) { const auto levelOverride = rLevelOverrides.find(nLevel); @@ -7747,6 +7748,14 @@ void DocxAttributeOutput::OverrideNumberingDefinition( // or we have a level numbering override if (bListsAreDifferent || levelOverride != rLevelOverrides.end()) { +// If there are "gaps" in w:lvlOverride numbers, MS Word can have issues with numbering. +// So we need to emit empty override tokens up to current one. +
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa sw/source
sw/qa/extras/ww8export/data/tdf142840.odt |binary sw/qa/extras/ww8export/ww8export3.cxx | 17 + sw/source/filter/ww8/wrtw8nds.cxx |7 +-- 3 files changed, 22 insertions(+), 2 deletions(-) New commits: commit f2bf1cc2a9a4a09ec16900e91949e1669963c392 Author: Vasily Melenchuk AuthorDate: Fri Apr 29 11:10:48 2022 +0300 Commit: Michael Stahl CommitDate: Thu May 12 11:21:14 2022 +0200 tdf#142840: doc export: use BookmarkToWord() for hyperlinks Inernal hyperlinks to bookmarks should not contain spaces. This is not required for RTF or DOC: MS Word is okay with spaces there (unlike in DOCX). But since we are replacing spaces in bookmark names we should do this also in links to these bookmarks. Change-Id: I7a3e530817572ed53032c2be1ad96f8e8498bac3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133590 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit d45315c8eb91862958b29ead09cec58e03a80096) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134177 Reviewed-by: Michael Stahl diff --git a/sw/qa/extras/ww8export/data/tdf142840.odt b/sw/qa/extras/ww8export/data/tdf142840.odt new file mode 100644 index ..27af4cdb5e6a Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf142840.odt differ diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index 8e894c711457..330fb8b6bb2c 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -988,6 +988,23 @@ DECLARE_WW8EXPORT_TEST(testTdf136814, "tdf136814.odt") } +DECLARE_WW8EXPORT_TEST(testTdf142840, "tdf142840.odt") +{ +CPPUNIT_ASSERT_EQUAL(1, getPages()); + +uno::Reference xBookmarksSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); +uno::Reference xBookmarksByName = xBookmarksSupplier->getBookmarks(); + +// Ensure space are replaced by underscore in bookmark name (it was working before, but ensure this) +CPPUNIT_ASSERT_EQUAL(static_cast(1), xBookmarksByIdx->getCount()); +CPPUNIT_ASSERT(xBookmarksByName->hasByName("Chapter_1")); +CPPUNIT_ASSERT(!xBookmarksByName->hasByName("Chapter 1")); + +// And hyperlink is referring bookmark with underscore also (this was broken) +CPPUNIT_ASSERT_EQUAL(OUString("#Chapter_1"), getProperty(getRun(getParagraph(1), 1), "HyperLinkURL")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 6081ab30af1d..ff23fc6fa9c1 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1028,8 +1028,11 @@ bool WW8AttributeOutput::AnalyzeURL( const OUString& rUrl, const OUString& rTarg if ( !sURL.isEmpty() ) sURL = URIHelper::simpleNormalizedMakeRelative( m_rWW8Export.GetWriter().GetBaseURL(), sURL ); -if ( bBookMarkOnly ) -sURL = FieldString( ww::eHYPERLINK ); +if (bBookMarkOnly) +{ +sURL = FieldString(ww::eHYPERLINK); +*pMark = BookmarkToWord(*pMark); +} else sURL = FieldString( ww::eHYPERLINK ) + "\"" + sURL + "\"";
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ww8export/data/tdf142840.odt |binary sw/qa/extras/ww8export/ww8export3.cxx | 17 + sw/source/filter/ww8/wrtw8nds.cxx |7 +-- 3 files changed, 22 insertions(+), 2 deletions(-) New commits: commit d45315c8eb91862958b29ead09cec58e03a80096 Author: Vasily Melenchuk AuthorDate: Fri Apr 29 11:10:48 2022 +0300 Commit: Thorsten Behrens CommitDate: Thu May 12 03:27:45 2022 +0200 tdf#142840: doc export: use BookmarkToWord() for hyperlinks Inernal hyperlinks to bookmarks should not contain spaces. This is not required for RTF or DOC: MS Word is okay with spaces there (unlike in DOCX). But since we are replacing spaces in bookmark names we should do this also in links to these bookmarks. Change-Id: I7a3e530817572ed53032c2be1ad96f8e8498bac3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133590 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/ww8export/data/tdf142840.odt b/sw/qa/extras/ww8export/data/tdf142840.odt new file mode 100644 index ..27af4cdb5e6a Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf142840.odt differ diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index 4e6cfd65924a..067d3486ec00 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -1082,6 +1082,23 @@ CPPUNIT_TEST_FIXTURE(Test, testClearingBreak) verify(); } +DECLARE_WW8EXPORT_TEST(testTdf142840, "tdf142840.odt") +{ +CPPUNIT_ASSERT_EQUAL(1, getPages()); + +uno::Reference xBookmarksSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); +uno::Reference xBookmarksByName = xBookmarksSupplier->getBookmarks(); + +// Ensure space are replaced by underscore in bookmark name (it was working before, but ensure this) +CPPUNIT_ASSERT_EQUAL(static_cast(1), xBookmarksByIdx->getCount()); +CPPUNIT_ASSERT(xBookmarksByName->hasByName("Chapter_1")); +CPPUNIT_ASSERT(!xBookmarksByName->hasByName("Chapter 1")); + +// And hyperlink is referring bookmark with underscore also (this was broken) +CPPUNIT_ASSERT_EQUAL(OUString("#Chapter_1"), getProperty(getRun(getParagraph(1), 1), "HyperLinkURL")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 5da3ca9fbee5..63786a219948 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1019,8 +1019,11 @@ bool WW8AttributeOutput::AnalyzeURL( const OUString& rUrl, const OUString& rTarg if ( !sURL.isEmpty() ) sURL = URIHelper::simpleNormalizedMakeRelative( m_rWW8Export.GetWriter().GetBaseURL(), sURL ); -if ( bBookMarkOnly ) -sURL = FieldString( ww::eHYPERLINK ); +if (bBookMarkOnly) +{ +sURL = FieldString(ww::eHYPERLINK); +*pMark = BookmarkToWord(*pMark); +} else sURL = FieldString( ww::eHYPERLINK ) + "\"" + sURL + "\"";
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf148515.rtf | 14 ++ sw/qa/extras/rtfexport/rtfexport4.cxx | 19 +++ writerfilter/source/rtftok/rtfsprm.cxx|2 +- 3 files changed, 34 insertions(+), 1 deletion(-) New commits: commit b6deb063ac182b631dc9b61b4baca18744794ab1 Author: Vasily Melenchuk AuthorDate: Thu Apr 21 10:04:50 2022 +0300 Commit: Xisco Fauli CommitDate: Wed Apr 27 10:45:33 2022 +0200 tdf#148515: RTF filter: do not use char prop defaults for tables During deduplication of table row (when nStyleType == 0) we should not deduplicate character properties against default style: this leads to invalid default settings for table rows/cells. Attempts to do so are already made during \pard processing when default style is checked if it is paragraph style. But this is not enough: style definition can contain paragraph and character properties as well. Change-Id: If520c5a248897728b7de08a017136ca1a01a5f13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132943 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 3a05acb8f0d94728ea6cbfd7a69dac6ffa7ffc68) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133477 Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/rtfexport/data/tdf148515.rtf b/sw/qa/extras/rtfexport/data/tdf148515.rtf new file mode 100644 index ..f8e27e577425 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf148515.rtf @@ -0,0 +1,14 @@ +{\rtf1\ansi +{\fonttbl +{\f1 Impact;} +} + +{\stylesheet +{\fs20\f1\af1 Normal;} +} + +\trowd\cellx5000\cellx1 +\pard\intbl\f1\fs10 XX\cell +\pard\intbl\cell +\row +} diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 31469fc0ef02..0a39524f24d3 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -602,6 +602,25 @@ DECLARE_RTFEXPORT_TEST(testTdf139948, "tdf139948.rtf") sal_uInt32(0), getProperty(getParagraph(5), "BottomBorder").LineWidth); } +DECLARE_RTFEXPORT_TEST(testTdf148515, "tdf148515.rtf") +{ +uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); + +uno::Reference xCell1(xTable->getCellByName("A1"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("XX"), xCell1->getString()); +CPPUNIT_ASSERT_EQUAL( +5.0f, +getProperty(getRun(getParagraphOfText(1, xCell1->getText()), 1), "CharHeight")); + +uno::Reference xCell2(xTable->getCellByName("B1"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString(""), xCell2->getString()); +CPPUNIT_ASSERT_EQUAL( +5.0f, +getProperty(getRun(getParagraphOfText(1, xCell2->getText()), 1), "CharHeight")); + +CPPUNIT_ASSERT_EQUAL(10.f, getProperty(getRun(getParagraph(2), 1), "CharHeight")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx index 04df49bc0287..2edfec829edf 100644 --- a/writerfilter/source/rtftok/rtfsprm.cxx +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -159,7 +159,7 @@ void RTFSprms::eraseLast(Id nKeyword) static RTFValue::Pointer_t getDefaultSPRM(Id const id, Id nStyleType) { -if (!nStyleType || nStyleType == NS_ooxml::LN_Value_ST_StyleType_character) +if (nStyleType == NS_ooxml::LN_Value_ST_StyleType_character) { switch (id) {
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf148515.rtf | 14 ++ sw/qa/extras/rtfexport/rtfexport4.cxx | 19 +++ writerfilter/source/rtftok/rtfsprm.cxx|2 +- 3 files changed, 34 insertions(+), 1 deletion(-) New commits: commit 3a05acb8f0d94728ea6cbfd7a69dac6ffa7ffc68 Author: Vasily Melenchuk AuthorDate: Thu Apr 21 10:04:50 2022 +0300 Commit: Thorsten Behrens CommitDate: Wed Apr 27 00:56:10 2022 +0200 tdf#148515: RTF filter: do not use char prop defaults for tables During deduplication of table row (when nStyleType == 0) we should not deduplicate character properties against default style: this leads to invalid default settings for table rows/cells. Attempts to do so are already made during \pard processing when default style is checked if it is paragraph style. But this is not enough: style definition can contain paragraph and character properties as well. Change-Id: If520c5a248897728b7de08a017136ca1a01a5f13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132943 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/rtfexport/data/tdf148515.rtf b/sw/qa/extras/rtfexport/data/tdf148515.rtf new file mode 100644 index ..f8e27e577425 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf148515.rtf @@ -0,0 +1,14 @@ +{\rtf1\ansi +{\fonttbl +{\f1 Impact;} +} + +{\stylesheet +{\fs20\f1\af1 Normal;} +} + +\trowd\cellx5000\cellx1 +\pard\intbl\f1\fs10 XX\cell +\pard\intbl\cell +\row +} diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 276bdd963b26..65b8ac90954c 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -646,6 +646,25 @@ DECLARE_RTFEXPORT_TEST(testTdf139948, "tdf139948.rtf") sal_uInt32(0), getProperty(getParagraph(5), "BottomBorder").LineWidth); } +DECLARE_RTFEXPORT_TEST(testTdf148515, "tdf148515.rtf") +{ +uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); + +uno::Reference xCell1(xTable->getCellByName("A1"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("XX"), xCell1->getString()); +CPPUNIT_ASSERT_EQUAL( +5.0f, +getProperty(getRun(getParagraphOfText(1, xCell1->getText()), 1), "CharHeight")); + +uno::Reference xCell2(xTable->getCellByName("B1"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString(""), xCell2->getString()); +CPPUNIT_ASSERT_EQUAL( +5.0f, +getProperty(getRun(getParagraphOfText(1, xCell2->getText()), 1), "CharHeight")); + +CPPUNIT_ASSERT_EQUAL(10.f, getProperty(getRun(getParagraph(2), 1), "CharHeight")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx index 04df49bc0287..2edfec829edf 100644 --- a/writerfilter/source/rtftok/rtfsprm.cxx +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -159,7 +159,7 @@ void RTFSprms::eraseLast(Id nKeyword) static RTFValue::Pointer_t getDefaultSPRM(Id const id, Id nStyleType) { -if (!nStyleType || nStyleType == NS_ooxml::LN_Value_ST_StyleType_character) +if (nStyleType == NS_ooxml::LN_Value_ST_StyleType_character) { switch (id) {
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf139948.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx| 26 + sw/qa/extras/rtfexport/data/tdf139948.rtf |8 + sw/qa/extras/rtfexport/rtfexport4.cxx | 32 ++ writerfilter/source/dmapper/DomainMapper.cxx | 11 ++- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 25 + writerfilter/source/dmapper/DomainMapper_Impl.hxx |3 ++ writerfilter/source/dmapper/PropertyIds.cxx |1 writerfilter/source/dmapper/PropertyIds.hxx |1 writerfilter/source/rtftok/rtfdispatchflag.cxx|4 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx|5 ++- 11 files changed, 113 insertions(+), 3 deletions(-) New commits: commit 537b2616b9c8639b2f1108047f39693ac6bd5500 Author: Vasily Melenchuk AuthorDate: Fri Apr 1 16:35:40 2022 +0300 Commit: Xisco Fauli CommitDate: Tue Apr 26 14:20:42 2022 +0200 tdf#139948: docx and rtf import: emulate border in between Writer does not support border in between available in all MS formats. Since this feature is missing in core it will be better to emulate it with top borders than to ignore it completely. Change-Id: I4e5a99cde5908066c4bb483136cfe9a1316df53c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132429 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit e3a996bf72a16f5b22e6ff021745af5cec70a632) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132594 Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/ooxmlexport/data/tdf139948.docx b/sw/qa/extras/ooxmlexport/data/tdf139948.docx new file mode 100644 index ..1b3f7df00031 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf139948.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index c0b693247828..41c188a3532e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -260,6 +260,32 @@ DECLARE_OOXMLEXPORT_TEST(testTdf81507, "tdf81507.docx") xmlXPathFreeObject(pXmlObj); } +DECLARE_OOXMLEXPORT_TEST(testTdf139948, "tdf139948.docx") +{ +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(1, "No border"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(2, "Border below"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(88), +getProperty(getParagraph(3, "Borders below and above"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(88), +getProperty(getParagraph(4, "Border above"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(5, "No border"), "TopBorder").LineWidth); + + +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(1), "BottomBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(2), "BottomBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(3), "BottomBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(4), "BottomBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(5), "BottomBorder").LineWidth); +} + DECLARE_OOXMLEXPORT_TEST(testTdf144563, "tdf144563.docx") { uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/rtfexport/data/tdf139948.rtf b/sw/qa/extras/rtfexport/data/tdf139948.rtf new file mode 100644 index ..0b601a764adf --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf139948.rtf @@ -0,0 +1,8 @@ +{\rtf1\ansi +No border\par +\pard\brdrbtw\brdrs\brdrw50 +Border below\par +Borders below and above\par +Border above\par +\pard No border\par +} \ No newline at end of file diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 33a2a246a181..31469fc0ef02 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -570,6 +570,38 @@ DECLARE_RTFEXPORT_TEST(testTdf111851, "tdf111851.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(xCell6, "BackColor")); } +DECLARE_RTFEXPORT_TEST(testTdf139948, "tdf139948.rtf") +{ +CPPUNIT_ASSERT_EQUAL( +sal_uInt32(0), +getProperty(getParagraph(1, "No border"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL( +sal_uInt32(0), +getProperty(getParagraph(2, "Border below"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL( +sal_uInt32(88), +getProperty(getParagraph(3
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/rtftok/rtfvalue.cxx | 140 +--- writerfilter/source/rtftok/rtfvalue.hxx | 25 ++--- 2 files changed, 89 insertions(+), 76 deletions(-) New commits: commit 7678e7ed88007061c3469db3b28b0e91acea7ed6 Author: Vasily Melenchuk AuthorDate: Thu Mar 17 22:57:51 2022 +0300 Commit: Miklos Vajna CommitDate: Tue Apr 26 08:34:55 2022 +0200 rtf filter: reduce memory allocations count RTFValue in most cases contain only one value: either num, string, picture, etc. No reason to allocate all of them in the same time. RTF filter should became faster and consume less memory, however I did not made any measuremets. Change-Id: Ic12a941ce774b9066d7c57b38139af07851ac7b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131720 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/writerfilter/source/rtftok/rtfvalue.cxx b/writerfilter/source/rtftok/rtfvalue.cxx index e4b3a5a11c68..42f60a1c97d7 100644 --- a/writerfilter/source/rtftok/rtfvalue.cxx +++ b/writerfilter/source/rtftok/rtfvalue.cxx @@ -15,106 +15,73 @@ using namespace com::sun::star; namespace writerfilter::rtftok { -RTFValue::RTFValue(int nValue, OUString sValue, const RTFSprms& rAttributes, const RTFSprms& rSprms, +RTFValue::RTFValue(int nValue, OUString sValue, const RTFSprms* pAttributes, const RTFSprms* pSprms, uno::Reference xShape, uno::Reference xStream, uno::Reference xObject, bool bForceString, - const RTFShape& aShape, const RTFPicture& rPicture) + const RTFShape* pShape, const RTFPicture* pPicture) : m_nValue(nValue) , m_sValue(std::move(sValue)) -, m_pAttributes(new RTFSprms(rAttributes)) -, m_pSprms(new RTFSprms(rSprms)) , m_xShape(std::move(xShape)) , m_xStream(std::move(xStream)) , m_xObject(std::move(xObject)) , m_bForceString(bForceString) -, m_pShape(new RTFShape(aShape)) -, m_pPicture(new RTFPicture(rPicture)) { +if (pAttributes) +m_pAttributes = new RTFSprms(*pAttributes); +if (pSprms) +m_pSprms = new RTFSprms(*pSprms); +if (pShape) +m_pShape = new RTFShape(*pShape); +if (pPicture) +m_pPicture = new RTFPicture(*pPicture); } -RTFValue::RTFValue() -: m_pAttributes(new RTFSprms()) -, m_pSprms(new RTFSprms()) -, m_pShape(new RTFShape()) -, m_pPicture(new RTFPicture) -{ -} +RTFValue::RTFValue() {} RTFValue::RTFValue(int nValue) : m_nValue(nValue) -, m_pAttributes(new RTFSprms()) -, m_pSprms(new RTFSprms()) -, m_pShape(new RTFShape()) -, m_pPicture(new RTFPicture) { } RTFValue::RTFValue(OUString sValue, bool bForce) : m_sValue(std::move(sValue)) -, m_pAttributes(new RTFSprms()) -, m_pSprms(new RTFSprms()) , m_bForceString(bForce) -, m_pShape(new RTFShape()) -, m_pPicture(new RTFPicture) { } RTFValue::RTFValue(const RTFSprms& rAttributes) : m_pAttributes(new RTFSprms(rAttributes)) -, m_pSprms(new RTFSprms()) -, m_pShape(new RTFShape()) -, m_pPicture(new RTFPicture) { } RTFValue::RTFValue(const RTFSprms& rAttributes, const RTFSprms& rSprms) : m_pAttributes(new RTFSprms(rAttributes)) , m_pSprms(new RTFSprms(rSprms)) -, m_pShape(new RTFShape()) -, m_pPicture(new RTFPicture) { } RTFValue::RTFValue(uno::Reference xShape) -: m_pAttributes(new RTFSprms()) -, m_pSprms(new RTFSprms()) -, m_xShape(std::move(xShape)) -, m_pShape(new RTFShape()) -, m_pPicture(new RTFPicture) +: m_xShape(std::move(xShape)) { } RTFValue::RTFValue(uno::Reference xStream) -: m_pAttributes(new RTFSprms()) -, m_pSprms(new RTFSprms()) -, m_xStream(std::move(xStream)) -, m_pShape(new RTFShape()) -, m_pPicture(new RTFPicture) +: m_xStream(std::move(xStream)) { } RTFValue::RTFValue(uno::Reference xObject) -: m_pAttributes(new RTFSprms()) -, m_pSprms(new RTFSprms()) -, m_xObject(std::move(xObject)) -, m_pShape(new RTFShape()) -, m_pPicture(new RTFPicture) +: m_xObject(std::move(xObject)) { } RTFValue::RTFValue(const RTFShape& aShape) -: m_pAttributes(new RTFSprms()) -, m_pSprms(new RTFSprms()) -, m_pShape(new RTFShape(aShape)) -, m_pPicture(new RTFPicture) +: m_pShape(new RTFShape(aShape)) { } RTFValue::RTFValue(const RTFPicture& rPicture) -: m_pAttributes(new RTFSprms()) -, m_pSprms(new RTFSprms()) -, m_pShape(new RTFShape()) -, m_pPicture(new RTFPicture(rPicture)) +: m_pPicture(new RTFPicture(rPicture)) { } @@ -148,13 +115,23 @@ uno::Any RTFValue::getAny() const return ret; } -RTFShape& RTFValue::getShape() const { return *m_pShape; } +RTFShape& RTFValue::getShape() const +{ +if (!m_pShape) +m_pShape = new RTFShape(); +return *m_pShape; +} -RTFPicture& RTFValue::getPic
[Libreoffice-commits] core.git: solenv/vs
solenv/vs/LibreOffice.natvis | 16 1 file changed, 16 insertions(+) New commits: commit 8b646cf931543093ba27e7aed7c8206d4b647a6d Author: Vasily Melenchuk AuthorDate: Mon Apr 25 15:54:19 2022 +0300 Commit: Vasily Melenchuk CommitDate: Tue Apr 26 07:47:37 2022 +0200 natvis: some extra patterns for SvRefs<...> and writerfilter Change-Id: I077232d641fee38da0f50cb838091c0fd0787189 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133416 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/solenv/vs/LibreOffice.natvis b/solenv/vs/LibreOffice.natvis index 0962c1c441fb..6dcfea5818b5 100644 --- a/solenv/vs/LibreOffice.natvis +++ b/solenv/vs/LibreOffice.natvis @@ -410,6 +410,22 @@ maType + +{{Params: {m_pSprms.pObj->size()}}} + + +m_pSprms.pObj->size() +m_pSprms.pObj->_Mypair._Myval2._Myfirst + + + + +{*pObj} +nullptr + + *pObj + + {mnFrameType,en} of {mpUpper->mnFrameType,en} {(void*)mpUpper} {{{mnFrameType,en}}}
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3-3' - sw/qa sw/source
sw/qa/uitest/writer_tests7/tdf144439.py |3 +-- sw/source/core/doc/number.cxx |2 +- 2 files changed, 2 insertions(+), 3 deletions(-) New commits: commit 9d933f2846030fb192a866307a19218d11be9461 Author: Vasily Melenchuk AuthorDate: Mon Apr 18 14:36:37 2022 +0300 Commit: Michael Stahl CommitDate: Wed Apr 20 12:13:31 2022 +0200 tdf#147472: sw: bug in numbering with previous level NONE Previous fix for tdf#146257 was not complete and was not able to take care of disabled numebering started just at beginning of the numbering string. UI test test_tdf144439_outline with modifications is covering this situation. No need in extra testcases. Change-Id: Id17838cec7fb4fb039f9b457b7ee9ad3ab345678 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133124 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk (cherry picked from commit a31a7b53c42eef3a8007766c60ec5a2539054a7c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133135 Reviewed-by: Xisco Fauli (cherry picked from commit 90715026e5a19956ef449694937893c0c76bea21) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133137 Reviewed-by: Adolfo Jayme Barrientos Reviewed-by: Michael Stahl Tested-by: Michael Stahl diff --git a/sw/qa/uitest/writer_tests7/tdf144439.py b/sw/qa/uitest/writer_tests7/tdf144439.py index 6797260f7240..4862375834e8 100644 --- a/sw/qa/uitest/writer_tests7/tdf144439.py +++ b/sw/qa/uitest/writer_tests7/tdf144439.py @@ -69,8 +69,7 @@ class tdf144439(UITestCase): Paragraphs = document.Text.createEnumeration() Para1 = Paragraphs.nextElement() self.assertEqual(Para1.String, "Outline2") -# Well, this looks strange, but we asked to show 1 & 2 levels and 1st is without numbering -self.assertEqual(Para1.getPropertyValue("ListLabelString"), ".1") +self.assertEqual(Para1.getPropertyValue("ListLabelString"), "1") with self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog") as xDialog: # Select level "1" diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 8a5b9c5d7c60..4e446cbf215c 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -705,7 +705,7 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto OUString sFind("%" + OUString::number(i + 1) + "%"); sal_Int32 nPositionToken = sLevelFormat.indexOf(sFind); sal_Int32 nPositionNextToken = sLevelFormat.indexOf('%', nPositionToken + sFind.getLength()); -if (nPositionToken > 0 && nPositionNextToken >= nPositionToken) +if (nPositionToken >= 0 && nPositionNextToken >= nPositionToken) { sLevelFormat = sLevelFormat.replaceAt(nPositionToken, nPositionNextToken - nPositionToken, u""); }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3-3' - sw/source
sw/source/ui/fldui/flddok.cxx | 13 + 1 file changed, 13 insertions(+) New commits: commit f67484bdb6d99589789dfe0c2ac49f6160e9d95d Author: Vasily Melenchuk AuthorDate: Wed Apr 13 20:19:35 2022 +0300 Commit: Michael Stahl CommitDate: Tue Apr 19 12:28:46 2022 +0200 tdf#148551: sw ui: set default format value for Insert Field dlg My previous implementation was changing current format selection only for field edit dialog. However it should be initialized also for insert field dlg. It is not always first element. Instead of older confusing approach right now there is a switch to set defaults: it is less confusing IMO. Change-Id: I189339ba66effc49267004a42345a28892cb693c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132980 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit b2b821715a3745718a941fa99dda92137c0f0c86) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133045 (cherry picked from commit 911d7c3336f07a4ea49bb539bf1bd35f11eea2a0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133050 Reviewed-by: Adolfo Jayme Barrientos Reviewed-by: Vasily Melenchuk Reviewed-by: Xisco Fauli Reviewed-by: Michael Stahl Tested-by: Michael Stahl diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index fba96e93cb4a..3bd1b4f5dea1 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -471,6 +471,19 @@ sal_Int32 SwFieldDokPage::FillFormatLB(SwFieldTypesEnum nTypeId) { m_xFormatLB->select_id(OUString::number(GetCurField()->GetFormat() & ~AF_FIXED)); } +else +{ +// Select default selected value for "Insert" dialog +switch (nTypeId) +{ +case SwFieldTypesEnum::PageNumber: +case SwFieldTypesEnum::DocumentStatistics: +m_xFormatLB->select_text(SwResId(FMT_NUM_PAGEDESC)); +break; +default: +m_xFormatLB->select(0); +} +} FormatHdl(*m_xFormatLB);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa sw/source
sw/qa/uitest/writer_tests7/tdf144439.py |3 +-- sw/source/core/doc/number.cxx |2 +- 2 files changed, 2 insertions(+), 3 deletions(-) New commits: commit 90715026e5a19956ef449694937893c0c76bea21 Author: Vasily Melenchuk AuthorDate: Mon Apr 18 14:36:37 2022 +0300 Commit: Xisco Fauli CommitDate: Tue Apr 19 11:16:58 2022 +0200 tdf#147472: sw: bug in numbering with previous level NONE Previous fix for tdf#146257 was not complete and was not able to take care of disabled numebering started just at beginning of the numbering string. UI test test_tdf144439_outline with modifications is covering this situation. No need in extra testcases. Change-Id: Id17838cec7fb4fb039f9b457b7ee9ad3ab345678 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133124 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk (cherry picked from commit a31a7b53c42eef3a8007766c60ec5a2539054a7c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133135 Reviewed-by: Xisco Fauli diff --git a/sw/qa/uitest/writer_tests7/tdf144439.py b/sw/qa/uitest/writer_tests7/tdf144439.py index 6797260f7240..4862375834e8 100644 --- a/sw/qa/uitest/writer_tests7/tdf144439.py +++ b/sw/qa/uitest/writer_tests7/tdf144439.py @@ -69,8 +69,7 @@ class tdf144439(UITestCase): Paragraphs = document.Text.createEnumeration() Para1 = Paragraphs.nextElement() self.assertEqual(Para1.String, "Outline2") -# Well, this looks strange, but we asked to show 1 & 2 levels and 1st is without numbering -self.assertEqual(Para1.getPropertyValue("ListLabelString"), ".1") +self.assertEqual(Para1.getPropertyValue("ListLabelString"), "1") with self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog") as xDialog: # Select level "1" diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 8a5b9c5d7c60..4e446cbf215c 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -705,7 +705,7 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto OUString sFind("%" + OUString::number(i + 1) + "%"); sal_Int32 nPositionToken = sLevelFormat.indexOf(sFind); sal_Int32 nPositionNextToken = sLevelFormat.indexOf('%', nPositionToken + sFind.getLength()); -if (nPositionToken > 0 && nPositionNextToken >= nPositionToken) +if (nPositionToken >= 0 && nPositionNextToken >= nPositionToken) { sLevelFormat = sLevelFormat.replaceAt(nPositionToken, nPositionNextToken - nPositionToken, u""); }
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/uitest/writer_tests7/tdf144439.py |3 +-- sw/source/core/doc/number.cxx |2 +- 2 files changed, 2 insertions(+), 3 deletions(-) New commits: commit a31a7b53c42eef3a8007766c60ec5a2539054a7c Author: Vasily Melenchuk AuthorDate: Mon Apr 18 14:36:37 2022 +0300 Commit: Vasily Melenchuk CommitDate: Mon Apr 18 20:07:48 2022 +0200 tdf#147472: sw: bug in numbering with previous level NONE Previous fix for tdf#146257 was not complete and was not able to take care of disabled numebering started just at beginning of the numbering string. UI test test_tdf144439_outline with modifications is covering this situation. No need in extra testcases. Change-Id: Id17838cec7fb4fb039f9b457b7ee9ad3ab345678 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133124 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/sw/qa/uitest/writer_tests7/tdf144439.py b/sw/qa/uitest/writer_tests7/tdf144439.py index 103d64f84f18..34911ee4c542 100644 --- a/sw/qa/uitest/writer_tests7/tdf144439.py +++ b/sw/qa/uitest/writer_tests7/tdf144439.py @@ -71,8 +71,7 @@ class tdf144439(UITestCase): Paragraphs = document.Text.createEnumeration() Para1 = Paragraphs.nextElement() self.assertEqual(Para1.String, "Outline2") -# Well, this looks strange, but we asked to show 1 & 2 levels and 1st is without numbering -self.assertEqual(Para1.getPropertyValue("ListLabelString"), ".1") +self.assertEqual(Para1.getPropertyValue("ListLabelString"), "1") with self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog") as xDialog: # Select level "1" diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 0615c9a912d5..4e353a2b2803 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -704,7 +704,7 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto OUString sFind("%" + OUString::number(i + 1) + "%"); sal_Int32 nPositionToken = sLevelFormat.indexOf(sFind); sal_Int32 nPositionNextToken = sLevelFormat.indexOf('%', nPositionToken + sFind.getLength()); -if (nPositionToken > 0 && nPositionNextToken >= nPositionToken) +if (nPositionToken >= 0 && nPositionNextToken >= nPositionToken) { sLevelFormat = sLevelFormat.replaceAt(nPositionToken, nPositionNextToken - nPositionToken, u""); }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/source
sw/source/ui/fldui/flddok.cxx | 13 + 1 file changed, 13 insertions(+) New commits: commit 911d7c3336f07a4ea49bb539bf1bd35f11eea2a0 Author: Vasily Melenchuk AuthorDate: Wed Apr 13 20:19:35 2022 +0300 Commit: Thorsten Behrens CommitDate: Sun Apr 17 00:12:30 2022 +0200 tdf#148551: sw ui: set default format value for Insert Field dlg My previous implementation was changing current format selection only for field edit dialog. However it should be initialized also for insert field dlg. It is not always first element. Instead of older confusing approach right now there is a switch to set defaults: it is less confusing IMO. Change-Id: I189339ba66effc49267004a42345a28892cb693c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132980 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit b2b821715a3745718a941fa99dda92137c0f0c86) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133045 diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index fba96e93cb4a..3bd1b4f5dea1 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -471,6 +471,19 @@ sal_Int32 SwFieldDokPage::FillFormatLB(SwFieldTypesEnum nTypeId) { m_xFormatLB->select_id(OUString::number(GetCurField()->GetFormat() & ~AF_FIXED)); } +else +{ +// Select default selected value for "Insert" dialog +switch (nTypeId) +{ +case SwFieldTypesEnum::PageNumber: +case SwFieldTypesEnum::DocumentStatistics: +m_xFormatLB->select_text(SwResId(FMT_NUM_PAGEDESC)); +break; +default: +m_xFormatLB->select(0); +} +} FormatHdl(*m_xFormatLB);
[Libreoffice-commits] core.git: sw/source
sw/source/ui/fldui/flddok.cxx | 13 + 1 file changed, 13 insertions(+) New commits: commit b2b821715a3745718a941fa99dda92137c0f0c86 Author: Vasily Melenchuk AuthorDate: Wed Apr 13 20:19:35 2022 +0300 Commit: Thorsten Behrens CommitDate: Fri Apr 15 18:02:00 2022 +0200 tdf#148551: sw ui: set default format value for Insert Field dlg My previous implementation was changing current format selection only for field edit dialog. However it should be initialized also for insert field dlg. It is not always first element. Instead of older confusing approach right now there is a switch to set defaults: it is less confusing IMO. Change-Id: I189339ba66effc49267004a42345a28892cb693c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132980 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index 2e7c1c67dbc2..4e65a7c3fb26 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -479,6 +479,19 @@ sal_Int32 SwFieldDokPage::FillFormatLB(SwFieldTypesEnum nTypeId) { m_xFormatLB->select_id(OUString::number(GetCurField()->GetFormat() & ~AF_FIXED)); } +else +{ +// Select default selected value for "Insert" dialog +switch (nTypeId) +{ +case SwFieldTypesEnum::PageNumber: +case SwFieldTypesEnum::DocumentStatistics: +m_xFormatLB->select_text(SwResId(FMT_NUM_PAGEDESC)); +break; +default: +m_xFormatLB->select(0); +} +} FormatHdl(*m_xFormatLB);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf95706_2.rtf | 17 ++ sw/qa/extras/rtfexport/rtfexport4.cxx | 12 + writerfilter/source/rtftok/rtfdispatchvalue.cxx |4 writerfilter/source/rtftok/rtfdocumentimpl.cxx | 162 +--- writerfilter/source/rtftok/rtfdocumentimpl.hxx |1 5 files changed, 122 insertions(+), 74 deletions(-) New commits: commit 8daac72b7a0b7cdf6eb520273829c0c0c15ddef5 Author: Vasily Melenchuk AuthorDate: Thu Apr 7 20:59:08 2022 +0300 Commit: Xisco Fauli CommitDate: Mon Apr 11 11:53:51 2022 +0200 tdf#95706: RTF import: tolerant font table parsing While font name in font table should end with semicolon ({\fonttbl{\f42 Arial;}}) it is not always true and MS Word is tolerant to it: it still able to parse this correctly. Seems LO also should not require strict spec conformance. So idea of font parsing is changed: instead of inserting font on semicolon, it is done on next \fN or destination end. All collected text to this moment is a font name. Change-Id: I6b41951217442a71fd2ebbfc58a3fc79f6f913db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132686 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit 844be7358f1eec00094a55fa1fb4fadadb8cd1bf) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132699 Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/rtfexport/data/tdf95706_2.rtf b/sw/qa/extras/rtfexport/data/tdf95706_2.rtf new file mode 100644 index ..d36d2ccd2396 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf95706_2.rtf @@ -0,0 +1,17 @@ +{\rtf\ansi +{\fonttbl +{\f1 Arial} +\f2 Impact +\f3 T\'69mes New Roman +\f4 T +a +h +o +m +a +} +\pard\f1\fs26 Arial\par +\pard\f2\fs26 Impact\par +\pard\f3\fs26 Times New Roman\par +\pard\f4\fs26 Tahoma\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 1f1434054085..33a2a246a181 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -522,6 +522,18 @@ DECLARE_RTFEXPORT_TEST(testTdf95706, "tdf95706.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun16, "CharFontName")); } +DECLARE_RTFEXPORT_TEST(testTdf95706_2, "tdf95706_2.rtf") +{ +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), + getProperty(getRun(getParagraph(1), 1), "CharFontName")); +CPPUNIT_ASSERT_EQUAL(OUString("Impact"), + getProperty(getRun(getParagraph(2), 1), "CharFontName")); +CPPUNIT_ASSERT_EQUAL(OUString("Times New Roman"), + getProperty(getRun(getParagraph(3), 1), "CharFontName")); +CPPUNIT_ASSERT_EQUAL(OUString("Tahoma"), + getProperty(getRun(getParagraph(4), 1), "CharFontName")); +} + DECLARE_RTFEXPORT_TEST(testTdf111851, "tdf111851.rtf") { uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx index d78f087d76e3..35d3e0128c84 100644 --- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx +++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx @@ -762,6 +762,10 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) if (m_aStates.top().getDestination() == Destination::FONTTABLE || m_aStates.top().getDestination() == Destination::FONTENTRY) { +// Some text in buffer? It is font name. So previous font definition is complete +if (m_aStates.top().getCurrentDestinationText()->getLength()) +handleFontTableEntry(); + m_aFontIndexes.push_back(nParam); m_nCurrentFontIndex = getFontIndex(nParam); } diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 8ea858abada5..9e77cbf4602e 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1332,6 +1332,74 @@ void RTFDocumentImpl::singleChar(sal_uInt8 nValue, bool bRunProps) } } +void RTFDocumentImpl::handleFontTableEntry() +{ +OUString aName = m_aStates.top().getCurrentDestinationText()->makeStringAndClear(); + +if (aName.isEmpty()) +return; + +if (aName.endsWith(";")) +{ +aName = aName.copy(0, aName.getLength() - 1); +} + +// Old documents can contain no encoding information in fontinfo, +// but there can be font name suffixes: Arial CE is not a special +// font, it is ordinal Arial, but with used cp 1250 encoding. +// Moreover these suffixes have priority over \cpgN and \fcharsetN +// in MS Word. +OUString aFontSuffix; +OUString aNam
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf95706_2.rtf | 17 ++ sw/qa/extras/rtfexport/rtfexport4.cxx | 12 + writerfilter/source/rtftok/rtfdispatchvalue.cxx |4 writerfilter/source/rtftok/rtfdocumentimpl.cxx | 162 +--- writerfilter/source/rtftok/rtfdocumentimpl.hxx |1 5 files changed, 122 insertions(+), 74 deletions(-) New commits: commit 844be7358f1eec00094a55fa1fb4fadadb8cd1bf Author: Vasily Melenchuk AuthorDate: Thu Apr 7 20:59:08 2022 +0300 Commit: Miklos Vajna CommitDate: Fri Apr 8 11:22:54 2022 +0200 tdf#95706: RTF import: tolerant font table parsing While font name in font table should end with semicolon ({\fonttbl{\f42 Arial;}}) it is not always true and MS Word is tolerant to it: it still able to parse this correctly. Seems LO also should not require strict spec conformance. So idea of font parsing is changed: instead of inserting font on semicolon, it is done on next \fN or destination end. All collected text to this moment is a font name. Change-Id: I6b41951217442a71fd2ebbfc58a3fc79f6f913db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132686 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/rtfexport/data/tdf95706_2.rtf b/sw/qa/extras/rtfexport/data/tdf95706_2.rtf new file mode 100644 index ..d36d2ccd2396 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf95706_2.rtf @@ -0,0 +1,17 @@ +{\rtf\ansi +{\fonttbl +{\f1 Arial} +\f2 Impact +\f3 T\'69mes New Roman +\f4 T +a +h +o +m +a +} +\pard\f1\fs26 Arial\par +\pard\f2\fs26 Impact\par +\pard\f3\fs26 Times New Roman\par +\pard\f4\fs26 Tahoma\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 2d036538d6fe..c2af71a93f63 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -553,6 +553,18 @@ DECLARE_RTFEXPORT_TEST(testTdf95706, "tdf95706.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun16, "CharFontName")); } +DECLARE_RTFEXPORT_TEST(testTdf95706_2, "tdf95706_2.rtf") +{ +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), + getProperty(getRun(getParagraph(1), 1), "CharFontName")); +CPPUNIT_ASSERT_EQUAL(OUString("Impact"), + getProperty(getRun(getParagraph(2), 1), "CharFontName")); +CPPUNIT_ASSERT_EQUAL(OUString("Times New Roman"), + getProperty(getRun(getParagraph(3), 1), "CharFontName")); +CPPUNIT_ASSERT_EQUAL(OUString("Tahoma"), + getProperty(getRun(getParagraph(4), 1), "CharFontName")); +} + DECLARE_RTFEXPORT_TEST(testTdf111851, "tdf111851.rtf") { uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx index b3c04bb0f1f1..ca092fb66a37 100644 --- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx +++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx @@ -762,6 +762,10 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) if (m_aStates.top().getDestination() == Destination::FONTTABLE || m_aStates.top().getDestination() == Destination::FONTENTRY) { +// Some text in buffer? It is font name. So previous font definition is complete +if (m_aStates.top().getCurrentDestinationText()->getLength()) +handleFontTableEntry(); + m_aFontIndexes.push_back(nParam); m_nCurrentFontIndex = getFontIndex(nParam); } diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 5a19ccebb20a..47349ac8aaba 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1332,6 +1332,74 @@ void RTFDocumentImpl::singleChar(sal_uInt8 nValue, bool bRunProps) } } +void RTFDocumentImpl::handleFontTableEntry() +{ +OUString aName = m_aStates.top().getCurrentDestinationText()->makeStringAndClear(); + +if (aName.isEmpty()) +return; + +if (aName.endsWith(";")) +{ +aName = aName.copy(0, aName.getLength() - 1); +} + +// Old documents can contain no encoding information in fontinfo, +// but there can be font name suffixes: Arial CE is not a special +// font, it is ordinal Arial, but with used cp 1250 encoding. +// Moreover these suffixes have priority over \cpgN and \fcharsetN +// in MS Word. +OUString aFontSuffix; +OUString aNameNoSuffix(aName); +sal_Int32 nLastSpace = aName.lastIndexOf(' '); +if (nLastSpace >= 0) +{ +aFontSuffix = aName.copy(nLastSpace + 1); +
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf95706.rtf | 36 ++ sw/qa/extras/rtfexport/rtfexport4.cxx | 61 + writerfilter/source/rtftok/rtfcharsets.cxx |9 +++ writerfilter/source/rtftok/rtfcharsets.hxx | 13 + writerfilter/source/rtftok/rtfdocumentimpl.cxx | 39 +++ 5 files changed, 156 insertions(+), 2 deletions(-) New commits: commit d72dece2bc61e3bab8db5968d53dc0e98a3bea4d Author: Vasily Melenchuk AuthorDate: Tue Apr 5 19:13:05 2022 +0300 Commit: Miklos Vajna CommitDate: Fri Apr 8 11:20:10 2022 +0200 tdf#95706: RTF import: Use fontname suffixes to detect encoding Font names like "Arial CE", "Times New Roman Cyr" are not special fonts. They are classical Arial, Times New Roman... And these suffixes can be used to detect encoding used for RTF text. Most interesting: for MS Word these suffixes have priority: {\f34\cpg1253\fcharset161 Arial Baltic;} will have cp1257 and not cp1253. Looks like compatibility issue came from dark ages. Change-Id: Ife8e781d5d04c3f6a8c11fcf604357c74bf33055 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132584 Tested-by: Jenkins Reviewed-by: Miklos Vajna Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132681 Reviewed-by: Michael Stahl diff --git a/sw/qa/extras/rtfexport/data/tdf95706.rtf b/sw/qa/extras/rtfexport/data/tdf95706.rtf new file mode 100644 index ..64c97930441d --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf95706.rtf @@ -0,0 +1,36 @@ +{\rtf\ansi +{\fonttbl +{\f1 Arial Baltic;} +{\f2 Arial CE;} +{\f3 Arial Cyr;} +{\f4 Arial Greek;} +{\f5 Arial Tur;} +{\f6 Arial (Hebrew);} +{\f7 Arial (Arabic);} +{\f8 Arial (Vietnamese);} +{\f9 Arial BlaBlaBla;} + +{\f10\cpg1253\fcharset161 Arial;} +{\f11\fcharset161 Arial;} +{\f12\cpg1253 Arial;} +{\f13\cpg1253\fcharset161 Arial Baltic;} +{\f14 Arial Baltic;\cpg1253\fcharset161} + +} +\pard Font name suffixes:\par +\pard\f1\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f2\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f3\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f4\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f5\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f6\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f7\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f8\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f9\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard Font entry charset values:\par +\pard\f10\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f11\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f12\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f13\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f14\fs26 \'c0\'c1\'c2\'c3\'c4\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 32f1a5f88cad..1f1434054085 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -461,6 +461,67 @@ CPPUNIT_TEST_FIXTURE(Test, testGutterTop) CPPUNIT_ASSERT(bGutterAtTop); } +DECLARE_RTFEXPORT_TEST(testTdf95706, "tdf95706.rtf") +{ +uno::Reference xRun2 += getRun(getParagraph(2), 1, u"\u0104\u012e\u0100\u0106\u00c4"); +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun2, "CharFontName")); + +uno::Reference xRun3 += getRun(getParagraph(3), 1, u"\u0154\u00c1\u00c2\u0102\u00c4"); +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun3, "CharFontName")); + +uno::Reference xRun4 += getRun(getParagraph(4), 1, u"\u0410\u0411\u0412\u0413\u0414"); +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun4, "CharFontName")); + +uno::Reference xRun5 += getRun(getParagraph(5), 1, u"\u0390\u0391\u0392\u0393\u0394"); +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun5, "CharFontName")); + +uno::Reference xRun6 += getRun(getParagraph(6), 1, u"\u00c0\u00c1\u00c2\u00c3\u00c4"); +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun6, "CharFontName")); + +uno::Reference xRun7 += getRun(getParagraph(7), 1, u"\u05b0\u05b1\u05b2\u05b3\u05b4"); +// Do not check font for Hebrew: it can be substituted by smth able to handle these chars +//CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun7, "CharFontName")); + +uno::Reference xRun8 += getRun(getParagraph(8), 1, u"\u06c1\u0621\u0622\u0623\u0624"); +// Do not check font for Arabic: it can be substituted by smth able to ha
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf95706.rtf | 36 ++ sw/qa/extras/rtfexport/rtfexport4.cxx | 61 + writerfilter/source/rtftok/rtfcharsets.cxx |9 +++ writerfilter/source/rtftok/rtfcharsets.hxx | 13 + writerfilter/source/rtftok/rtfdocumentimpl.cxx | 39 +++ 5 files changed, 156 insertions(+), 2 deletions(-) New commits: commit 965313b9efc761c70aacf6e3ebee60ffa2b1d5dd Author: Vasily Melenchuk AuthorDate: Tue Apr 5 19:13:05 2022 +0300 Commit: Miklos Vajna CommitDate: Thu Apr 7 14:29:04 2022 +0200 tdf#95706: RTF import: Use fontname suffixes to detect encoding Font names like "Arial CE", "Times New Roman Cyr" are not special fonts. They are classical Arial, Times New Roman... And these suffixes can be used to detect encoding used for RTF text. Most interesting: for MS Word these suffixes have priority: {\f34\cpg1253\fcharset161 Arial Baltic;} will have cp1257 and not cp1253. Looks like compatibility issue came from dark ages. Change-Id: Ife8e781d5d04c3f6a8c11fcf604357c74bf33055 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132584 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/rtfexport/data/tdf95706.rtf b/sw/qa/extras/rtfexport/data/tdf95706.rtf new file mode 100644 index ..64c97930441d --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf95706.rtf @@ -0,0 +1,36 @@ +{\rtf\ansi +{\fonttbl +{\f1 Arial Baltic;} +{\f2 Arial CE;} +{\f3 Arial Cyr;} +{\f4 Arial Greek;} +{\f5 Arial Tur;} +{\f6 Arial (Hebrew);} +{\f7 Arial (Arabic);} +{\f8 Arial (Vietnamese);} +{\f9 Arial BlaBlaBla;} + +{\f10\cpg1253\fcharset161 Arial;} +{\f11\fcharset161 Arial;} +{\f12\cpg1253 Arial;} +{\f13\cpg1253\fcharset161 Arial Baltic;} +{\f14 Arial Baltic;\cpg1253\fcharset161} + +} +\pard Font name suffixes:\par +\pard\f1\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f2\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f3\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f4\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f5\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f6\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f7\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f8\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f9\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard Font entry charset values:\par +\pard\f10\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f11\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f12\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f13\fs26 \'c0\'c1\'c2\'c3\'c4\par +\pard\f14\fs26 \'c0\'c1\'c2\'c3\'c4\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 8f81b1565695..2d036538d6fe 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -492,6 +492,67 @@ CPPUNIT_TEST_FIXTURE(Test, testClearingBreak) verify(); } +DECLARE_RTFEXPORT_TEST(testTdf95706, "tdf95706.rtf") +{ +uno::Reference xRun2 += getRun(getParagraph(2), 1, u"\u0104\u012e\u0100\u0106\u00c4"); +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun2, "CharFontName")); + +uno::Reference xRun3 += getRun(getParagraph(3), 1, u"\u0154\u00c1\u00c2\u0102\u00c4"); +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun3, "CharFontName")); + +uno::Reference xRun4 += getRun(getParagraph(4), 1, u"\u0410\u0411\u0412\u0413\u0414"); +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun4, "CharFontName")); + +uno::Reference xRun5 += getRun(getParagraph(5), 1, u"\u0390\u0391\u0392\u0393\u0394"); +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun5, "CharFontName")); + +uno::Reference xRun6 += getRun(getParagraph(6), 1, u"\u00c0\u00c1\u00c2\u00c3\u00c4"); +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun6, "CharFontName")); + +uno::Reference xRun7 += getRun(getParagraph(7), 1, u"\u05b0\u05b1\u05b2\u05b3\u05b4"); +// Do not check font for Hebrew: it can be substituted by smth able to handle these chars +//CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun7, "CharFontName")); + +uno::Reference xRun8 += getRun(getParagraph(8), 1, u"\u06c1\u0621\u0622\u0623\u0624"); +// Do not check font for Arabic: it can be substituted by smth able to handle these chars +//CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun8, "CharFontName")); + +uno::Reference xRun9
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - sw/qa sw/rtfexport_setup.mk tools/CppunitTest_tools_test.mk tools/qa tools/source writerfilter/source
sw/qa/extras/rtfexport/data/tdf116358.rtf | 116 + sw/qa/extras/rtfexport/rtfexport4.cxx | 30 ++ sw/rtfexport_setup.mk |1 tools/CppunitTest_tools_test.mk|1 tools/qa/cppunit/test_Wildcard.cxx | 46 + tools/source/fsys/wldcrd.cxx | 77 +--- writerfilter/source/dmapper/SettingsTable.cxx |6 - writerfilter/source/filter/WriterFilter.cxx|1 writerfilter/source/rtftok/rtfdispatchflag.cxx |3 9 files changed, 241 insertions(+), 40 deletions(-) New commits: commit 8bbe35a88da6c7f1803cb99783bea4be074c7635 Author: Vasily Melenchuk AuthorDate: Wed Mar 30 13:09:19 2022 +0300 Commit: Andras Timar CommitDate: Wed Apr 6 13:28:32 2022 +0200 tdf#116358: rtf import: "keep with next" also affects table rows Like in DOCX for RTF there is exactly same behavior for paragraphs inside cells. They do affect table breaking over the pages. So: 1) Enable "TableRowKeep" doc setting for RTF documents. 2) Do not ignore \keepn token for paragraphs in tables. Change-Id: I11e45ca9114c792b8cdbeb77dd51359717129651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132305 Tested-by: Jenkins Reviewed-by: Miklos Vajna Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132355 diff --git a/sw/qa/extras/rtfexport/data/tdf116358.rtf b/sw/qa/extras/rtfexport/data/tdf116358.rtf new file mode 100644 index ..09a9b3f8ead8 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf116358.rtf @@ -0,0 +1,116 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset204 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq2\fcharset204 Times New Roman;}{\f5\froman\fprq2\fcharset204 Liberation Sans{\*\falt Arial};}{\f6\fnil\fprq2\fcharset204 Microsoft YaHei;}{\f7\fnil\fprq2\fcharset204 0;}{\f8\fnil\fprq2\fcharset204 Times New Roman;}{\f9\fnil\fprq2\fcharset204 Lucida Sans;}} +{\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{\s0\snext0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 Normal;} +{\s15\sbasedon0\snext16\rtlch\af9\afs28\alang1081 \ltrch\lang2057\langfe2052\hich\af5\loch\ql\widctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\f5\fs28\lang2057\kerning1\dbch\af6\langfe2052 Heading;} +{\s16\sbasedon0\snext16\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 Text Body;} +{\s17\sbasedon16\snext17\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 List;} +{\s18\sbasedon0\snext18\rtlch\af9\afs24\alang1081\ai \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\sb120\sa120\ltrpar\cf0\f3\fs24\lang2057\i\kerning1\dbch\af7\langfe2052 Caption;} +{\s19\sbasedon0\snext19\rtlch\af9\afs24\alang255 \ltrch\lang255\langfe255\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang255\kerning1\dbch\af7\langfe255 Index;} +{\s20\sbasedon0\snext20\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\nowidctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 Table Contents;} +}{\*\generator LibreOfficeDev/7.4.0.0.alpha0$Windows_X86_64 LibreOffice_project/1e1cab9d5a0728c13209aeed95b6802175799a0a}{\info{\creatim\yr2022\mo3\dy30\hr9\min3}{\revtim\yr2022\mo3\dy30\hr9\min11}{\printim\yr0\mo0\dy0\hr0\min0}}{\*\userprops}\deftab709 +\hyphauto1\viewscale100 +{\*\pgdsctbl +{\pgdsc0\pgdscuse451\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Default Page Style;}} +\formshade\paperh16838\paperw11906\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgndec\sftnnar\saftnnrlc\sectunlocked1\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +{\*\ftnsep\chftnsep}\pgndec\pard\plain \s0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052{\loch +A} +\par \pard\plain \s0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf148361.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 16 writerfilter/source/dmapper/SdtHelper.cxx| 20 ++-- writerfilter/source/dmapper/SdtHelper.hxx|3 +++ 4 files changed, 33 insertions(+), 6 deletions(-) New commits: commit 2d1bd913d9f896d55c03dd509eb11c81667c5436 Author: Vasily Melenchuk AuthorDate: Mon Apr 4 18:05:18 2022 +0300 Commit: Xisco Fauli CommitDate: Wed Apr 6 09:34:49 2022 +0200 tdf#148361: docx sdt: cleanup databinding data after inserting Databinding data is used only for current sdt block. It should be clean up after usage to avoid impact on next sdt blocks. Change-Id: I53f47dd655ed027d40eb518784dcae69813e612f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132524 Tested-by: Jenkins Tested-by: Xisco Fauli Reviewed-by: Vasily Melenchuk (cherry picked from commit fafadd7aee8c384af210008f693b5007a9f5ea48) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132595 Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/ooxmlexport/data/tdf148361.docx b/sw/qa/extras/ooxmlexport/data/tdf148361.docx new file mode 100644 index ..ecf9a5f0087c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148361.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 370989a9d6b7..51f0d9fb9345 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -143,6 +143,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123642_BookmarkAtDocEnd, "tdf123642.docx") CPPUNIT_ASSERT_EQUAL(OUString("Bookmark1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart[1]", "name")); } +DECLARE_OOXMLEXPORT_TEST(testTdf148361, "tdf148361.docx") +{ +// Refresh fields and ensure cross-reference to numbered para is okay +uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); + +uno::Reference xFields(xFieldsAccess->createEnumeration()); +CPPUNIT_ASSERT(xFields->hasMoreElements()); + +uno::Reference xTextField1(xFields->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("itadmin"), xTextField1->getPresentation(false)); + +uno::Reference xTextField2(xFields->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("[Type text]"), xTextField2->getPresentation(false)); +} + DECLARE_OOXMLEXPORT_TEST(testTdf142407, "tdf142407.docx") { uno::Reference xPageStyles = getStyles("PageStyles"); diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 576d63d430c6..f4b02fab4d02 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -264,8 +264,7 @@ void SdtHelper::createDropDownControl() } // clean up -m_aDropDownItems.clear(); -setControlType(SdtControlType::unknown); +clear(); } void SdtHelper::createPlainTextControl() @@ -296,8 +295,7 @@ void SdtHelper::createPlainTextControl() uno::makeAny(getInteropGrabBagAndClear())); // clean up -m_aDropDownItems.clear(); -setControlType(SdtControlType::unknown); +clear(); } void SdtHelper::createDateContentControl() @@ -372,11 +370,11 @@ void SdtHelper::createDateContentControl() uno::UNO_QUERY); xRefreshable->refresh(); -setControlType(SdtControlType::unknown); - // Store all unused sdt parameters from grabbag xNameCont->insertByName(UNO_NAME_MISC_OBJ_INTEROPGRABBAG, uno::makeAny(getInteropGrabBagAndClear())); + +clear(); } void SdtHelper::createControlShape(awt::Size aSize, @@ -423,6 +421,16 @@ bool SdtHelper::containedInInteropGrabBag(const OUString& rValueName) [&rValueName](const beans::PropertyValue& i) { return i.Name == rValueName; }); } +void SdtHelper::clear() +{ +m_aDropDownItems.clear(); +setControlType(SdtControlType::unknown); +m_sDataBindingPrefixMapping.clear(); +m_sDataBindingXPath.clear(); +m_sDataBindingStoreItemID.clear(); +m_aGrabBag.clear(); +} + } // namespace writerfilter::dmapper /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/SdtHelper.hxx b/writerfilter/source/dmapper/SdtHelper.hxx index e58d73168d79..d9a6115a1251 100644 --- a/writerfilter/source/dmapper/SdtHelper.hxx +++ b/writerfilter/source/dmapper/SdtHelper.hxx @@ -102,6 +102,9 @@ class SdtHelper final : public virtual SvRefBase void loadPropertiesXMLs(); +/// Clear all collected attributes for futher reuse +void clear(); + public: explicit SdtHelper(DomainMapper_Impl& rDM_Impl, css::uno::Reference const& xContext);
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf148361.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 16 writerfilter/source/dmapper/SdtHelper.cxx| 20 ++-- writerfilter/source/dmapper/SdtHelper.hxx|3 +++ 4 files changed, 33 insertions(+), 6 deletions(-) New commits: commit fafadd7aee8c384af210008f693b5007a9f5ea48 Author: Vasily Melenchuk AuthorDate: Mon Apr 4 18:05:18 2022 +0300 Commit: Vasily Melenchuk CommitDate: Tue Apr 5 16:50:21 2022 +0200 tdf#148361: docx sdt: cleanup databinding data after inserting Databinding data is used only for current sdt block. It should be clean up after usage to avoid impact on next sdt blocks. Change-Id: I53f47dd655ed027d40eb518784dcae69813e612f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132524 Tested-by: Jenkins Tested-by: Xisco Fauli Reviewed-by: Vasily Melenchuk diff --git a/sw/qa/extras/ooxmlexport/data/tdf148361.docx b/sw/qa/extras/ooxmlexport/data/tdf148361.docx new file mode 100644 index ..ecf9a5f0087c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148361.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index f199b1fa6671..00f54a17c561 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -232,6 +232,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123642_BookmarkAtDocEnd, "tdf123642.docx") CPPUNIT_ASSERT_EQUAL(OUString("Bookmark1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart[1]", "name")); } +DECLARE_OOXMLEXPORT_TEST(testTdf148361, "tdf148361.docx") +{ +// Refresh fields and ensure cross-reference to numbered para is okay +uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); + +uno::Reference xFields(xFieldsAccess->createEnumeration()); +CPPUNIT_ASSERT(xFields->hasMoreElements()); + +uno::Reference xTextField1(xFields->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("itadmin"), xTextField1->getPresentation(false)); + +uno::Reference xTextField2(xFields->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("[Type text]"), xTextField2->getPresentation(false)); +} + DECLARE_OOXMLEXPORT_TEST(testTdf142407, "tdf142407.docx") { uno::Reference xPageStyles = getStyles("PageStyles"); diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 6d02a044dae6..0bda90d71e4f 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -262,8 +262,7 @@ void SdtHelper::createDropDownControl() } // clean up -m_aDropDownItems.clear(); -setControlType(SdtControlType::unknown); +clear(); } void SdtHelper::createPlainTextControl() @@ -294,8 +293,7 @@ void SdtHelper::createPlainTextControl() uno::makeAny(getInteropGrabBagAndClear())); // clean up -m_aDropDownItems.clear(); -setControlType(SdtControlType::unknown); +clear(); } void SdtHelper::createDateContentControl() @@ -370,11 +368,11 @@ void SdtHelper::createDateContentControl() uno::UNO_QUERY); xRefreshable->refresh(); -setControlType(SdtControlType::unknown); - // Store all unused sdt parameters from grabbag xNameCont->insertByName(UNO_NAME_MISC_OBJ_INTEROPGRABBAG, uno::makeAny(getInteropGrabBagAndClear())); + +clear(); } void SdtHelper::createControlShape(awt::Size aSize, @@ -421,6 +419,16 @@ bool SdtHelper::containedInInteropGrabBag(const OUString& rValueName) [&rValueName](const beans::PropertyValue& i) { return i.Name == rValueName; }); } +void SdtHelper::clear() +{ +m_aDropDownItems.clear(); +setControlType(SdtControlType::unknown); +m_sDataBindingPrefixMapping.clear(); +m_sDataBindingXPath.clear(); +m_sDataBindingStoreItemID.clear(); +m_aGrabBag.clear(); +} + } // namespace writerfilter::dmapper /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/SdtHelper.hxx b/writerfilter/source/dmapper/SdtHelper.hxx index fb458d8d8b94..54e083ee8df2 100644 --- a/writerfilter/source/dmapper/SdtHelper.hxx +++ b/writerfilter/source/dmapper/SdtHelper.hxx @@ -102,6 +102,9 @@ class SdtHelper final : public virtual SvRefBase void loadPropertiesXMLs(); +/// Clear all collected attributes for futher reuse +void clear(); + public: explicit SdtHelper(DomainMapper_Impl& rDM_Impl, css::uno::Reference const& xContext);
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf139948.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx| 26 + sw/qa/extras/rtfexport/data/tdf139948.rtf |8 + sw/qa/extras/rtfexport/rtfexport4.cxx | 32 ++ writerfilter/source/dmapper/DomainMapper.cxx | 11 ++- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 25 + writerfilter/source/dmapper/DomainMapper_Impl.hxx |3 ++ writerfilter/source/dmapper/PropertyIds.cxx |1 writerfilter/source/dmapper/PropertyIds.hxx |1 writerfilter/source/rtftok/rtfdispatchflag.cxx|4 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx|5 ++- 11 files changed, 113 insertions(+), 3 deletions(-) New commits: commit e3a996bf72a16f5b22e6ff021745af5cec70a632 Author: Vasily Melenchuk AuthorDate: Fri Apr 1 16:35:40 2022 +0300 Commit: Miklos Vajna CommitDate: Tue Apr 5 15:50:54 2022 +0200 tdf#139948: docx and rtf import: emulate border in between Writer does not support border in between available in all MS formats. Since this feature is missing in core it will be better to emulate it with top borders than to ignore it completely. Change-Id: I4e5a99cde5908066c4bb483136cfe9a1316df53c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132429 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/ooxmlexport/data/tdf139948.docx b/sw/qa/extras/ooxmlexport/data/tdf139948.docx new file mode 100644 index ..1b3f7df00031 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf139948.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 69591c638fcc..f199b1fa6671 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -397,6 +397,32 @@ DECLARE_OOXMLEXPORT_TEST(testTdf81507, "tdf81507.docx") xmlXPathFreeObject(pXmlObj); } +DECLARE_OOXMLEXPORT_TEST(testTdf139948, "tdf139948.docx") +{ +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(1, "No border"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(2, "Border below"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(88), +getProperty(getParagraph(3, "Borders below and above"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(88), +getProperty(getParagraph(4, "Border above"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(5, "No border"), "TopBorder").LineWidth); + + +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(1), "BottomBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(2), "BottomBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(3), "BottomBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(4), "BottomBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), +getProperty(getParagraph(5), "BottomBorder").LineWidth); +} + DECLARE_OOXMLEXPORT_TEST(testTdf144563, "tdf144563.docx") { uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/rtfexport/data/tdf139948.rtf b/sw/qa/extras/rtfexport/data/tdf139948.rtf new file mode 100644 index ..0b601a764adf --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf139948.rtf @@ -0,0 +1,8 @@ +{\rtf1\ansi +No border\par +\pard\brdrbtw\brdrs\brdrw50 +Border below\par +Borders below and above\par +Border above\par +\pard No border\par +} \ No newline at end of file diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 123b3b31ae4d..8f81b1565695 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -528,6 +528,38 @@ DECLARE_RTFEXPORT_TEST(testTdf111851, "tdf111851.rtf") CPPUNIT_ASSERT_EQUAL(COL_BLACK, getProperty(xCell6, "BackColor")); } +DECLARE_RTFEXPORT_TEST(testTdf139948, "tdf139948.rtf") +{ +CPPUNIT_ASSERT_EQUAL( +sal_uInt32(0), +getProperty(getParagraph(1, "No border"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL( +sal_uInt32(0), +getProperty(getParagraph(2, "Border below"), "TopBorder").LineWidth); +CPPUNIT_ASSERT_EQUAL( +sal_uInt32(88), +getProperty(getParagraph(3, "Borders below and above"), "TopBorder") +.LineWidth); +CPPUNIT_ASSERT_EQUAL( +sal_uInt32(88), +getProperty(getParagraph
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa sw/rtfexport_setup.mk writerfilter/source
sw/qa/extras/rtfexport/data/tdf116358.rtf | 116 + sw/qa/extras/rtfexport/rtfexport4.cxx | 30 ++ sw/rtfexport_setup.mk |1 writerfilter/source/dmapper/SettingsTable.cxx |6 - writerfilter/source/filter/WriterFilter.cxx|1 writerfilter/source/rtftok/rtfdispatchflag.cxx |3 6 files changed, 152 insertions(+), 5 deletions(-) New commits: commit 4ef50c9ac03960c694c50e5a7488693422503357 Author: Vasily Melenchuk AuthorDate: Wed Mar 30 13:09:19 2022 +0300 Commit: Miklos Vajna CommitDate: Fri Apr 1 08:38:32 2022 +0200 tdf#116358: rtf import: "keep with next" also affects table rows Like in DOCX for RTF there is exactly same behavior for paragraphs inside cells. They do affect table breaking over the pages. So: 1) Enable "TableRowKeep" doc setting for RTF documents. 2) Do not ignore \keepn token for paragraphs in tables. Change-Id: I11e45ca9114c792b8cdbeb77dd51359717129651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132305 Tested-by: Jenkins Reviewed-by: Miklos Vajna Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132355 diff --git a/sw/qa/extras/rtfexport/data/tdf116358.rtf b/sw/qa/extras/rtfexport/data/tdf116358.rtf new file mode 100644 index ..09a9b3f8ead8 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf116358.rtf @@ -0,0 +1,116 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset204 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq2\fcharset204 Times New Roman;}{\f5\froman\fprq2\fcharset204 Liberation Sans{\*\falt Arial};}{\f6\fnil\fprq2\fcharset204 Microsoft YaHei;}{\f7\fnil\fprq2\fcharset204 0;}{\f8\fnil\fprq2\fcharset204 Times New Roman;}{\f9\fnil\fprq2\fcharset204 Lucida Sans;}} +{\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{\s0\snext0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 Normal;} +{\s15\sbasedon0\snext16\rtlch\af9\afs28\alang1081 \ltrch\lang2057\langfe2052\hich\af5\loch\ql\widctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\f5\fs28\lang2057\kerning1\dbch\af6\langfe2052 Heading;} +{\s16\sbasedon0\snext16\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 Text Body;} +{\s17\sbasedon16\snext17\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 List;} +{\s18\sbasedon0\snext18\rtlch\af9\afs24\alang1081\ai \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\sb120\sa120\ltrpar\cf0\f3\fs24\lang2057\i\kerning1\dbch\af7\langfe2052 Caption;} +{\s19\sbasedon0\snext19\rtlch\af9\afs24\alang255 \ltrch\lang255\langfe255\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang255\kerning1\dbch\af7\langfe255 Index;} +{\s20\sbasedon0\snext20\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\nowidctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 Table Contents;} +}{\*\generator LibreOfficeDev/7.4.0.0.alpha0$Windows_X86_64 LibreOffice_project/1e1cab9d5a0728c13209aeed95b6802175799a0a}{\info{\creatim\yr2022\mo3\dy30\hr9\min3}{\revtim\yr2022\mo3\dy30\hr9\min11}{\printim\yr0\mo0\dy0\hr0\min0}}{\*\userprops}\deftab709 +\hyphauto1\viewscale100 +{\*\pgdsctbl +{\pgdsc0\pgdscuse451\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Default Page Style;}} +\formshade\paperh16838\paperw11906\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgndec\sftnnar\saftnnrlc\sectunlocked1\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +{\*\ftnsep\chftnsep}\pgndec\pard\plain \s0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052{\loch +A} +\par \pard\plain \s0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052\loch + +\par \pard\plain \s0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe205
[Libreoffice-commits] core.git: sw/qa sw/rtfexport_setup.mk writerfilter/source
sw/qa/extras/rtfexport/data/tdf116358.rtf | 116 + sw/qa/extras/rtfexport/rtfexport4.cxx | 30 ++ sw/rtfexport_setup.mk |1 writerfilter/source/dmapper/SettingsTable.cxx |6 - writerfilter/source/filter/WriterFilter.cxx|1 writerfilter/source/rtftok/rtfdispatchflag.cxx |3 6 files changed, 152 insertions(+), 5 deletions(-) New commits: commit f0c7746e83e9c9f17f7c415ef3423c882a6de1ca Author: Vasily Melenchuk AuthorDate: Wed Mar 30 13:09:19 2022 +0300 Commit: Miklos Vajna CommitDate: Thu Mar 31 08:35:57 2022 +0200 tdf#116358: rtf import: "keep with next" also affects table rows Like in DOCX for RTF there is exactly same behavior for paragraphs inside cells. They do affect table breaking over the pages. So: 1) Enable "TableRowKeep" doc setting for RTF documents. 2) Do not ignore \keepn token for paragraphs in tables. Change-Id: I11e45ca9114c792b8cdbeb77dd51359717129651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132305 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/rtfexport/data/tdf116358.rtf b/sw/qa/extras/rtfexport/data/tdf116358.rtf new file mode 100644 index ..09a9b3f8ead8 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf116358.rtf @@ -0,0 +1,116 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset204 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq2\fcharset204 Times New Roman;}{\f5\froman\fprq2\fcharset204 Liberation Sans{\*\falt Arial};}{\f6\fnil\fprq2\fcharset204 Microsoft YaHei;}{\f7\fnil\fprq2\fcharset204 0;}{\f8\fnil\fprq2\fcharset204 Times New Roman;}{\f9\fnil\fprq2\fcharset204 Lucida Sans;}} +{\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{\s0\snext0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 Normal;} +{\s15\sbasedon0\snext16\rtlch\af9\afs28\alang1081 \ltrch\lang2057\langfe2052\hich\af5\loch\ql\widctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\f5\fs28\lang2057\kerning1\dbch\af6\langfe2052 Heading;} +{\s16\sbasedon0\snext16\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 Text Body;} +{\s17\sbasedon16\snext17\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 List;} +{\s18\sbasedon0\snext18\rtlch\af9\afs24\alang1081\ai \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\sb120\sa120\ltrpar\cf0\f3\fs24\lang2057\i\kerning1\dbch\af7\langfe2052 Caption;} +{\s19\sbasedon0\snext19\rtlch\af9\afs24\alang255 \ltrch\lang255\langfe255\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang255\kerning1\dbch\af7\langfe255 Index;} +{\s20\sbasedon0\snext20\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\nowidctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052 Table Contents;} +}{\*\generator LibreOfficeDev/7.4.0.0.alpha0$Windows_X86_64 LibreOffice_project/1e1cab9d5a0728c13209aeed95b6802175799a0a}{\info{\creatim\yr2022\mo3\dy30\hr9\min3}{\revtim\yr2022\mo3\dy30\hr9\min11}{\printim\yr0\mo0\dy0\hr0\min0}}{\*\userprops}\deftab709 +\hyphauto1\viewscale100 +{\*\pgdsctbl +{\pgdsc0\pgdscuse451\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Default Page Style;}} +\formshade\paperh16838\paperw11906\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgndec\sftnnar\saftnnrlc\sectunlocked1\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +{\*\ftnsep\chftnsep}\pgndec\pard\plain \s0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052{\loch +A} +\par \pard\plain \s0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052\loch + +\par \pard\plain \s0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\af3\loch\ql\widctlpar\hyphpar0\ltrpar\cf0\f3\fs24\lang2057\kerning1\dbch\af7\langfe2052\loch + +\par \pard\plain \s0\rtlch\af9\afs24\alang1081 \ltrch\lang2057\langfe2052\hich\a
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf148111.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 28 +++ writerfilter/source/dmapper/SdtHelper.cxx|3 +- 3 files changed, 30 insertions(+), 1 deletion(-) New commits: commit cebca5086b42ff9462d8c6f8ed2344a0138b2f4a Author: Vasily Melenchuk AuthorDate: Fri Mar 25 11:14:10 2022 +0300 Commit: Xisco Fauli CommitDate: Mon Mar 28 11:32:10 2022 +0200 tdf#148111: docx std fields: use placeholder text for empty data It is quite unexpected Word behavior: if data source for sdt field exists but contains empty string it is not used. Placeholder is inserted instead. In general behavior is more complex: logic of replacement is defined by property and results can vary (see testcase). But LO does not support this property correctly yet. Change-Id: I2ec8efe05f79a01af5d74d21bfcd05f3b19e3970 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132096 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 9d033508af5257aeebbd8c22a053db5e74a814d3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132050 Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/ooxmlexport/data/tdf148111.docx b/sw/qa/extras/ooxmlexport/data/tdf148111.docx new file mode 100644 index ..a46fb508dc0e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148111.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 9937d86b0f88..ea1d894f67ad 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -181,6 +181,34 @@ DECLARE_OOXMLEXPORT_TEST(testTdf146851_2, "tdf146851_2.docx") CPPUNIT_ASSERT_EQUAL(OUString("Schedule"), xTextField->getPresentation(false)); } +DECLARE_OOXMLEXPORT_TEST(testTdf148111, "tdf148111.docx") +{ +uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); + +uno::Reference xFields(xFieldsAccess->createEnumeration()); +std::vector aExpectedValues = { +// These field values are NOT in order in document: getTextFields did provide +// fields in a strange but fixed order +"Title", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Title", "Title", "Title", +"Title", "Title", "Title", "Title" +}; + +sal_uInt16 nIndex = 0; +while (xFields->hasMoreElements()) +{ +uno::Reference xTextField(xFields->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(aExpectedValues[nIndex++], xTextField->getPresentation(false)); +} + +// No more fields +CPPUNIT_ASSERT(!xFields->hasMoreElements()); +} + DECLARE_OOXMLEXPORT_TEST(testTdf81507, "tdf81507.docx") { xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index c5ec47f2be23..576d63d430c6 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -197,7 +197,8 @@ std::optional SdtHelper::getValueFromDataBinding() { uno::Reference xResult = xXpathAPI->eval(xDocument, m_sDataBindingXPath); -if (xResult.is() && xResult->getNodeList() && xResult->getNodeList()->getLength()) +if (xResult.is() && xResult->getNodeList() && xResult->getNodeList()->getLength() +&& xResult->getString().getLength()) { return xResult->getString(); }
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf148111.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 28 +++ writerfilter/source/dmapper/SdtHelper.cxx|3 +- 3 files changed, 30 insertions(+), 1 deletion(-) New commits: commit 9d033508af5257aeebbd8c22a053db5e74a814d3 Author: Vasily Melenchuk AuthorDate: Fri Mar 25 11:14:10 2022 +0300 Commit: Thorsten Behrens CommitDate: Sat Mar 26 23:02:01 2022 +0100 tdf#148111: docx std fields: use placeholder text for empty data It is quite unexpected Word behavior: if data source for sdt field exists but contains empty string it is not used. Placeholder is inserted instead. In general behavior is more complex: logic of replacement is defined by property and results can vary (see testcase). But LO does not support this property correctly yet. Change-Id: I2ec8efe05f79a01af5d74d21bfcd05f3b19e3970 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132096 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/ooxmlexport/data/tdf148111.docx b/sw/qa/extras/ooxmlexport/data/tdf148111.docx new file mode 100644 index ..a46fb508dc0e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148111.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index aff5fb3b336c..8162b8fbb414 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -319,6 +319,34 @@ DECLARE_OOXMLEXPORT_TEST(testTdf146851_2, "tdf146851_2.docx") CPPUNIT_ASSERT_EQUAL(OUString("Schedule"), xTextField->getPresentation(false)); } +DECLARE_OOXMLEXPORT_TEST(testTdf148111, "tdf148111.docx") +{ +uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); + +uno::Reference xFields(xFieldsAccess->createEnumeration()); +std::vector aExpectedValues = { +// These field values are NOT in order in document: getTextFields did provide +// fields in a strange but fixed order +"Title", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Placeholder", "Placeholder", "Placeholder", +"Placeholder", "Title", "Title", "Title", +"Title", "Title", "Title", "Title" +}; + +sal_uInt16 nIndex = 0; +while (xFields->hasMoreElements()) +{ +uno::Reference xTextField(xFields->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(aExpectedValues[nIndex++], xTextField->getPresentation(false)); +} + +// No more fields +CPPUNIT_ASSERT(!xFields->hasMoreElements()); +} + DECLARE_OOXMLEXPORT_TEST(testTdf81507, "tdf81507.docx") { xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index f4fa3ef69405..f05d1c68b049 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -195,7 +195,8 @@ std::optional SdtHelper::getValueFromDataBinding() { uno::Reference xResult = xXpathAPI->eval(xDocument, m_sDataBindingXPath); -if (xResult.is() && xResult->getNodeList() && xResult->getNodeList()->getLength()) +if (xResult.is() && xResult->getNodeList() && xResult->getNodeList()->getLength() +&& xResult->getString().getLength()) { return xResult->getString(); }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 8 commits - cui/source sc/source sw/qa sw/source vcl/source writerfilter/source
cui/source/dialogs/SpellDialog.cxx |2 sc/source/ui/docshell/impex.cxx| 73 +++-- sw/qa/extras/rtfexport/data/tdf104390.rtf |6 ++ sw/qa/extras/rtfexport/data/tdf118047.rtf | 14 sw/qa/extras/rtfexport/data/tdf131234.rtf | 12 sw/qa/extras/rtfexport/rtfexport5.cxx | 47 sw/qa/extras/uiwriter/uiwriter3.cxx| 45 +++ sw/source/core/frmedt/fetab.cxx| 22 +-- sw/source/core/txtnode/fntcache.cxx|4 + vcl/source/gdi/pdfwriter_impl.cxx |4 - writerfilter/source/rtftok/rtfdispatchflag.cxx |6 -- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 47 +--- writerfilter/source/rtftok/rtfdocumentimpl.hxx |3 - writerfilter/source/rtftok/rtfsprm.cxx | 12 14 files changed, 223 insertions(+), 74 deletions(-) New commits: commit 4d2d9cf9c3165e2460466cc75e5a8453346610c8 Author: Vasily Melenchuk AuthorDate: Mon Mar 21 17:12:12 2022 +0300 Commit: Andras Timar CommitDate: Fri Mar 25 12:59:34 2022 +0100 tdf#104390: rtf import: init default font for entire state stack If first document element is buried deep in destinations and thus deep in state stack (m_aStates) initialization of default font is very local and will be lost after closing these destinations. So let's initialize entire states stack with default font if none is provided istead of initialization just a top element. Change-Id: I966c282f43b84baece909a4c3cd359cbcd317e63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131906 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit 24b5490cb0fd8de19415509fbf452874669106ad) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131864 Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/rtfexport/data/tdf104390.rtf b/sw/qa/extras/rtfexport/data/tdf104390.rtf new file mode 100644 index ..842e73e19a85 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf104390.rtf @@ -0,0 +1,6 @@ +{\rtf1\deff0 +{\fonttbl +{\f0 Courier New;}} +\fs72 +Hello }}}{World!}} +} \ No newline at end of file diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 36bf6c839b65..297635fce37e 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -1339,6 +1339,21 @@ DECLARE_RTFEXPORT_TEST(testTdf118047, "tdf118047.rtf") CPPUNIT_ASSERT_MESSAGE("Header is too large", 1000 > nHeight); } +DECLARE_RTFEXPORT_TEST(testTdf104390, "tdf104390.rtf") +{ +uno::Reference xPara = getParagraph(1); +uno::Reference xRunEnumAccess(xPara, uno::UNO_QUERY); +uno::Reference xRunEnum = xRunEnumAccess->createEnumeration(); + +// Check font in first run +uno::Reference xRun(xRunEnum->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(36.f, getProperty(xRun, "CharHeight")); +CPPUNIT_ASSERT_EQUAL(OUString("Courier New"), getProperty(xRun, "CharFontName")); + +// Ensure there is only one run +CPPUNIT_ASSERT_MESSAGE("Extra elements in paragraph", !xRunEnum->hasMoreElements()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 072430ebe15f..af4ba47158c3 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -397,16 +397,22 @@ void RTFDocumentImpl::checkFirstRun() assert(!m_bNeedSect || m_bFirstRunException); setNeedSect(true); // first call that succeeds -// set the requested default font, if there are none +// set the requested default font, if there are none for each state in stack RTFValue::Pointer_t pFont = getNestedAttribute(m_aDefaultState.getCharacterSprms(), NS_ooxml::LN_EG_RPrBase_rFonts, NS_ooxml::LN_CT_Fonts_ascii); -RTFValue::Pointer_t pCurrentFont -= getNestedAttribute(m_aStates.top().getCharacterSprms(), NS_ooxml::LN_EG_RPrBase_rFonts, - NS_ooxml::LN_CT_Fonts_ascii); -if (pFont && !pCurrentFont) -putNestedAttribute(m_aStates.top().getCharacterSprms(), NS_ooxml::LN_EG_RPrBase_rFonts, - NS_ooxml::LN_CT_Fonts_ascii, pFont); +if (!pFont) +return; + +for (size_t i = 0; i < m_aStates.size(); i++) +{ +RTFValue::Pointer_t pCurrentFont += getNestedAttribute(m_aStates[i].getCharacterSprms(), NS_ooxml::LN_EG_RPrBase_rFonts, + NS_ooxml::LN_CT_Fonts_ascii); +if (!pCurrentFont) +putNestedAttribute(m_aStates[i].getCharacterSprms(), NS_ooxml::LN_EG_RPrB