[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - editeng/source sw/qa sw/source
editeng/source/editeng/impedit3.cxx |6 -- sw/qa/core/text/data/tdf129810.odt |binary sw/qa/core/text/text.cxx| 33 + sw/source/core/text/porlay.cxx |3 +++ 4 files changed, 40 insertions(+), 2 deletions(-) New commits: commit 3548c92453b9d0d85270bc6309a91c4107e49685 Author: Khaled Hosny AuthorDate: Fri Jun 23 19:10:49 2023 +0300 Commit: خالد حسني CommitDate: Sat Jun 24 07:20:08 2023 +0200 tdf#129810: Compress fullwidth CJK punctuation When compressions CJK punctuation, compress also full width versions to match Word behaviour. Change-Id: Ic35cfcbacca1974b7241d657f078148bac06478e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153530 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit 4a92323b54e7d63a8bc0b8e62fdc6b31760dcd05) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153519 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index c6847168be4a..8a581988f679 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -140,14 +140,16 @@ AsianCompressionFlags GetCharTypeForCompression( sal_Unicode cChar ) { case 0x3008: case 0x300A: case 0x300C: case 0x300E: case 0x3010: case 0x3014: case 0x3016: case 0x3018: -case 0x301A: case 0x301D: +case 0x301A: case 0x301D: case 0xFF09: case 0xFF3D: +case 0xFF5D: { return AsianCompressionFlags::PunctuationRight; } case 0x3001: case 0x3002: case 0x3009: case 0x300B: case 0x300D: case 0x300F: case 0x3011: case 0x3015: case 0x3017: case 0x3019: case 0x301B: case 0x301E: -case 0x301F: +case 0x301F: case 0xFF08: case 0xFF0C: case 0xFF0E: +case 0xFF1A: case 0xFF1B: case 0xFF3B: case 0xFF5B: { return AsianCompressionFlags::PunctuationLeft; } diff --git a/sw/qa/core/text/data/tdf129810.odt b/sw/qa/core/text/data/tdf129810.odt new file mode 100644 index ..b5a482b52caf Binary files /dev/null and b/sw/qa/core/text/data/tdf129810.odt differ diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index c638e0f4be0c..a4d4540ab228 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -1362,6 +1363,38 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testParaUpperMarginFlyIntersect) CPPUNIT_ASSERT_EQUAL(521, nHeight); } +CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf129810) +{ +// Load the document, which embeds a CJK font. +createSwDoc("tdf129810.odt"); + +// Render the document to a metafile. +SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); +SwDocShell* pShell = pTextDoc->GetDocShell(); +std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile(); +CPPUNIT_ASSERT(xMetaFile); + +// Find the fist text array action +for (size_t nAction = 0; nAction < xMetaFile->GetActionSize(); nAction++) +{ +auto pAction = xMetaFile->GetAction(nAction); +if (pAction->GetType() == MetaActionType::TEXTARRAY) +{ +auto pTextArrayAction = static_cast(pAction); +auto pDXArray = pTextArrayAction->GetDXArray(); + +// There should be 13 chars on the first line +CPPUNIT_ASSERT_GREATER(size_t(13), pDXArray.size()); + +// Assert we are using the expected width for uncompressed chars +CPPUNIT_ASSERT_EQUAL(sal_Int32(720), pDXArray[0]); +// Assert we are using the expected width for compressed chars +CPPUNIT_ASSERT_EQUAL(sal_Int32(500), pDXArray[6] - pDXArray[5]); +break; +} +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 37ad6edd9eff..151f7ee9027e 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -1491,6 +1491,7 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, case 0x3008: case 0x300A: case 0x300C: case 0x300E: case 0x3010: case 0x3014: case 0x3016: case 0x3018: case 0x301A: case 0x301D: +case 0xFF08: case 0xFF3B: case 0xFF5B: eState = SPECIAL_LEFT; break; // Right punctuation found @@ -1498,9 +1499,11 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, case 0x300D: case 0x300F: case 0x3011: case 0x3015: case 0x3017: case 0x3019: case 0x301B: case 0x301E: case 0x301F: +case 0xFF09: case 0xFF3D: case 0xFF5D: eState = SPECIAL_RIGHT; break; case 0x3001: case 0x3002: // Fullstop or comma +
[Libreoffice-commits] core.git: download.lst external/libassuan
download.lst|4 ++-- external/libassuan/ExternalPackage_libassuan.mk |2 +- external/libassuan/w32-build-fixes.patch.1 | 14 -- 3 files changed, 3 insertions(+), 17 deletions(-) New commits: commit 88019e3ac34e35c193df0ae682722f6ec3ba5133 Author: Taichi Haradaguchi <20001...@ymail.ne.jp> AuthorDate: Sat Jun 24 10:18:55 2023 +0900 Commit: Taichi Haradaguchi <20001...@ymail.ne.jp> CommitDate: Sat Jun 24 05:29:19 2023 +0200 Update libassuan to 2.5.6 Change-Id: Iea5af01231e67c24d34287929a54f5ec86af47ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153545 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> diff --git a/download.lst b/download.lst index 536f73bb6b4f..16c58a1c13c9 100644 --- a/download.lst +++ b/download.lst @@ -289,8 +289,8 @@ LCMS2_TARBALL := lcms2-2.12.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts -LIBASSUAN_SHA256SUM := 8e8c2fcc982f9ca67dcbb1d95e2dc746b1739a4668bc20b3a3c5be632edb34e4 -LIBASSUAN_TARBALL := libassuan-2.5.5.tar.bz2 +LIBASSUAN_SHA256SUM := e9fd27218d5394904e4e39788f9b1742711c3e6b41689a31aa3380bd5aa4f426 +LIBASSUAN_TARBALL := libassuan-2.5.6.tar.bz2 # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/libassuan/ExternalPackage_libassuan.mk b/external/libassuan/ExternalPackage_libassuan.mk index 0f24e5e2dec4..2df7b562d584 100644 --- a/external/libassuan/ExternalPackage_libassuan.mk +++ b/external/libassuan/ExternalPackage_libassuan.mk @@ -15,7 +15,7 @@ ifneq ($(DISABLE_DYNLOADING),TRUE) ifeq ($(OS),LINUX) -$(eval $(call gb_ExternalPackage_add_file,libassuan,$(LIBO_LIB_FOLDER)/libassuan.so.0,src/.libs/libassuan.so.0.8.5)) +$(eval $(call gb_ExternalPackage_add_file,libassuan,$(LIBO_LIB_FOLDER)/libassuan.so.0,src/.libs/libassuan.so.0.8.6)) else ifeq ($(OS),MACOSX) diff --git a/external/libassuan/w32-build-fixes.patch.1 b/external/libassuan/w32-build-fixes.patch.1 index ebf98c5f5093..8d77eef37cd5 100644 --- a/external/libassuan/w32-build-fixes.patch.1 +++ b/external/libassuan/w32-build-fixes.patch.1 @@ -33,20 +33,6 @@ diff -ru libassuan.orig/src/Makefile.am libassuan/src/Makefile.am `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \ sed -e 's/-I/--include-dir /g;s/-D/--define /g'` -@@ -148,10 +148,10 @@ - $(DESTDIR)$(bindir)/gpgcedev.dll - endif - -+mkheader$(EXEEXT): mkheader.c Makefile --mkheader: mkheader.c Makefile - $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) \ - $(LDFLAGS_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c - -+assuan.h: assuan.h.in mkheader$(EXEEXT) $(parts_of_assuan_h) -+ ./mkheader$(EXEEXT) $(host_os) $(srcdir)/assuan.h.in \ --assuan.h: assuan.h.in mkheader $(parts_of_assuan_h) -- ./mkheader $(host_os) $(srcdir)/assuan.h.in \ -$(PACKAGE_VERSION) $(VERSION_NUMBER) >$@ diff -ru libassuan.orig/src/assuan-handler.c libassuan/src/assuan-handler.c --- libassuan.orig/src/assuan-handler.c 2016-06-25 16:27:49.0 +0200 +++ libassuan/src/assuan-handler.c 2017-09-24 15:32:51.200956200 +0200
Re: Re: make check Error
When I run make with C:sources\ and C:cygwin64\ excluded from Microsoft Defender Antivirus Scans, I got the same error. OS: Windows 11 22H2(Version 10.0.22621.1848) Visual Sttudio: 2022 Windows SDK: 10.0.22621.1778 (buid.log) [build UIM] share/config/soffice.cfg/modules/schart/menubar/menubar [build UIM] share/config/soffice.cfg/modules/dbapp/menubar/menubar [build UIM] share/config/soffice.cfg/modules/dbbrowser/menubar/compat [build UIM] share/config/soffice.cfg/modules/dbquery/menubar/menubar [build UIM] share/config/soffice.cfg/modules/dbrelation/menubar/menubar [build UIM] share/config/soffice.cfg/modules/dbtable/menubar/menubar [build UIM] share/config/soffice.cfg/modules/dbtdata/menubar/menubar [build UIM] share/config/soffice.cfg/modules/BasicIDE/menubar/menubar [build UIM] share/config/soffice.cfg/modules/sbibliography/menubar/menubar [build PKG] UIConfig/modules/StartModule [build UIM] share/config/soffice.cfg/modules/StartModule/menubar/menubar [build UIM] share/config/soffice.cfg/modules/dbreport/menubar/menubar tar: bazel/external/harfbuzz/config/config-override.h: Cannot change mode to rwxr-xr-x: Not a directory tar: bazel/external/expat/config/expat_config.h: Cannot change mode to rwxr-xr-x: Not a directory tar: bazel/external/freetype/config/android: Cannot change mode to rwxr-xr-x: Not a directory tar: bazel/external/freetype/config/no-type1: Cannot change mode to rwxr-xr-x: Not a directory tar: bazel/external/icu/utils/icu: Cannot change mode to rwxr-xr-x: Not a directory tar: Exiting with failure status due to previous errors make[1]: *** [C:/sources/libo-core/solenv/gbuild/UnpackedTarball.mk:60: C:/sources/libo-core/workdir/UnpackedTarget/skia-m111-a31e897fb3dcbc96b2b40999751611d029bf5404.tar.xz] Error 2 make[1]: *** Waiting for unfinished jobs make: *** [Makefile:289: build] Error 2 taichi.
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/unotools sw/source unotools/source
include/unotools/charclass.hxx |4 sw/source/core/edit/autofmt.cxx|2 +- unotools/source/i18n/charclass.cxx | 17 + 3 files changed, 22 insertions(+), 1 deletion(-) New commits: commit a6d35a7940a2c72594b470aec341c867e6faf82c Author: Baole Fang AuthorDate: Fri Jun 23 11:47:54 2023 -0400 Commit: خالد حسني CommitDate: Sat Jun 24 01:44:35 2023 +0200 tdf#142437: Fix word boundary detection in autocorrect Marks (combining and spacing) were incorrectly considered word separators, because isLetterNumeric() matches only for letters and numbers. The new isBase() matches any character with BASE_FORM character class, which covers letters, numbers, and marks. Change-Id: I27ec2f7fb8d360791a280d10aba9b6d16e7cfb71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153509 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit caab94a3e0387bde05538cff91ff13446f330785) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153517 diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx index 7cb35ba2a594..bc91aca63631 100644 --- a/include/unotools/charclass.hxx +++ b/include/unotools/charclass.hxx @@ -58,6 +58,9 @@ inline constexpr sal_Int32 nCharClassNumericTypeMask = css::i18n::KCharacterType::PRINTABLE | css::i18n::KCharacterType::BASE_FORM; +inline constexpr sal_Int32 nCharClassBaseType = +css::i18n::KCharacterType::BASE_FORM; + class UNOTOOLS_DLLPUBLIC CharClass { LanguageTag maLanguageTag; @@ -167,6 +170,7 @@ public: bool isDigit( const OUString& rStr, sal_Int32 nPos ) const; bool isAlphaNumeric( const OUString& rStr, sal_Int32 nPos ) const; bool isLetterNumeric( const OUString& rStr, sal_Int32 nPos ) const; +bool isBase( const OUString& rStr, sal_Int32 nPos ) const; bool isUpper( const OUString& rStr, sal_Int32 nPos ) const; bool isLetter( const OUString& rStr ) const; bool isNumeric( const OUString& rStr ) const; diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 2c9eb69ac16a..010e0b20b80e 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -2110,7 +2110,7 @@ void SwAutoFormat::AutoCorrect(TextFrameIndex nPos) bFirstSent = true; [[fallthrough]]; default: -if (!(rAppCC.isLetterNumeric(*pText, sal_Int32(nPos)) +if (!(rAppCC.isBase(*pText, sal_Int32(nPos)) || '/' == cChar )) // '/' should not be a word separator (e.g. '1/2' needs to be handled as one word for replacement) { --nPos; // revert ++nPos which was decremented in for loop diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx index be3a9f4f0ee0..423f9530f2cb 100644 --- a/unotools/source/i18n/charclass.cxx +++ b/unotools/source/i18n/charclass.cxx @@ -253,6 +253,23 @@ bool CharClass::isLetterNumeric( const OUString& rStr ) const return false; } +bool CharClass::isBase( const OUString& rStr, sal_Int32 nPos ) const +{ +sal_Unicode c = rStr[nPos]; +if ( c < 128 ) +return rtl::isAsciiAlphanumeric( c ); + +try +{ +return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) & nCharClassBaseType ) != 0; +} +catch ( const Exception& ) +{ +TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); +} +return false; +} + bool CharClass::isUpper( const OUString& rStr, sal_Int32 nPos ) const { sal_Unicode c = rStr[nPos];
[Libreoffice-commits] core.git: avmedia/source include/unotools sd/source sfx2/source unotools/source vcl/source
avmedia/source/framework/MediaControlBase.cxx |7 +-- include/unotools/localedatawrapper.hxx|8 ++-- sd/source/ui/slideshow/showwin.cxx|3 ++- sfx2/source/dialog/dinfdlg.cxx| 10 ++ unotools/source/i18n/localedatawrapper.cxx| 21 + vcl/source/control/field2.cxx |9 +++-- 6 files changed, 39 insertions(+), 19 deletions(-) New commits: commit c20337889469e41cec89bd421fab533f16b4b451 Author: Eike Rathke AuthorDate: Fri Jun 23 14:44:44 2023 +0200 Commit: Eike Rathke CommitDate: Sat Jun 24 01:20:12 2023 +0200 Change LocaleDataWrapper::getDuration() parameter to tools::Duration ... instead of tools::Time Change-Id: I8e49de43a1870541d75add34089eec67b7a8be31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153533 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx index d2c254293811..fb8f91066b67 100644 --- a/avmedia/source/framework/MediaControlBase.cxx +++ b/avmedia/source/framework/MediaControlBase.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -46,9 +47,11 @@ void MediaControlBase::UpdateTimeField( MediaItem const & aMediaItem, double fTi SvtSysLocale aSysLocale; const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData(); -aTimeString += rLocaleData.getDuration( tools::Time( 0, 0, static_cast< sal_uInt32 >( floor( fTime ) ) ) ) + +aTimeString += rLocaleData.getDuration( +tools::Duration( 0, 0, 0, static_cast( floor( fTime )), 0)) + " / " + -rLocaleData.getDuration( tools::Time( 0, 0, static_cast< sal_uInt32 >( floor( aMediaItem.getDuration() ) )) ); +rLocaleData.getDuration( +tools::Duration( 0, 0, 0, static_cast( floor( aMediaItem.getDuration())), 0)); if( mxTimeEdit->get_text() != aTimeString ) mxTimeEdit->set_text( aTimeString ); diff --git a/include/unotools/localedatawrapper.hxx b/include/unotools/localedatawrapper.hxx index 5fbdcd0782b7..d6eeb174e735 100644 --- a/include/unotools/localedatawrapper.hxx +++ b/include/unotools/localedatawrapper.hxx @@ -42,7 +42,11 @@ namespace com::sun::star::i18n { struct FormatElement; } namespace com::sun::star::i18n { struct CalendarItem2; } class Date; -namespace tools { class Time; } +namespace tools +{ +class Time; +class Duration; +} class CalendarWrapper; enum class DateOrder { @@ -311,7 +315,7 @@ public: OUString getDate( const Date& rDate ) const; OUString getTime( const tools::Time& rTime, bool bSec = true, bool b100Sec = false ) const; -OUString getDuration( const tools::Time& rTime, +OUString getDuration( const tools::Duration& rDuration, bool bSec = true, bool b100Sec = false ) const; /** Simple number formatting diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index 8e1f8a6d49cd..4bc0d414307c 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -38,6 +38,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -512,7 +513,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly ) SvtSysLocaleaSysLocale; const LocaleDataWrapper&aLocaleData = aSysLocale.GetLocaleData(); -aText += " ( " + aLocaleData.getDuration( ::tools::Time( 0, 0, mnPauseTimeout ) ) + " )"; +aText += " ( " + aLocaleData.getDuration( ::tools::Duration( 0, 0, 0, mnPauseTimeout, 0 )) + " )"; pVDev->DrawText( Point( aOffset.Width(), 0 ), aText ); GetOutDev()->DrawOutDev( Point( aOutOrg.X(), aOffset.Height() ), aVDevSize, Point(), aVDevSize, *pVDev ); bDrawn = true; diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index f702c2ec10c1..5c564af981a2 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -745,8 +746,7 @@ IMPL_LINK_NOARG(SfxDocumentPage, DeleteHdl, weld::Button&, void) m_xCreateValFt->set_label( ConvertDateTime_Impl( aName, uDT, rLocaleWrapper ) ); m_xChangeValFt->set_label( "" ); m_xPrintValFt->set_label( "" ); -const tools::Time aTime( 0 ); -m_xTimeLogValFt->set_label( rLocaleWrapper.getDuration( aTime ) ); +m_xTimeLogValFt->set_label( rLocaleWrapper.getDuration( tools::Duration() ) ); m_xDocNoValFt->set_label(OUString('1')); bHandleDelete = true; } @@ -1065,8 +1065,10 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) const tools::Long nTime = rInfoItem.getEditingDuration(); if ( bUseUserData ) { -const
[Libreoffice-commits] core.git: editeng/source sw/qa sw/source
editeng/source/editeng/impedit3.cxx |6 -- sw/qa/core/text/data/tdf129810.odt |binary sw/qa/core/text/text.cxx| 33 + sw/source/core/text/porlay.cxx |3 +++ 4 files changed, 40 insertions(+), 2 deletions(-) New commits: commit 4a92323b54e7d63a8bc0b8e62fdc6b31760dcd05 Author: Khaled Hosny AuthorDate: Fri Jun 23 19:10:49 2023 +0300 Commit: خالد حسني CommitDate: Sat Jun 24 01:01:18 2023 +0200 tdf#129810: Compress fullwidth CJK punctuation When compressions CJK punctuation, compress also full width versions to match Word behaviour. Change-Id: Ic35cfcbacca1974b7241d657f078148bac06478e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153530 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 7a82359e8851..510ab1624319 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -142,14 +142,16 @@ AsianCompressionFlags GetCharTypeForCompression( sal_Unicode cChar ) { case 0x3008: case 0x300A: case 0x300C: case 0x300E: case 0x3010: case 0x3014: case 0x3016: case 0x3018: -case 0x301A: case 0x301D: +case 0x301A: case 0x301D: case 0xFF09: case 0xFF3D: +case 0xFF5D: { return AsianCompressionFlags::PunctuationRight; } case 0x3001: case 0x3002: case 0x3009: case 0x300B: case 0x300D: case 0x300F: case 0x3011: case 0x3015: case 0x3017: case 0x3019: case 0x301B: case 0x301E: -case 0x301F: +case 0x301F: case 0xFF08: case 0xFF0C: case 0xFF0E: +case 0xFF1A: case 0xFF1B: case 0xFF3B: case 0xFF5B: { return AsianCompressionFlags::PunctuationLeft; } diff --git a/sw/qa/core/text/data/tdf129810.odt b/sw/qa/core/text/data/tdf129810.odt new file mode 100644 index ..b5a482b52caf Binary files /dev/null and b/sw/qa/core/text/data/tdf129810.odt differ diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 96ffbf4e74a3..0997d64725b8 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -1424,6 +1425,38 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testParaUpperMarginFlyIntersect) CPPUNIT_ASSERT_EQUAL(521, nHeight); } +CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf129810) +{ +// Load the document, which embeds a CJK font. +createSwDoc("tdf129810.odt"); + +// Render the document to a metafile. +SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); +SwDocShell* pShell = pTextDoc->GetDocShell(); +std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile(); +CPPUNIT_ASSERT(xMetaFile); + +// Find the fist text array action +for (size_t nAction = 0; nAction < xMetaFile->GetActionSize(); nAction++) +{ +auto pAction = xMetaFile->GetAction(nAction); +if (pAction->GetType() == MetaActionType::TEXTARRAY) +{ +auto pTextArrayAction = static_cast(pAction); +auto pDXArray = pTextArrayAction->GetDXArray(); + +// There should be 13 chars on the first line +CPPUNIT_ASSERT_GREATER(size_t(13), pDXArray.size()); + +// Assert we are using the expected width for uncompressed chars +CPPUNIT_ASSERT_EQUAL(sal_Int32(720), pDXArray[0]); +// Assert we are using the expected width for compressed chars +CPPUNIT_ASSERT_EQUAL(sal_Int32(500), pDXArray[6] - pDXArray[5]); +break; +} +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 14ac23395dcf..4f15fbcccbf7 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -1481,6 +1481,7 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, case 0x3008: case 0x300A: case 0x300C: case 0x300E: case 0x3010: case 0x3014: case 0x3016: case 0x3018: case 0x301A: case 0x301D: +case 0xFF08: case 0xFF3B: case 0xFF5B: eState = SPECIAL_LEFT; break; // Right punctuation found @@ -1488,9 +1489,11 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, case 0x300D: case 0x300F: case 0x3011: case 0x3015: case 0x3017: case 0x3019: case 0x301B: case 0x301E: case 0x301F: +case 0xFF09: case 0xFF3D: case 0xFF5D: eState = SPECIAL_RIGHT; break; case 0x3001: case 0x3002: // Fullstop or comma +case 0xFF0C: case 0xFF0E: case 0xFF1A: case 0xFF1B: eState = SPECIAL_MIDDLE ; break;
[Libreoffice-commits] core.git: sc/source
sc/source/ui/dbgui/filtdlg.cxx | 18 +- sc/source/ui/inc/filtdlg.hxx |2 +- 2 files changed, 10 insertions(+), 10 deletions(-) New commits: commit d84291f55746cd4fa7c1f236a14b362eaddde7b9 Author: Taichi Haradaguchi <20001...@ymail.ne.jp> AuthorDate: Sun Feb 26 18:26:42 2023 +0900 Commit: Taichi Haradaguchi <20001...@ymail.ne.jp> CommitDate: Sat Jun 24 00:49:26 2023 +0200 Rename "aStrTextColor" to "aStrFontColor" This patch improves consistently with item labels in AutoFilter/Standard Filter menu. Change-Id: Ibee26623f5561d228930b887778d5c61b32a1456 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147747 Tested-by: Taichi Haradaguchi <20001...@ymail.ne.jp> Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index dd6060021e7e..ca9a59ec566f 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -59,7 +59,7 @@ ScFilterDlg::ScFilterDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pPa , aStrEmpty(ScResId(SCSTR_FILTER_EMPTY)) , aStrNotEmpty(ScResId(SCSTR_FILTER_NOTEMPTY)) , aStrColumn(ScResId(SCSTR_COLUMN_LETTER)) -, aStrTextColor(ScResId(SCSTR_FILTER_FONT_COLOR_COND)) +, aStrFontColor(ScResId(SCSTR_FILTER_FONT_COLOR_COND)) , aStrBackgroundColor(ScResId(SCSTR_FILTER_BACKGROUND_COLOR_COND)) , nWhichQuery(rArgSet.GetPool()->GetWhich(SID_QUERY)) , theQueryData(static_cast(rArgSet.Get(nWhichQuery)).GetQueryData()) @@ -113,7 +113,7 @@ ScFilterDlg::ScFilterDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pPa m_xEdCopyArea->SetReferences(this, m_xFtDbAreaLabel.get()); m_xRbCopyArea->SetReferences(this, m_xEdCopyArea.get()); -assert(m_xLbCond1->find_text(aStrTextColor) != -1); +assert(m_xLbCond1->find_text(aStrFontColor) != -1); assert(m_xLbCond1->find_text(aStrBackgroundColor) != -1); Init( rArgSet ); @@ -288,7 +288,7 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet ) else if (rEntry.IsQueryByTextColor() || rEntry.IsQueryByBackgroundColor()) { nCondPos = maCondLbArr[i]->find_text( -rEntry.IsQueryByTextColor() ? aStrTextColor : aStrBackgroundColor); +rEntry.IsQueryByTextColor() ? aStrFontColor : aStrBackgroundColor); maValueEdArr[i]->set_visible(false); maColorLbArr[i]->set_visible(true); maColorLbArr[i]->set_sensitive(true); @@ -646,7 +646,7 @@ void ScFilterDlg::UpdateColorList(size_t nList) std::set aColors; OUString sSelectedCondition = maCondLbArr[nPos]->get_active_text(); -if (sSelectedCondition == aStrTextColor) +if (sSelectedCondition == aStrFontColor) aColors = pList->maFilterEntries.getTextColors(); else if (sSelectedCondition == aStrBackgroundColor) aColors = pList->maFilterEntries.getBackgroundColors(); @@ -659,7 +659,7 @@ void ScFilterDlg::UpdateColorList(size_t nList) OUString sId = rColor.AsRGBHexString(); if (rColor == COL_AUTO) { -OUString sText = sSelectedCondition == aStrTextColor +OUString sText = sSelectedCondition == aStrFontColor ? ScResId(SCSTR_FILTER_AUTOMATIC_COLOR) : ScResId(SCSTR_FILTER_NO_FILL); maColorLbArr[nPos]->append(sId, sText); @@ -672,7 +672,7 @@ void ScFilterDlg::UpdateColorList(size_t nList) auto aItem = rEntry.GetQueryItem(); if (aItem.maColor == rColor -&& ((sSelectedCondition == aStrTextColor && aItem.meType == ScQueryEntry::ByTextColor) +&& ((sSelectedCondition == aStrFontColor && aItem.meType == ScQueryEntry::ByTextColor) || (sSelectedCondition == aStrBackgroundColor && aItem.meType == ScQueryEntry::ByBackgroundColor))) { @@ -1117,7 +1117,7 @@ IMPL_LINK(ScFilterDlg, LbSelectHdl, weld::ComboBox&, rLb, void) ScQueryOp op; sal_uInt16 nQ = 0; bool bEnableColorLb = false; -if (rLb.get_active_text() == aStrTextColor || rLb.get_active_text() == aStrBackgroundColor) +if (rLb.get_active_text() == aStrFontColor || rLb.get_active_text() == aStrBackgroundColor) { bEnableColorLb = true; op = SC_EQUAL; @@ -1186,7 +1186,7 @@ IMPL_LINK(ScFilterDlg, LbSelectHdl, weld::ComboBox&, rLb, void) ScQueryEntry& aEntry = theQueryData.GetEntry(nQ); Color aColor = Color::STRtoRGB(maColorLbArr[nQ]->get_active_id()); -if (maCondLbArr[nQ]->get_active_text() == aStrTextColor) +if (maCondLbArr[nQ]->get_active_text() == aStrFontColor) { aEntry.SetQueryByTextColor(aColor); } @@ -1452,7 +1452,7 @@ void ScFilterDlg::RefreshEditRow( size_t nOffset ) else if (rEntry.IsQueryByTextColor() ||
[Libreoffice-commits] core.git: svgio/inc svgio/qa svgio/source
svgio/inc/svgnode.hxx |3 svgio/qa/cppunit/SvgImportTest.cxx | 19 svgio/qa/cppunit/data/tdf156034.svg | 20 + svgio/source/svgreader/svgnode.cxx | 140 ++-- 4 files changed, 115 insertions(+), 67 deletions(-) New commits: commit 45d13c26d815cbbb73db5d327809368c89b9eec3 Author: Xisco Fauli AuthorDate: Fri Jun 23 12:59:17 2023 +0200 Commit: Xisco Fauli CommitDate: Fri Jun 23 22:57:22 2023 +0200 tdf#156034: check for css style further up in the hierarchy Change-Id: I92c6673f1249cc4a273c490cdc0496474ce1f0c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153498 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/svgio/inc/svgnode.hxx b/svgio/inc/svgnode.hxx index f2eb0fcb1b6e..af23bc4eb32f 100644 --- a/svgio/inc/svgnode.hxx +++ b/svgio/inc/svgnode.hxx @@ -120,6 +120,9 @@ namespace svgio::svgreader /// helper for filling the CssStyle vector once dependent on mbCssStyleVectorBuilt void fillCssStyleVector(const OUString& rClassStr, const SvgStyleAttributes& rOriginal); +void addCssStyle( +const SvgDocument& rDocument, +const OUString& aConcatenated); void fillCssStyleVectorUsingHierarchyAndSelectors( const OUString& rClassStr, const SvgNode& rCurrent, diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index d29cc30bf41c..8e7d86c145f2 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -320,6 +320,25 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf145896) assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[3]", "color", "#ff"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf156034) +{ +Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf156034.svg"); +CPPUNIT_ASSERT_EQUAL(1, static_cast(aSequence.getLength())); + +drawinglayer::Primitive2dXmlDump dumper; +xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequence); + +CPPUNIT_ASSERT (pDocument); + +// Without the fix in place, this test would have failed with +// - Expected: #008000 +// - Actual : #ff +assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]", "color", "#008000"); +assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "color", "#008000"); +assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[3]", "color", "#008000"); +assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[4]", "color", "#008000"); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf156018) { Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf156018.svg"); diff --git a/svgio/qa/cppunit/data/tdf156034.svg b/svgio/qa/cppunit/data/tdf156034.svg new file mode 100644 index ..ed14c5fe4aaf --- /dev/null +++ b/svgio/qa/cppunit/data/tdf156034.svg @@ -0,0 +1,20 @@ +http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; viewBox="-0 0 300 300"> + + +.g1 rect {fill:green;} +#g3 rect {fill:green;} + + + + + + + + + + + + + + + diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx index 2137209d5599..35277ef0ed87 100644 --- a/svgio/source/svgreader/svgnode.cxx +++ b/svgio/source/svgreader/svgnode.cxx @@ -39,53 +39,30 @@ namespace svgio::svgreader return nullptr; } -void SvgNode::fillCssStyleVectorUsingHierarchyAndSelectors( -const OUString& rClassStr, -const SvgNode& rCurrent, -const OUString& aConcatenated) +void SvgNode::addCssStyle(const SvgDocument& rDocument, const OUString& aConcatenated) { -const SvgDocument& rDocument = getDocument(); +const SvgStyleAttributes* pNew = rDocument.findGlobalCssStyleAttributes(aConcatenated); -if(!rDocument.hasGlobalCssStyleAttributes()) -return; - -const SvgNode* pParent = rCurrent.getParent(); - -// check for ID (highest priority) -if(rCurrent.getId()) +if(pNew) { -const OUString& rId = *rCurrent.getId(); - -if(rId.getLength()) -{ -const OUString aNewConcatenated( -"#" + rId + aConcatenated); - -if(pParent) -{ -// check for combined selectors at parent firstso that higher specificity will be in front - fillCssStyleVectorUsingHierarchyAndSelectors(rClassStr, *pParent, aNewConcatenated); -} - -const SvgStyleAttributes* pNew = rDocument.findGlobalCssStyleAttributes(aNewConcatenated); - -if(pNew) -
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 2 commits - sw/qa sw/source
sw/qa/extras/uiwriter/data/table-at-end-of-cell.fodt | 219 +++ sw/qa/extras/uiwriter/uiwriter.cxx | 18 + sw/source/core/docnode/ndtbl.cxx | 46 +++ sw/source/core/edit/eddel.cxx| 10 4 files changed, 283 insertions(+), 10 deletions(-) New commits: commit 60e842da3ec3b48b715d9793a3cdeff76efa4152 Author: Michael Stahl AuthorDate: Thu Jun 15 13:13:05 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:53:58 2023 +0200 tdf#155685 sw: ExtendedSelectAll with tables, group the Undo objects Change-Id: I2fba70968c97cd9704212cd799b333d2d158a042 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153115 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 5ab4fb27f4232fe0f36cfc079acb065d1712a355) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153131 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx index b7997dbafa86..6cbce339615c 100644 --- a/sw/source/core/edit/eddel.cxx +++ b/sw/source/core/edit/eddel.cxx @@ -97,6 +97,12 @@ void SwEditShell::DeleteSel(SwPaM& rPam, bool const isArtificialSelection, bool SwPaM * pPam = &rPam; if (oSelectAll) { +if (!oSelectAll->second.empty()) +{ +SwRewriter aRewriter; +aRewriter.AddRule(UndoArg1, SwResId(STR_MULTISEL)); +GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::DELETE, &aRewriter); +} // tdf#155685 tables at the end must be deleted separately for (SwTableNode *const pTable : oSelectAll->second) { @@ -113,6 +119,10 @@ void SwEditShell::DeleteSel(SwPaM& rPam, bool const isArtificialSelection, bool GetDoc()->getIDocumentContentOperations().DeleteAndJoin(*pPam, isArtificialSelection ? SwDeleteFlags::ArtificialSelection : SwDeleteFlags::Default); SaveTableBoxContent( pPam->GetPoint() ); +if (oSelectAll && !oSelectAll->second.empty()) +{ +GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::END, nullptr); +} } // Selection is not needed anymore commit 1adbd1024d064b1a22ea9b36ae40cf78f21e4d19 Author: Michael Stahl AuthorDate: Thu Jun 15 12:22:11 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:53:46 2023 +0200 tdf#155685 sw: fix another ExtendedSelectAll Redo crash w table at end This can be reproduced with a table containing in the last cell a paragraph followed by a table, then ExtendedSelectAll in the cell and delete. On Redo of the SwUndoDelete: warn:legacy.osl:326138:326138:sw/source/core/frmedt/tblsel.cxx:1775: MakeSelUnions with pStart or pEnd not in CellFrame In function: const_reference std::vector::operator[](size_type) const [_Tp = SwTableBox *, _Allocator = std::allocator] Error: attempt to subscript container with out-of-bounds index 0, but container only holds 0 elements. The problem is that DelTable() calls PaMCorrAbs() with a target that is outside of the outer table, so the SwEditShell::DeleteSel() rPam has one end in the last table cell and other end outside the table. Change-Id: Ia2764a4c99ba12102957153e005284a44be04fd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153114 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 4ef548a672658ab164e45e45ebd1b9f0b9282019) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153130 Reviewed-by: Caolán McNamara diff --git a/sw/qa/extras/uiwriter/data/table-at-end-of-cell.fodt b/sw/qa/extras/uiwriter/data/table-at-end-of-cell.fodt new file mode 100644 index ..4e18f7dc2ce4 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/table-at-end-of-cell.fodt @@ -0,0 +1,219 @@ + +http://www.w3.org/TR/css3-text/"; xmlns:grddl="http://www.w3.org/2003/g/data-view#"; xmlns:xhtml="http://www.w3.org/1999/xhtml"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xforms="http://www.w3.org/2002/xforms"; xmlns:dom="http://www.w3.org/2001/xml-events"; xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML"; xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office"; xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooow="http://openoffice.org/2004/writer"; xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns:drawooo="http://openoffice.org/2010/draw"; xmlns:oooc="http://openoffice.org/2004/calc"; xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:c alcext="urn:org:documentfoundat
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - vcl/source
vcl/source/gdi/CommonSalLayout.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 19825bfe38820b9abd5281c9f3ca60297693bae5 Author: Khaled Hosny AuthorDate: Tue Jun 20 10:17:49 2023 +0300 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:53:09 2023 +0200 tdf#107718: Fix script itemization of vertical text Mixed script vertical text was not correctly splitting runs at script changes, resulting in Hangul text being mixed with Han text in the same run breaking the Hangul composition. Change-Id: I09c3f799bede6aa8a19684779d500504a9813af7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153313 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit 1afc13b0b84353109827d78807836c01f030ab66) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153335 Reviewed-by: Caolán McNamara diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 5cac0ebdb6b0..754b228f8ad3 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -391,7 +391,7 @@ bool GenericSalLayout::LayoutText(vcl::text::ImplLayoutArgs& rArgs, const SalLay aDirection = bRightToLeft ? HB_DIRECTION_RTL : HB_DIRECTION_LTR; } -if (aSubRuns.empty() || aSubRuns.back().maDirection != aDirection) +if (aSubRuns.empty() || aSubRuns.back().maDirection != aDirection || aSubRuns.back().maScript != aScript) aSubRuns.push_back({ nPrevIdx, nIdx, aScript, aDirection }); else aSubRuns.back().mnEnd = nIdx;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 2 commits - svx/source sw/source vcl/inc vcl/source
svx/source/svdraw/svdotextdecomposition.cxx |8 ++- sw/source/core/txtnode/fntcache.cxx | 10 vcl/inc/sallayout.hxx |1 vcl/source/gdi/sallayout.cxx| 66 +++- 4 files changed, 54 insertions(+), 31 deletions(-) New commits: commit a84bf20b345ba016ab67217f5fd73eebb517dc6b Author: Khaled Hosny AuthorDate: Mon Jun 12 22:29:11 2023 +0300 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:52:56 2023 +0200 tdf#152048: Fix measuring text width with font fallback This is a regression from: commit 43a5400063b17ed4ba4cbb38bdf5da4a991f60e2 Author: Khaled Hosny Date: Thu May 25 10:59:18 2023 +0300 tdf#152048: Fix underline width for Kashida-justified text It fixed measuring width when there is Kashida justification, but broke it for font fallback, because of the way MultiSalLayout measures the text width takes the maximum of the text widths for all its layouts, but layouts with missing glyphs are now giving wrong text width as they are measuring the width of .notdef (GID 0) glyph. This change makes MultiSalLayout measure the text width by iterating over all its valid glyphs. Change-Id: I8b19e0d44326c6f0afe6e504ab6d90c6fb3575f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152933 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit 38b5e9bc7d45f52f11bad125a584ad2261383de6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152920 Reviewed-by: Caolán McNamara diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index 35496750c286..d48edaaf67f2 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -62,6 +62,7 @@ class MultiSalLayout final : public SalLayout public: voidDrawText(SalGraphics&) const override; sal_Int32 GetTextBreak(DeviceCoordinate nMaxWidth, DeviceCoordinate nCharExtra, int nFactor) const override; +DeviceCoordinate GetTextWidth() const final override; DeviceCoordinate FillDXArray(std::vector* pDXArray, const OUString& rStr) const override; voidGetCaretPositions(int nArraySize, sal_Int32* pCaretXArray) const override; boolGetNextGlyph(const GlyphItem** pGlyph, DevicePoint& rPos, int& nStart, diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 1ed2a37ad71b..3cdd71642b5b 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -1009,45 +1009,53 @@ sal_Int32 MultiSalLayout::GetTextBreak( DeviceCoordinate nMaxWidth, DeviceCoordi return -1; } -DeviceCoordinate MultiSalLayout::FillDXArray( std::vector* pCharWidths, const OUString& rStr ) const +DeviceCoordinate MultiSalLayout::GetTextWidth() const { -DeviceCoordinate nMaxWidth = 0; +// Measure text width. There might be holes in each SalLayout due to +// missing chars, so we use GetNextGlyph() to get the glyphs across all +// layouts. +int nStart = 0; +DevicePoint aPos; +const GlyphItem* pGlyphItem; -// prepare merging of fallback levels -std::vector aTempWidths; -const int nCharCount = mnEndCharPos - mnMinCharPos; -if( pCharWidths ) +DeviceCoordinate nWidth = 0; +while (GetNextGlyph(&pGlyphItem, aPos, nStart)) +nWidth += pGlyphItem->newWidth(); + +return nWidth; +} + +DeviceCoordinate MultiSalLayout::FillDXArray( std::vector* pCharWidths, const OUString& rStr ) const +{ +if (pCharWidths) { +// prepare merging of fallback levels +std::vector aTempWidths; +const int nCharCount = mnEndCharPos - mnMinCharPos; pCharWidths->clear(); pCharWidths->resize(nCharCount, 0); -} -for( int n = mnLevel; --n >= 0; ) -{ -// query every fallback level -DeviceCoordinate nTextWidth = mpLayouts[n]->FillDXArray( &aTempWidths, rStr ); -if( !nTextWidth ) -continue; -// merge results from current level -if( nMaxWidth < nTextWidth ) -nMaxWidth = nTextWidth; -if( !pCharWidths ) -continue; -// calculate virtual char widths using most probable fallback layout -for( int i = 0; i < nCharCount; ++i ) +for (int n = mnLevel; --n >= 0;) { -// #i17359# restriction: -// one char cannot be resolved from different fallbacks -if( (*pCharWidths)[i] != 0 ) -continue; -DeviceCoordinate nCharWidth = aTempWidths[i]; -if( !nCharWidth ) -continue; -(*pCharWidths)[i] = nCharWidth; +// query every fallback level +mpLayouts[n]->FillDXArray(&aTempWidths, rStr); + +// calculate virtual char widths using most probable fallback layout +for (int i = 0; i < nCharCount; ++i) +{ +// #i17359# restriction:
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - ucb/source
ucb/source/ucp/webdav-curl/CurlSession.cxx |4 1 file changed, 4 insertions(+) New commits: commit 16b15b8d0ce7a94a5374706cba65a354e1f4dbe1 Author: Michael Stahl AuthorDate: Tue Jun 6 14:06:35 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:52:11 2023 +0200 ucb: webdav-curl: auth data is invalid when receiving 401 Even if it used to be valid before; unfortunately newly entered credentials weren't actually used because the flag was never reset. Change-Id: Ib36689f40ff780596b9cfe6fe589a6f2e79cfcd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152679 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 7efdacc1cd529e1801c9adf803a1a2db8334e67a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152658 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx index 86eb265f55c6..5773fd2398f6 100644 --- a/ucb/source/ucp/webdav-curl/CurlSession.cxx +++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx @@ -1388,6 +1388,10 @@ auto CurlProcessor::ProcessRequest( case SC_UNAUTHORIZED: case SC_PROXY_AUTHENTICATION_REQUIRED: { +(statusCode != SC_PROXY_AUTHENTICATION_REQUIRED + ? rSession.m_isAuthenticated + : rSession.m_isAuthenticatedProxy) += false; // any auth data in m_pCurl is invalid auto& rnAuthRequests(statusCode == SC_UNAUTHORIZED ? nAuthRequests : nAuthRequestsProxy); if (rnAuthRequests == 10)
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/inc sw/source
sw/inc/crsrsh.hxx|2 sw/inc/doc.hxx |1 sw/source/core/crsr/crsrsh.cxx | 38 - sw/source/core/docnode/ndtbl.cxx | 262 --- sw/source/core/edit/eddel.cxx| 15 +- sw/source/core/edit/edglss.cxx |8 - 6 files changed, 181 insertions(+), 145 deletions(-) New commits: commit 1af94c9f4ce5754bc64a30fd5b2250d7ec2c4f46 Author: Michael Stahl AuthorDate: Mon Jun 5 20:24:45 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:51:24 2023 +0200 tdf#155685 sw: fix crash on undo of ExtendedSelectAll with table at end While the selection with table at the end works for Copy, unfortunately it doesn't work for Delete, because SwUndoDelete can't handle it, and an empty SwTableNode+SwEndNode pair remains. This needs some extra code, extract a SwDoc::DelTable() out of SwDoc::DeleteRowCol() and call it from SwEditShell::DeleteSel() to create separate SwUndoDelete objects per table, which appears to work. (regression from commit d81379db730a163c5ff75d4f3a3cddbd7b5eddda) Change-Id: I1534b100d31bc279bce298d3c2bd235cffc1f9d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152628 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 16e40e8d6e6d606cd239331ad7d4c409b3add8e6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152652 Reviewed-by: Caolán McNamara diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index c3d3dc85959f..364616f19100 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -331,7 +331,7 @@ public: // only for usage in special cases allowed! void ExtendedSelectAll(bool bFootnotes = true); /// If ExtendedSelectAll() was called and selection didn't change since then. -SwNode const* ExtendedSelectedAll() const; +::std::optional<::std::pair>> ExtendedSelectedAll() const; enum class StartsWith { None, Table, HiddenPara }; /// If document body starts with a table or starts/ends with hidden paragraph. StartsWith StartsWith_(); diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 31292e1cc5cb..e62bc4ba1f37 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1206,6 +1206,7 @@ public: // Delete Columns/Rows in table. enum class RowColMode { DeleteRow = 0, DeleteColumn = 1, DeleteProtected = 2 }; +void DelTable(SwTableNode * pTable); bool DeleteRowCol(const SwSelBoxes& rBoxes, RowColMode eMode = RowColMode::DeleteRow); void DeleteRow( const SwCursor& rCursor ); void DeleteCol( const SwCursor& rCursor ); diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index f234c9db5b8d..f2b8ad05f738 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -813,11 +813,12 @@ static typename SwCursorShell::StartsWith EndsWith(SwStartNode const& rStart) // return the node that is the start of the extended selection (to include table // or section start nodes; looks like extending for end nodes is not required) -SwNode const* SwCursorShell::ExtendedSelectedAll() const +::std::optional<::std::pair>> +SwCursorShell::ExtendedSelectedAll() const { if (m_pTableCursor) { -return nullptr; +return {}; } SwNodes& rNodes = GetDoc()->GetNodes(); @@ -828,27 +829,48 @@ SwNode const* SwCursorShell::ExtendedSelectedAll() const SwContentNode* pStart = rNodes.GoNext(&nNode); if (!pStart) { -return nullptr; +return {}; } nNode = *pStartNode->EndOfSectionNode(); SwContentNode* pEnd = SwNodes::GoPrevious(&nNode); if (!pEnd) { -return nullptr; +return {}; } SwPosition aStart(*pStart, 0); SwPosition aEnd(*pEnd, pEnd->Len()); if (!(aStart == *pShellCursor->Start() && aEnd == *pShellCursor->End())) { -return nullptr; +return {}; } +auto const ends(::EndsWith(*pStartNode)); if (::StartsWith(*pStartNode) == StartsWith::None -&& ::EndsWith(*pStartNode) == StartsWith::None) +&& ends == StartsWith::None) { -return nullptr; // "ordinary" selection will work +return {}; // "ordinary" selection will work +} + +::std::vector tablesAtEnd; +if (ends == StartsWith::Table) +{ +SwNode * pLastNode(rNodes[pStartNode->EndOfSectionIndex() - 1]); +while (pLastNode->IsEndNode()) +{ +SwNode *const pNode(pLastNode->StartOfSectionNode()); +if (pNode->IsTableNode()) +{ +tablesAtEnd.push_back(pNode->GetTableNode()); +pLastNode = rNodes[pNode->GetIndex() - 1]; +} +else if (pNode->IsSectionNode()) +{ +pLastNode = rNodes[pLastNode->GetIndex() - 1]; +} +} +assert(!tablesAtEnd.empty()); } // tdf#133990 ensure directly containing sect
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa sw/source
sw/qa/extras/layout/data/tdf152983-1-min.docx |binary sw/qa/extras/layout/layout.cxx|6 ++ sw/source/core/layout/wsfrm.cxx |5 +++-- 3 files changed, 9 insertions(+), 2 deletions(-) New commits: commit ce863cf085e093e7385818a7d6d598a161e33a28 Author: Michael Stahl AuthorDate: Thu Jun 1 20:19:36 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:51:07 2023 +0200 tdf#152983 sw: layout: fix crash in SwContentFrame::Cut() Surprisingly, SwContentFrame::Cut() is called in a situation where the frame is not connected to any SwPageFrame yet - it is in a follow fly of a fly chain that is anchored in a footer, and SwFlyFrame::ChainFrames() removes it. (regression from commit b9ef71476fd70bc13f50ebe80390e0730d1b7afb) Change-Id: Iad84b7b422126e050493dc3b181d47c4dca2fae2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152510 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit d3b64de9581bd5e36ced007ff2e9139bd0343a35) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152533 Reviewed-by: Caolán McNamara diff --git a/sw/qa/extras/layout/data/tdf152983-1-min.docx b/sw/qa/extras/layout/data/tdf152983-1-min.docx new file mode 100644 index ..804e8fefe68f Binary files /dev/null and b/sw/qa/extras/layout/data/tdf152983-1-min.docx differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index d4979120be0e..b4101e9f033e 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -1265,6 +1265,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150606) } #endif +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf152983) +{ +//just care it doesn't crash/assert +createSwDoc("tdf152983-1-min.docx"); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf137025) { // Check the padding of the textbox diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index f753a993aceb..c59717f94901 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -1227,10 +1227,11 @@ void SwContentFrame::Cut() // RemoveSuperfluous can only remove empty pages at the end; // find if there are pages without content following pPage // and if so request a call to CheckPageDescs() -SwPageFrame const* pNext(pPage); SwViewShell *pSh = pRoot->GetCurrShell(); -if (pSh && pSh->Imp()->IsAction()) +// tdf#152983 pPage is null when called from SwHeadFootFrame ctor +if (pPage && pSh && pSh->Imp()->IsAction()) { +SwPageFrame const* pNext(pPage); while ((pNext = static_cast(pNext->GetNext( { if (!sw::IsPageFrameEmpty(*pNext) && !pNext->IsFootnotePage())
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa sw/source
sw/qa/extras/layout/data/tdf150606-1-min.odt |binary sw/qa/extras/layout/layout.cxx | 65 +++ sw/source/core/layout/fly.cxx|6 ++ 3 files changed, 70 insertions(+), 1 deletion(-) New commits: commit 560b94971b656914d17c9d1befdad2dbd3f1119a Author: Michael Stahl AuthorDate: Thu Jun 1 12:45:20 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:50:29 2023 +0200 tdf#150606 sw: layout: leave follow SwTabFrame invalid in columns With the minimised bugdoc, on Undo, some 12 or so pages are created, and the end of the deleted table is shown in the document view. So first the last pages are layouted, and then once those are done layout proceeds from page 1. The problem is that on page 9, a table remains in the 2nd column of the section, and there is nothing in the 1st column and on pages 5-8. This is because ::CalcContent() is the last thing that formats the table on page 9, and it explicitly disables MoveBwd() for follow tables via m_bLockBackMove. That appears to be intentional but because it's already been there since initial CVS import it's unclear why; it might be based on the assumption that a previous column would have moved over rows from the follow table already. Try to encourage the table to try to MoveBwd() at a later time, when it's being formatted from the SwLayAction::FormatContent_() loop, which appears to help. (somehow regression from commit 723728cd358693b8f4bc9d913541aa4479f2bd48) Change-Id: I421525269948aa5f5302e6db234c89230f00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152485 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 5a739d98d0efa5be2130b7d758d494012abc87b3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152446 Reviewed-by: Caolán McNamara diff --git a/sw/qa/extras/layout/data/tdf150606-1-min.odt b/sw/qa/extras/layout/data/tdf150606-1-min.odt new file mode 100644 index ..63bd1ceb0a5b Binary files /dev/null and b/sw/qa/extras/layout/data/tdf150606-1-min.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 587fa4d4294e..d4979120be0e 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -1200,6 +1200,71 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader) } } +#if !defined(MACOSX) +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150606) +{ +createSwDoc("tdf150606-1-min.odt"); + +SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); +CPPUNIT_ASSERT(pTextDoc); +SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); + +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + +assertXPath(pXmlDoc, "/root/page[1]/body/section/column[1]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[1]/body/section/column[2]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[1]/body/section/column", 2); +assertXPath(pXmlDoc, "/root/page[2]/body/section/column[1]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[2]/body/section/column[2]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[2]/body/section/column", 2); +assertXPath(pXmlDoc, "/root/page[3]/body/section/column[1]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[3]/body/section/column[2]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[3]/body/section/column", 2); +assertXPath(pXmlDoc, "/root/page[4]/body/section/column[1]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[4]/body/section/column[2]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[4]/body/section/column", 2); +// on page 5 the table is split across balanced columns +assertXPath(pXmlDoc, "/root/page[5]/body/section/column[1]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[5]/body/section/column[2]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[5]/body/section/column", 2); +assertXPath(pXmlDoc, "/root/page", 5); + +pWrtShell->Down(false, 1); +dispatchCommand(mxComponent, ".uno:DeleteTable", {}); + +discardDumpedLayout(); +pXmlDoc = parseLayoutDump(); + +assertXPath(pXmlDoc, "/root/page[1]/body/section/column/body/tab", 0); +assertXPath(pXmlDoc, "/root/page", 1); + +pWrtShell->Undo(); +Scheduler::ProcessEventsToIdle(); + +discardDumpedLayout(); +pXmlDoc = parseLayoutDump(); + +assertXPath(pXmlDoc, "/root/page[1]/body/section/column[1]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[1]/body/section/column[2]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[1]/body/section/column", 2); +assertXPath(pXmlDoc, "/root/page[2]/body/section/column[1]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[2]/body/section/column[2]/body/tab", 1); +assertXPath(pXmlDoc, "/root/page[2]/body/section/column", 2); +assertXPath(pXmlDoc, "/root/page[3]/body/section/column[1]/body/tab", 1); +
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sfx2/source starmath/qa sw/qa vcl/qa xmlsecurity/qa
sfx2/source/doc/objembed.cxx|9 - sfx2/source/doc/objmisc.cxx |7 ++- sfx2/source/doc/objxtor.cxx |8 +++- starmath/qa/cppunit/test_cursor.cxx |1 + starmath/qa/cppunit/test_node.cxx |1 + starmath/qa/cppunit/test_nodetotextvisitors.cxx |1 + sw/qa/python/check_xmodifiable2.py |9 - vcl/qa/cppunit/filter/ipdf/ipdf.cxx |4 xmlsecurity/qa/unit/signing/signing.cxx |4 9 files changed, 36 insertions(+), 8 deletions(-) New commits: commit bde746141f9b382156a5ce79ebf82c5e32fc455b Author: Michael Stahl AuthorDate: Fri Jun 16 14:51:13 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:48:59 2023 +0200 tdf#146547 sfx2: allow read-only documents to be modified This is particularly useful for a Writer document that contains a section that is set to be editable in a read-only document, so that the user is warned when closing such a document without saving it. Originally this check was added in commit 27db57efc51487b3976fbf73df1868b8fb78d201 "CWS fwkbugfix05" "#i39869#: readonly docs should never become modified" but the actual problem there was that the read-only document was displayed in a wizard dialog, not in a document view, so let's instead check that the document is some kind of "internal" document. Also the dialog's Save button should do something, and since the document is read-only, a Save As dialog appears appropriate. Change-Id: I339cbe92a2c9eb74a1f5061246f921037a47f79c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153180 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit aca32a55456aa4e907b216fb490b3c15d26c3d55) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153147 Reviewed-by: Caolán McNamara diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx index f2e91cef821e..1be515a6e704 100644 --- a/sfx2/source/doc/objembed.cxx +++ b/sfx2/source/doc/objembed.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -84,8 +85,14 @@ void SfxObjectShell::SetVisArea( const tools::Rectangle & rVisArea ) pImpl->m_aVisArea = rVisArea; if ( GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) { -if ( IsEnableSetModified() ) +if (IsEnableSetModified() +// Base forms use EMBEDDED but they actually live in their own +// frame - resizing that shouldn't set it to modified. +&& pImpl->pBaseModel +&& pImpl->pBaseModel->getIdentifier() != "com.sun.star.sdb.FormDesign") +{ SetModified(); +} SfxGetpApp()->NotifyEvent(SfxEventHint( SfxEventHintId::VisAreaChanged, GlobalEventConfig::GetEventName(GlobalEventId::VISAREACHANGED), this)); } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 6b86e2163ccb..d0f49831db0c 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -247,7 +247,12 @@ void SfxObjectShell::EnableSetModified( bool bEnable ) bool SfxObjectShell::IsEnableSetModified() const { -return pImpl->m_bEnableSetModified && !IsReadOnly(); +// tdf#146547 read-only does not prevent modified, instead try to prevent +// setting "internal" documents that may be displayed in some dialog but +// which the user didn't load or activate to modified. +return pImpl->m_bEnableSetModified && !IsPreview() +&& eCreateMode != SfxObjectCreateMode::ORGANIZER +&& eCreateMode != SfxObjectCreateMode::INTERNAL; } diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index c7f34aeadc31..397a9372089e 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -565,7 +565,13 @@ bool SfxObjectShell::PrepareClose { // Save by each Dispatcher const SfxPoolItem *pPoolItem; -if ( IsSaveVersionOnClose() ) +if (IsReadOnly()) +{ +SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI ); +const SfxPoolItem* ppArgs[] = { &aWarnItem, nullptr }; +pPoolItem = pFrame->GetBindings().ExecuteSynchron(SID_SAVEASDOC, ppArgs); +} +else if (IsSaveVersionOnClose()) { SfxStringItem aItem( SID_DOCINFO_COMMENTS, SfxResId(STR_AUTOMATICVERSION) ); SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI ); diff --git a/starmath/qa/cppunit/test_cursor.cxx b/starmath/qa/cppunit/test_cursor.cxx index 56c673c1bd22..5f4c551675a1 100644 --- a/starmath/qa/cppunit/test_cursor.cxx +++ b/starmath/qa/cppunit/test_cursor.cxx @@ -58,6 +58,7 @@ void Test::setUp() SmGlobals::ensure(); xDocShRef = new SmDocShell(Sfx
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - i18npool/source sw/qa sw/source
i18npool/source/characterclassification/cclass_unicode_parser.cxx | 10 +- sw/qa/extras/uiwriter/data/tdf125154.odt |binary sw/qa/extras/uiwriter/uiwriter.cxx| 47 ++ sw/source/core/bastyp/calc.cxx|2 4 files changed, 57 insertions(+), 2 deletions(-) New commits: commit 1bd9a51b826015746069fcc0d02a30a2ddc7e7f5 Author: Michael Stahl AuthorDate: Tue Jun 13 17:15:07 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:47:51 2023 +0200 tdf#125154 i18npool,sw: fix group separators in numbers in formulas Commit 776f7e7463de3e97f3056712ee567f49a314829d changed cclass_Unicode to reject group separators in numbers by default, but users are complaining that the neat "5.000" numbers in their existing documents are now considered invalid. * in SwCalc, use GROUP_SEPARATOR_IN_NUMBER * in cclass_Unicode::parseText(), reject a group separator if it is not followed by at least 3 digits With this, a number from tdf#42518 "0.19" is still considered invalid, while "5.000" is now valid again. Change-Id: If86f2ed4c27be16f866d7f4cee00789344e9ee2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153047 Tested-by: Michael Stahl Reviewed-by: Michael Stahl (cherry picked from commit 29f5742bc8ff36741baac5b71082b3daee70ac18) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153146 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx index 313e42a0f2fe..f1b2e9bd7c17 100644 --- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx +++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx @@ -827,8 +827,16 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 { if (current == cGroupSep) { -if (getFlags(nextChar, eState) & ParserFlags::VALUE_DIGIT) +// accept only if it is followed by 3 digits +sal_Int32 tempIndex(index); +sal_uInt32 const nextChar2((tempIndex < rText.getLength()) ? rText.iterateCodePoints(&tempIndex) : 0); +sal_uInt32 const nextChar3((tempIndex < rText.getLength()) ? rText.iterateCodePoints(&tempIndex) : 0); +if (getFlags(nextChar, eState) & ParserFlags::VALUE_DIGIT +&& getFlags(nextChar2, eState) & ParserFlags::VALUE_DIGIT +&& getFlags(nextChar3, eState) & ParserFlags::VALUE_DIGIT) +{ nParseTokensType |= KParseTokens::GROUP_SEPARATOR_IN_NUMBER; +} else { // Trailing group separator character is not a diff --git a/sw/qa/extras/uiwriter/data/tdf125154.odt b/sw/qa/extras/uiwriter/data/tdf125154.odt new file mode 100644 index ..81dee2be72cf Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf125154.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 5cad83ed7b0f..7a5675ccfb73 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -375,6 +375,53 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testBookmarkCopy) } } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFormulaNumberWithGroupSeparator) +{ +createSwDoc("tdf125154.odt"); +dispatchCommand(mxComponent, ".uno:UpdateAll", {}); +SwDoc* pDoc = getSwDoc(); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); +pWrtShell->SttEndDoc(true); +SwField const* pField; + +pField = pWrtShell->GetCurField(); +CPPUNIT_ASSERT_EQUAL(OUString("1000"), pField->GetFormula()); +CPPUNIT_ASSERT_EQUAL(OUString("1.000"), pField->ExpandField(true, nullptr)); +pWrtShell->GoNextCell(); +CPPUNIT_ASSERT_EQUAL(OUString("1"), pWrtShell->GetCursor()->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); +pWrtShell->GoNextCell(); +pField = pWrtShell->GetCurField(); +CPPUNIT_ASSERT_EQUAL(OUString("test"), pField->GetFormula()); +CPPUNIT_ASSERT_EQUAL(OUString("1.000"), pField->ExpandField(true, nullptr)); +pWrtShell->GoNextCell(); +// the problem was that this was 0 +CPPUNIT_ASSERT_EQUAL(OUString("1"), pWrtShell->GetCursor()->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); +pWrtShell->Down(false); +pWrtShell->SttPara(false); +pField = pWrtShell->GetCurField(); +CPPUNIT_ASSERT_EQUAL(OUString("1000*10%"), pField->GetFormula()); +CPPUNIT_ASSERT_EQUAL(OUString("100"), pField->ExpandField(true, nullptr)); +pWrtShell->Down(false); +pField = p
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - i18npool/source sw/qa sw/source
i18npool/source/characterclassification/cclass_unicode_parser.cxx | 10 +- sw/qa/extras/uiwriter/data/tdf125154.odt |binary sw/qa/extras/uiwriter/uiwriter.cxx| 47 ++ sw/source/core/bastyp/calc.cxx|2 4 files changed, 57 insertions(+), 2 deletions(-) New commits: commit 38fc8636e4e7a79bbf59acea05f188220f22cf95 Author: Michael Stahl AuthorDate: Tue Jun 13 17:15:07 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:47:39 2023 +0200 tdf#125154 i18npool,sw: fix group separators in numbers in formulas Commit 776f7e7463de3e97f3056712ee567f49a314829d changed cclass_Unicode to reject group separators in numbers by default, but users are complaining that the neat "5.000" numbers in their existing documents are now considered invalid. * in SwCalc, use GROUP_SEPARATOR_IN_NUMBER * in cclass_Unicode::parseText(), reject a group separator if it is not followed by at least 3 digits With this, a number from tdf#42518 "0.19" is still considered invalid, while "5.000" is now valid again. Change-Id: If86f2ed4c27be16f866d7f4cee00789344e9ee2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153047 Tested-by: Michael Stahl Reviewed-by: Michael Stahl (cherry picked from commit 29f5742bc8ff36741baac5b71082b3daee70ac18) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153145 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx index aed29ea1ce5b..9ed95e2f907a 100644 --- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx +++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx @@ -827,8 +827,16 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 { if (current == cGroupSep) { -if (getFlags(nextChar, eState) & ParserFlags::VALUE_DIGIT) +// accept only if it is followed by 3 digits +sal_Int32 tempIndex(index); +sal_uInt32 const nextChar2((tempIndex < rText.getLength()) ? rText.iterateCodePoints(&tempIndex) : 0); +sal_uInt32 const nextChar3((tempIndex < rText.getLength()) ? rText.iterateCodePoints(&tempIndex) : 0); +if (getFlags(nextChar, eState) & ParserFlags::VALUE_DIGIT +&& getFlags(nextChar2, eState) & ParserFlags::VALUE_DIGIT +&& getFlags(nextChar3, eState) & ParserFlags::VALUE_DIGIT) +{ nParseTokensType |= KParseTokens::GROUP_SEPARATOR_IN_NUMBER; +} else { // Trailing group separator character is not a diff --git a/sw/qa/extras/uiwriter/data/tdf125154.odt b/sw/qa/extras/uiwriter/data/tdf125154.odt new file mode 100644 index ..81dee2be72cf Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf125154.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 4a84aeef9f44..58ebbcde09ff 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -375,6 +375,53 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testBookmarkCopy) } } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFormulaNumberWithGroupSeparator) +{ +createSwDoc("tdf125154.odt"); +dispatchCommand(mxComponent, ".uno:UpdateAll", {}); +SwDoc* pDoc = getSwDoc(); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); +pWrtShell->SttEndDoc(true); +SwField const* pField; + +pField = pWrtShell->GetCurField(); +CPPUNIT_ASSERT_EQUAL(OUString("1000"), pField->GetFormula()); +CPPUNIT_ASSERT_EQUAL(OUString("1.000"), pField->ExpandField(true, nullptr)); +pWrtShell->GoNextCell(); +CPPUNIT_ASSERT_EQUAL(OUString("1"), pWrtShell->GetCursor()->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); +pWrtShell->GoNextCell(); +pField = pWrtShell->GetCurField(); +CPPUNIT_ASSERT_EQUAL(OUString("test"), pField->GetFormula()); +CPPUNIT_ASSERT_EQUAL(OUString("1.000"), pField->ExpandField(true, nullptr)); +pWrtShell->GoNextCell(); +// the problem was that this was 0 +CPPUNIT_ASSERT_EQUAL(OUString("1"), pWrtShell->GetCursor()->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); +pWrtShell->Down(false); +pWrtShell->SttPara(false); +pField = pWrtShell->GetCurField(); +CPPUNIT_ASSERT_EQUAL(OUString("1000*10%"), pField->GetFormula()); +CPPUNIT_ASSERT_EQUAL(OUString("100"), pField->ExpandField(true, nullptr)); +pWrtShell->Down(false); +pField = p
[Libreoffice-commits] core.git: i18npool/CustomTarget_breakiterator.mk
i18npool/CustomTarget_breakiterator.mk |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 4df8266d42dd51a1cf82833de5b99a6a138a6491 Author: Caolán McNamara AuthorDate: Fri Jun 23 20:28:23 2023 +0100 Commit: Caolán McNamara CommitDate: Fri Jun 23 22:46:22 2023 +0200 fix a from-scratch i18npool build problem genbrk: Could not open output file "/mnt/workdir/CustomTarget/i18npool/breakiterator/count_word.brk", "U_FILE_ACCESS_ERROR" make[1]: *** [/mnt/i18npool/CustomTarget_breakiterator.mk:91: /mnt/workdir/CustomTarget/i18npool/breakiterator/count_word.brk] Error 4 make[1]: *** Waiting for unfinished jobs genbrk: Could not open output file "/mnt/workdir/CustomTarget/i18npool/breakiterator/edit_word_he.brk", "U_FILE_ACCESS_ERROR" make[1]: *** [/mnt/i18npool/CustomTarget_breakiterator.mk:91: /mnt/workdir/CustomTarget/i18npool/breakiterator/edit_word_he.brk] Error 4 genbrk: Could not open output file "/mnt/workdir/CustomTarget/i18npool/breakiterator/dict_word_he.brk", "U_FILE_ACCESS_ERROR" make[1]: *** [/mnt/i18npool/CustomTarget_breakiterator.mk:91: /mnt/workdir/CustomTarget/i18npool/breakiterator/dict_word_he.brk] Error 4 genbrk: Could not open output file "/mnt/workdir/CustomTarget/i18npool/breakiterator/dict_word_prepostdash.brk", "U_FILE_ACCESS_ERROR" make[1]: *** [/mnt/i18npool/CustomTarget_breakiterator.mk:91: /mnt/workdir/CustomTarget/i18npool/breakiterator/dict_word_prepostdash.brk] Error 4 genbrk: Could not open output file "/mnt/workdir/CustomTarget/i18npool/breakiterator/dict_word_nodash.brk", "U_FILE_ACCESS_ERROR" make[1]: *** [/mnt/i18npool/CustomTarget_breakiterator.mk:91: /mnt/workdir/CustomTarget/i18npool/breakiterator/dict_word_nodash.brk] Error 4 genbrk: Could not open output file "/mnt/workdir/CustomTarget/i18npool/breakiterator/dict_word_hu.brk", "U_FILE_ACCESS_ERROR" make[1]: *** [/mnt/i18npool/CustomTarget_breakiterator.mk:91: /mnt/workdir/CustomTarget/i18npool/breakiterator/dict_word_hu.brk] Error 4 genbrk: Could not open output file "/mnt/workdir/CustomTarget/i18npool/breakiterator/dict_word.brk", "U_FILE_ACCESS_ERROR" make[1]: *** [/mnt/i18npool/CustomTarget_breakiterator.mk:91: /mnt/workdir/CustomTarget/i18npool/breakiterator/dict_word.brk] Error 4 probably since: commit c276694bc06ae460a78532757db08e531b478e20 Date: Wed Jun 21 13:14:42 2023 +0300 Remove another workaround for old versions of ICU Change-Id: I31f07900d46a042a50d1bbbdd889ef6cee6bed8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153538 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/i18npool/CustomTarget_breakiterator.mk b/i18npool/CustomTarget_breakiterator.mk index 26647da8e4df..8229a5e8f314 100644 --- a/i18npool/CustomTarget_breakiterator.mk +++ b/i18npool/CustomTarget_breakiterator.mk @@ -85,7 +85,8 @@ $(i18npool_BIDIR)/%_brk.c : $(i18npool_BIDIR)/%.brk $(call gb_ExternalExecutable $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),CCD) $(i18npool_BIDIR)/%.brk : $(SRCDIR)/i18npool/source/breakiterator/data/%.txt \ - $(call gb_ExternalExecutable_get_dependencies,genbrk) + $(call gb_ExternalExecutable_get_dependencies,genbrk) \ + | $(i18npool_BIDIR)/.dir $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),BRK,1) $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),BRK) $(call gb_Helper_abbreviate_dirs,\
[Libreoffice-commits] core.git: include/unotools sw/source unotools/source
include/unotools/charclass.hxx |4 sw/source/core/edit/autofmt.cxx|2 +- unotools/source/i18n/charclass.cxx | 17 + 3 files changed, 22 insertions(+), 1 deletion(-) New commits: commit caab94a3e0387bde05538cff91ff13446f330785 Author: Baole Fang AuthorDate: Fri Jun 23 11:47:54 2023 -0400 Commit: خالد حسني CommitDate: Fri Jun 23 22:20:58 2023 +0200 tdf#142437: Fix word boundary detection in autocorrect Marks (combining and spacing) were incorrectly considered word separators, because isLetterNumeric() matches only for letters and numbers. The new isBase() matches any character with BASE_FORM character class, which covers letters, numbers, and marks. Change-Id: I27ec2f7fb8d360791a280d10aba9b6d16e7cfb71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153509 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx index 7cb35ba2a594..bc91aca63631 100644 --- a/include/unotools/charclass.hxx +++ b/include/unotools/charclass.hxx @@ -58,6 +58,9 @@ inline constexpr sal_Int32 nCharClassNumericTypeMask = css::i18n::KCharacterType::PRINTABLE | css::i18n::KCharacterType::BASE_FORM; +inline constexpr sal_Int32 nCharClassBaseType = +css::i18n::KCharacterType::BASE_FORM; + class UNOTOOLS_DLLPUBLIC CharClass { LanguageTag maLanguageTag; @@ -167,6 +170,7 @@ public: bool isDigit( const OUString& rStr, sal_Int32 nPos ) const; bool isAlphaNumeric( const OUString& rStr, sal_Int32 nPos ) const; bool isLetterNumeric( const OUString& rStr, sal_Int32 nPos ) const; +bool isBase( const OUString& rStr, sal_Int32 nPos ) const; bool isUpper( const OUString& rStr, sal_Int32 nPos ) const; bool isLetter( const OUString& rStr ) const; bool isNumeric( const OUString& rStr ) const; diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 2c9eb69ac16a..010e0b20b80e 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -2110,7 +2110,7 @@ void SwAutoFormat::AutoCorrect(TextFrameIndex nPos) bFirstSent = true; [[fallthrough]]; default: -if (!(rAppCC.isLetterNumeric(*pText, sal_Int32(nPos)) +if (!(rAppCC.isBase(*pText, sal_Int32(nPos)) || '/' == cChar )) // '/' should not be a word separator (e.g. '1/2' needs to be handled as one word for replacement) { --nPos; // revert ++nPos which was decremented in for loop diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx index be3a9f4f0ee0..423f9530f2cb 100644 --- a/unotools/source/i18n/charclass.cxx +++ b/unotools/source/i18n/charclass.cxx @@ -253,6 +253,23 @@ bool CharClass::isLetterNumeric( const OUString& rStr ) const return false; } +bool CharClass::isBase( const OUString& rStr, sal_Int32 nPos ) const +{ +sal_Unicode c = rStr[nPos]; +if ( c < 128 ) +return rtl::isAsciiAlphanumeric( c ); + +try +{ +return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) & nCharClassBaseType ) != 0; +} +catch ( const Exception& ) +{ +TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); +} +return false; +} + bool CharClass::isUpper( const OUString& rStr, sal_Int32 nPos ) const { sal_Unicode c = rStr[nPos];
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source
sc/source/filter/excel/xihelper.cxx |6 ++ sc/source/filter/inc/worksheethelper.hxx |4 +++- sc/source/filter/oox/sheetdatabuffer.cxx |4 +++- sc/source/filter/oox/worksheethelper.cxx |6 +- 4 files changed, 17 insertions(+), 3 deletions(-) New commits: commit 845a359609fccfa2d5b5d7e57f504074aafd3caf Author: Henry Castro AuthorDate: Tue Feb 28 09:50:28 2023 -0400 Commit: Xisco Fauli CommitDate: Fri Jun 23 22:00:01 2023 +0200 sc: filter: excel: import cell multi-line text The excel document, if the cell has multi-line text and the property wrap text is off, the paragraphs are rendered all in a single line. Signed-off-by: Henry Castro Change-Id: I3b5c82dde2616887e51ad6e3dfe91d100482f747 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148004 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153470 Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153489 diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index 3552e8d65f1b..e095d22018ac 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -238,10 +238,16 @@ void XclImpStringHelper::SetToDocument( const OUString& aStr = rString.GetText(); if (aStr.indexOf('\n') != -1 || aStr.indexOf('\r') != -1) { +const XclImpXFBuffer& rXFBuffer = rRoot.GetXFBuffer(); +const XclImpXF* pXF = rXFBuffer.GetXF( nXFIndex ); +bool bSingleLine = pXF ? !pXF->GetLineBreak() : false; + // Multiline content. ScFieldEditEngine& rEngine = rDoc.getDoc().GetEditEngine(); +rEngine.SetSingleLine(bSingleLine); rEngine.SetTextCurrentDefaults(aStr); rDoc.setEditCell(rPos, rEngine.CreateTextObject()); +rEngine.SetSingleLine(false); } else { diff --git a/sc/source/filter/inc/worksheethelper.hxx b/sc/source/filter/inc/worksheethelper.hxx index 3a44dc2e105e..4081d248e32b 100644 --- a/sc/source/filter/inc/worksheethelper.hxx +++ b/sc/source/filter/inc/worksheethelper.hxx @@ -262,7 +262,9 @@ public: /** Inserts a rich-string cell directly into the Calc sheet. */ void putRichString( const ScAddress& rAddress, -RichString& rString, const oox::xls::Font* pFirstPortionFont ); +RichString& rString, +const oox::xls::Font* pFirstPortionFont, +bool bSingleLine = false); /** Inserts a formula cell directly into the Calc sheet. */ void putFormulaTokens( diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx index 5632d8356353..7c7e9a06d221 100644 --- a/sc/source/filter/oox/sheetdatabuffer.cxx +++ b/sc/source/filter/oox/sheetdatabuffer.cxx @@ -120,6 +120,8 @@ void SheetDataBuffer::setStringCell( const CellModel& rModel, const RichStringRe { OSL_ENSURE( rxString, "SheetDataBuffer::setStringCell - missing rich string object" ); const oox::xls::Font* pFirstPortionFont = getStyles().getFontFromCellXf( rModel.mnXfId ).get(); +const Xf* pXf = getStyles().getCellXf( rModel.mnXfId ).get(); +bool bSingleLine = pXf ? !rxString->isPreserveSpace() && !pXf->getAlignment().getModel().mbWrapText : false; OUString aText; if( rxString->extractPlainString( aText, pFirstPortionFont ) ) { @@ -127,7 +129,7 @@ void SheetDataBuffer::setStringCell( const CellModel& rModel, const RichStringRe } else { -putRichString( rModel.maCellAddr, *rxString, pFirstPortionFont ); +putRichString( rModel.maCellAddr, *rxString, pFirstPortionFont, bSingleLine ); setCellFormat( rModel ); } } diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 6ea756f884ce..e34f5a47d190 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -1596,12 +1596,16 @@ void WorksheetHelper::setCellFormulaValue( getFormulaBuffer().setCellFormulaValue(rAddress, rValueStr, nCellType); } -void WorksheetHelper::putRichString( const ScAddress& rAddress, RichString& rString, const oox::xls::Font* pFirstPortionFont ) +void WorksheetHelper::putRichString( const ScAddress& rAddress, RichString& rString, const oox::xls::Font* pFirstPortionFont, bool bSingleLine ) { ScEditEngineDefaulter& rEE = getEditEngine(); +rEE.SetSingleLine(bSingleLine); + // The cell will own the text object instance returned from convert(). getDocImport().setEditCell(rAddress, rString.convert(rEE, pFirstPortionFont)); + +rEE.SetSingleLine(false); } void WorksheetHelper::putFormulaTokens( const ScAddress& rAddress, const ApiTokenSequence& rTokens )
[Libreoffice-commits] core.git: distro-configs/LibreOfficeCoverity.conf
distro-configs/LibreOfficeCoverity.conf |2 ++ 1 file changed, 2 insertions(+) New commits: commit 9bb6f3083b8b2a763417ca1cdce21865a41ddd08 Author: Caolán McNamara AuthorDate: Fri Jun 23 20:18:51 2023 +0100 Commit: Caolán McNamara CommitDate: Fri Jun 23 21:35:24 2023 +0200 update LibreOfficeCoverity.conf Change-Id: I61b62814b39d18c589e447c6518b7011f0b9bf26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153536 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/distro-configs/LibreOfficeCoverity.conf b/distro-configs/LibreOfficeCoverity.conf index 5b301570b8fc..29959e007812 100644 --- a/distro-configs/LibreOfficeCoverity.conf +++ b/distro-configs/LibreOfficeCoverity.conf @@ -11,6 +11,8 @@ --with-system-libs --with-system-headers --without-system-cppunit +--without-system-dragonbox +--without-system-frozen --without-system-libfixmath --enable-dbus --enable-extension-integration
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source
sc/source/filter/inc/xistyle.hxx |1 + 1 file changed, 1 insertion(+) New commits: commit da1d9d2704f7d3b36be9cc6540d3a318e28abf6f Author: Henry Castro AuthorDate: Tue Feb 28 09:44:27 2023 -0400 Commit: Xisco Fauli CommitDate: Fri Jun 23 21:05:53 2023 +0200 sc: filter: excel: add getter function LineBreak Signed-off-by: Henry Castro Change-Id: I17646ed53f663fd72a10437d7a3a4407df0c176e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148003 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153468 Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153488 diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx index 1d0f0e04c5b1..b4e5250dc37f 100644 --- a/sc/source/filter/inc/xistyle.hxx +++ b/sc/source/filter/inc/xistyle.hxx @@ -387,6 +387,7 @@ public: /** Reads an XF record. */ voidReadXF( XclImpStream& rStrm ); +bool GetLineBreak() const { return maAlignment.mbLineBreak; } sal_uInt8GetHorAlign() const { return maAlignment.mnHorAlign; } sal_uInt16 GetFontIndex() const { return mnXclFont; }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - editeng/qa
editeng/qa/unit/core-test.cxx | 15 +++ 1 file changed, 15 insertions(+) New commits: commit 1d2e077266069ff347f70c74b95aae8b93fe45ef Author: Henry Castro AuthorDate: Wed Feb 8 13:36:44 2023 -0400 Commit: Xisco Fauli CommitDate: Fri Jun 23 21:05:36 2023 +0200 editeng: qa: add single line unit test Signed-off-by: Henry Castro Change-Id: I8abd816ec7c115d5a1f17d3b68e3e758cea02d82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148002 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153404 Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153486 diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index e21e3c7a38d4..075703266c18 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -101,6 +101,8 @@ public: void testTdf148148(); +void testSingleLine(); + DECL_STATIC_LINK( Test, CalcFieldValueHdl, EditFieldInfo*, void ); CPPUNIT_TEST_SUITE(Test); @@ -125,6 +127,7 @@ public: CPPUNIT_TEST(testTransliterate); CPPUNIT_TEST(testTdf147196); CPPUNIT_TEST(testTdf148148); +CPPUNIT_TEST(testSingleLine); CPPUNIT_TEST_SUITE_END(); private: @@ -1975,6 +1978,18 @@ void Test::testTdf148148() } +void Test::testSingleLine() +{ +EditEngine aEditEngine( mpItemPool.get() ); + +aEditEngine.SetSingleLine(true); +aEditEngine.SetText("Bolivian\nSanta Cruz de la Sierra"); +aEditEngine.QuickFormatDoc(true); +CPPUNIT_ASSERT_EQUAL(true, aEditEngine.IsFormatted()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aEditEngine.GetParagraphCount()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aEditEngine.GetLineCount(0)); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - editeng/source
editeng/source/editeng/impedit2.cxx |3 ++- editeng/source/editeng/impedit3.cxx | 16 2 files changed, 14 insertions(+), 5 deletions(-) New commits: commit c10fc6658b0cf65e5ede027b9161f060dd1f586e Author: Henry Castro AuthorDate: Tue Jan 31 16:10:08 2023 -0400 Commit: Xisco Fauli CommitDate: Fri Jun 23 21:05:18 2023 +0200 editeng: ignore line breaks Add option to ignore line breaks, and draw the paragraph as single line. Signed-off-by: Henry Castro Change-Id: I957c3462f6dabe7c1a3322dcbe6753c0c5adc851 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148001 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153400 Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153485 diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index cc8b39154844..3a000cb7e911 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2740,7 +2740,8 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& aCurSel, const OUStrin sal_Int32 nStart = 0; while ( nStart < aText.getLength() ) { -sal_Int32 nEnd = aText.indexOf( LINE_SEP, nStart ); +sal_Int32 nEnd = !aStatus.IsSingleLine() ? +aText.indexOf( LINE_SEP, nStart ) : -1; if ( nEnd == -1 ) nEnd = aText.getLength(); // not dereference! diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index bcf0c044872f..c6847168be4a 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -1437,7 +1437,8 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) else if ( !bEOL && !bContinueLastPortion ) { DBG_ASSERT( pPortion && ((nPortionEnd-nPortionStart) == pPortion->GetLen()), "However, another portion?!" ); -tools::Long nRemainingWidth = nMaxLineWidth - nTmpWidth; +tools::Long nRemainingWidth = !aStatus.IsSingleLine() ? +nMaxLineWidth - nTmpWidth : pLine->GetCharPosArray()[pLine->GetCharPosArray().size() - 1] + 1; bool bCanHyphenate = ( aTmpFont.GetCharSet() != RTL_TEXTENCODING_SYMBOL ); if ( bCompressedChars && pPortion && ( pPortion->GetLen() > 1 ) && pPortion->GetExtraInfos() && pPortion->GetExtraInfos()->bCompressed ) { @@ -2013,9 +2014,16 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te aUserOptions.allowPunctuationOutsideMargin = bAllowPunctuationOutsideMargin; aUserOptions.allowHyphenateEnglish = false; -i18n::LineBreakResults aLBR = _xBI->getLineBreak( -pNode->GetString(), nMaxBreakPos, aLocale, nMinBreakPos, aHyphOptions, aUserOptions ); -nBreakPos = aLBR.breakIndex; +if (!aStatus.IsSingleLine()) +{ +i18n::LineBreakResults aLBR = _xBI->getLineBreak( +pNode->GetString(), nMaxBreakPos, aLocale, nMinBreakPos, aHyphOptions, aUserOptions ); +nBreakPos = aLBR.breakIndex; +} +else +{ +nBreakPos = nMaxBreakPos; +} // BUG in I18N - under special condition (break behind field, #87327#) breakIndex is < nMinBreakPos if ( nBreakPos < nMinBreakPos )
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - editeng/source include/editeng
editeng/source/editeng/editeng.cxx | 11 +++ include/editeng/editeng.hxx|2 ++ 2 files changed, 13 insertions(+) New commits: commit d384437ec2d0f01f9273de8bfdde378da999b125 Author: Henry Castro AuthorDate: Tue Feb 28 09:42:16 2023 -0400 Commit: Xisco Fauli CommitDate: Fri Jun 23 21:04:59 2023 +0200 editeng: add setter function SingleLine Signed-off-by: Henry Castro Change-Id: I66cad37e1d3728369f0a08195bf85e6c0d50f0ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148000 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153399 Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153484 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 12e52b27331a..c766328fd667 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1872,6 +1872,17 @@ bool EditEngine::IsFlatMode() const return !( pImpEditEngine->aStatus.UseCharAttribs() ); } +void EditEngine::SetSingleLine(bool bValue) +{ +if (bValue == pImpEditEngine->aStatus.IsSingleLine()) +return; + +if (bValue) +pImpEditEngine->aStatus.TurnOnFlags(EEControlBits::SINGLELINE); +else +pImpEditEngine->aStatus.TurnOffFlags(EEControlBits::SINGLELINE); +} + void EditEngine::SetControlWord( EEControlBits nWord ) { diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index b31b77160ad5..85accc9d36e3 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -404,6 +404,8 @@ public: boolIsFlatMode() const; voidSetFlatMode( bool bFlat ); +voidSetSingleLine( bool bValue ); + voidSetControlWord( EEControlBits nWord ); EEControlBits GetControlWord() const;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 2 commits - editeng/source include/editeng sc/source
editeng/source/editeng/editstt2.hxx|3 +++ include/editeng/editstat.hxx |3 ++- sc/source/filter/inc/richstring.hxx|7 ++- sc/source/filter/oox/richstring.cxx| 12 +++- sc/source/filter/oox/richstringcontext.cxx |4 +++- 5 files changed, 25 insertions(+), 4 deletions(-) New commits: commit 1e7451560e3a03f6ca68bad8b0450e79a0cfa627 Author: Henry Castro AuthorDate: Tue May 9 17:43:48 2023 -0400 Commit: Xisco Fauli CommitDate: Fri Jun 23 21:04:34 2023 +0200 sc: filter: oox: fix preserve space, single line case The unit test testPreserveTextWhitespace2XLSX fails when a single line is enabled Test name: ScExportTest::testPreserveTextWhitespace2XLSX equality assertion failed - Expected: 1 - Actual : 0 - In <>, XPath '/x:sst/x:si[2]/x:r[1]/x:t' number of nodes is incorrect In order to fix, the single line cell should not be enabled and import the attribute: abc Signed-off-by: Henry Castro Change-Id: I380ba8726c03abc40bdc745ea74eceb80fec6e54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151599 Tested-by: Jenkins CollaboraOffice (cherry picked from commit 2dd86aa3f365057494bf41f4da7f2f410ea3bf2e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151615 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153459 Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153487 diff --git a/sc/source/filter/inc/richstring.hxx b/sc/source/filter/inc/richstring.hxx index 7c233507b419..b74e3036f473 100644 --- a/sc/source/filter/inc/richstring.hxx +++ b/sc/source/filter/inc/richstring.hxx @@ -208,7 +208,7 @@ class RichString public: /** Appends and returns an index of a portion object for a plain string (t element). */ -sal_Int32 importText(); +sal_Int32 importText(const AttributeList& rAttribs); /** Appends and returns an index of a portion object for a new formatting run (r element). */ sal_Int32 importRun(); /** Appends and returns a phonetic text object for a new phonetic run (rPh element). */ @@ -236,6 +236,10 @@ public: RichStringPortion& getPortion(sal_Int32 nPortionIdx) { return maTextPortions[nPortionIdx]; } +voidsetAttributes(const AttributeList& rAttribs); + +boolisPreserveSpace() const { return mbPreserveSpace; } + private: /** Creates, appends, and returns a new empty string portion. */ sal_Int32 createPortion(); @@ -253,6 +257,7 @@ private: std::vector maTextPortions; /// String portions with font data. std::unique_ptr mxPhonSettings; /// Phonetic settings for this string. PhoneticVector maPhonPortions; /// Phonetic text portions. +bool mbPreserveSpace = false; }; typedef std::shared_ptr< RichString > RichStringRef; diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx index 8d2f964362d0..a1345179c19a 100644 --- a/sc/source/filter/oox/richstring.cxx +++ b/sc/source/filter/oox/richstring.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -293,8 +294,10 @@ void PhoneticPortionModelList::importPortions( SequenceInputStream& rStrm ) } } -sal_Int32 RichString::importText() +sal_Int32 RichString::importText(const AttributeList& rAttribs) { +setAttributes(rAttribs); + return createPortion(); } @@ -303,6 +306,13 @@ sal_Int32 RichString::importRun() return createPortion(); } +void RichString::setAttributes(const AttributeList& rAttribs) +{ +auto aAttrSpace = rAttribs.getString(oox::NMSP_xml | oox::XML_space); +if (aAttrSpace && *aAttrSpace == "preserve") +mbPreserveSpace = true; +} + RichStringPhoneticRef RichString::importPhoneticRun( const AttributeList& rAttribs ) { RichStringPhoneticRef xPhonetic = createPhonetic(); diff --git a/sc/source/filter/oox/richstringcontext.cxx b/sc/source/filter/oox/richstringcontext.cxx index 280ac293a390..0c83fff2e9f3 100644 --- a/sc/source/filter/oox/richstringcontext.cxx +++ b/sc/source/filter/oox/richstringcontext.cxx @@ -33,7 +33,7 @@ ContextHandlerRef RichStringContext::onCreateContext( sal_Int32 nElement, const switch( nElement ) { case XLS_TOKEN( t ): -mnPortionIdx = mxString->importText(); +mnPortionIdx = mxString->importText(rAttribs); return this;// collect text in onCharacters() case XLS_TOKEN( r ): mnPortionIdx = mxString->importRun(); @@ -57,6 +57,7 @@ ContextHandlerRef RichStringContext::onCreateContext( sal_Int32 nElement, const break; case XLS_TOKEN( t ): +mxString->setAttributes(rAttribs); return this;// collect portion text in onCharacters() } break; @@ -65
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/viewfun6.cxx |3 --- 1 file changed, 3 deletions(-) New commits: commit 805abacd0d1fe2d5522a2041fc3c07961a62ba5f Author: Justin Luth AuthorDate: Fri Jun 23 10:58:54 2023 -0400 Commit: Justin Luth CommitDate: Fri Jun 23 20:45:29 2023 +0200 related tdf#68695 tdf#141136 sc: comment can't resize; avoid context change In order to avoid having the notebookbar constantly flipping back to the home tab, try to avoid useless context switches. That should also be a nice performance win. In this case, the context change occurred because handles were enabled, but that broke in LO 4.1, so just revert that broken OOo fix. Back in OOo, https://bz.apache.org/ooo/show_bug.cgi?id=33764 added resize handles to a newly inserted comment, and was added to LO as part of a huge batch. commit 07b0c01857137de7e4bd02375e7c892d622d270e Author: Oliver Bolte on Mon Mar 2 14:19:13 2009 + CWS-TOOLING: integrate CWS dr66 But that didn't allow select and copy, so in LO 4.1 commit 54a1feb9b9bd654774b9aa60cda7ef9a1cd11064 Author: Armin Le Grand on Fri May 10 12:08:40 2013 +0100 Resolves: #i122142# use simple text hilight frames Bug 68695 exists to complain about the inability to resize. Change-Id: If04d718b7de9cff1038bbe9f6372d4859643d3f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153508 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index e8e9dbc554ed..a840670dfce2 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -541,9 +541,6 @@ void ScViewFunc::EditNote() if ( ScDrawView* pScDrawView = GetScDrawView() ) pScDrawView->SyncForGrid( pCaption ); -// #i33764# enable the resize handles before starting edit mode -if( FuPoor* pDraw = GetDrawFuncPtr() ) -static_cast< FuSelection* >( pDraw )->ActivateNoteHandles( pCaption ); // activate object (as in FuSelection::TestComment) GetViewData().GetDispatcher().Execute( SID_DRAW_NOTEEDIT, SfxCallMode::SYNCHRON | SfxCallMode::RECORD );
[Libreoffice-commits] core.git: vcl/source
vcl/source/control/tabctrl.cxx | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) New commits: commit 9f5393abea012be04ab7ecb26d8031019bc50f62 Author: Justin Luth AuthorDate: Thu Jun 22 14:29:15 2023 -0400 Commit: Justin Luth CommitDate: Fri Jun 23 20:43:41 2023 +0200 tdf#141136 NBB SetContext: try to stay on the same tab The user was forced on the HOME page at almost any context change. Instead, this should only happen if: -there is a special context tab -there is no special tab, and some "random" tab is needed. This helps in a lot of cases, but there are still plenty of cases where TWO context changes are emitted for one logical event. For example, in Calc a new comment switches to special DRAW tab, and then immediately to DrawText which has no tab -> home tab. So further fixes are needed to prevent machine-gun fire context events. Change-Id: Ibaf18fa823c613b4d11d33284842e439d3689542 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153476 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index c384cb036db6..d44554b80b83 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2285,17 +2285,27 @@ void NotebookbarTabControlBase::SetContext( vcl::EnumContext::Context eContext ) bool bHandled = false; +TabPage* pPage = GetTabPage(mnCurPageId); +// Try to stay on the current tab (unless the new context has a special tab) +if (pPage && eLastContext != vcl::EnumContext::Context::Any +&& pPage->HasContext(vcl::EnumContext::Context::Any) && pPage->IsEnabled()) +{ +bHandled = true; +} + for (int nChild = 0; nChild < GetPageCount(); ++nChild) { sal_uInt16 nPageId = TabControl::GetPageId(nChild); -TabPage* pPage = GetTabPage(nPageId); +pPage = GetTabPage(nPageId); if (!pPage) continue; SetPageVisible(nPageId, pPage->HasContext(eContext) || pPage->HasContext(vcl::EnumContext::Context::Any)); -if (pPage->HasContext(eContext) && eContext != vcl::EnumContext::Context::Any) +if (eContext != vcl::EnumContext::Context::Any +&& (!bHandled || !pPage->HasContext(vcl::EnumContext::Context::Any)) +&& pPage->HasContext(eContext)) { SetCurPageId(nPageId); bHandled = true;
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sc/source
sc/source/core/data/table2.cxx | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) New commits: commit 44dc896c7878ffe972c7c16df61f311f2e240a0e Author: Luboš Luňák AuthorDate: Wed Feb 16 09:54:54 2022 +0100 Commit: Gabor Kelemen CommitDate: Fri Jun 23 19:29:06 2023 +0100 for unallocated columns check default column attributes (tdf#132057) The problem was that this was returning false for the protected attribute just because a column was not allocated, but the default attributes had the flag set (so if the column had been allocated first it would have the flag set too). Change-Id: I2ef1ef40cafb7e8fc6f7b561c0a376af63f2ad26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129984 Tested-by: Jenkins Reviewed-by: Luboš Luňák (cherry picked from commit a717029e217621482ef799731f945090c6d6be4b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130015 Reviewed-by: Xisco Fauli (cherry picked from commit 5bdf7c93abd15dc422586228186e822096ce1517) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130018 diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 2085e623f932..0af4861983cb 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -2059,15 +2059,12 @@ const ScPatternAttr* ScTable::GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, S bool ScTable::HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, HasAttrFlags nMask ) const { -if ( nCol1 >= aCol.size() ) - return false; -if ( nCol2 >= aCol.size() ) - nCol2 = aCol.size() - 1; // Rows above range, doesn't contains flags - -bool bFound = false; -for (SCCOL i=nCol1; i<=nCol2 && !bFound; i++) -bFound |= aCol[i].HasAttrib( nRow1, nRow2, nMask ); -return bFound; +for(SCCOL nCol = nCol1; nCol <= nCol2 && nCol < aCol.size(); ++nCol ) +if( aCol[nCol].HasAttrib( nRow1, nRow2, nMask )) +return true; +if( nCol2 >= aCol.size()) + return aDefaultColAttrArray.HasAttrib( nRow1, nRow2, nMask ); +return false; } bool ScTable::HasAttribSelection( const ScMarkData& rMark, HasAttrFlags nMask ) const
[Libreoffice-commits] core.git: Changes to 'refs/tags/cp-23.05.1-1'
Tag 'cp-23.05.1-1' created by Andras Timar at 2023-06-23 16:50 + cp-23.05.1-1 Changes since cp-23.05.0-5-70: --- 0 files changed ---
[Libreoffice-commits] translations.git: Changes to 'refs/tags/cp-23.05.1-1'
Tag 'cp-23.05.1-1' created by Andras Timar at 2023-06-23 16:50 + cp-23.05.1-1 Changes since cp-23.05.0-2-1: --- 0 files changed ---
[Libreoffice-commits] help.git: Changes to 'refs/tags/cp-23.05.1-1'
Tag 'cp-23.05.1-1' created by Andras Timar at 2023-06-23 16:50 + cp-23.05.1-1 Changes since co-23.05-branch-point-9: --- 0 files changed ---
[Libreoffice-commits] dictionaries.git: Changes to 'refs/tags/cp-23.05.1-1'
Tag 'cp-23.05.1-1' created by Andras Timar at 2023-06-23 16:50 + cp-23.05.1-1 Changes since co-23.05-branch-point: Andras Timar (1): On Linux dictionaries are packaged separately --- Module_dictionaries.mk |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 4 commits - configure.ac oox/source svgio/qa svgio/source
configure.ac |2 oox/source/export/chartexport.cxx |4 - svgio/qa/cppunit/SvgImportTest.cxx| 31 + svgio/qa/cppunit/data/tdf145896.svg | 12 + svgio/qa/cppunit/data/tdf155833.svg | 31 + svgio/source/svgreader/svgdocumenthandler.cxx | 17 +-- svgio/source/svgreader/svgimagenode.cxx | 60 +++--- svgio/source/svgreader/svgstylenode.cxx |6 +- 8 files changed, 109 insertions(+), 54 deletions(-) New commits: commit ff79c423495940f6070585c1c367586418821a99 Author: Andras Timar AuthorDate: Fri Jun 23 18:34:31 2023 +0200 Commit: Andras Timar CommitDate: Fri Jun 23 18:49:12 2023 +0200 Bump version to 23.05.1.1 Change-Id: Ib82a73120573a25a01334a50b27324e70717b52d diff --git a/configure.ac b/configure.ac index 4aa1813a1486..5de94c69d5f5 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl in order to create a configure script. # several non-alphanumeric characters, those are split off and used only for the # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea. -AC_INIT([Collabora Office],[23.05.0.5],[],[],[https://collaboraoffice.com/]) +AC_INIT([Collabora Office],[23.05.1.1],[],[],[https://collaboraoffice.com/]) dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard commit a341c8ab8f2c6bb11a2564d0a4c9f30f504ba516 Author: Xisco Fauli AuthorDate: Thu Jun 15 10:10:38 2023 +0200 Commit: Andras Timar CommitDate: Fri Jun 23 18:49:12 2023 +0200 tdf#155833: apply transform to image even if target is equal to viewbox Change-Id: Ie820528384d096c6a332e2abd0095f68c7f64a0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153103 Tested-by: Jenkins Reviewed-by: Xisco Fauli (cherry picked from commit 6dce36484bfcac711251710697dca961fd77ca20) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153082 Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153153 diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index ce9329b1a21a..16975f06f0b2 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -402,6 +402,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf45771) assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "familyname", "Times New Roman"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf155833) +{ +Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf155833.svg"); +CPPUNIT_ASSERT_EQUAL(1, static_cast(aSequence.getLength())); + +drawinglayer::Primitive2dXmlDump dumper; +xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequence); + +CPPUNIT_ASSERT (pDocument); + +assertXPath(pDocument, "/primitive2D/transform/mask/transform/transform/transform/transform/transform/bitmap", 1); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf97941) { //Check tspan fontsize when using relative units diff --git a/svgio/qa/cppunit/data/tdf155833.svg b/svgio/qa/cppunit/data/tdf155833.svg new file mode 100644 index ..8cc908424af0 --- /dev/null +++ b/svgio/qa/cppunit/data/tdf155833.svg @@ -0,0 +1,31 @@ + + + +http://www.w3.org/1999/xlink"; + xmlns="http://www.w3.org/2000/svg"; + xmlns:svg="http://www.w3.org/2000/svg";> + + + + + + + + diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index ed7b81cef61a..19c8c9404541 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -310,45 +310,37 @@ namespace svgio::svgreader if(aNewTarget.empty()) return; -if(aTarget.equal(aViewBox)) -{ -// just add to rTarget -rTarget.append(aNewTarget); -} -else -{ -// create mapping -const SvgAspectRatio& rRatio = maSvgAspectRatio; +// create mapping +const SvgAspectRatio& rRatio = maSvgAspectRatio; -// even when ratio is not set, use the defaults -// let mapping be created from SvgAspectRatio -const basegfx::B2DHomMatrix aEmbeddingTransform(rRatio.createMapping(aTarget, aViewBox)); +// even when ratio is not set, use the defaults +// let mapping be created from SvgAspectRatio +const basegfx::B2DHomMatrix aEmbeddingTransform(rRatio.createMapping(aTarget, aViewBox)); -if(!aEmbeddingTransform.isIdentity()) -{ -const drawinglayer::primitive2d::Primitive2DReference xRef( -new drawinglayer::primitive2d::TransformPrimitive2D( -
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - svx/uiconfig sw/source vcl/jsdialog
svx/uiconfig/ui/acceptrejectchangesdialog.ui | 14 +- sw/source/ui/misc/titlepage.cxx |1 + sw/source/uibase/inc/titlepage.hxx |1 + sw/source/uibase/misc/redlndlg.cxx |2 +- vcl/jsdialog/enabled.cxx |5 + 5 files changed, 21 insertions(+), 2 deletions(-) New commits: commit 1102e01bc9ef0fa65121b7d4154efaeede45193c Author: Szymon Kłos AuthorDate: Fri Jun 16 18:53:46 2023 +0200 Commit: Andras Timar CommitDate: Fri Jun 23 18:43:09 2023 +0200 jsdialog: enable Manage Changes dialog Change-Id: Ibc501dc595eba93adde7b635a5de1122b22c9651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153190 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/svx/uiconfig/ui/acceptrejectchangesdialog.ui b/svx/uiconfig/ui/acceptrejectchangesdialog.ui index 58d1e10bdfcb..a2d4f4e2741f 100644 --- a/svx/uiconfig/ui/acceptrejectchangesdialog.ui +++ b/svx/uiconfig/ui/acceptrejectchangesdialog.ui @@ -58,7 +58,19 @@ - + +True +False +vertical + + + + + +True +True +1 + diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 502eea81dea8..de5310de0311 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -82,7 +82,7 @@ SwModelessRedlineAcceptDlg::SwModelessRedlineAcceptDlg( SfxBindings* _pBindings, SwChildWinWrapper* pChild, weld::Window *pParent) : SfxModelessDialogController(_pBindings, pChild, pParent, "svx/ui/acceptrejectchangesdialog.ui", "AcceptRejectChangesDialog") -, m_xContentArea(m_xDialog->weld_content_area()) +, m_xContentArea(m_xBuilder->weld_container("container")) , m_pChildWin(pChild) { m_xImplDlg.reset(new SwRedlineAcceptDlg(m_xDialog, m_xBuilder.get(), m_xContentArea.get())); diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index e4e09487bb87..d2d304ce2014 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -222,12 +222,16 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile) || rUIFile == u"sfx/ui/managestylepage.ui" || rUIFile == u"sfx/ui/password.ui" // svx +|| rUIFile == u"svx/ui/acceptrejectchangesdialog.ui" || rUIFile == u"svx/ui/accessibilitycheckdialog.ui" || rUIFile == u"svx/ui/accessibilitycheckentry.ui" || rUIFile == u"svx/ui/compressgraphicdialog.ui" || rUIFile == u"svx/ui/findreplacedialog.ui" || rUIFile == u"svx/ui/fontworkgallerydialog.ui" || rUIFile == u"svx/ui/headfootformatpage.ui" +|| rUIFile == u"svx/ui/redlinecontrol.ui" +|| rUIFile == u"svx/ui/redlinefilterpage.ui" +|| rUIFile == u"svx/ui/redlineviewpage.ui" || rUIFile == u"svx/ui/themecoloreditdialog.ui" || rUIFile == u"svx/ui/themedialog.ui" // uui commit a3d479abf247d5f3379131302532c8f0e8da6667 Author: Szymon Kłos AuthorDate: Fri Jun 16 18:30:35 2023 +0200 Commit: Andras Timar CommitDate: Fri Jun 23 18:42:59 2023 +0200 jsdialog: enable Insert Title Page dialog we need to weld also RB_INSERT_NEW_PAGES so when we check it - JSDialog executor will make it active and RB_USE_EXISTING_PAGES inactive Change-Id: I0abc5b6610e301abb1d24ecea680f63358dc5584 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153189 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx index 4308c8db246d..0d8c776cce64 100644 --- a/sw/source/ui/misc/titlepage.cxx +++ b/sw/source/ui/misc/titlepage.cxx @@ -150,6 +150,7 @@ SwTitlePageDlg::SwTitlePageDlg(weld::Window *pParent) , mpIndexDesc(nullptr) , mpNormalDesc(nullptr) , m_xUseExistingPagesRB(m_xBuilder->weld_radio_button("RB_USE_EXISTING_PAGES")) +, m_xInsertNewPagesRB(m_xBuilder->weld_radio_button("RB_INSERT_NEW_PAGES")) , m_xPageCountNF(m_xBuilder->weld_spin_button("NF_PAGE_COUNT")) , m_xDocumentStartRB(m_xBuilder->weld_radio_button("RB_DOCUMENT_START")) , m_xPageStartRB(m_xBuilder->weld_radio_button("RB_PAGE_START")) diff --git a/sw/source/uibase/inc/titlepage.hxx b/sw/source/uibase/inc/titlepage.hxx index 9e8c58984652..13f167786339 100644 --- a/sw/source/uibase/inc/titlepage.hxx +++ b/sw/source/uibase/inc/titlepage.hxx @@ -31,6 +31,7 @@ private: const SwPageDesc* mpNormalDesc; std::unique_ptr m_xUseExistingPagesRB; +std::unique_ptr m_xInsertNewPagesRB; // required by LOK JSDialogs std::unique_ptr m_xPageCountNF; std::unique_ptr m_xDocumentStartRB; std::unique_ptr m_xPageStartRB; diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index cd2cd
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/sfx2 sfx2/source
include/sfx2/sidebar/Deck.hxx |2 ++ sfx2/source/sidebar/Deck.cxx | 16 sfx2/source/sidebar/DeckLayouter.cxx |7 --- sfx2/source/sidebar/SidebarController.cxx |3 +++ 4 files changed, 21 insertions(+), 7 deletions(-) New commits: commit 1eb31531051ea1abd36905b252618374700cc0a5 Author: Szymon Kłos AuthorDate: Wed Jun 21 17:36:09 2023 +0200 Commit: Andras Timar CommitDate: Fri Jun 23 18:37:35 2023 +0200 lok: sidebar: send full update only when changed panels we only need to send update when: - we switch to other deck - panels were hidden, shown, created this helps to avoid full updates in navigator when clicking on images, what causes context change Change-Id: If1bca6167cdc3e9294eb5aefb923e92bc9043edc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153401 Reviewed-by: Attila Szűcs Tested-by: Attila Szűcs Tested-by: Jenkins CollaboraOffice diff --git a/include/sfx2/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx index fe73e6332d90..215d3d215674 100644 --- a/include/sfx2/sidebar/Deck.hxx +++ b/include/sfx2/sidebar/Deck.hxx @@ -66,6 +66,8 @@ public: sal_Int32 GetMinimalWidth() const { return mnMinimalWidth; } +static void LOKSendSidebarFullUpdate(); + private: void RequestLayoutInternal(); diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index b6ddffa89550..f9c8140bc9ff 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -29,6 +29,7 @@ #include #include +#include #include using namespace css; @@ -36,6 +37,15 @@ using namespace css::uno; namespace sfx2::sidebar { +void Deck::LOKSendSidebarFullUpdate() +{ +if (comphelper::LibreOfficeKit::isActive()) +{ +sal_uInt64 nShellId = reinterpret_cast(SfxViewShell::Current()); +jsdialog::SendFullUpdate(std::to_string(nShellId) + "sidebar", "Panel"); +} +} + Deck::Deck(const DeckDescriptor& rDeckDescriptor, SidebarDockingWindow* pParentWindow, const std::function& rCloserAction) : InterimItemWindow(pParentWindow, "sfx/ui/deck.ui", "Deck") @@ -117,6 +127,7 @@ void Deck::DataChanged(const DataChangedEvent&) rpPanel->DataChanged(); RequestLayoutInternal(); +Deck::LOKSendSidebarFullUpdate(); } /* @@ -181,12 +192,17 @@ void Deck::ResetPanels(SharedPanelContainer&& rPanelContainer) aHiddens.push_back(rpPanel); } } + +bool bDifferent = maPanels.size() != rPanelContainer.size() || aHiddens.size(); maPanels = std::move(rPanelContainer); // Hidden ones always at the end maPanels.insert(std::end(maPanels), std::begin(aHiddens), std::end(aHiddens)); RequestLayoutInternal(); + +if (bDifferent) +Deck::LOKSendSidebarFullUpdate(); } void Deck::RequestLayoutInternal() diff --git a/sfx2/source/sidebar/DeckLayouter.cxx b/sfx2/source/sidebar/DeckLayouter.cxx index 5473aa95f001..824b66ac1aff 100644 --- a/sfx2/source/sidebar/DeckLayouter.cxx +++ b/sfx2/source/sidebar/DeckLayouter.cxx @@ -37,7 +37,6 @@ #include #include -#include using namespace css; using namespace css::uno; @@ -307,12 +306,6 @@ sal_Int32 PlacePanels ( } } -if (comphelper::LibreOfficeKit::isActive()) -{ -sal_uInt64 nShellId = reinterpret_cast(SfxViewShell::Current()); -jsdialog::SendFullUpdate(std::to_string(nShellId) + "sidebar", "Panel"); -} - return nY; } diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 3546297df79c..459bf9fb2ff8 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -686,7 +686,10 @@ void SidebarController::SwitchToDeck ( std::shared_ptr xDeckDescriptor = mpResourceManager->GetDeckDescriptor(rsDeckId); if (xDeckDescriptor) +{ SwitchToDeck(*xDeckDescriptor, maCurrentContext); +Deck::LOKSendSidebarFullUpdate(); +} } }
[Libreoffice-commits] core.git: include/tools tools/qa tools/source
include/tools/duration.hxx | 12 ++ tools/qa/cppunit/test_duration.cxx | 65 +- tools/source/datetime/duration.cxx | 70 + 3 files changed, 115 insertions(+), 32 deletions(-) New commits: commit c968d8989004301b49d67a093a6eb8a629533837 Author: Eike Rathke AuthorDate: Fri Jun 23 12:42:29 2023 +0200 Commit: Eike Rathke CommitDate: Fri Jun 23 18:32:17 2023 +0200 Introduce tools::Duration individual time values ctor Change-Id: I516d3727cbcf6667b32dc963febbf4b753ef6a91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153497 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/include/tools/duration.hxx b/include/tools/duration.hxx index a027cd671cd1..ea33953751b8 100644 --- a/include/tools/duration.hxx +++ b/include/tools/duration.hxx @@ -39,6 +39,14 @@ public: unless one is 0. */ Duration(sal_Int32 nDays, const Time& rTime); +/** Individual time values can be out-of-range, all will be normalized. +Additionally, the resulting time overall hour value is not restricted +to sal_uInt16 like it is with Time, as values >=24 flow over into days. +For a negative duration only a negative nDays can be given, thus a +negative duration of less than one day is not possible. */ +Duration(sal_Int32 nDays, sal_uInt32 nHours, sal_uInt32 nMinutes, sal_uInt32 nSeconds, + sal_uInt64 nNanoseconds); + bool IsNegative() const { return mnDays < 0 || maTime.GetTime() < 0; } sal_Int32 GetDays() const { return mnDays; } const Time& GetTime() const { return maTime; } @@ -60,6 +68,10 @@ private: /** Internal days and Time values. */ Duration(sal_Int32 nDays, sal_Int64 nTime); +/** Prerequisite: mnDays is already set. */ +void Normalize(sal_uInt64 nHours, sal_uInt64 nMinutes, sal_uInt64 nSeconds, + sal_uInt64 nNanoseconds, bool bNegative); + /** Prerequisite: mnDays is already correctly set and absolute value of nanoseconds less than one day. */ void ApplyTime(sal_Int64 nNS); diff --git a/tools/qa/cppunit/test_duration.cxx b/tools/qa/cppunit/test_duration.cxx index c328db7cec38..c4032be83a03 100644 --- a/tools/qa/cppunit/test_duration.cxx +++ b/tools/qa/cppunit/test_duration.cxx @@ -114,12 +114,73 @@ void DurationTest::testDuration() } { // 235929599 seconds == SAL_MAX_UINT16 hours + 59 minutes + 59 seconds -const Duration aD(0, Time(0, 0, 235929599)); +const Duration aD(0, Time(0, 0, 235929599, Time::nanoSecPerSec - 1)); CPPUNIT_ASSERT_EQUAL(static_cast(2730), aD.GetDays()); CPPUNIT_ASSERT_EQUAL(static_cast(15), aD.GetTime().GetHour()); CPPUNIT_ASSERT_EQUAL(static_cast(59), aD.GetTime().GetMin()); CPPUNIT_ASSERT_EQUAL(static_cast(59), aD.GetTime().GetSec()); -CPPUNIT_ASSERT_EQUAL(static_cast(0), aD.GetTime().GetNanoSec()); +CPPUNIT_ASSERT_EQUAL(static_cast(9), aD.GetTime().GetNanoSec()); +} +{ +// 235929599 seconds == SAL_MAX_UINT16 hours + 59 minutes + 59 seconds +const Duration aD(0, 0, 0, 235929599, Time::nanoSecPerSec - 1); +CPPUNIT_ASSERT_EQUAL(static_cast(2730), aD.GetDays()); +CPPUNIT_ASSERT_EQUAL(static_cast(15), aD.GetTime().GetHour()); +CPPUNIT_ASSERT_EQUAL(static_cast(59), aD.GetTime().GetMin()); +CPPUNIT_ASSERT_EQUAL(static_cast(59), aD.GetTime().GetSec()); +CPPUNIT_ASSERT_EQUAL(static_cast(9), aD.GetTime().GetNanoSec()); +} +{ +const Duration aD(1, 2, 3, 4, 5); +CPPUNIT_ASSERT_EQUAL(static_cast(1), aD.GetDays()); +CPPUNIT_ASSERT_EQUAL(static_cast(2), aD.GetTime().GetHour()); +CPPUNIT_ASSERT_EQUAL(static_cast(3), aD.GetTime().GetMin()); +CPPUNIT_ASSERT_EQUAL(static_cast(4), aD.GetTime().GetSec()); +CPPUNIT_ASSERT_EQUAL(static_cast(5), aD.GetTime().GetNanoSec()); +} +{ +const Duration aD(-1, 2, 3, 4, 5); +CPPUNIT_ASSERT(aD.IsNegative()); +CPPUNIT_ASSERT_EQUAL(static_cast(-1), aD.GetDays()); +CPPUNIT_ASSERT_EQUAL(static_cast(2), aD.GetTime().GetHour()); +CPPUNIT_ASSERT_EQUAL(static_cast(3), aD.GetTime().GetMin()); +CPPUNIT_ASSERT_EQUAL(static_cast(4), aD.GetTime().GetSec()); +CPPUNIT_ASSERT_EQUAL(static_cast(5), aD.GetTime().GetNanoSec()); +} +{ +const Duration aD(1, SAL_MAX_UINT32, SAL_MAX_UINT32, SAL_MAX_UINT32, SAL_MAX_UINT64); +CPPUNIT_ASSERT_EQUAL(static_cast(182202802), aD.GetDays()); +CPPUNIT_ASSERT_EQUAL(static_cast(1), aD.GetTime().GetHour()); +CPPUNIT_ASSERT_EQUAL(static_cast(17), aD.GetTime().GetMin()); +CPPUNIT_ASSERT_EQUAL(static_cast(48), aD.GetTime().GetSec()); +CPPUNIT_ASSERT_EQUAL(static_cast(709551615), aD.GetTime().GetNanoSec()); +} +{ +const Duration aD(-1, SAL_MAX_
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/app/docstyle.cxx | 109 -- 1 file changed, 48 insertions(+), 61 deletions(-) New commits: commit 759d414748bda99f29b04806f72d479e320c2f9f Author: Maxim Monastirsky AuthorDate: Wed Jun 21 09:07:20 2023 +0300 Commit: Maxim Monastirsky CommitDate: Fri Jun 23 17:26:42 2023 +0200 tdf#103064 Simplify the code a bit - Use SfxItemIter instead of manually iterating the ranges. While SwFormat::GetItemState does some extra stuff on top of SfxItemSet, it doesn't seem to be relevant for our use case. - Avoid searching for styles again and again. Change-Id: I397dd71a5ffb8cbf7d508b68abb3fc1b585938af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153479 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index e50c087d23fc..c78966a762e6 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -151,8 +151,7 @@ public: if (nId == SfxHintId::StyleSheetModified) { pStyleSheet->SetName(pDocStyleSheet->GetName()); -pStyleSheet->GetItemSet().ClearItem(); -EnsureStyleHierarchy(pDocStyleSheet->GetName(), pDocStyleSheet->GetFamily()); +UpdateStyleHierarchyFrom(pStyleSheet, pDocStyleSheet); static_cast(pStyleSheet)->Broadcast(SfxHint(SfxHintId::DataChanged)); } else if (nId == SfxHintId::StyleSheetErased) @@ -162,21 +161,19 @@ public: SfxStyleSheetBase* Find(const OUString& rName, SfxStyleFamily eFamily, SfxStyleSearchBits = SfxStyleSearchBits::All) override { -if (eFamily != SfxStyleFamily::All) -EnsureStyleHierarchy(rName, eFamily); -return SfxStyleSheetPool::Find(rName, eFamily); -} +auto pStyleSheet = SfxStyleSheetPool::Find(rName, eFamily); -void EnsureStyleHierarchy(const OUString& rName, SfxStyleFamily eFamily) -{ -auto pDocStyleSheet = m_pOwner->Find(rName, eFamily); -if (!pDocStyleSheet) -return; +if (auto pDocStyleSheet = pStyleSheet ? nullptr : m_pOwner->Find(rName, eFamily)) +{ +pStyleSheet = &Make(pDocStyleSheet->GetName(), pDocStyleSheet->GetFamily()); +UpdateStyleHierarchyFrom(pStyleSheet, pDocStyleSheet); +} -auto pStyleSheet = SfxStyleSheetPool::Find(rName, eFamily); -if (!pStyleSheet) -pStyleSheet = &Make(rName, eFamily); +return pStyleSheet; +} +void UpdateStyleHierarchyFrom(SfxStyleSheetBase* pStyleSheet, SfxStyleSheetBase* pDocStyleSheet) +{ FillItemSet(pStyleSheet, pDocStyleSheet); // Remember now, as the next calls will invalidate pDocStyleSheet. @@ -193,61 +190,50 @@ public: void FillItemSet(SfxStyleSheetBase* pDestSheet, SfxStyleSheetBase* pSourceSheet) { auto& rItemSet = pDestSheet->GetItemSet(); -if (rItemSet.Count() > 0) -return; +rItemSet.ClearItem(); auto pCol = static_cast(pSourceSheet)->GetCollection(); -if (!pCol->GetAttrSet().Count()) -return; - -const WhichRangesContainer aRanges(svl::Items); +SfxItemIter aIter(pCol->GetAttrSet()); +std::optional oLRSpaceItem; -for (const auto& range : aRanges) +for (auto pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem()) { -std::optional oLRSpaceItem; +if (aIter.GetItemState(false) != SfxItemState::SET) +continue; -for (auto i = range.first; i < range.second; ++i) +auto nWhich = pItem->Which(); +auto nSlotId = rPool.GetSlotId(nWhich); +auto nNewWhich = rPool.GetSecondaryPool()->GetWhich(nSlotId); +if (nNewWhich != nSlotId) +rItemSet.Put(pItem->CloneSetWhich(nNewWhich)); +else if (nWhich == RES_MARGIN_FIRSTLINE) { -const SfxPoolItem* pItem; -if (pCol->GetItemState(i, false, &pItem) != SfxItemState::SET) -continue; - -auto nSlotId = rPool.GetSlotId(i); -auto nNewWhich = rPool.GetSecondaryPool()->GetWhich(nSlotId); -if (nNewWhich != nSlotId) -rItemSet.Put(pItem->CloneSetWhich(nNewWhich)); -else if (i == RES_MARGIN_FIRSTLINE) -{ -if (!oLRSpaceItem) -oLRSpaceItem.emplace(EE_PARA_LRSPACE); -auto pFirstLineItem = static_cast(pItem); - (*oLRSpaceItem).SetTextFirstLineOffsetValue(pFirstLineItem->GetTextFirstLineOffset()); - (*oLRSpaceItem).SetAutoFirst(pFirstLineItem->IsAutoFirst()); -} -else if (i == RES_MARGIN_TEXTLEFT) -
[Libreoffice-commits] core.git: sw/source
sw/source/core/txtnode/OnlineAccessibilityCheck.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit df29592493367bc03c9602c924711852eecf64c4 Author: Andrea Gelmini AuthorDate: Fri Jun 23 11:59:57 2023 +0200 Commit: Julien Nabet CommitDate: Fri Jun 23 14:46:14 2023 +0200 Fix typo Change-Id: Ib72e45a25e80559b2493d0901d1a2bfacb56077b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153496 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx index 4b2dfe9237e9..025dba8c5f25 100644 --- a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx +++ b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx @@ -248,7 +248,7 @@ void OnlineAccessibilityCheck::lookForPreviousNodeAndUpdate(const SwPosition& rN return; } -// Run the docement level Accessibility Check +// Run the document level Accessibility Check runDocumentLevelAccessibilityCheck(); // Get the real previous node from index
[Libreoffice-commits] core.git: tools/source
tools/source/datetime/ttime.cxx | 12 1 file changed, 12 insertions(+) New commits: commit b07d72c6c1075efa6b64c67758566426c22c5225 Author: Eike Rathke AuthorDate: Wed Jun 21 21:46:17 2023 +0200 Commit: Eike Rathke CommitDate: Fri Jun 23 14:27:05 2023 +0200 Clamp and assert maximum hours value in Time::init() Change-Id: Ia777222f3c797b90663b55499a57025e410b1d70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153407 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx index 148bf0cbecc6..fcfa2e080e99 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -125,6 +125,18 @@ void tools::Time::init( sal_uInt32 nHour, sal_uInt32 nMin, sal_uInt32 nSec, sal_ nHour+= nMin / minInHour; nMin %= minInHour; +// 922337 * HOUR_MASK = 9223370 largest possible value, 922338 +// would be -9223364073709551616. +assert(HOUR_MASK * nHour >= 0 && "use tools::Duration with days instead!"); +if (HOUR_MASK * nHour < 0) +nHour = 922337; + +// But as is, GetHour() retrieves only sal_uInt16. Though retrieving in +// nanoseconds or milliseconds might be possible this is all crap. +assert(nHour <= SAL_MAX_UINT16 && "use tools::Duration with days instead!"); +if (nHour > SAL_MAX_UINT16) +nHour = SAL_MAX_UINT16; + // construct time nTime = nNanoSec + nSec * SEC_MASK +
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - writerfilter/source
writerfilter/source/dmapper/PropertyIds.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 1b5cee822e0bc15ddbdfc86926678ca35ab3e082 Author: Tomaž Vajngerl AuthorDate: Sun Jun 18 23:35:36 2023 +0900 Commit: Xisco Fauli CommitDate: Fri Jun 23 13:19:39 2023 +0200 use frozen::make_unordered_map so no need to specify the count Change-Id: I08057846e735028fb4634fad8b210c707905e096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153233 Tested-by: Jenkins Tested-by: Julien Nabet Reviewed-by: Julien Nabet (cherry picked from commit d7bc610a359ca7e95b3a600c03da6a0b9e6f439c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153515 Tested-by: Xisco Fauli Reviewed-by: Xisco Fauli diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index d294a3ad082c..11ef07230fad 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -26,7 +26,7 @@ namespace writerfilter::dmapper{ namespace { -constexpr frozen::unordered_map constPropertyMap +constexpr auto constPropertyMap = frozen::make_unordered_map( { { PROP_CHAR_WEIGHT, u"CharWeight"}, { PROP_CHAR_POSTURE, u"CharPosture"}, @@ -378,7 +378,7 @@ namespace { PROP_CURSOR_NOT_IGNORE_TABLES_IN_HF, u"CursorNotIgnoreTables"}, { PROP_PARA_CONNECT_BORDERS, u"ParaIsConnectBorder"}, { PROP_DECORATIVE, u"Decorative"}, -}; +}); } // end anonymous ns OUString getPropertyName( PropertyIds eId )
[Libreoffice-commits] core.git: extras/source include/svx svx/inc
extras/source/palettes/standard.sog |4 +++- include/svx/strings.hrc | 22 +++--- svx/inc/strings.hxx | 22 +++--- 3 files changed, 25 insertions(+), 23 deletions(-) New commits: commit d0a9d04d2287da456317c5a59af3ccbe3b98b977 Author: Heiko Tietze AuthorDate: Fri Jun 16 09:03:11 2023 +0200 Commit: Heiko Tietze CommitDate: Fri Jun 23 11:23:35 2023 +0200 MCGR: Some exemplary multi-color gradients * "Rainbow, Sunrise, Sunset" added * "Preset, Spotted Grey, Teal To Blue" removed to keep items inside scrolled window Change-Id: I3be6c8596accc769df92a8610260ed38a6c29602 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153166 Tested-by: Jenkins Reviewed-by: Regina Henschel Reviewed-by: Heiko Tietze diff --git a/extras/source/palettes/standard.sog b/extras/source/palettes/standard.sog index 036faa856de4..32f9d37e9411 100644 --- a/extras/source/palettes/standard.sog +++ b/extras/source/palettes/standard.sog @@ -1 +1,3 @@ -http://www.w3.org/1999/xlink"; xmlns:svg="http://www.w3.org/2000/svg"; xmlns:ooo="http://openoffice.org/2004/office";> + + +http://www.w3.org/1999/xlink"; xmlns:svg="http://www.w3.org/2000/svg"; xmlns:ooo="http://openoffice.org/2004/office"; xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"> diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index 249d01060a39..eb8ca335f91c 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -783,17 +783,17 @@ #define RID_SVXSTR_GRDT71 NC_("RID_SVXSTR_GRDT71", "Pastel Dream") #define RID_SVXSTR_GRDT72 NC_("RID_SVXSTR_GRDT72", "Blue Touch") #define RID_SVXSTR_GRDT73 NC_("RID_SVXSTR_GRDT73", "Blank with Gray") -#define RID_SVXSTR_GRDT74 NC_("RID_SVXSTR_GRDT74", "Spotted Gray") -#define RID_SVXSTR_GRDT75 NC_("RID_SVXSTR_GRDT75", "London Mist") -#define RID_SVXSTR_GRDT76 NC_("RID_SVXSTR_GRDT76", "Teal to Blue") -#define RID_SVXSTR_GRDT77 NC_("RID_SVXSTR_GRDT77", "Midnight") -#define RID_SVXSTR_GRDT78 NC_("RID_SVXSTR_GRDT78", "Deep Ocean") -#define RID_SVXSTR_GRDT79 NC_("RID_SVXSTR_GRDT79", "Submarine") -#define RID_SVXSTR_GRDT80 NC_("RID_SVXSTR_GRDT80", "Green Grass") -#define RID_SVXSTR_GRDT81 NC_("RID_SVXSTR_GRDT81", "Neon Light") -#define RID_SVXSTR_GRDT82 NC_("RID_SVXSTR_GRDT82", "Sunshine") -#define RID_SVXSTR_GRDT83 NC_("RID_SVXSTR_GRDT83", "Present") -#define RID_SVXSTR_GRDT84 NC_("RID_SVXSTR_GRDT84", "Mahogany") +#define RID_SVXSTR_GRDT74 NC_("RID_SVXSTR_GRDT74", "London Mist") +#define RID_SVXSTR_GRDT75 NC_("RID_SVXSTR_GRDT75", "Submarine") +#define RID_SVXSTR_GRDT76 NC_("RID_SVXSTR_GRDT76", "Midnight") +#define RID_SVXSTR_GRDT77 NC_("RID_SVXSTR_GRDT77", "Deep Ocean") +#define RID_SVXSTR_GRDT78 NC_("RID_SVXSTR_GRDT78", "Mahogany") +#define RID_SVXSTR_GRDT79 NC_("RID_SVXSTR_GRDT79", "Green Grass") +#define RID_SVXSTR_GRDT80 NC_("RID_SVXSTR_GRDT80", "Neon Light") +#define RID_SVXSTR_GRDT81 NC_("RID_SVXSTR_GRDT81", "Sunshine") +#define RID_SVXSTR_GRDT82 NC_("RID_SVXSTR_GRDT82", "Rainbow") +#define RID_SVXSTR_GRDT83 NC_("RID_SVXSTR_GRDT83", "Sunrise") +#define RID_SVXSTR_GRDT84 NC_("RID_SVXSTR_GRDT84", "Sunset") // /gradients #define RID_SVXSTR_HATCH0 NC_("RID_SVXSTR_HATCH0", "Black 0 Degrees") #define RID_SVXSTR_HATCH1 NC_("RID_SVXSTR_HATCH1", "Black 90 Degrees") diff --git a/svx/inc/strings.hxx b/svx/inc/strings.hxx index 1c917bee9318..17302aa13ae0 100644 --- a/svx/inc/strings.hxx +++ b/svx/inc/strings.hxx @@ -192,17 +192,17 @@ inline constexpr OUStringLiteral RID_SVXSTR_GRDT70_DEF = u inline constexpr OUStringLiteral RID_SVXSTR_GRDT71_DEF = u"Pastel Dream"; inline constexpr OUStringLiteral RID_SVXSTR_GRDT72_DEF = u"Blue Touch"; inline constexpr OUStringLiteral RID_SVXSTR_GRDT73_DEF = u"Blank with Gray"; -inline constexpr OUStringLiteral RID_SVXSTR_GRDT74_DEF = u"Spotted Gray"; -inline constexpr OUStringLiteral R
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/inc sc/source
sc/inc/patattr.hxx |4 +++- sc/source/core/data/patattr.cxx | 14 ++ 2 files changed, 17 insertions(+), 1 deletion(-) New commits: commit 2d31337e9111ff00a6575a21ad50677c9b6c08e6 Author: Noel Grandin AuthorDate: Thu Jun 22 09:38:50 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jun 23 11:12:18 2023 +0200 Speed up scrolling through large document with lots of patterns Cache visibility for use in ScPatternAttr::IsVisible Change-Id: Ia248a06b876b53115bbc3017d97538bbbc03830d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153450 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mike Kaganski Reviewed-by: Caolán McNamara diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx index 5b031f488467..d78509ca74e3 100644 --- a/sc/inc/patattr.hxx +++ b/sc/inc/patattr.hxx @@ -54,6 +54,7 @@ class SC_DLLPUBLIC ScPatternAttr final : public SfxSetItem { std::optional pName; mutable std::optional mxHashCode; +mutable std::optional mxVisible; ScStyleSheet* pStyle; sal_uInt64 mnKey; public: @@ -152,11 +153,12 @@ public: // TODO: tdf#135215: This is a band-aid to detect changes and invalidate the hash, // a proper way would be probably to override SfxItemSet::Changed(), but 6cb400f41df0dd10 // hardcoded SfxSetItem to contain SfxItemSet. -SfxItemSet& GetItemSet() { mxHashCode.reset(); return SfxSetItem::GetItemSet(); } +SfxItemSet& GetItemSet() { mxHashCode.reset(); mxVisible.reset(); return SfxSetItem::GetItemSet(); } using SfxSetItem::GetItemSet; private: voidCalcHashCode() const; +boolCalcVisible() const; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 532831f90a78..09ea27cb1e3d 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -963,6 +963,7 @@ void ScPatternAttr::GetFromEditItemSet( const SfxItemSet* pEditSet ) return; GetFromEditItemSet( GetItemSet(), *pEditSet ); mxHashCode.reset(); +mxVisible.reset(); } void ScPatternAttr::FillEditParaItems( SfxItemSet* pEditSet ) const @@ -1006,6 +1007,7 @@ void ScPatternAttr::DeleteUnchanged( const ScPatternAttr* pOldAttrs ) { rThisSet.ClearItem( nSubWhich ); mxHashCode.reset(); +mxVisible.reset(); } } else if ( eOldState != SfxItemState::DONTCARE ) @@ -1015,6 +1017,7 @@ void ScPatternAttr::DeleteUnchanged( const ScPatternAttr* pOldAttrs ) { rThisSet.ClearItem( nSubWhich ); mxHashCode.reset(); +mxVisible.reset(); } } } @@ -1036,6 +1039,7 @@ void ScPatternAttr::ClearItems( const sal_uInt16* pWhich ) for (sal_uInt16 i=0; pWhich[i]; i++) rSet.ClearItem(pWhich[i]); mxHashCode.reset(); +mxVisible.reset(); } static SfxStyleSheetBase* lcl_CopyStyleToPool @@ -1171,6 +1175,13 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD } bool ScPatternAttr::IsVisible() const +{ +if (!mxVisible) +mxVisible = CalcVisible(); +return *mxVisible; +} + +bool ScPatternAttr::CalcVisible() const { const SfxItemSet& rSet = GetItemSet(); @@ -1252,6 +1263,7 @@ void ScPatternAttr::SetStyleSheet( ScStyleSheet* pNewStyle, bool bClearDirectFor pStyle = nullptr; } mxHashCode.reset(); +mxVisible.reset(); } void ScPatternAttr::UpdateStyleSheet(const ScDocument& rDoc) @@ -1278,6 +1290,7 @@ void ScPatternAttr::UpdateStyleSheet(const ScDocument& rDoc) else pStyle = nullptr; mxHashCode.reset(); +mxVisible.reset(); } void ScPatternAttr::StyleToName() @@ -1290,6 +1303,7 @@ void ScPatternAttr::StyleToName() pStyle = nullptr; GetItemSet().SetParent( nullptr ); mxHashCode.reset(); +mxVisible.reset(); } }
Re: Unit test for bug fix tdf#155901 MCGR: preserve first and last gradient stop too
Hi Xisco, Xisco Fauli schrieb am 23.06.2023 um 09:58: Hi Regina, I can do it. Just go ahead and push it once you think the patch is ready. Then I can create the UItests based on the scenarios described in your email. Thanks. Kind regards, Regina
[Libreoffice-commits] core.git: cui/source include/svx sd/source svx/source
cui/source/inc/cuitabarea.hxx |8 +- cui/source/tabpages/tpgradnt.cxx | 25 +--- cui/source/tabpages/tptrans.cxx | 28 + include/svx/sidebar/AreaPropertyPanelBase.hxx |4 - include/svx/sidebar/AreaTransparencyGradientPopup.hxx |4 - sd/source/ui/sidebar/SlideBackground.cxx | 25 +--- sd/source/ui/sidebar/SlideBackground.hxx |4 - svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 33 +++ svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx | 42 -- 9 files changed, 105 insertions(+), 68 deletions(-) New commits: commit bb19bda1dc620f0f8662776d9818aedf45486994 Author: Regina Henschel AuthorDate: Wed Jun 21 15:01:20 2023 +0200 Commit: Regina Henschel CommitDate: Fri Jun 23 10:54:24 2023 +0200 tdf#155901 MCGR: preserve first and last gradient stop too Error was, that only the in-between gradient stops were preserve. First stop was set with fixed offset 0, last stop with fixed offset 1. The offsets of first and last gradient stop of the original gradient were lost. Now in all cases (hopefully) the complete gradient stops vector is preserved and the original offset is used, if e.g. the user changes the color. For calculating transparence the indirect way over Color is removed. Instead percent is directly transformed to the 0..1 values of BColor. That avoids rounding errors. Change-Id: Icdf699a6c2e9c6289d2f77033858448e58396a60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153395 Tested-by: Jenkins Reviewed-by: Regina Henschel diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 2d6c713236da..4e766c76e57d 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -169,7 +169,7 @@ class SvxTransparenceTabPage : public SfxTabPage std::unique_ptr m_xCtlBitmapPreview; std::unique_ptr m_xCtlXRectPreview; -// MCGR: Preserve in-between ColorStops until we have an UI to edit these +// MCGR: Preserve ColorStops until we have a UI to edit these basegfx::BColorStops maColorStops; DECL_LINK(ClickTransOffHdl_Impl, weld::Toggleable&, void); @@ -187,7 +187,7 @@ class SvxTransparenceTabPage : public SfxTabPage bool InitPreview ( const SfxItemSet& rSet ); void InvalidatePreview (bool bEnable = true ); -// MCGR: Preserve in-between ColorStops until we have an UI to edit these +// MCGR: Preserve ColorStops until we have a UI to edit these basegfx::BColorStops createColorStops(); public: @@ -367,7 +367,7 @@ private: XFillAttrSetItemm_aXFillAttr; SfxItemSet& m_rXFSet; -// MCGR: Preserve in-between ColorStops until we have an UI to edit these +// MCGR: Preserve ColorStops until we have a UI to edit these basegfx::BColorStops m_aColorStops; SvxXRectPreview m_aCtlPreview; @@ -409,7 +409,7 @@ private: void SetControlState_Impl( css::awt::GradientStyle eXGS ); sal_Int32 SearchGradientList(std::u16string_view rGradientName); -// MCGR: Preserve in-between ColorStops until we have an UI to edit these +// MCGR: Preserve ColorStops until we have a UI to edit these basegfx::BColorStops createColorStops(); public: diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 7f6630747a42..d3d066236ae1 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -548,9 +548,11 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl() m_xLbColorTo->SetNoSelection(); m_xLbColorTo->SelectEntry(Color(pGradient->GetColorStops().back().getStopColor())); -// MCGR: preserve in-between ColorStops if given -if (pGradient->GetColorStops().size() > 2) -m_aColorStops = basegfx::BColorStops(pGradient->GetColorStops().begin() + 1, pGradient->GetColorStops().end() - 1); +// MCGR: preserve ColorStops if given. +// tdf#155901 We need offset of first and last stop, so include them. +if (pGradient->GetColorStops().size() >= 2) +m_aColorStops = basegfx::BColorStops(pGradient->GetColorStops().begin(), + pGradient->GetColorStops().end()); else m_aColorStops.clear(); @@ -641,14 +643,19 @@ basegfx::BColorStops SvxGradientTabPage::createColorStops() { basegfx::BColorStops aColorStops; -aColorStops.emplace_back(0.0, m_xLbColorFrom->GetSelectEntryColor().getBColor()); - -if(!m_aColorStops.empty()) +if(m_aColorStops.size() >= 2) { -aColorStops.insert(aColorStops.begin(), m_aColorStops.begin(), m_aColorStops.end()); +aColorStops.emplace_back(m_aColorStops.front().getStopOffset(), + m_xLbColorFrom->GetSelectEntryColor().getBColor()); +aColorStops.insert(aColorStops.
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/patattr.hxx |4 +++- sc/source/core/data/patattr.cxx | 14 ++ 2 files changed, 17 insertions(+), 1 deletion(-) New commits: commit 8ec8d592e31aebe19075e9f89c4c2c7abcf8d420 Author: Noel Grandin AuthorDate: Thu Jun 22 09:38:50 2023 +0200 Commit: Noel Grandin CommitDate: Fri Jun 23 10:36:53 2023 +0200 Speed up scrolling through large document with lots of patterns Cache visibility for use in ScPatternAttr::IsVisible Change-Id: Ia248a06b876b53115bbc3017d97538bbbc03830d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153482 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx index ba15cfb1dd27..4d7df0c6ac23 100644 --- a/sc/inc/patattr.hxx +++ b/sc/inc/patattr.hxx @@ -54,6 +54,7 @@ class SC_DLLPUBLIC ScPatternAttr final : public SfxSetItem { std::optional pName; mutable std::optional mxHashCode; +mutable std::optional mxVisible; ScStyleSheet* pStyle; sal_uInt64 mnKey; public: @@ -184,11 +185,12 @@ public: // TODO: tdf#135215: This is a band-aid to detect changes and invalidate the hash, // a proper way would be probably to override SfxItemSet::Changed(), but 6cb400f41df0dd10 // hardcoded SfxSetItem to contain SfxItemSet. -SfxItemSet& GetItemSet() { mxHashCode.reset(); return SfxSetItem::GetItemSet(); } +SfxItemSet& GetItemSet() { mxHashCode.reset(); mxVisible.reset(); return SfxSetItem::GetItemSet(); } using SfxSetItem::GetItemSet; private: voidCalcHashCode() const; +boolCalcVisible() const; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 706ab6ae5c19..199d41ab25f1 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -981,6 +981,7 @@ void ScPatternAttr::GetFromEditItemSet( const SfxItemSet* pEditSet ) return; GetFromEditItemSet( GetItemSet(), *pEditSet ); mxHashCode.reset(); +mxVisible.reset(); } void ScPatternAttr::FillEditParaItems( SfxItemSet* pEditSet ) const @@ -1024,6 +1025,7 @@ void ScPatternAttr::DeleteUnchanged( const ScPatternAttr* pOldAttrs ) { rThisSet.ClearItem( nSubWhich ); mxHashCode.reset(); +mxVisible.reset(); } } else if ( eOldState != SfxItemState::DONTCARE ) @@ -1033,6 +1035,7 @@ void ScPatternAttr::DeleteUnchanged( const ScPatternAttr* pOldAttrs ) { rThisSet.ClearItem( nSubWhich ); mxHashCode.reset(); +mxVisible.reset(); } } } @@ -1054,6 +1057,7 @@ void ScPatternAttr::ClearItems( const sal_uInt16* pWhich ) for (sal_uInt16 i=0; pWhich[i]; i++) rSet.ClearItem(pWhich[i]); mxHashCode.reset(); +mxVisible.reset(); } static SfxStyleSheetBase* lcl_CopyStyleToPool @@ -1189,6 +1193,13 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD } bool ScPatternAttr::IsVisible() const +{ +if (!mxVisible) +mxVisible = CalcVisible(); +return *mxVisible; +} + +bool ScPatternAttr::CalcVisible() const { const SfxItemSet& rSet = GetItemSet(); @@ -1312,6 +1323,7 @@ void ScPatternAttr::SetStyleSheet( ScStyleSheet* pNewStyle, bool bClearDirectFor pStyle = nullptr; } mxHashCode.reset(); +mxVisible.reset(); } void ScPatternAttr::UpdateStyleSheet(const ScDocument& rDoc) @@ -1338,6 +1350,7 @@ void ScPatternAttr::UpdateStyleSheet(const ScDocument& rDoc) else pStyle = nullptr; mxHashCode.reset(); +mxVisible.reset(); } void ScPatternAttr::StyleToName() @@ -1350,6 +1363,7 @@ void ScPatternAttr::StyleToName() pStyle = nullptr; GetItemSet().SetParent( nullptr ); mxHashCode.reset(); +mxVisible.reset(); } }
[Libreoffice-commits] core.git: sw/source
sw/source/core/access/AccessibilityCheck.cxx| 19 +-- sw/source/core/txtnode/OnlineAccessibilityCheck.cxx | 10 -- 2 files changed, 17 insertions(+), 12 deletions(-) New commits: commit 1dc60ddafbbc1b1e8612cf1263f6987a1f3417b6 Author: Balazs Varga AuthorDate: Thu Jun 22 18:48:10 2023 +0200 Commit: Samuel Mehrbrodt CommitDate: Fri Jun 23 10:31:08 2023 +0200 tdf#152576 - A11Y sidebar: improving update of issues on sidebar Put the empty paragraph nodes to the correct WeakNodeContainer. Change-Id: I2db5608b0f7a625b6221d9290ea3d2502f4cadea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153469 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index ec2a101795e5..b9eeaafc6171 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -683,21 +683,20 @@ public: class NewlineSpacingCheck : public NodeCheck { private: -static SwTextNode* getNextTextNode(SwNode* pCurrent) +static SwTextNode* getPrevTextNode(SwNode* pCurrent) { SwTextNode* pTextNode = nullptr; auto nIndex = pCurrent->GetIndex(); -auto nCount = pCurrent->GetNodes().Count(); -nIndex++; // go to next node +nIndex--; // go to previous node -while (pTextNode == nullptr && nIndex < nCount) +while (pTextNode == nullptr && nIndex >= SwNodeOffset(0)) { auto pNode = pCurrent->GetNodes()[nIndex]; if (pNode->IsTextNode()) pTextNode = pNode->GetTextNode(); -nIndex++; +nIndex--; } return pTextNode; @@ -721,16 +720,16 @@ public: auto nParagraphLength = pTextNode->GetText().getLength(); if (nParagraphLength == 0) { -SwTextNode* pNextTextNode = getNextTextNode(pCurrent); -if (!pNextTextNode) +SwTextNode* pPrevTextNode = getPrevTextNode(pCurrent); +if (!pPrevTextNode) return; -if (pNextTextNode->GetText().getLength() == 0) +if (pPrevTextNode->GetText().getLength() == 0) { auto pIssue = lclAddIssue(m_rIssueCollection, SwResId(STR_AVOID_NEWLINES_SPACE), sfx::AccessibilityIssueID::TEXT_FORMATTING); pIssue->setIssueObject(IssueObject::TEXT); -pIssue->setNode(pNextTextNode); -SwDoc& rDocument = pNextTextNode->GetDoc(); +pIssue->setNode(pTextNode); +SwDoc& rDocument = pTextNode->GetDoc(); pIssue->setDoc(rDocument); } } diff --git a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx index d39443313c6f..4b2dfe9237e9 100644 --- a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx +++ b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx @@ -248,15 +248,16 @@ void OnlineAccessibilityCheck::lookForPreviousNodeAndUpdate(const SwPosition& rN return; } +// Run the docement level Accessibility Check +runDocumentLevelAccessibilityCheck(); + // Get the real previous node from index SwNode* pNode = pCurrentNode->GetNodes()[m_nPreviousNodeIndex]; if (pNode && (pNode->IsContentNode() || pNode->IsTableNode())) { -runDocumentLevelAccessibilityCheck(); runAccessibilityCheck(pNode); updateNodeStatus(pNode); -updateStatusbar(); // Assign previous node and index m_pPreviousNode = std::move(pCurrentWeak); @@ -264,9 +265,14 @@ void OnlineAccessibilityCheck::lookForPreviousNodeAndUpdate(const SwPosition& rN } else { +runAccessibilityCheck(pCurrentNode); +updateNodeStatus(pCurrentNode); + m_pPreviousNode.reset(); m_nPreviousNodeIndex = SwNodeOffset(-1); } + +updateStatusbar(); } void OnlineAccessibilityCheck::clearAccessibilityIssuesFromAllNodes()
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/uitest/writer_tests/trackedChanges.py | 65 sw/source/uibase/inc/redlndlg.hxx |3 + sw/source/uibase/misc/redlndlg.cxx | 13 + 3 files changed, 80 insertions(+), 1 deletion(-) New commits: commit 952fb2a4386a6ae2187b646e372131a5345f59fe Author: László Németh AuthorDate: Thu Jun 22 17:33:16 2023 +0200 Commit: László Németh CommitDate: Fri Jun 23 10:29:33 2023 +0200 tdf#155847 sw tracked table column: fix crash in Manage Changes In Manage Changes dialog window, accept/Reject multiple tracked table columns need major tree list update because of not continuous redline ranges in the child lists of the multiple tree list parents, otherwise assert/crash could occur. Follow-up to commit 4a40a42afc3ba551e6e58947fc2e44689979b629 "tdf#155847 sw tracked table column: manage multiple changes". Change-Id: I3c7f61d35cbb433067c1f4fd28b80ad7da8ba12e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153464 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/uitest/writer_tests/trackedChanges.py b/sw/qa/uitest/writer_tests/trackedChanges.py index 0b0c38d27533..8681140bb695 100644 --- a/sw/qa/uitest/writer_tests/trackedChanges.py +++ b/sw/qa/uitest/writer_tests/trackedChanges.py @@ -597,4 +597,69 @@ class trackedchanges(UITestCase): self.assertEqual(0, len(changesList.getChildren())) +def test_tdf155847_multiple_tracked_columns_crash(self): +with self.ui_test.load_file(get_url_for_data_file("TC-table-del-add.docx")) as document: + +xWriterDoc = self.xUITest.getTopFocusWindow() +xWriterEdit = xWriterDoc.getChild("writer_edit") + +# accept all changes and insert new columns with change tracking +self.xUITest.executeCommand(".uno:AcceptAllTrackedChanges") +tables = document.getTextTables() +self.assertEqual(2, len(tables)) +self.assertEqual(len(tables[0].getColumns()), 3) +self.xUITest.executeCommand(".uno:InsertColumnsAfter") +self.xUITest.executeCommand(".uno:DeleteColumns") +self.assertEqual(len(tables[0].getColumns()), 4) + +xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') +xToolkit.processEventsToIdle() + +# check and reject changes +with self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges", close_button="close") as xTrackDlg: +changesList = xTrackDlg.getChild("writerchanges") + +# six changes, but only one visible in the Manage Changes dialog window +state = get_state_as_dict(changesList) +self.assertEqual(state['Children'], '6') + +# This was 4 (missing handling of multiple different columns) +self.assertEqual(state['VisibleCount'], '2') +# Now: 2 changes (deleted and inserted columns) +self.assertEqual(2, len(changesList.getChildren())) + +# select second tracked table column in tree list +xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') +changesList.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"})) + +# while not empty, i.e. starts with CH_TXT_TRACKED_DUMMY_CHAR +while len(get_state_as_dict(xWriterEdit)["SelectedText"]): +xToolkit.processEventsToIdle() + +# reject column insertion + +xAccBtn = xTrackDlg.getChild("reject") +# Without the fix in place, it would have crashed here +xAccBtn.executeAction("CLICK", tuple()) + +# inserted column is removed + +self.assertEqual(len(tables[0].getColumns()), 3) + +# single parent left in the dialog window +self.assertEqual(1, len(changesList.getChildren())) + +# accept column deletion + +xAccBtn = xTrackDlg.getChild("accept") +xAccBtn.executeAction("CLICK", tuple()) + +# deleted column is removed + +self.assertEqual(len(tables[0].getColumns()), 2) + +# no changes in the dialog window + +self.assertEqual(0, len(changesList.getChildren())) + # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx index 7337f1fadce4..c8cfd8cc8262 100644 --- a/sw/source/uibase/inc/redlndlg.hxx +++ b/sw/source/uibase/inc/redlndlg.hxx @@ -77,6 +77,9 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg final // prevent update dialog data during longer operations (cf #102657#) boolm_bInhibitActivate; +// table column changes have not continuous redline ranges: it needs major
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source
sc/source/ui/view/output2.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 68bbbfd3b93c546c8004e916ea58a4c16f95c648 Author: Czeber László Ádám AuthorDate: Mon Jun 12 16:12:05 2023 +0200 Commit: László Németh CommitDate: Fri Jun 23 10:23:59 2023 +0200 tdf#122676 sc: fix format with * (filling) and NBSP thousand separator Numbers containing no-break space (NBSP) thousand separator enabled the EditEngine layout, losing filling e.g. for stretching spaces. Enable EditEngine for NBSP characters only if there is no filling in the number format code, fixing MSO interoperability, too. In number format codes, asterisk (*) followed by a character is used to fill the available space in the column with that character, e.g. format code [>0]" "* # ##0" € ";[<0]-* # ##0" € ";" "* -#" € ";" "@" " put the minus sign at the left side of the column, while the number at the right side of the column. Because of the NBSP thousand separator, bigger numbers got different layout previously, i.e. minus signs right next to the numbers. Note: there is a better solution for the layout problem: using narrow no-break space (U-202F), which is the proposed thousand separator in typography, and it's back-compatible, because it doesn't enable the different layout. Change-Id: Ia35f01733687ee6005f06ff3ab999b7a4b712ad4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152901 Reviewed-by: László Németh Tested-by: László Németh (cherry picked from commit c60700711caff1fc61e5219abdb17c535ea4459d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153336 Tested-by: Jenkins diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 46d26860976e..d8dfb064e605 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -815,6 +815,11 @@ bool ScDrawStringsVars::HasEditCharacters() const switch(aString[nIdx]) { case CHAR_NBSP: +// tdf#122676: Ignore CHAR_NBSP (this is thousand separator in any number) +// if repeat character is set +if (nRepeatPos < 0) +return true; +break; case CHAR_SHY: case CHAR_ZWSP: case CHAR_LRM:
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/AccessibilityCheckStrings.hrc|1 sw/inc/OnlineAccessibilityCheck.hxx |6 sw/source/core/access/AccessibilityCheck.cxx|6 ++-- sw/source/core/access/AccessibilityIssue.cxx| 28 ++-- sw/source/core/inc/AccessibilityIssue.hxx |1 sw/source/core/txtnode/OnlineAccessibilityCheck.cxx | 15 ++ sw/source/uibase/uiview/view2.cxx |3 +- 7 files changed, 55 insertions(+), 5 deletions(-) New commits: commit bbb104ea2b8f3e48273f316cfad406e904a2f331 Author: Balazs Varga AuthorDate: Tue Jun 20 15:38:40 2023 +0200 Commit: Samuel Mehrbrodt CommitDate: Fri Jun 23 10:17:29 2023 +0200 tdf#155503 - A11Y sidebar: Add quick fix action to set document title Add fix button to set the document title. Fix updates issue of document level changes. Change-Id: Ibab5cab3b595de4df68c3022a5864b2d2d4bed2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153352 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/sw/inc/AccessibilityCheckStrings.hrc b/sw/inc/AccessibilityCheckStrings.hrc index 12e2e1fa2b8d..0efaee64ca4b 100644 --- a/sw/inc/AccessibilityCheckStrings.hrc +++ b/sw/inc/AccessibilityCheckStrings.hrc @@ -40,6 +40,7 @@ #define STR_DOCUMENT_DEFAULT_LANGUAGE NC_("STR_DOCUMENT_DEFAULT_LANGUAGE", "Document default language is not set.") #define STR_STYLE_NO_LANGUAGE NC_("STR_STYLE_NO_LANGUAGE", "Style “%STYLE_NAME%” has no language set.") #define STR_DOCUMENT_TITLE NC_("STR_DOCUMENT_TITLE", "Document title is not set.") +#define STR_ENTER_DOCUMENT_TITLENC_("STR_ENTER_DOCUMENT_TITLE", "Enter document title:") #define STR_ENTER_ALT NC_("STR_ENTER_ALT", "Enter alternative text:") diff --git a/sw/inc/OnlineAccessibilityCheck.hxx b/sw/inc/OnlineAccessibilityCheck.hxx index fc158e28db7e..1055c7e67d53 100644 --- a/sw/inc/OnlineAccessibilityCheck.hxx +++ b/sw/inc/OnlineAccessibilityCheck.hxx @@ -67,8 +67,14 @@ public: OnlineAccessibilityCheck(SwDoc& rDocument); void update(SwPosition const& rNewPos); void resetAndQueue(SwNode* pNode); +void resetAndQueueDocumentLevel(); void updateCheckerActivity(); sal_Int32 getNumberOfAccessibilityIssues() { return m_nAccessibilityIssues; } +sal_Int32 getNumberOfDocumentLevelAccessibilityIssues() +{ +return m_pDocumentAccessibilityIssues ? m_pDocumentAccessibilityIssues->getIssues().size() + : sal_Int32(0); +} }; } // end sw diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 802ad2c8dea3..ec2a101795e5 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -1263,8 +1263,10 @@ public: OUString sTitle = xDocumentProperties->getTitle(); if (o3tl::trim(sTitle).empty()) { -lclAddIssue(m_rIssueCollection, SwResId(STR_DOCUMENT_TITLE), -sfx::AccessibilityIssueID::DOCUMENT_TITLE); +auto pIssue = lclAddIssue(m_rIssueCollection, SwResId(STR_DOCUMENT_TITLE), + sfx::AccessibilityIssueID::DOCUMENT_TITLE); +pIssue->setDoc(*pDoc); +pIssue->setIssueObject(IssueObject::DOCUMENT_TITLE); } } }; diff --git a/sw/source/core/access/AccessibilityIssue.cxx b/sw/source/core/access/AccessibilityIssue.cxx index d1ebb53bdeeb..d0366b1ef3e2 100644 --- a/sw/source/core/access/AccessibilityIssue.cxx +++ b/sw/source/core/access/AccessibilityIssue.cxx @@ -8,6 +8,8 @@ * */ +#include + #include #include #include @@ -42,7 +44,8 @@ void AccessibilityIssue::setObjectID(OUString const& rID) { m_sObjectID = rID; } bool AccessibilityIssue::canGotoIssue() const { -if (m_pDoc && m_eIssueObject != IssueObject::UNKNOWN) +if (m_pDoc && m_eIssueObject != IssueObject::UNKNOWN +&& m_eIssueObject != IssueObject::DOCUMENT_TITLE) return true; return false; } @@ -119,7 +122,8 @@ void AccessibilityIssue::gotoIssue() const bool AccessibilityIssue::canQuickFixIssue() const { return m_eIssueObject == IssueObject::GRAPHIC || m_eIssueObject == IssueObject::OLE - || m_eIssueObject == IssueObject::SHAPE || m_eIssueObject == IssueObject::FORM; + || m_eIssueObject == IssueObject::SHAPE || m_eIssueObject == IssueObject::FORM + || m_eIssueObject == IssueObject::DOCUMENT_TITLE; } void AccessibilityIssue::quickFixIssue() const @@ -158,6 +162,26 @@ void AccessibilityIssue::quickFixIssue() const } } break; +case IssueObject::DOCUMENT_TITLE: +{ +OUString aDesc = SwResId(STR_ENTER_DOCUMENT_TITLE); +SvxNameDialog aNameDialog(m_pParent, "", aDesc); +if (aNameDialog.run() == RET_OK
Re: Unit test for bug fix tdf#155901 MCGR: preserve first and last gradient stop too
Hi Regina, I can do it. Just go ahead and push it once you think the patch is ready. Then I can create the UItests based on the scenarios described in your email. On 21/6/23 19:20, Regina Henschel wrote: Hi all, tdf#155901 MCGR: preserve first and last gradient stop too https://gerrit.libreoffice.org/c/core/+/153395 fixes a bug in the Gradient tab of the Area dialog or the sidebar respectively. Because the test needs to act on the dialog, I do not see how to do that in a cppunit-test. The below described scenarios has to be tested. Would someone be so kind and write a unit test? Or guide me how to do it? I'm working on Windows; I'm not sure whether it is possible on Windows at all. Kind regards, Regina (A) Open attached document. Select the only shape. Open Area dialog, e.g. from context menu. Go to Area tab, if dialog is not already there. Click on Gradient button, if not already active. Change 'To color' field to e.g. White. OK. Inspect the property 'FillGradient' of the shape. Look at element [3] in its 'ColorStops' component. That is the last element in the sequence. Assert that its 'StopOffset' attribute still has value 0.7 Whitout fix the value was 1. That means changing the color of the stop had changed its offset. Look at element [0] in its 'ColorStops' component. That is the first element in the sequence. Assert that its StopOffset attribute still has value 0.3 Without fix the value was 0. (B) Open attached document. Select the only shape. Go to properties pane of the sidebar. If the 'Fill' list does not have 'Gradient' active, deselect the shape and select it again (an old bug not related to MCGR). Change the 'Fill gradient to' field to White. Inspect... same as in (A) (C) Open attached document. Select the only shape. Go to Gradient page of the Area dialog again. Click the Add button. A box opens to enter a name. Do that. Ok. Inspect... same as in (A). -- Xisco Faulí LibreOffice QA Team IRC: x1sc0
Re: ESC budget ranking vote
On 6/22/23 20:47, Ilmari Lauhakangas wrote: Per the decision in the ESC budget review meeting today, below is the ranking of budget items to be submitted to TDF board of directors. Non-conflicted ESC members: please give your approval of the ranking by replying to this mail. +1 Stephan + Cleanup & further improve ODF conformance (2021) + Convert Impress slideshow to drawinglayer primitives (2021) + Writer tables: support cell margins (next to cell padding) (2021) + Font subsetter for font embedding (2022) + XLSX Aggressive Competitors tracker: gridlines for 3d line charts (2022) + Look-ahead styleref field for Writer (2022) + Normalized spell checking (2022) + Remove/Replace usages of XOR-Paint (2022) + ODT export nondeterminism (2022) + Bitmaps in vcl: Merge RGB and A layer into one (2022) + Allow inline graphics, formulas in impress (and draw), open equation with inline formulas from PPT, PPS, PPTX, PPSX (ranked 1 in Feb 2023) + Make Firebird implementation production-ready (ranked 3 in Feb 2023) + SVG rendering improvements (ranked 4 in Feb 2023) + Rotated Writer TextFrames (ranked 9 in Feb 2023) + XLSX Aggressive Competitors tracker: support math equations in Calc shapes (ranked 12 in Feb 2023) + Slideshow: rendering content on top of videos (ranked 19 in Feb 2023) + Missing ODF Features: Attribute svg:d of some of the possible commands are missing (ranked 30 in Feb 2023) + Missing ODF Features: The attribute draw:text-rotate-angle is interpreted, but there exists no user interface to change it. (ranked 33 in Feb 2023) + Missing ODF Feature: missing completely (ranked 33 in Feb 2023) + Missing ODF Features: Draw:shadow-offset-x/y only partially implemented (ranked 38 in Feb 2023) + Replace remaining Carbon functions with non-Carbon functions (macOS) (ranked 38 in Feb 2023) + Tests for drawinglayer and basegfx (ranked 41 in Feb 2023)
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa sw/source
sw/qa/extras/uiwriter/uiwriter2.cxx | 19 +++ sw/source/core/crsr/crsrsh.cxx | 10 ++ 2 files changed, 29 insertions(+) New commits: commit ed8247bdcf8e97eaee9698a2a7874fcb0fe28146 Author: Michael Stahl AuthorDate: Fri Jun 9 13:59:58 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jun 23 09:53:35 2023 +0200 tdf#155939 sw: fix infinite loop when changing document language If there's a footnote in the document, changing the document langauge goes into an infinite loop in FindParentText(), because the selection created by ExtendedSelectAll(true) is actually invalid, apparently the intention is that only very limited functions may be called while it is active. Don't handle this invalid "very" extended selection like one created by ExtendedSelectAll(false). (regression from commit d81379db730a163c5ff75d4f3a3cddbd7b5eddda) Change-Id: Icf1032715cf2e0a05bf485039c483440c08bb6bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152797 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit ca9341cf60f3f9350662d30b61f6eadefca24667) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152819 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 1ac7b41988d1..c41a31945966 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -18,6 +18,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -175,6 +179,21 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf101534) CPPUNIT_ASSERT(aSet.HasItem(RES_LR_SPACE)); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testExtendedSelectAllHang) +{ +createSwDoc(); +SwDoc* const pDoc = getSwDoc(); +SwWrtShell* const pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + +pWrtShell->InsertFootnote(""); +pWrtShell->StartOfSection(); +SwView* pView = pDoc->GetDocShell()->GetView(); +SfxStringItem aLangString(SID_LANGUAGE_STATUS, "Default_Spanish (Bolivia)"); +// this looped +pView->GetViewFrame()->GetDispatcher()->ExecuteList(SID_LANGUAGE_STATUS, SfxCallMode::SYNCHRON, +{ &aLangString }); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineMoveInsertInDelete) { createSwDoc(); diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 03cecdbbd8bf..f234c9db5b8d 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -867,6 +867,16 @@ SwNode const* SwCursorShell::ExtendedSelectedAll() const typename SwCursorShell::StartsWith SwCursorShell::StartsWith_() { SwShellCursor const*const pShellCursor = getShellCursor(false); +// first, check if this is invalid; ExtendedSelectAll(true) may result in +// a) an ordinary selection that is valid +// b) a selection that is extended +// c) a selection that is invalid and will cause FindParentText to loop +SwNode const& rEndOfExtras(GetDoc()->GetNodes().GetEndOfExtras()); +if (pShellCursor->Start()->nNode.GetIndex() <= rEndOfExtras.GetIndex() +&& rEndOfExtras.GetIndex() < pShellCursor->End()->nNode.GetIndex()) +{ +return StartsWith::None; // *very* extended, no ExtendedSelectedAll handling! +} SwStartNode const*const pStartNode(FindParentText(*pShellCursor)); if (auto const ret = ::StartsWith(*pStartNode); ret != StartsWith::None) {
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/source
sc/source/ui/inc/select.hxx | 10 - sc/source/ui/view/select.cxx | 266 +-- 2 files changed, 138 insertions(+), 138 deletions(-) New commits: commit 8276b9593a2a9e3a0d5aaeaadd64369667120303 Author: Henry Castro AuthorDate: Wed Jun 21 11:15:58 2023 -0400 Commit: Caolán McNamara CommitDate: Fri Jun 23 09:51:00 2023 +0200 sc: prefix m_* ScViewFunctionSet class members .. Change-Id: Ic16ae0fc6580e350444576a087c333d52296ec5e Signed-off-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153405 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sc/source/ui/inc/select.hxx b/sc/source/ui/inc/select.hxx index ea3082f972c6..e1223f91e793 100644 --- a/sc/source/ui/inc/select.hxx +++ b/sc/source/ui/inc/select.hxx @@ -40,12 +40,12 @@ public: class ScViewFunctionSet : public FunctionSet// View (Gridwin / keyboard) { private: -ScViewData* pViewData; -ScViewSelectionEngine* pEngine; +ScViewData* m_pViewData; +ScViewSelectionEngine* m_pEngine; -boolbAnchor; -boolbStarted; -ScAddress aAnchorPos; +boolm_bAnchor; +boolm_bStarted; +ScAddress m_aAnchorPos; ScSplitPos GetWhich() const; diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx index 3dbe74373237..dc85bb8ef041 100644 --- a/sc/source/ui/view/select.cxx +++ b/sc/source/ui/view/select.cxx @@ -44,27 +44,27 @@ static bool bDidSwitch = false; // View (Gridwin / keyboard) ScViewFunctionSet::ScViewFunctionSet( ScViewData* pNewViewData ) : -pViewData( pNewViewData ), -pEngine( nullptr ), -bAnchor( false ), -bStarted( false ) +m_pViewData( pNewViewData ), +m_pEngine( nullptr ), +m_bAnchor( false ), +m_bStarted( false ) { -OSL_ENSURE(pViewData, "ViewData==0 at FunctionSet"); +OSL_ENSURE(m_pViewData, "ViewData==0 at FunctionSet"); } ScSplitPos ScViewFunctionSet::GetWhich() const { -if (pEngine) -return pEngine->GetWhich(); +if (m_pEngine) +return m_pEngine->GetWhich(); else -return pViewData->GetActivePart(); +return m_pViewData->GetActivePart(); } sal_uLong ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos, bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll ) { sal_uLong nUpdateInterval = SELENG_AUTOREPEAT_INTERVAL_MAX; -vcl::Window* pWin = pEngine->GetWindow(); +vcl::Window* pWin = m_pEngine->GetWindow(); tools::Rectangle aScrRect = pWin->GetDesktopRectPixel(); Point aRootPos = pWin->OutputToAbsoluteScreenPixel(Point(0,0)); if (bRightScroll) @@ -124,7 +124,7 @@ sal_uLong ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const Poi } #ifdef _WIN32 -ScTabViewShell* pViewShell = pViewData->GetViewShell(); +ScTabViewShell* pViewShell = m_pViewData->GetViewShell(); bool bRefMode = pViewShell && pViewShell->IsRefInputMode(); if (bRefMode && nUpdateInterval < SC_SELENG_REFMODE_UPDATE_INTERVAL_MIN) // Lower the update interval during ref mode, because re-draw can be @@ -139,25 +139,25 @@ sal_uLong ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const Poi void ScViewFunctionSet::SetSelectionEngine( ScViewSelectionEngine* pSelEngine ) { -pEngine = pSelEngine; +m_pEngine = pSelEngine; } // Drag & Drop void ScViewFunctionSet::BeginDrag() { -SCTAB nTab = pViewData->GetTabNo(); +SCTAB nTab = m_pViewData->GetTabNo(); SCCOL nPosX; SCROW nPosY; -if (pEngine) +if (m_pEngine) { -Point aMPos = pEngine->GetMousePosPixel(); -pViewData->GetPosFromPixel( aMPos.X(), aMPos.Y(), GetWhich(), nPosX, nPosY ); +Point aMPos = m_pEngine->GetMousePosPixel(); +m_pViewData->GetPosFromPixel( aMPos.X(), aMPos.Y(), GetWhich(), nPosX, nPosY ); } else { -nPosX = pViewData->GetCurX(); -nPosY = pViewData->GetCurY(); +nPosX = m_pViewData->GetCurX(); +nPosY = m_pViewData->GetCurY(); } ScModule* pScMod = SC_MOD(); @@ -165,24 +165,24 @@ void ScViewFunctionSet::BeginDrag() if (bRefMode) return; -pViewData->GetView()->FakeButtonUp( GetWhich() ); // ButtonUp is swallowed +m_pViewData->GetView()->FakeButtonUp( GetWhich() ); // ButtonUp is swallowed -ScMarkData& rMark = pViewData->GetMarkData(); +ScMarkData& rMark = m_pViewData->GetMarkData(); rMark.MarkToSimple(); if ( !rMark.IsMarked() || rMark.IsMultiMarked() ) return; ScDocumentUniquePtr pClipDoc(new ScDocument( SCDOCMODE_CLIP )); // bApi = TRUE -> no error messages -bool bCopied = pViewData->GetView()->CopyToClip( pClipDoc.get(),
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source
sw/source/core/undo/docundo.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 001ef1ee056a74247e9a6229f466aa268e6765c7 Author: Szymon Kłos AuthorDate: Thu Jun 22 16:46:22 2023 +0200 Commit: Michael Meeks CommitDate: Fri Jun 23 09:18:40 2023 +0200 lok: use correct shell when doing undo When doing undo we save EditShell reference in the context object. Later it is used to get cursor we want to move to the place where modification was done (in sw/source/core/undo/unins.cxx:281). In LOK case when 2 different sessions were used and undo was done by user A - then user's B cursor was moved. This fixes that issue. We use current shell instead of getting it indirectly through SwDoc::GetEditShell() Change-Id: I7a10ea98587f48818e8d0aaa9ad739d4eed514f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153461 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx index a9efc248259a..57202fe3632a 100644 --- a/sw/source/core/undo/docundo.cxx +++ b/sw/source/core/undo/docundo.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -666,7 +667,10 @@ bool UndoManager::impl_DoUndoRedo(UndoOrRedoType undoOrRedo, size_t nUndoOffset) UnoActionContext c(& rDoc); // exception-safe StartAllAction/EndAllAction -SwEditShell *const pEditShell(rDoc.GetEditShell()); +SwView* pViewShell = dynamic_cast(SfxViewShell::Current()); +SwEditShell *const pEditShell( +comphelper::LibreOfficeKit::isActive() && pViewShell ? pViewShell->GetWrtShellPtr() +: rDoc.GetEditShell()); OSL_ENSURE(pEditShell, "sw::UndoManager needs a SwEditShell!"); if (!pEditShell) {