[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - dbaccess/source
dbaccess/source/ui/uno/copytablewizard.cxx | 68 ++--- 1 file changed, 33 insertions(+), 35 deletions(-) New commits: commit 32d3db8d35c7de98bec8e2b6888ad04237be7f35 Author: Noel Grandin AuthorDate: Fri Oct 28 11:28:58 2022 +0200 Commit: Aron Budea CommitDate: Sun Nov 20 04:23:39 2022 +0100 make ValueTransfer easier to understand storing references to local variables makes it harder to figure out what the control flow is doing. Change-Id: Ifa7fedd6e4be19a0aa8180aa4f754f1811ca44a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141965 Tested-by: Jenkins Reviewed-by: Noel Grandin (cherry picked from commit ca82061c2cad00aeddb17b766063776fee0ee41a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142207 Reviewed-by: Aron Budea diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 583811eef79b..f77fa0e480a0 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -941,40 +941,39 @@ namespace class ValueTransfer { public: -ValueTransfer( const sal_Int32& _rSourcePos, const sal_Int32& _rDestPos, std::vector< sal_Int32 >&& _rColTypes, +ValueTransfer( std::vector< sal_Int32 > _rColTypes, const Reference< XRow >& _rxSource, const Reference< XParameters >& _rxDest ) -:m_rSourcePos( _rSourcePos ) -,m_rDestPos( _rDestPos ) -,m_rColTypes( std::move(_rColTypes) ) +:m_ColTypes( std::move(_rColTypes) ) ,m_xSource( _rxSource ) ,m_xDest( _rxDest ) { } template< typename VALUE_TYPE > -void transferValue( VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ), +void transferValue( sal_Int32 _nSourcePos, sal_Int32 _nDestPos, +VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ), void (SAL_CALL XParameters::*_pSetter)( sal_Int32, VALUE_TYPE ) ) { -VALUE_TYPE value( (m_xSource.get()->*_pGetter)( m_rSourcePos ) ); +VALUE_TYPE value( (m_xSource.get()->*_pGetter)( _nSourcePos ) ); if ( m_xSource->wasNull() ) -m_xDest->setNull( m_rDestPos, m_rColTypes[ m_rSourcePos ] ); +m_xDest->setNull( _nDestPos, m_ColTypes[ _nSourcePos ] ); else -(m_xDest.get()->*_pSetter)( m_rDestPos, value ); +(m_xDest.get()->*_pSetter)( _nDestPos, value ); } - template< typename VALUE_TYPE > -void transferComplexValue( VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ), + +template< typename VALUE_TYPE > +void transferComplexValue( sal_Int32 _nSourcePos, sal_Int32 _nDestPos, +VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ), void (SAL_CALL XParameters::*_pSetter)( sal_Int32, const VALUE_TYPE& ) ) { -const VALUE_TYPE value( (m_xSource.get()->*_pGetter)( m_rSourcePos ) ); +const VALUE_TYPE value( (m_xSource.get()->*_pGetter)( _nSourcePos ) ); if ( m_xSource->wasNull() ) -m_xDest->setNull( m_rDestPos, m_rColTypes[ m_rSourcePos ] ); +m_xDest->setNull( _nDestPos, m_ColTypes[ _nSourcePos ] ); else -(m_xDest.get()->*_pSetter)( m_rDestPos, value ); +(m_xDest.get()->*_pSetter)( _nDestPos, value ); } private: -const sal_Int32&m_rSourcePos; -const sal_Int32&m_rDestPos; -const std::vector< sal_Int32 >m_rColTypes; +const std::vector< sal_Int32 > m_ColTypes; const Reference< XRow > m_xSource; const Reference< XParameters > m_xDest; }; @@ -1142,13 +1141,12 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou // notify listeners m_aCopyTableListeners.notifyEach( &XCopyTableListener::copyingRow, aCopyEvent ); -sal_Int32 nDestColumn( 0 ); -sal_Int32 nSourceColumn( 1 ); -ValueTransfer aTransfer( nSourceColumn, nDestColumn, std::vector(aSourceColTypes), xRow, xStatementParams ); +sal_Int32 nSourceColumn( 0 ); +ValueTransfer aTransfer( aSourceColTypes, xRow, xStatementParams ); for ( auto const& rColumnPos : aColumnPositions ) { -nDestColumn = rColumnPos.first; +sal_Int32 nDestColumn = rColumnPos.first; if ( nDestColumn == COLUMN_POSITION_NOT_FOUND ) { ++nSourceColumn; @@ -1174,7 +1172,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou { case DataType::DOUBLE: case DataType::REAL: -aTransfer.transferValue( &XRow::getDouble, &XParameters::setDouble ); +aTransfer.transferValue( nSourceColumn, nDestCol
[Libreoffice-commits] core.git: vcl/inc vcl/quartz vcl/skia vcl/source vcl/unx vcl/win
vcl/inc/font/PhysicalFontFace.hxx |2 vcl/inc/quartz/salgdi.h|2 vcl/inc/unx/freetype_glyphcache.hxx|2 vcl/inc/win/salgdi.h |4 - vcl/inc/win/winlayout.hxx |3 + vcl/quartz/ctfonts.cxx |2 vcl/skia/win/gdiimpl.cxx |2 vcl/source/font/LogicalFontInstance.cxx|2 vcl/source/font/PhysicalFontFace.cxx |2 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |2 vcl/win/gdi/DWriteTextRenderer.cxx |2 vcl/win/gdi/salfont.cxx| 63 + 12 files changed, 47 insertions(+), 41 deletions(-) New commits: commit 64d4275b60d50a87fb2bf4dd45be3c28902cec52 Author: Khaled Hosny AuthorDate: Sun Nov 20 02:34:26 2022 +0200 Commit: خالد حسني CommitDate: Sun Nov 20 02:35:17 2022 +0100 vcl: fix artificial bold and italic on Windows Move creating DWFontFace to WinFontInstance so that it get proper font synthesis settings. Regression from: commit a80239ede3236c84d7a05d0fbc0f299811fee6c0 Author: Khaled Hosny Date: Sat Nov 19 03:03:15 2022 +0200 vcl: move creating DWFontFace to WinFontFace Change-Id: Ifba947d8908a37972d723028258500b10ec24cd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142982 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/font/PhysicalFontFace.hxx b/vcl/inc/font/PhysicalFontFace.hxx index 6e99ae4a098c..96f2533f22fe 100644 --- a/vcl/inc/font/PhysicalFontFace.hxx +++ b/vcl/inc/font/PhysicalFontFace.hxx @@ -194,7 +194,7 @@ public: return nullptr; } -virtual const std::vector& GetVariations() const; +virtual const std::vector& GetVariations(const LogicalFontInstance&) const; protected: mutable hb_face_t* mpHbFace; diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 79ea9e32e0d6..4812404bbc6e 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -72,7 +72,7 @@ public: hb_blob_t* GetHbTable(hb_tag_t nTag) const override; -const std::vector& GetVariations() const override; +const std::vector& GetVariations(const LogicalFontInstance&) const override; private: CTFontDescriptorRef mxFontDescriptor; diff --git a/vcl/inc/unx/freetype_glyphcache.hxx b/vcl/inc/unx/freetype_glyphcache.hxx index 4cf982c50a12..5bc1632ccee6 100644 --- a/vcl/inc/unx/freetype_glyphcache.hxx +++ b/vcl/inc/unx/freetype_glyphcache.hxx @@ -101,7 +101,7 @@ public: virtual hb_face_t* GetHbFace() const override; virtual hb_blob_t* GetHbTable(hb_tag_t nTag) const override; -const std::vector& GetVariations() const override; +const std::vector& GetVariations(const LogicalFontInstance&) const override; }; class SAL_DLLPUBLIC_RTTI FreetypeFontInstance final : public LogicalFontInstance diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index 999bb39a1812..f26f1d40f0c9 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -72,11 +72,9 @@ public: BYTEGetCharSet() const { return meWinCharSet; } BYTEGetPitchAndFamily() const { return mnPitchAndFamily; } -IDWriteFontFace*GetDWFontFace() const; - hb_blob_t* GetHbTable(hb_tag_t nTag) const override; -const std::vector& GetVariations() const override; +const std::vector& GetVariations(const LogicalFontInstance&) const override; private: sal_IntPtr mnId; diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index 702bf7bf0b2a..fb8e5a1c6e43 100644 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -54,6 +54,8 @@ public: bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const override; +IDWriteFontFace* GetDWFontFace() const; + private: explicit WinFontInstance(const WinFontFace&, const vcl::font::FontSelectPattern&); @@ -65,6 +67,7 @@ private: float m_fScale; bool m_bIsCJKVerticalFont; sal_Int32 m_nTmDescent; +mutable sal::systools::COMReference mxDWFontFace; }; class TextOutRenderer diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index c2f6a8a55c00..92fd35fa2cee 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -268,7 +268,7 @@ hb_blob_t* CoreTextFontFace::GetHbTable(hb_tag_t nTag) const return pBlob; } -const std::vector& CoreTextFontFace::GetVariations() const +const std::vector& CoreTextFontFace::GetVariations(const LogicalFontInstance&) const { CTFontRef pFont = CTFontCreateWithFontDescriptor(mxFontDescriptor, 0.0, nullptr); diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx index a9df26cb53a1..d063b440cf31 100644 --- a/vcl/skia/win/gdiimpl.cxx +++ b/vcl/skia/win/gdiimpl.cxx @@ -135,7 +135,7 @@ WinSkiaSalGraphicsImpl::c
[Libreoffice-commits] core.git: offapi/com
offapi/com/sun/star/chart2/XChartTypeTemplate.idl |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 16a7e944ab1b318fafb7dd48d48379168403d2e8 Author: Andrea Gelmini AuthorDate: Sat Nov 19 17:13:48 2022 +0100 Commit: Julien Nabet CommitDate: Sat Nov 19 23:02:12 2022 +0100 Fix typo Change-Id: Iaa40db0f7799c70f39bb74d9768f84ff236502ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142977 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/offapi/com/sun/star/chart2/XChartTypeTemplate.idl b/offapi/com/sun/star/chart2/XChartTypeTemplate.idl index 147343d4b685..994f5e9ea876 100644 --- a/offapi/com/sun/star/chart2/XChartTypeTemplate.idl +++ b/offapi/com/sun/star/chart2/XChartTypeTemplate.idl @@ -164,7 +164,7 @@ interface XChartTypeTemplate : ::com::sun::star::uno::XInterface Then I removed the whole XChartTypeTemplate interface in commit 58766f997d59e4684f2887fd8cdeb12d2f8a9366. Which turned out to be a bad idea, so I restored it. - I restored it in this form because I want to restore binary compatibily with vtable + I restored it in this form because I want to restore binary compatibility with vtable layout, but I don't want to restore the XDataInterpreter stuff, which was not useful for external use. */
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/unostyle.hxx |4 +--- sw/source/ui/vba/vbaview.hxx |4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) New commits: commit 9cac01b4f19c8fc3adb1a19a71b2f214a1586d8f Author: Siddharth AuthorDate: Wed Nov 9 11:30:33 2022 +0530 Commit: Ilmari Lauhakangas CommitDate: Sat Nov 19 18:58:02 2022 +0100 tdf#143148 Use pragma once instead of include guards Change-Id: I50c2c0f202780d06b556ae82b51bab5c3f79d72e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142498 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx index 7091fd603602..2c936486032e 100644 --- a/sw/inc/unostyle.hxx +++ b/sw/inc/unostyle.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SW_INC_UNOSTYLE_HXX -#define INCLUDED_SW_INC_UNOSTYLE_HXX +#pragma once #include #include @@ -391,6 +390,5 @@ class SwXTextCellStyle final : public cppu::WeakImplHelper static css::uno::Reference CreateXTextCellStyle(SwDocShell* pDocShell, const OUString& sName); }; -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaview.hxx b/sw/source/ui/vba/vbaview.hxx index 7ac6003ddfc3..66d59e61b739 100644 --- a/sw/source/ui/vba/vbaview.hxx +++ b/sw/source/ui/vba/vbaview.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SW_SOURCE_UI_VBA_VBAVIEW_HXX -#define INCLUDED_SW_SOURCE_UI_VBA_VBAVIEW_HXX +#pragma once #include #include @@ -58,6 +57,5 @@ public: virtual OUString getServiceImplName() override; virtual css::uno::Sequence getServiceNames() override; }; -#endif // INCLUDED_SW_SOURCE_UI_VBA_VBAVIEW_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: desktop/qa desktop/source include/LibreOfficeKit sfx2/source
desktop/qa/desktop_lib/test_desktop_lib.cxx |5 - desktop/source/lib/init.cxx | 113 +--- include/LibreOfficeKit/LibreOfficeKit.h |4 include/LibreOfficeKit/LibreOfficeKit.hxx |8 + sfx2/source/view/lokhelper.cxx |6 - 5 files changed, 103 insertions(+), 33 deletions(-) New commits: commit 931e3d204e59ccb2e9c479477e6e66b2c098924f Author: Szymon Kłos AuthorDate: Mon Aug 29 09:34:53 2022 +0200 Commit: Szymon Kłos CommitDate: Sat Nov 19 18:16:16 2022 +0100 lok: masterpage: Introduce mode property to tile rendering This is needed for Impress which can have slides in two Edit Modes: Master Page and Page. Change-Id: I3eca0f51ba7970e793026d1ac6aa09b19b7a904b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137869 Reviewed-by: Ashod Nakashian Tested-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142969 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index dd84323f6c9b..e7762753775f 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -2275,7 +2275,7 @@ void DesktopLOKTest::testPaintPartTile() // Call paintPartTile() to paint the second part (in whichever view it finds suitable for this). unsigned char pPixels[256 * 256 * 4]; -pDocument->m_pDocumentClass->paintPartTile(pDocument, pPixels, 1, 256, 256, 0, 0, 256, 256); +pDocument->m_pDocumentClass->paintPartTile(pDocument, pPixels, 1, 0, 256, 256, 0, 0, 256, 256); // Type again. Scheduler::ProcessEventsToIdle(); @@ -3624,10 +3624,11 @@ void DesktopLOKTest::testABI() offsetof(struct _LibreOfficeKitDocumentClass, sendContentControlEvent)); CPPUNIT_ASSERT_EQUAL(documentClassOffset(65), offsetof(struct _LibreOfficeKitDocumentClass, getSelectionTypeAndText)); CPPUNIT_ASSERT_EQUAL(documentClassOffset(66), offsetof(struct _LibreOfficeKitDocumentClass, getDataArea)); +CPPUNIT_ASSERT_EQUAL(documentClassOffset(67), offsetof(struct _LibreOfficeKitDocumentClass, getEditMode)); // Extending is fine, update this, and add new assert for the offsetof the // new method -CPPUNIT_ASSERT_EQUAL(documentClassOffset(67), sizeof(struct _LibreOfficeKitDocumentClass)); +CPPUNIT_ASSERT_EQUAL(documentClassOffset(68), sizeof(struct _LibreOfficeKitDocumentClass)); } CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 1163ef2a638f..766248ef00ef 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -998,6 +998,7 @@ static void doc_selectPart(LibreOfficeKitDocument* pThis, int nPart, int nSelect static void doc_moveSelectedParts(LibreOfficeKitDocument* pThis, int nPosition, bool bDuplicate); static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart); static void doc_setPartMode(LibreOfficeKitDocument* pThis, int nPartMode); +static int doc_getEditMode(LibreOfficeKitDocument* pThis); static void doc_paintTile(LibreOfficeKitDocument* pThis, unsigned char* pBuffer, const int nCanvasWidth, const int nCanvasHeight, @@ -1013,6 +1014,7 @@ static void doc_paintTileToCGContext(LibreOfficeKitDocument* pThis, static void doc_paintPartTile(LibreOfficeKitDocument* pThis, unsigned char* pBuffer, const int nPart, + const int nMode, const int nCanvasWidth, const int nCanvasHeight, const int nTilePosX, const int nTilePosY, const int nTileWidth, const int nTileHeight); @@ -1269,6 +1271,7 @@ LibLODocument_Impl::LibLODocument_Impl(uno::Reference xC m_pDocumentClass->moveSelectedParts = doc_moveSelectedParts; m_pDocumentClass->getPartName = doc_getPartName; m_pDocumentClass->setPartMode = doc_setPartMode; +m_pDocumentClass->getEditMode = doc_getEditMode; m_pDocumentClass->paintTile = doc_paintTile; #ifdef IOS m_pDocumentClass->paintTileToCGContext = doc_paintTileToCGContext; @@ -3641,6 +3644,23 @@ static void doc_setPartMode(LibreOfficeKitDocument* pThis, } } +static int doc_getEditMode(LibreOfficeKitDocument* pThis) +{ +comphelper::ProfileZone aZone("doc_getEditMode"); + +SolarMutexGuard aGuard; +SetLastExceptionMsg(); + +ITiledRenderable* pDoc = getTiledRenderable(pThis); +if (!pDoc) +{ +SetLastExceptionMsg("Document doesn't support tiled rendering"); +return 0; +} + +return pDoc->getEditMode(); +} + static void doc_paintTile(LibreOfficeKitDocument* pThis, unsigned char* pBuffer,
[Libreoffice-commits] core.git: cui/qa cui/source cui/uiconfig include/svx svx/source
cui/qa/unit/cui-dialogs-test.cxx |3 cui/source/dialogs/sdrcelldlg.cxx| 43 + cui/source/factory/dlgfact.cxx |4 cui/source/factory/dlgfact.hxx |2 cui/source/inc/paragrph.hxx |8 + cui/source/inc/sdrcelldlg.hxx|2 cui/source/tabpages/paragrph.cxx | 40 - cui/uiconfig/ui/formatcellsdialog.ui | 151 +-- cui/uiconfig/ui/paragalignpage.ui| 11 ++ include/svx/svxdlg.hxx |2 svx/source/table/tablecontroller.cxx |2 11 files changed, 244 insertions(+), 24 deletions(-) New commits: commit 553cfbfc9e74a03fe02a58e9aa6076fc1dddeb7b Author: Maxim Monastirsky AuthorDate: Tue Oct 4 16:05:06 2022 +0300 Commit: Maxim Monastirsky CommitDate: Sat Nov 19 18:13:54 2022 +0100 Prepare the dialog for cell style editing Change-Id: I54ec1486f49f240e1ab88662b9d1b0b741cf8878 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142905 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky diff --git a/cui/qa/unit/cui-dialogs-test.cxx b/cui/qa/unit/cui-dialogs-test.cxx index f4f73facbaa6..cf8c302fc209 100644 --- a/cui/qa/unit/cui-dialogs-test.cxx +++ b/cui/qa/unit/cui-dialogs-test.cxx @@ -69,7 +69,8 @@ VclPtr CuiDialogsTest::createDialogByID(sal_uInt32 nID) { case 0: // "cui/ui/formatcellsdialog.ui" { -pReturnDialog = mpFact->CreateSvxFormatCellsDialog(nullptr, mxAttr.get(), *mxModel); +pReturnDialog += mpFact->CreateSvxFormatCellsDialog(nullptr, mxAttr.get(), *mxModel, true); break; } diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx index fda8b4ce1385..3afbc0f694d3 100644 --- a/cui/source/dialogs/sdrcelldlg.cxx +++ b/cui/source/dialogs/sdrcelldlg.cxx @@ -21,10 +21,15 @@ #include #include #include +#include +#include +#include +#include +#include #include -SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel) -: SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", pAttr) +SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, bool bStyle) +: SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", pAttr, bStyle) , mrOutAttrs(*pAttr) , mpColorTab(rModel.GetColorList()) , mnColorTabState ( ChangeType::NONE ) @@ -37,7 +42,29 @@ SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemS AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS); AddTabPage("border", RID_SVXPAGE_BORDER ); AddTabPage("area", RID_SVXPAGE_AREA); -AddTabPage("shadow", SvxShadowTabPage::Create, nullptr); + +if (bStyle) +{ +AddTabPage("position", RID_SVXPAGE_CHAR_POSITION); +AddTabPage("highlight", RID_SVXPAGE_BKG); +AddTabPage("indentspacing", RID_SVXPAGE_STD_PARAGRAPH); +AddTabPage("alignment", SvxParaAlignTabPage::Create, SvxParaAlignTabPage::GetSdrRanges); +RemoveTabPage("shadow"); +} +else +{ +RemoveTabPage("position"); +RemoveTabPage("highlight"); +RemoveTabPage("indentspacing"); +RemoveTabPage("alignment"); +AddTabPage("shadow", SvxShadowTabPage::Create, nullptr); +RemoveStandardButton(); +} + +if (bStyle && SvtCJKOptions::IsAsianTypographyEnabled()) +AddTabPage("asian", RID_SVXPAGE_PARA_ASIAN); +else +RemoveTabPage("asian"); } void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage) @@ -62,6 +89,16 @@ void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage) static_cast(rPage).SetColorList( mpColorTab ); static_cast(rPage).SetColorChgd( &mnColorTabState ); } +else if (rId == "alignment") +{ +static_cast(rPage).EnableSdrVertAlign(); +} +else if (rId == "highlight") +{ +SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); + aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR))); +rPage.PageCreated(aSet); +} else SfxTabDialogController::PageCreated(rId, rPage); } diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index fb61dafcecbb..930452d64d09 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1428,9 +1428,9 @@ VclPtr AbstractDialogFactory_Impl::CreateLinksDialog(wel return VclPtr::Create(std::move(xLinkDlg)); } -VclPtr AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel) +VclPtr AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, bool bStyle) { -return VclPtr::Create(std
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) New commits: commit bac26f91ae930902c336b1e5ceb08e1ae5de8d8a Author: Szymon Kłos AuthorDate: Mon Nov 14 16:11:55 2022 +0100 Commit: Szymon Kłos CommitDate: Sat Nov 19 17:44:34 2022 +0100 lok: masterpage: disable callbacks on painting We did that only for original view, but we need to disable callbacks for used view - so when we switch mode or part it will not send the notification to the client. Bug fixed by this patch: 1. open impress in two LOK sessions 2. A enters MasterPage mode 3. B switched slide 4. A exits MasterPage mode result: A was switched to the slide selected by B Change-Id: I7dde8bb4c73862813d064319922aba4c4b727db9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142716 Tested-by: Jenkins CollaboraOffice Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142966 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 41f05517082f..1163ef2a638f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3817,7 +3817,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, { // Text documents have a single coordinate system; don't change part. int nOrigPart = 0; -const bool isText = (doc_getDocumentType(pThis) == LOK_DOCTYPE_TEXT); +const int aType = doc_getDocumentType(pThis); +const bool isText = (aType == LOK_DOCTYPE_TEXT); int nViewId = nOrigViewId; int nLastNonEditorView = nViewId; if (!isText) @@ -3853,6 +3854,14 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, doc_setView(pThis, nLastNonEditorView); } +// Disable callbacks while we are painting - after setting the view +if (nViewId != nOrigViewId && nViewId >= 0) +{ +const auto handlerIt = pDocument->mpCallbackFlushHandlers.find(nViewId); +if (handlerIt != pDocument->mpCallbackFlushHandlers.end()) +handlerIt->second->disableCallbacks(); +} + nOrigPart = doc_getPart(pThis); if (nPart != nOrigPart) { @@ -3880,6 +3889,13 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, } if (!isText && nViewId != nOrigViewId) { +if (nViewId >= 0) +{ +const auto handlerIt = pDocument->mpCallbackFlushHandlers.find(nViewId); +if (handlerIt != pDocument->mpCallbackFlushHandlers.end()) +handlerIt->second->enableCallbacks(); +} + doc_setView(pThis, nOrigViewId); } }
[Libreoffice-commits] core.git: sc/source
sc/source/ui/inc/inscldlg.hxx |1 - sc/source/ui/miscdlgs/inscldlg.cxx |3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) New commits: commit 325bab6a92921a0356cc3e1c66f14ad0c6200d85 Author: Szymon Kłos AuthorDate: Wed Nov 2 18:40:09 2022 +0100 Commit: Szymon Kłos CommitDate: Sat Nov 19 16:45:39 2022 +0100 Dont use equal name for label and widget Change-Id: I71b052aff4317b416f0c02bde549461b64f1a6f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142181 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142968 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/sc/source/ui/inc/inscldlg.hxx b/sc/source/ui/inc/inscldlg.hxx index d159c65cd8ac..b44bfb60baa9 100644 --- a/sc/source/ui/inc/inscldlg.hxx +++ b/sc/source/ui/inc/inscldlg.hxx @@ -30,7 +30,6 @@ private: std::unique_ptr m_xBtnCellsRight; std::unique_ptr m_xBtnInsRow; std::unique_ptr m_xBtnInsCol; -std::unique_ptr m_xLbCellsRight; public: ScInsertCellDlg(weld::Window* pParent, bool bDisallowCellMove); diff --git a/sc/source/ui/miscdlgs/inscldlg.cxx b/sc/source/ui/miscdlgs/inscldlg.cxx index ac97c6ac3578..e077724f4264 100644 --- a/sc/source/ui/miscdlgs/inscldlg.cxx +++ b/sc/source/ui/miscdlgs/inscldlg.cxx @@ -32,11 +32,10 @@ ScInsertCellDlg::ScInsertCellDlg(weld::Window* pParent, bool bDisallowCellMove) , m_xBtnCellsRight(m_xBuilder->weld_radio_button("right")) , m_xBtnInsRow(m_xBuilder->weld_radio_button("rows")) , m_xBtnInsCol(m_xBuilder->weld_radio_button("cols")) -, m_xLbCellsRight(m_xBuilder->weld_label("right")) { const ScViewData* pViewData = ScDocShell::GetViewData(); if (pViewData && pViewData->GetDocument().IsLayoutRTL(pViewData->GetTabNo())) -m_xLbCellsRight->set_label(ScResId(SCSTR_INSERT_RTL)); +m_xBtnCellsRight->set_label(ScResId(SCSTR_INSERT_RTL)); if (bDisallowCellMove) {
[Libreoffice-commits] core.git: sd/source
sd/source/ui/view/drviews1.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 2dd51938908b9856bd1ad4b252cd60805262baa5 Author: Szymon Kłos AuthorDate: Tue Nov 15 16:49:15 2022 +0100 Commit: Szymon Kłos CommitDate: Sat Nov 19 16:44:21 2022 +0100 lok: masterpage: don't switch page on mode change Go back to the last used page when closing MasterPage. There was a bug when one user was in MasterPage mode and other switched page - then on close we opened other user page. Change-Id: I02f3b36429a62b855b215803d6684b3382228326 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142740 Tested-by: Jenkins CollaboraOffice Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142967 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 64440617e611..da00680667ce 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -409,7 +409,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) OUString aPageName = pPage->GetName(); maTabControl->InsertPage(pPage->getPageId(), aPageName); -if ( pPage->IsSelected() ) +if ( !comphelper::LibreOfficeKit::isActive() && pPage->IsSelected() ) { nActualPageId = pPage->getPageId(); }
[Libreoffice-commits] core.git: 2 commits - include/vcl sd/source vcl/jsdialog
include/vcl/weld.hxx |1 + sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx |5 - vcl/jsdialog/executor.cxx |3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) New commits: commit fc656a56b283ec0eb308faf78fa171fd69b1e807 Author: Szymon Kłos AuthorDate: Thu Nov 17 22:25:33 2022 +0100 Commit: Szymon Kłos CommitDate: Sat Nov 19 16:31:58 2022 +0100 jsdialogs: correctly detect button's handler Change-Id: I5bb3e60d52813fddfc9a5eb7a0e87d5f5e3853f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142904 Reviewed-by: Michael Meeks Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142964 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index b024bc33c4af..9bb5bfb6ed74 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1479,6 +1479,7 @@ public: virtual void set_from_icon_name(const OUString& rIconName) = 0; virtual OUString get_label() const = 0; void clicked() { signal_clicked(); } +bool is_custom_handler_set() { return m_aClickHdl.IsSet(); } // font size is in points, not pixels, e.g. see Window::[G]etPointFont virtual void set_font(const vcl::Font& rFont) = 0; diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index a389e3ab0739..51dcca8f5d16 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -59,7 +59,8 @@ bool ExecuteAction(const std::string& nWindowId, const OString& rWidget, StringM if (sControlType == "responsebutton") { -if (pWidget == nullptr) +auto pButton = dynamic_cast(pWidget); +if (pWidget == nullptr || (pButton && !pButton->is_custom_handler_set())) { // welded wrapper not found - use response code instead pWidget = JSInstanceBuilder::FindWeldWidgetsMap(nWindowId, "__DIALOG__"); commit 71c88cf9d5f5dffa86e5a111e19468a5a2a2b6c0 Author: Szymon Kłos AuthorDate: Mon Nov 14 11:38:40 2022 +0100 Commit: Szymon Kłos CommitDate: Sat Nov 19 16:31:44 2022 +0100 lok: masterpage: don't remove old cache In multi user view when switching between MasterPage and Page mode it was failing to find cache because it was removed by other views. We need that to allow invalidation after master page changed something. Change-Id: I070345b0fe6942965aece5bf729ceb37b7d99397 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142697 Tested-by: Jenkins CollaboraOffice Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142965 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx index 465bb6c992b5..76fc3753fc53 100644 --- a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx +++ b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx @@ -27,6 +27,8 @@ #include #include +#include + namespace { /** Collection of data that is stored for all active preview caches. @@ -298,7 +300,8 @@ std::shared_ptr PageCacheManager::ChangeSize ( pResult = rpCache; } -else +// In multi user view this can happen - no issue (reset after switching MasterPage) +else if (!comphelper::LibreOfficeKit::isActive()) { assert(iCacheToChange != mpPageCaches->end()); }
[Libreoffice-commits] core.git: chart2/source offapi/com offapi/UnoApi_offapi.mk
chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx |2 chart2/source/controller/dialogs/ChartTypeDialogController.cxx|2 chart2/source/controller/dialogs/DialogModel.cxx |8 chart2/source/inc/ChartTypeTemplate.hxx | 45 +- chart2/source/model/main/ChartModel_Persistence.cxx |2 chart2/source/model/main/Diagram.cxx |2 chart2/source/model/template/AreaChartTypeTemplate.cxx| 10 chart2/source/model/template/AreaChartTypeTemplate.hxx|6 chart2/source/model/template/BarChartTypeTemplate.cxx | 14 chart2/source/model/template/BarChartTypeTemplate.hxx | 10 chart2/source/model/template/BubbleChartTypeTemplate.cxx | 12 chart2/source/model/template/BubbleChartTypeTemplate.hxx |8 chart2/source/model/template/ChartTypeTemplate.cxx| 83 ++- chart2/source/model/template/ColumnLineChartTypeTemplate.cxx | 10 chart2/source/model/template/ColumnLineChartTypeTemplate.hxx | 10 chart2/source/model/template/LineChartTypeTemplate.cxx| 10 chart2/source/model/template/LineChartTypeTemplate.hxx| 10 chart2/source/model/template/NetChartTypeTemplate.cxx | 10 chart2/source/model/template/NetChartTypeTemplate.hxx |6 chart2/source/model/template/PieChartTypeTemplate.cxx | 14 chart2/source/model/template/PieChartTypeTemplate.hxx | 10 chart2/source/model/template/ScatterChartTypeTemplate.cxx | 16 chart2/source/model/template/ScatterChartTypeTemplate.hxx | 12 chart2/source/model/template/StockChartTypeTemplate.cxx | 14 chart2/source/model/template/StockChartTypeTemplate.hxx | 10 chart2/source/tools/DiagramHelper.cxx |2 offapi/UnoApi_offapi.mk |2 offapi/com/sun/star/chart2/ChartTypeTemplate.idl | 46 ++ offapi/com/sun/star/chart2/XChartTypeTemplate.idl | 224 ++ 29 files changed, 476 insertions(+), 134 deletions(-) New commits: commit ec6502a1f61fcbd4bf05b62f172650fe442c3a1d Author: Noel Grandin AuthorDate: Fri Nov 18 10:58:28 2022 +0200 Commit: Noel Grandin CommitDate: Sat Nov 19 15:50:48 2022 +0100 tdf#151846 Restore XChartTypeTemplate Which I removed in commit 58766f997d59e4684f2887fd8cdeb12d2f8a9366. Turns out it does have some usefulness for extensions. So restore most of it. The exception is the getDataInterpreter method, for which I have added a placeholder, so that the restored class has the same vtable layout as the original. Change-Id: Ief9b48ef2c408580bc24b5a8a0e11131edb3b943 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142908 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index eefed59e3e6a..7b911fbd3820 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -1195,7 +1195,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance( DiagramHelper::tTemplateWithServiceName aTemplateWithService( DiagramHelper::getTemplateForDiagram( xDiagram, xTemplateManager )); if( aTemplateWithService.xChartTypeTemplate.is()) -aTemplateWithService.xChartTypeTemplate->resetStyles( xDiagram );//#i109371# +aTemplateWithService.xChartTypeTemplate->resetStyles2( xDiagram );//#i109371# xTemplate->changeDiagram( xDiagram ); if( AllSettings::GetMathLayoutRTL() ) AxisHelper::setRTLAxisLayout( AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 ) ); diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx index 4c157611f21b..72c51a30d6d0 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx @@ -318,7 +318,7 @@ void ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParame DiagramHelper::tTemplateWithServiceName aTemplateWithService( DiagramHelper::getTemplateForDiagram( xDiagram, xTemplateManager )); if( aTemplateWithService.xChartTypeTemplate.is()) -aTemplateWithService.xChartTypeTemplate->resetStyles( xDiagram ); +aTemplateWithService.xChartTypeTemplate->resetStyles2( xDiagram ); xTemplate->changeDiagram( xDiagram ); if( AllSettings::GetMathLayoutRTL() ) Ax
[Libreoffice-commits] core.git: vcl/inc vcl/quartz vcl/source vcl/unx vcl/win
vcl/inc/font/PhysicalFontFace.hxx |9 +++ vcl/inc/quartz/salgdi.h|2 - vcl/inc/unx/freetype_glyphcache.hxx|2 - vcl/inc/unx/glyphcache.hxx |2 - vcl/inc/win/salgdi.h |2 - vcl/quartz/ctfonts.cxx |9 --- vcl/source/font/PhysicalFontFace.cxx | 30 +++-- vcl/unx/generic/glyphs/freetype_glyphcache.cxx | 17 +++--- vcl/win/gdi/salfont.cxx| 11 + 9 files changed, 46 insertions(+), 38 deletions(-) New commits: commit a38bb773bb568ef942293f23d0701da933817e8f Author: Khaled Hosny AuthorDate: Sat Nov 19 14:58:40 2022 +0200 Commit: خالد حسني CommitDate: Sat Nov 19 15:45:21 2022 +0100 vcl: use std::optional in PhysicalFontFace Otherwise when a font does not, say, support variations or color palettes, we keep querying the font each time they are requested. Change-Id: I3a41bc73dd814b25af3a8b5b009632ecf7ef27ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142963 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/font/PhysicalFontFace.hxx b/vcl/inc/font/PhysicalFontFace.hxx index ae0e6ad7d5bf..6e99ae4a098c 100644 --- a/vcl/inc/font/PhysicalFontFace.hxx +++ b/vcl/inc/font/PhysicalFontFace.hxx @@ -194,16 +194,15 @@ public: return nullptr; } -virtual std::vector GetVariations() const { return {}; }; +virtual const std::vector& GetVariations() const; protected: mutable hb_face_t* mpHbFace; mutable hb_font_t* mpHbUnscaledFont; mutable FontCharMapRef mxCharMap; -mutable vcl::FontCapabilities maFontCapabilities; -mutable bool mbFontCapabilitiesRead; -mutable std::vector maColorPalettes; -mutable std::vector m_aVariations; +mutable std::optional mxFontCapabilities; +mutable std::optional> mxColorPalettes; +mutable std::optional> mxVariations; explicit PhysicalFontFace(const FontAttributes&); diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 121aef3cf59a..79ea9e32e0d6 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -72,7 +72,7 @@ public: hb_blob_t* GetHbTable(hb_tag_t nTag) const override; -std::vector GetVariations() const override; +const std::vector& GetVariations() const override; private: CTFontDescriptorRef mxFontDescriptor; diff --git a/vcl/inc/unx/freetype_glyphcache.hxx b/vcl/inc/unx/freetype_glyphcache.hxx index 0ec53c073006..4cf982c50a12 100644 --- a/vcl/inc/unx/freetype_glyphcache.hxx +++ b/vcl/inc/unx/freetype_glyphcache.hxx @@ -101,7 +101,7 @@ public: virtual hb_face_t* GetHbFace() const override; virtual hb_blob_t* GetHbTable(hb_tag_t nTag) const override; -std::vector GetVariations() const override; +const std::vector& GetVariations() const override; }; class SAL_DLLPUBLIC_RTTI FreetypeFontInstance final : public LogicalFontInstance diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx index a6be9e872da6..22e2f0e173d9 100644 --- a/vcl/inc/unx/glyphcache.hxx +++ b/vcl/inc/unx/glyphcache.hxx @@ -129,8 +129,6 @@ public: boolGetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const; boolGetAntialiasAdvice() const; -std::vector GetVariations() const; - private: friend class FreetypeFontInstance; friend class FreetypeManager; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index e0661dec5a1c..999bb39a1812 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -76,7 +76,7 @@ public: hb_blob_t* GetHbTable(hb_tag_t nTag) const override; -std::vector GetVariations() const override; +const std::vector& GetVariations() const override; private: sal_IntPtr mnId; diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 0ca4ffc953ec..c2f6a8a55c00 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -268,12 +268,13 @@ hb_blob_t* CoreTextFontFace::GetHbTable(hb_tag_t nTag) const return pBlob; } -std::vector CoreTextFontFace::GetVariations() const +const std::vector& CoreTextFontFace::GetVariations() const { CTFontRef pFont = CTFontCreateWithFontDescriptor(mxFontDescriptor, 0.0, nullptr); -if (m_aVariations.empty()) +if (!mxVariations) { +mxVariations.emplace(); CFArrayRef pAxes = CTFontCopyVariationAxes(pFont); if (pAxes) { @@ -300,7 +301,7 @@ std::vector CoreTextFontFace::GetVariations() const continue; CFNumberGetValue(pValue, kCFNumberFloatType, &fValue); -m_aVariations.push_back({ nTag, fValue }); +mxVariations->push_back({ nTag, fValue }); } } CFRele
Test failure on some Windows systems with 125% display scaling, Chart2ImportTest::testAutomaticSizeBarChartVeryLongLabel
A new dev is seeing this test failure on Windows with 125% scaling, the test passes if scaling is set to 100%: C:/cygwin/home/Client/lode/dev/core/chart2/qa/extras/chart2import.cxx(2273) : error : Assertion Test name: Chart2ImportTest::testAutomaticSizeBarChartVeryLongLabel double equality assertion failed - Expected: 5320 - Actual : 4765 - Delta : 100 Mike added tolerance to this test in 09e499e64ec4acb24c9524c8aacabc6182124442 but in this case the difference seems surprisingly large. Ilmari
Test failure in embeddedobj on some Windows systems
This failure was first observed in September this year and now another new dev is facing it: C:/cygwin/home/Client/lode/dev/core/test/source/xmltesttools.cxx(174) : error : Assertion Test name: testSaveOnThread::TestBody equality assertion failed - Expected: 0.1665in - Actual : 1.9685in - In <>, attribute 'visible-area-width' of '//style:graphic-properties' incorrect value. Miklos's comments from September: "I meant that in case we get RPC_E_WRONG_THREAD at embeddedobj/source/msole/olecomponent.cxx:1018, then we know how to work things around. It looks like the failing scenario doesn't get this error code, but fails in a different way, so the visible area (asserted in the testcase) is wrong exactly the way it was wrong for everyone before d5cd62164d32273a25913c93aa04be9f7f3a4073." "Getting RPC_E_WRONG_THREAD on the first try is expected, what's unexpected is that the 2nd try doesn't work the way the test wants it." I asked Hossein how the new dev could continue debugging the issue and he looked into it a bit: "as I understand from the code, the checks does not happen when the DPI is not 96, in which I think most of the today's displays are not. embeddedobj/qa/cppunit/msole.cxx:98 CPPUNIT_TEST_FIXTURE(Test, testSaveOnThread) { // Given an embedded object which hosts mspaint data: if (Application::GetDefaultDevice()->GetDPIX() != 96) { return; } . . . } I changed the code to bypass this condition, and then I saw the test failing as I expected, as it is tailored to 96 dpi only. On my machine, it failed with 0.0555in instead of 0.1665in. I also wasn't faced with RPC_E_WRONG_THREAD value of `hr`, but it was shown as `S_OK`, passing SUCCEEDED(). Previously, when I wanted to debug multiple values in CppunitTests, I usually dumped them into a temporary file. I think this idea can be used to dump specific values to a set of files, each for a thread. Alternatively, one can switch between threads in the Visual Studio debugger by using the appropriate window, that can be enabled from the debug menu. But, it is not always easy to debug a multi-threaded application." If someone has ideas on how to figure this out, let me know. Ilmari
Changes in LibreOfficeKit
Hi all, I looked at Gerrit.LibreOffice and found a patch on the LibreOfficeKit which not make it into the LibreOffice master. I think this were only a slip of the pen: https://gerrit.libreoffice.org/c/core/+/137869 It would be great if the developer or the reviewer could merge this patch into the LibreOffice master too. Regards, Andreas -- ## Free Software Advocate ## Plone add-on developer ## My blog: http://www.amantke.de/blog
Re: contribution
On 18.11.2022 14.11, Konstantin Limarev wrote: Hi! I’m Konstantin Limarev, 3 year experience C++ developer. I’m working on add-on for LibreOffice for Windows based on examples provided with SDK. I made my project migrating from make to CMake and wonder know if LibreOffice SDK has plans to migrate to CMake in roadmap, examples part at least. In any case I would be happy to contribute if any help required, especially in CMake migration. You might enjoy this: https://dev.blog.documentfoundation.org/2022/04/19/using-cmake-to-build-libreoffice-cpp-sdk-examples/ We are exploring using Meson for LibreOffice core, so it would be interesting to see how SDK examples would build with Meson. Ilmari
[Libreoffice-commits] core.git: solenv/clang-format vcl/inc vcl/win
solenv/clang-format/excludelist |1 vcl/inc/win/salgdi.h|2 vcl/win/gdi/dw-extra.h | 141 vcl/win/gdi/salfont.cxx | 36 ++ 4 files changed, 180 insertions(+) New commits: commit e65b0bf83b8225fde81ee7b10c1fa4b9f32b6ed1 Author: Khaled Hosny AuthorDate: Sat Nov 19 09:34:56 2022 +0200 Commit: خالد حسني CommitDate: Sat Nov 19 12:44:58 2022 +0100 vcl: add WinFontFace::GetVariations() This makes font variation settings to be applied to glyph advances and text layout, not only glyph shapes. The sw-extra.h file is needed because we target Windows 7 and the interfaces we want to use are only exposed for Windows 10. File copied from: https://hg.mozilla.org/mozilla-central/file/704f09a557a4dfc9057f1672b711789f64f74a82/gfx/2d/dw-extra.h Change-Id: I7bbb4c3f2b70274754f844fedb0c4329c8f649a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142347 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index f3f6c774e7a3..b50d8bf4f4f0 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -15082,6 +15082,7 @@ vcl/win/dtrans/XNotifyingDataObject.hxx vcl/win/dtrans/XTDataObject.cxx vcl/win/dtrans/XTDataObject.hxx vcl/win/gdi/DWriteTextRenderer.cxx +vcl/win/gdi/dw-extra.h vcl/win/gdi/gdiimpl.cxx vcl/win/gdi/gdiimpl.hxx vcl/win/gdi/salbmp.cxx diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index 8d93577e4cb1..e0661dec5a1c 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -76,6 +76,8 @@ public: hb_blob_t* GetHbTable(hb_tag_t nTag) const override; +std::vector GetVariations() const override; + private: sal_IntPtr mnId; diff --git a/vcl/win/gdi/dw-extra.h b/vcl/win/gdi/dw-extra.h new file mode 100644 index ..4c07d81d2126 --- /dev/null +++ b/vcl/win/gdi/dw-extra.h @@ -0,0 +1,141 @@ +// +// copied from: +// https://hg.mozilla.org/mozilla-central/file/704f09a557a4dfc9057f1672b711789f64f74a82/gfx/2d/dw-extra.h +// + +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * New DirectWrite interfaces based on Win10 Fall Creators Update versions + * of dwrite_3.h and dcommon.h (from SDK 10.0.17061.0). This particular + * subset of declarations is intended to be just sufficient to compile the + * Gecko DirectWrite font code; it omits many other new interfaces, etc. + */ + +#ifndef DWRITE_EXTRA_H +#define DWRITE_EXTRA_H + +#pragma once + +interface IDWriteFontResource; +interface IDWriteFontFaceReference1; + +enum DWRITE_GLYPH_IMAGE_FORMATS { + DWRITE_GLYPH_IMAGE_FORMATS_NONE = 0x, + DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE = 0x0001, + DWRITE_GLYPH_IMAGE_FORMATS_CFF = 0x0002, + DWRITE_GLYPH_IMAGE_FORMATS_COLR = 0x0004, + DWRITE_GLYPH_IMAGE_FORMATS_SVG = 0x0008, + DWRITE_GLYPH_IMAGE_FORMATS_PNG = 0x0010, + DWRITE_GLYPH_IMAGE_FORMATS_JPEG = 0x0020, + DWRITE_GLYPH_IMAGE_FORMATS_TIFF = 0x0040, + DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8 = 0x0080, +}; + +#ifdef DEFINE_ENUM_FLAG_OPERATORS +DEFINE_ENUM_FLAG_OPERATORS(DWRITE_GLYPH_IMAGE_FORMATS); +#endif + +#define DWRITE_MAKE_FONT_AXIS_TAG(a, b, c, d) \ + (static_cast(DWRITE_MAKE_OPENTYPE_TAG(a, b, c, d))) + +enum DWRITE_FONT_AXIS_TAG : UINT32 { + DWRITE_FONT_AXIS_TAG_WEIGHT = DWRITE_MAKE_FONT_AXIS_TAG('w', 'g', 'h', 't'), + DWRITE_FONT_AXIS_TAG_WIDTH = DWRITE_MAKE_FONT_AXIS_TAG('w', 'd', 't', 'h'), + DWRITE_FONT_AXIS_TAG_SLANT = DWRITE_MAKE_FONT_AXIS_TAG('s', 'l', 'n', 't'), + DWRITE_FONT_AXIS_TAG_OPTICAL_SIZE = + DWRITE_MAKE_FONT_AXIS_TAG('o', 'p', 's', 'z'), + DWRITE_FONT_AXIS_TAG_ITALIC = DWRITE_MAKE_FONT_AXIS_TAG('i', 't', 'a', 'l'), +}; + +enum DWRITE_FONT_AXIS_ATTRIBUTES { + DWRITE_FONT_AXIS_ATTRIBUTES_NONE = 0x, + DWRITE_FONT_AXIS_ATTRIBUTES_VARIABLE = 0x0001, + DWRITE_FONT_AXIS_ATTRIBUTES_HIDDEN = 0x0002, +}; + +struct DWRITE_FONT_AXIS_VALUE { + DWRITE_FONT_AXIS_TAG axisTag; + FLOAT value; +}; + +struct DWRITE_FONT_AXIS_RANGE { + DWRITE_FONT_AXIS_TAG axisTag; + FLOAT minValue; + FLOAT maxValue; +}; + +struct DWRITE_GLYPH_IMAGE_DATA { + const void* imageData; + UINT32 imageDataSize; + UINT32 uniqueDataId; + UINT32 pixelsPerEm; + D2D1_SIZE_U pixelSize; + D2D1_POINT_2L horizontalLeftOrigin; + D2D1_POINT_2L horizontalRightOrigin; + D2D1_POINT_2L verticalTopOrigin; + D2D1_POINT_2L verticalBottomOrigin; +}; + +interface DWRITE_DECLARE_INTERFACE("27F2A904-4EB8-441D-9678-0563F53E3E2F") +IDWriteFontFace4 : public IDWriteFontFace3 { + STDMETHOD_(DWRITE_GLYPH_IMAGE_FORMATS, GetGlyphImageFormats)() PURE; + STDMETHOD(GetGl
[Libreoffice-commits] core.git: vcl/inc
vcl/inc/win/salgdi.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit d00ed8359c082f460e5f318ddf180513ca429e46 Author: Khaled Hosny AuthorDate: Sat Nov 19 09:13:52 2022 +0200 Commit: خالد حسني CommitDate: Sat Nov 19 12:44:34 2022 +0100 vcl: make WinFontFace final Change-Id: Ie64c155c8dc4d2a4819d4f60999cbb8355687d86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142958 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index c21c36db2dec..8d93577e4cb1 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -59,14 +59,14 @@ class ImplFontMetricData; #define PALRGB_TO_RGB(nPalRGB) ((nPalRGB)&0x00ff) // win32 specific physically available font face -class WinFontFace : public vcl::font::PhysicalFontFace +class WinFontFace final : public vcl::font::PhysicalFontFace { public: explicitWinFontFace(const ENUMLOGFONTEXW&, const NEWTEXTMETRICW&); -virtual ~WinFontFace() override; +~WinFontFace() override; -virtual rtl::Reference CreateFontInstance( const vcl::font::FontSelectPattern& ) const override; -virtual sal_IntPtr GetFontId() const override; +rtl::Reference CreateFontInstance( const vcl::font::FontSelectPattern& ) const override; +sal_IntPtr GetFontId() const override; voidSetFontId( sal_IntPtr nId ) { mnId = nId; } BYTEGetCharSet() const { return meWinCharSet; } @@ -74,7 +74,7 @@ public: IDWriteFontFace*GetDWFontFace() const; -virtual hb_blob_t* GetHbTable(hb_tag_t nTag) const override; +hb_blob_t* GetHbTable(hb_tag_t nTag) const override; private: sal_IntPtr mnId;
[Libreoffice-commits] core.git: vcl/inc vcl/skia vcl/win
vcl/inc/skia/win/gdiimpl.hxx |2 +- vcl/inc/win/DWriteTextRenderer.hxx |2 +- vcl/inc/win/salgdi.h |3 +++ vcl/skia/win/gdiimpl.cxx | 33 +++-- vcl/win/gdi/DWriteTextRenderer.cxx | 26 -- vcl/win/gdi/salfont.cxx| 28 6 files changed, 56 insertions(+), 38 deletions(-) New commits: commit a80239ede3236c84d7a05d0fbc0f299811fee6c0 Author: Khaled Hosny AuthorDate: Sat Nov 19 03:03:15 2022 +0200 Commit: خالد حسني CommitDate: Sat Nov 19 12:44:10 2022 +0100 vcl: move creating DWFontFace to WinFontFace Change-Id: Ie0e94787d962eaec7753ae50d548ad8655dbc209 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142957 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/skia/win/gdiimpl.hxx b/vcl/inc/skia/win/gdiimpl.hxx index 92f873ca7d43..c5b12d08811a 100644 --- a/vcl/inc/skia/win/gdiimpl.hxx +++ b/vcl/inc/skia/win/gdiimpl.hxx @@ -63,7 +63,7 @@ public: protected: virtual void createWindowSurfaceInternal(bool forceRaster = false) override; -static sk_sp createDirectWriteTypeface(HDC hdc, HFONT hfont); +static sk_sp createDirectWriteTypeface(const WinFontInstance* pWinFont); static void initFontInfo(); inline static sal::systools::COMReference dwriteFontSetBuilder; inline static sal::systools::COMReference dwritePrivateCollection; diff --git a/vcl/inc/win/DWriteTextRenderer.hxx b/vcl/inc/win/DWriteTextRenderer.hxx index 5f0dc35ddd58..b2d685b20365 100644 --- a/vcl/inc/win/DWriteTextRenderer.hxx +++ b/vcl/inc/win/DWriteTextRenderer.hxx @@ -60,7 +60,7 @@ private: D2DWriteTextOutRenderer(const D2DWriteTextOutRenderer &) = delete; D2DWriteTextOutRenderer & operator = (const D2DWriteTextOutRenderer &) = delete; -bool GetDWriteFaceFromHDC(HDC hDC, IDWriteFontFace ** ppFontFace, float * lfSize) const; +IDWriteFontFace* GetDWriteFace(const WinFontInstance& rWinFont, float * lfSize) const; bool performRender(GenericSalLayout const &rLayout, SalGraphics &rGraphics, HDC hDC, bool& bRetry, bool bRenderingModeNatural); ID2D1Factory* mpD2DFactory; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index db00ff03455a..c21c36db2dec 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -72,6 +72,8 @@ public: BYTEGetCharSet() const { return meWinCharSet; } BYTEGetPitchAndFamily() const { return mnPitchAndFamily; } +IDWriteFontFace*GetDWFontFace() const; + virtual hb_blob_t* GetHbTable(hb_tag_t nTag) const override; private: @@ -80,6 +82,7 @@ private: BYTEmeWinCharSet; BYTEmnPitchAndFamily; LOGFONTWmaLogFont; +mutable sal::systools::COMReference mxDWFontFace; }; /** Class that creates (and destroys) a compatible Device Context. diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx index 74bc3cce5ec5..a9df26cb53a1 100644 --- a/vcl/skia/win/gdiimpl.cxx +++ b/vcl/skia/win/gdiimpl.cxx @@ -121,12 +121,12 @@ bool WinSkiaSalGraphicsImpl::RenderAndCacheNativeControl(CompatibleDC& rWhite, C return true; } -sk_sp WinSkiaSalGraphicsImpl::createDirectWriteTypeface(HDC hdc, HFONT hfont) try +sk_sp +WinSkiaSalGraphicsImpl::createDirectWriteTypeface(const WinFontInstance* pWinFont) try { using sal::systools::ThrowIfFailed; IDWriteFactory* dwriteFactory; -IDWriteGdiInterop* dwriteGdiInterop; -WinSalGraphics::getDWriteFactory(&dwriteFactory, &dwriteGdiInterop); +WinSalGraphics::getDWriteFactory(&dwriteFactory); if (!dwriteDone) { dwriteFontMgr = SkFontMgr_New_DirectWrite(dwriteFactory); @@ -135,30 +135,20 @@ sk_sp WinSkiaSalGraphicsImpl::createDirectWriteTypeface(HDC hdc, HFO if (!dwriteFontMgr) return nullptr; -// tdf#137122: We need to get the exact same font as HFONT refers to, -// since VCL core computes things like glyph ids based on that, and getting -// a different font could lead to mismatches (e.g. if there's a slightly -// different version of the same font installed system-wide). -// For that CreateFromFaceFromHdc() is necessary. The simpler -// CreateFontFromLOGFONT() seems to search for the best matching font, -// which may not be the exact font. -sal::systools::COMReference fontFace; -{ -comphelper::ScopeGuard g( -[ hdc, oldFont(SelectFont(hdc, hfont)) ] { SelectFont(hdc, oldFont); }); -ThrowIfFailed(dwriteGdiInterop->CreateFontFaceFromHdc(hdc, &fontFace), SAL_WHERE); -} +IDWriteFontFace* fontFace = pWinFont->GetFontFace()->GetDWFontFace(); +if (!fontFace) +return nullptr; sal::systools::COMReference collection; ThrowIfFailed(dwriteFactory->GetSystemFontCollection(&collection), SAL_WHERE); sal::systools::COMRefere
configure: error: Could not figure out what C++ library this is
Hello, I've just updated Ubuntu from 20.04 to 22.04. But configure now complains about C++ library, whereas it worked well with Ubuntu 20.04 My autogen.input is CC=clang CXX=clang++ --enable-pch=full --enable-icecream --enable-dbgutil --with-java --with-help --without-myspell-dicts --enable-ext-nlpsolver --without-doxygen --with-lang=en-US fr --with-jdk-home=/usr/lib/jvm/java-11-openjdk-amd64 configure output is here: https://paste.debian.net/1261208/ What should I do? Many thanks for your help. Laurent
[Libreoffice-commits] core.git: vcl/inc vcl/skia vcl/win
vcl/inc/skia/win/gdiimpl.hxx |2 -- vcl/inc/win/salgdi.h |7 +++ vcl/skia/win/gdiimpl.cxx | 11 --- vcl/win/gdi/DWriteTextRenderer.cxx | 13 ++--- vcl/win/gdi/salgdi.cxx | 32 5 files changed, 45 insertions(+), 20 deletions(-) New commits: commit 042473d4b162c87a27a55e9b9f076b5fc479a55a Author: Khaled Hosny AuthorDate: Sat Nov 19 00:30:15 2022 +0200 Commit: خالد حسني CommitDate: Sat Nov 19 12:43:51 2022 +0100 vcl: move creating DWriteFactory to a centeral place We already have code in two places to create it, and I will need it in yet another place. Change-Id: I12dee85347a3894045c345b0ec9d5e02c493c218 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142956 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/skia/win/gdiimpl.hxx b/vcl/inc/skia/win/gdiimpl.hxx index 1977e7152080..92f873ca7d43 100644 --- a/vcl/inc/skia/win/gdiimpl.hxx +++ b/vcl/inc/skia/win/gdiimpl.hxx @@ -65,8 +65,6 @@ protected: virtual void createWindowSurfaceInternal(bool forceRaster = false) override; static sk_sp createDirectWriteTypeface(HDC hdc, HFONT hfont); static void initFontInfo(); -inline static sal::systools::COMReference dwriteFactory; -inline static sal::systools::COMReference dwriteGdiInterop; inline static sal::systools::COMReference dwriteFontSetBuilder; inline static sal::systools::COMReference dwritePrivateCollection; inline static sk_sp dwriteFontMgr; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index 35d723b0bc90..db00ff03455a 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -161,6 +162,10 @@ private: RGNDATA*mpStdClipRgnData; // Cache Standard-ClipRegion-Data int mnPenWidth; // line width +inline static sal::systools::COMReference mxDWriteFactory; +inline static sal::systools::COMReference mxDWriteGdiInterop; +inline static bool bDWriteDone = false; + // just call both from setHDC! void InitGraphics(); void DeInitGraphics(); @@ -189,6 +194,8 @@ public: SCREEN }; +static void getDWriteFactory(IDWriteFactory** pFactory, IDWriteGdiInterop** pInterop = nullptr); + public: HWND gethWnd(); diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx index 692ad36b9eb2..74bc3cce5ec5 100644 --- a/vcl/skia/win/gdiimpl.cxx +++ b/vcl/skia/win/gdiimpl.cxx @@ -124,13 +124,12 @@ bool WinSkiaSalGraphicsImpl::RenderAndCacheNativeControl(CompatibleDC& rWhite, C sk_sp WinSkiaSalGraphicsImpl::createDirectWriteTypeface(HDC hdc, HFONT hfont) try { using sal::systools::ThrowIfFailed; +IDWriteFactory* dwriteFactory; +IDWriteGdiInterop* dwriteGdiInterop; +WinSalGraphics::getDWriteFactory(&dwriteFactory, &dwriteGdiInterop); if (!dwriteDone) { -ThrowIfFailed(DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), - reinterpret_cast(&dwriteFactory)), - SAL_WHERE); -ThrowIfFailed(dwriteFactory->GetGdiInterop(&dwriteGdiInterop), SAL_WHERE); -dwriteFontMgr = SkFontMgr_New_DirectWrite(dwriteFactory.get()); +dwriteFontMgr = SkFontMgr_New_DirectWrite(dwriteFactory); dwriteDone = true; } if (!dwriteFontMgr) @@ -343,8 +342,6 @@ void WinSkiaSalGraphicsImpl::ClearDevFontCache() dwriteFontMgr.reset(); dwriteFontSetBuilder.clear(); dwritePrivateCollection.clear(); -dwriteFactory.clear(); -dwriteGdiInterop.clear(); dwriteDone = false; initFontInfo(); // get font info again, just in case } diff --git a/vcl/win/gdi/DWriteTextRenderer.cxx b/vcl/win/gdi/DWriteTextRenderer.cxx index 64d49696b102..1e44d95ad2cb 100644 --- a/vcl/win/gdi/DWriteTextRenderer.cxx +++ b/vcl/win/gdi/DWriteTextRenderer.cxx @@ -101,8 +101,6 @@ HRESULT checkResult(HRESULT hr, const char* file, size_t line) D2DWriteTextOutRenderer::D2DWriteTextOutRenderer(bool bRenderingModeNatural) : mpD2DFactory(nullptr), -mpDWriteFactory(nullptr), -mpGdiInterop(nullptr), mpRT(nullptr), mRTProps(D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), @@ -110,14 +108,11 @@ D2DWriteTextOutRenderer::D2DWriteTextOutRenderer(bool bRenderingModeNatural) mbRenderingModeNatural(bRenderingModeNatural), meTextAntiAliasMode(D2DTextAntiAliasMode::Default) { +WinSalGraphics::getDWriteFactory(&mpDWriteFactory, &mpGdiInterop); HRESULT hr = S_OK; hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, __uuidof(ID2D1Factory), nullptr, reinterpret_cast(&mpD2DFactory)); -hr = DWriteCreateFactory(DWRIT
[Libreoffice-commits] core.git: vcl/inc vcl/win
vcl/inc/win/DWriteTextRenderer.hxx | 11 - vcl/win/gdi/DWriteTextRenderer.cxx | 80 ++--- 2 files changed, 6 insertions(+), 85 deletions(-) New commits: commit 0cf71ca47b463c0b944e31aa7bd66fdaf9097f8e Author: Khaled Hosny AuthorDate: Fri Nov 18 22:16:52 2022 +0200 Commit: خالد حسني CommitDate: Sat Nov 19 12:43:32 2022 +0100 vcl: remove unused D2DWriteTextOutRenderer code Change-Id: I873d13e3a230c2679daea2080a102d89003c90c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142955 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/win/DWriteTextRenderer.hxx b/vcl/inc/win/DWriteTextRenderer.hxx index b64cc48a1c6a..5f0dc35ddd58 100644 --- a/vcl/inc/win/DWriteTextRenderer.hxx +++ b/vcl/inc/win/DWriteTextRenderer.hxx @@ -47,14 +47,6 @@ public: HRESULT BindDC(HDC hDC, tools::Rectangle const & rRect = tools::Rectangle(0, 0, 1, 1)); -bool BindFont(HDC hDC) /*override*/; -bool ReleaseFont() /*override*/; - -std::vector GetGlyphInkBoxes(uint16_t const * pGid, uint16_t const * pGidEnd) const /*override*/; -ID2D1RenderTarget * GetRenderTarget() const { return mpRT; } -IDWriteFontFace * GetFontFace() const { return mpFontFace; } -float GetEmHeight() const { return mlfEmHeight; } - HRESULT CreateRenderTarget(bool bRenderingModeNatural); bool Ready() const; @@ -77,9 +69,6 @@ private: ID2D1DCRenderTarget * mpRT; const D2D1_RENDER_TARGET_PROPERTIES mRTProps; -IDWriteFontFace * mpFontFace; -float mlfEmHeight; -HDC mhDC; bool mbRenderingModeNatural; D2DTextAntiAliasMode meTextAntiAliasMode; }; diff --git a/vcl/win/gdi/DWriteTextRenderer.cxx b/vcl/win/gdi/DWriteTextRenderer.cxx index c160166a541e..64d49696b102 100644 --- a/vcl/win/gdi/DWriteTextRenderer.cxx +++ b/vcl/win/gdi/DWriteTextRenderer.cxx @@ -107,9 +107,6 @@ D2DWriteTextOutRenderer::D2DWriteTextOutRenderer(bool bRenderingModeNatural) mRTProps(D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), 0, 0)), -mpFontFace(nullptr), -mlfEmHeight(0.0f), -mhDC(nullptr), mbRenderingModeNatural(bRenderingModeNatural), meTextAntiAliasMode(D2DTextAntiAliasMode::Default) { @@ -229,8 +226,9 @@ bool D2DWriteTextOutRenderer::performRender(GenericSalLayout const & rLayout, Sa return ExTextOutRenderer()(rLayout, rGraphics, hDC, bRenderingModeNatural); } -mlfEmHeight = 0; -if (!GetDWriteFaceFromHDC(hDC, &mpFontFace, &mlfEmHeight)) +IDWriteFontFace* pFontFace; +float lfEmHeight = 0; +if (!GetDWriteFaceFromHDC(hDC, &pFontFace, &lfEmHeight)) return false; const WinFontInstance& rWinFont = static_cast(rLayout.GetFont()); @@ -268,8 +266,8 @@ bool D2DWriteTextOutRenderer::performRender(GenericSalLayout const & rLayout, Sa static_cast(aPos.getY() - bounds.Top()) }; WinFontTransformGuard aTransformGuard(mpRT, fHScale, rLayout, baseline, pGlyph->IsVertical()); DWRITE_GLYPH_RUN glyphs = { -mpFontFace, -mlfEmHeight, +pFontFace, +lfEmHeight, 1, glyphIndices, glyphAdvances, @@ -287,7 +285,7 @@ bool D2DWriteTextOutRenderer::performRender(GenericSalLayout const & rLayout, Sa if (pBrush) pBrush->Release(); -ReleaseFont(); +pFontFace->Release(); if (hr == D2DERR_RECREATE_TARGET) { @@ -298,72 +296,6 @@ bool D2DWriteTextOutRenderer::performRender(GenericSalLayout const & rLayout, Sa return succeeded; } -bool D2DWriteTextOutRenderer::BindFont(HDC hDC) -{ -// A TextOutRender can only be bound to one font at a time, so the -assert(mpFontFace == nullptr); -if (mpFontFace) -{ -ReleaseFont(); -return false; -} - -// Initially bind to an empty rectangle to get access to the font face, -// we'll update it once we've calculated a bounding rect in DrawGlyphs -if (FAILED(BindDC(mhDC = hDC))) -return false; - -mlfEmHeight = 0; -return GetDWriteFaceFromHDC(hDC, &mpFontFace, &mlfEmHeight); -} - -bool D2DWriteTextOutRenderer::ReleaseFont() -{ -mpFontFace->Release(); -mpFontFace = nullptr; -mhDC = nullptr; - -return true; -} - -// GetGlyphInkBoxes -// The inkboxes returned have their origin on the baseline, to a -ve value -// of Top() means the glyph extends abs(Top()) many pixels above the -// baseline, and +ve means the ink starts that many pixels below. -std::vector D2DWriteTextOutRenderer::GetGlyphInkBoxes(uint16_t const * pGid, uint16_t const * pGidEnd) const -{ -ptrdiff_t nGlyphs = pGidEnd - pGid; -if (nGlyphs < 0) -return st
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/layout/data/tdf152106.odt |binary sw/qa/extras/layout/layout.cxx | 11 +++ sw/source/core/layout/fly.cxx |8 3 files changed, 19 insertions(+) New commits: commit 6f0736c2981042f90e83cdd71b3f9c91dbe77661 Author: László Németh AuthorDate: Fri Nov 18 14:11:30 2022 +0100 Commit: László Németh CommitDate: Sat Nov 19 11:21:11 2022 +0100 tdf#152106 sw layout: fix freezing of multicol sections with flys Loading documents with multicol sections with flys could freeze Writer. Add loop control for multicol sections to fix it. Regression from commit 8feac9601cfe35ee0966776bab15d122206f154e "tdf#138518 sw: layout: avoid moving flys forward prematurely". Follow-up to ed12269c42f75f553bb8a8770923406f7824e473 "tdf#142080 sw: layout: fix infinite loop in CalcContent()". Change-Id: I06eb3f5a26b2d2ac3999b98a9661112b8bf7738f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142950 Tested-by: Jenkins Reviewed-by: László Németh diff --git a/sw/qa/extras/layout/data/tdf152106.odt b/sw/qa/extras/layout/data/tdf152106.odt new file mode 100644 index ..49ef5e50b8bd Binary files /dev/null and b/sw/qa/extras/layout/data/tdf152106.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index a5f4c961a602..c84b21f4e5bc 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2018,6 +2018,17 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf142080) "top", OUString::number(nPage9Top + 1460)); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf152106) +{ +// this caused an infinite loop +createSwDoc("tdf152106.odt"); + +xmlDocUniquePtr pLayout = parseLayoutDump(); + +// frame on page 3 +assertXPath(pLayout, "/root/page[3]/sorted_objs/fly", 1); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128198) { createSwDoc("tdf128198-1.docx"); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index ee779ce678a2..4cee6d9e712d 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1474,6 +1474,8 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl ) // FME 2007-08-30 #i81146# new loop control int nLoopControlRuns = 0; +// tdf#152106 loop control for multi-column sections +int nLoopControlRunsInMultiCol = 0; const int nLoopControlMax = 20; const SwFrame* pLoopControlCond = nullptr; @@ -1626,10 +1628,16 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl ) // #i28701# - restart layout process, if // requested by floating screen object formatting if (bRestartLayoutProcess +// tdf#152106 loop control in multi-column sections to avoid of freezing +&& nLoopControlRunsInMultiCol < nLoopControlMax // tdf#142080 if it was already on next page, and still is, // ignore restart, as restart could cause infinite loop && (wasFrameLowerOfLay || pLay->IsAnLower(pFrame))) { +bool bIsMultiColumn = pSect && pSect->GetSection() && pSect->Lower() && +pSect->Lower()->IsColumnFrame() && pSect->Lower()->GetNext(); +if ( bIsMultiColumn ) +++nLoopControlRunsInMultiCol; pFrame = pLay->ContainsAny(); pAgainObj1 = nullptr; pAgainObj2 = nullptr;
[Libreoffice-commits] core.git: bin/sanitize-excludelist.txt
bin/sanitize-excludelist.txt |1 + 1 file changed, 1 insertion(+) New commits: commit b72cf572bbf330bee411806c65c5bc2ff093a938 Author: Caolán McNamara AuthorDate: Sat Nov 19 10:01:31 2022 + Commit: Caolán McNamara CommitDate: Sat Nov 19 11:06:00 2022 +0100 ofz#53547 integer-overflow in poly is a lost cause I feel Change-Id: I3a8f67244ec8cf3d6c6abe9641c1d70f385567e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142959 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/bin/sanitize-excludelist.txt b/bin/sanitize-excludelist.txt index 0ed5b20a1575..259497f2f246 100644 --- a/bin/sanitize-excludelist.txt +++ b/bin/sanitize-excludelist.txt @@ -12,6 +12,7 @@ src:cairo*.h src:*/boost/boost/rational.hpp src:*/include/tools/gen.hxx src:*/tools/source/generic/gen.cxx +src:*/tools/source/generic/poly.cxx src:*/vcl/source/outdev/map.cxx [vptr] fun:_ZN4cppu14throwExceptionERKN3com3sun4star3uno3AnyE
[Libreoffice-commits] core.git: sw/source
sw/source/core/txtnode/OnlineAccessibilityCheck.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 4e4ca58abbbcbf03e69434062cdbfebe17113430 Author: Caolán McNamara AuthorDate: Fri Nov 18 20:41:40 2022 + Commit: Caolán McNamara CommitDate: Sat Nov 19 10:59:11 2022 +0100 ofz#53525 Abrt Change-Id: Ia99d6aff1e7e9b90167fc535c1fc7951e7f4b2b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142954 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx index d162e1a661ba..f919ce124a88 100644 --- a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx +++ b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx @@ -26,6 +26,7 @@ #include #include #include +#include namespace sw { @@ -67,7 +68,9 @@ OnlineAccessibilityCheck::OnlineAccessibilityCheck(SwDoc& rDocument) , m_nAccessibilityIssues(0) , m_bInitialCheck(false) , m_bOnlineCheckStatus( - officecfg::Office::Common::Accessibility::OnlineAccessibilityCheck::get()) + !utl::ConfigManager::IsFuzzing() + ? officecfg::Office::Common::Accessibility::OnlineAccessibilityCheck::get() + : false) { }