/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * 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/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * 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_SVL_UNDO_HXX #define INCLUDED_SVL_UNDO_HXX #include #include #include #include #include #include struct MarkedUndoAction; typedef o3tl::strong_int ViewShellId; class SVL_DLLPUBLIC SfxRepeatTarget { public: virtual ~SfxRepeatTarget() = 0; }; class SVL_DLLPUBLIC SfxUndoContext { public: virtual ~SfxUndoContext() = 0; }; class SVL_DLLPUBLIC SfxUndoAction { public: SfxUndoAction(); virtual ~SfxUndoAction() COVERITY_NOEXCEPT_FALSE; virtual void Undo(); virtual void UndoWithContext( SfxUndoContext& i_context ); virtual void Redo(); virtual void RedoWithContext( SfxUndoContext& i_context ); virtual void Repeat(SfxRepeatTarget&); virtual bool CanRepeat(SfxRepeatTarget&) const; virtual bool Merge( SfxUndoAction *pNextAction ); virtual OUString GetComment() const; virtual OUString GetRepeatComment(SfxRepeatTarget&) const; /// ID of the view shell that created this undo action. virtual ViewShellId GetViewShellId() const; /// Timestamp when this undo item was created. const DateTime& GetDateTime() const; virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const; private: SfxUndoAction( const SfxUndoAction& ) = delete; SfxUndoAction& operator=( const SfxUndoAction& ) = delete; DateTime m_aDateTime; }; /// is a mark on the Undo stack typedef sal_Int32 UndoStackMark; #define MARK_INVALID ::std::numeric_limits< UndoStackMark >::max() class SVL_DLLPUBLIC SfxUndoActions { struct Impl; std::unique_ptr mpImpl; public: SfxUndoActions(); SfxUndoActions( const SfxUndoActions& r ); ~SfxUndoActions(); bool empty() const; size_t size() const; const MarkedUndoAction& operator[]( size_t i ) const; MarkedUndoAction& operator[]( size_t i ); const SfxUndoAction* GetUndoAction( size_t i ) const; SfxUndoAction* GetUndoAction( size_t i ); void Remove( size_t i_pos ); void Remove( size_t i_pos, size_t i_count ); void Insert( SfxUndoAction* i_action, size_t i_pos ); }; /** do not make use of these implementation details, unless you really really have to! */ struct SVL_DLLPUBLIC SfxUndoArray { SfxUndoActions aUndoActions; size_t nMaxUndoActions; size_t nCurUndoAction; SfxUndoArray *pFatherUndoArray; SfxUndoArray(size_t nMax=0): nMaxUndoActions(nMax), nCurUndoAction(0), pFatherUndoArray(nullptr) {} virtual ~SfxUndoArray(); }; /** do not make use of these implementation details, unless you really really have to! */ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArray /* [Explanation] UndoAction to composite multiple Undos in one UndoAction. These actions are used by SfxUndomanager. With < SfxUndoManager::EnterListAction > you can go one composite level down and with < SfxUndoManager::LeaveListAction > up again. Redo and Undo work element wise on SfxListUndoActions. */ { struct Impl; std::unique_ptr mpImpl; public: SfxListUndoAction( const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId, SfxUndoArray *pFather ); virtual ~SfxListUndoAction() override; virtual void Undo() override; virtual void UndoWithContext( SfxUndoContext& i_context ) override; virtual void Redo() override; virtual void RedoWithContext( SfxUndoContext& i_context ) override; virtual void Repeat(SfxRepeatTarget&) override; virtual bool CanRepeat(SfxRepeatTarget&) const override; virtual bool Merge( SfxUndoAction *pNextAction ) override; virtual OUString GetComment() const override; /// See SfxUndoAction::GetViewShellId(). ViewShellId GetViewShellId() const override; virtual OUString GetRepeatComment(SfxRepeatTarget&) const override; sal_uInt16 GetId() const; void SetComment(const OUString& rComment); void dumpAsXml(struct _xmlTextWriter* pWriter) const override; }; /** is a callback interface for notifications about state changes of an SfxUndoManager */ class SAL_NO_VTABLE SfxUndoListener { public: virtual void actionUndone( const OUString& i_actionComment ) = 0; virtual void actionRedone( const OUString& i_actionComment ) = 0; virtual void undoActionAdded( const OUString& i_actionComment ) = 0; virtual void cleared() = 0; virtual void clearedRedo() = 0; virtual void resetAll() = 0; virtual void listActionEntered( const OUString& i_comment ) = 0; virtual void listActionLeft( const OUString& i_comment ) = 0; virtual void listActionCancelled() = 0; virtual void undoManagerDying() = 0; protected: ~SfxUndoListener() {} }; namespace svl { namespace undo { namespace impl { class UndoManagerGuard; class LockGuard; } } } struct SfxUndoManager_Data; class SVL_DLLPUBLIC SfxUndoManager { std::unique_ptr< SfxUndoManager_Data > m_xData; public: static bool const CurrentLevel = true; static bool const TopLevel = false; SfxUndoManager( size_t nMaxUndoActionCount = 20 ); virtual ~SfxUndoManager(); virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ); virtual void AddUndoAction( SfxUndoAction *pAction, bool bTryMerg=false ); virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const; virtual OUString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const; virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const; /// Get info about all undo actions (comment, view shell id, etc.) OUString GetUndoActionsInfo() const; virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const; virtual OUString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const; virtual SfxUndoAction* GetRedoAction() const; /// Get info about all redo actions (comment, view shell id, etc.) OUString GetRedoActionsInfo() const; virtual bool Undo(); virtual bool Redo(); /** Clears both the Redo and the Undo stack. Will assert and bail out when called while within a list action (IsInListAction). */ virtual void Clear(); /** Clears the Redo stack. Will assert and bail out when called while within a list action (IsInListAction). */ virtual void ClearRedo(); /** leaves any possible open list action (IsInListAction), and clears both the Undo and the Redo stack. Effectively, calling this method is equivalent to while ( IsInListAction() ) LeaveListAction();, followed by Clear(). The only difference to this calling sequence is that Reset is an atomic operation, also resulting in only one notification. */ virtual void Reset(); /** determines whether an Undo or Redo is currently running */ virtual bool IsDoing() const; virtual size_t GetRepeatActionCount() const; virtual OUString GetRepeatActionComment( SfxRepeatTarget &rTarget) const; virtual bool Repeat( SfxRepeatTarget &rTarget ); virtual bool CanRepeat( SfxRepeatTarget &rTarget ) const; virtual void EnterListAction(const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId); /** Leaves the list action entered with EnterListAction @return the number of the sub actions in the list which has just been left. Note that in case no such actions exist, the list action does not contribute to the Undo stack, but is silently removed. */ virtual size_t LeaveListAction(); /** Leaves the list action entered with EnterListAction, and forcefully merges the previous action on the stack into the newly created list action. Say you have an Undo action A on the stack, then call EnterListAction, followed by one or more calls to AddUndoAction, followed by a call to LeaveAndMergeListAction. In opposite to LeaveListAction, your Undo stack will now still contain one undo action: the newly created list action, whose first child is the original A, whose other children are those you added via AddUndoAction, and whose comment is the same as the comment of A. Effectively, this means that all actions added between EnterListAction and LeaveAndMergeListAction are hidden from the user. @return the number of the sub actions in the list which has just been left. Note that in case no such actions exist, the list action does not contribute to the Undo stack, but is silently removed. */ virtual size_t LeaveAndMergeListAction(); /// determines whether we're within a ListAction context, i.e. a LeaveListAction/LeaveAndMergeListAction call is pending virtual bool IsInListAction() const; /// Determines how many nested list actions are currently open virtual size_t GetListActionDepth() const; /** Clears the redo stack and removes the top undo action */ virtual void RemoveLastUndoAction(); /** enables (true) or disables (false) recording of undo actions If undo actions are added while undo is disabled, they are deleted. Disabling undo does not clear the current undo buffer! Multiple calls to EnableUndo are not cumulative. That is, calling EnableUndo( false ) twice, and then calling EnableUndo( true ) means that Undo is enable afterwards. */ virtual void EnableUndo( bool bEnable ); /// returns true if undo is currently enabled. /// This returns false if undo was disabled using EnableUndo( false ) and /// also during the runtime of the Undo() and Redo() methods. virtual bool IsUndoEnabled() const; /// Adds a new listener to be notified about changes in the UndoManager's state virtual void AddUndoListener( SfxUndoListener& i_listener ); virtual void RemoveUndoListener( SfxUndoListener& i_listener ); virtual bool IsEmptyActions() const; /** marks the current top-level element of the Undo stack, and returns a unique ID for it */ UndoStackMark MarkTopUndoAction(); /** removes a mark given by its ID. After the call, the mark ID is invalid. */ void RemoveMark( UndoStackMark const i_mark ); /** determines whether the top action on the Undo stack has a given mark */ bool HasTopUndoActionMark( UndoStackMark const i_mark ); /** removes the oldest Undo actions from the stack */ void RemoveOldestUndoAction(); void dumpAsXml(struct _xmlTextWriter* pWriter) const; protected: bool UndoWithContext( SfxUndoContext& i_context ); bool RedoWithContext( SfxUndoContext& i_context ); void ImplClearRedo_NoLock( bool const i_currentLevel ); /** clears all undo actions on the current level, plus all undo actions on superordinate levels, as soon as those levels are reached. If no list action is active currently, i.e. we're on the top level already, this method is equivalent to ->Clear. Otherwise, the Undo actions on the current level are removed. Upon leaving the current list action, all undo actions on the then-current level are removed, too. This is continued until the top level is reached. */ void ClearAllLevels(); virtual void EmptyActionsChanged(); private: size_t ImplLeaveListAction( const bool i_merge, ::svl::undo::impl::UndoManagerGuard& i_guard ); bool ImplAddUndoAction_NoNotify( SfxUndoAction* pAction, bool bTryMerge, bool bClearRedo, ::svl::undo::impl::UndoManagerGuard& i_guard ); void ImplClearRedo( ::svl::undo::impl::UndoManagerGuard& i_guard, bool const i_currentLevel ); void ImplClearUndo( ::svl::undo::impl::UndoManagerGuard& i_guard ); void ImplClearCurrentLevel_NoNotify( ::svl::undo::impl::UndoManagerGuard& i_guard ); size_t ImplGetRedoActionCount_Lock( bool const i_currentLevel = CurrentLevel ) const; bool ImplIsUndoEnabled_Lock() const; bool ImplIsInListAction_Lock() const; void ImplEnableUndo_Lock( bool const i_enable ); bool ImplUndo( SfxUndoContext* i_contextOrNull ); bool ImplRedo( SfxUndoContext* i_contextOrNull ); void ImplCheckEmptyActions(); inline bool ImplIsEmptyActions() const; friend class ::svl::undo::impl::LockGuard; }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ion> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-09-13ICU: fix aclocal dependencyXisco Fauli
Patch configure directly instead of configure.ac Change-Id: Iaaf3e10dc435d5d8f546c009b27c9a4aa7c09141 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173315 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-09-12ICU: upgrade to 75.1Xisco Fauli
Downloaded from https://github.com/unicode-org/icu/releases/tag/release-75-1 Change-Id: I882c57bf5ab613dc71f7ae1c31305596e1ca791f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168750 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-05-06makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo)Christian Lohmaier
…by a simple/static $(gb_UnpackedTarball_workdir)/foo see also 0c4c84a14b01c71c76a9c45a7f26aec4d64f3e4f Change-Id: I8e6aa55c85534c4446556548910c950ddbe7c6fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167163 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2024-02-21tdf#159529 clear hb_ot_face_t data after fetching 'sbix' and 'glyf' tablesPatrick Luby
The 'sbix' and 'glyf' tables can be very large for color emoji fonts so clear any cached data in hb_ot_face_t after fetching that table's extents. Change-Id: Id5deda9114b7199a4194ff16879e5791acd1cd82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163674 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-12Upgrade Harfbuzz to 8.0.0Taichi Haradaguchi
Change-Id: I04d81509c50f0335d201b5286460989f526b58f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154233 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2023-07-08tdf137553: Fix advance width for text using Graphite fontsKhaled Hosny
This is a HarfBuzz bug and it was reported upstream. Change-Id: Ibf945d30f57c7fb847b63c40f5a7b2903958ab89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154213 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-01Upgrade Harfbuzz to 7.3.0Taichi Haradaguchi
Release Notes: https://github.com/harfbuzz/harfbuzz/releases/tag/7.2.0 (v7.2.0) https://github.com/harfbuzz/harfbuzz/releases/tag/7.3.0 (v7.3.0) Change-Id: I4f57b7e829f2356b5e2b442ff00df555121c0e66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153729 Tested-by: Taichi Haradaguchi <20001722@ymail.ne.jp> Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2023-06-21No need to fiddle with ICU UChar typedef anymoreKhaled Hosny
The affected external dependencies should be building with c++11 by now already. Change-Id: I0d1f8aed6ed28f510f456a368b724c3c4eeb3240 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153389 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-03-23Upgrade Harfbuzz to 7.1.0Taichi Haradaguchi
* Fixes CVE-2023-25193. * if Harfbuzz >= 7.0.0, uses hb_font_draw_glyph() instead of hb_font_get_glyph_shape(). * Update URL in README. Change-Id: Id234c2b459c40ddac340731b44889b104e03a1e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148743 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
2023-02-22vcl: Avoid the need to patch HarfBuzzKhaled Hosny
Reverts parts of d552b4a549d614a03aa9328e017dec27bd3ff41e and 97e2e73e87479a742b798f362eda4baafb89497c. Instead of patching HarfBuzz, lets make use of the already mmap’ed file we use with FreeType. Change-Id: Ia81222118162a30cadb8c988bc477ad3ce36166d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147410 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-09Enable opening of downloaded fonts only in ForKit in OnlineTor Lillqvist
We want that only the ForKit process needs to have access to new font files added to a Collabora Online instance dynamically by downloading from a server. There are however many locations in the Kit process, in core and in external libraries like harfbuzz, where the code wants to open a font file. Handle this so that the ForKit process opens such a downloaded font file and doesn't close it. The file descriptor is thus inherited by Kit processes. The font file pathname passed on to other code is a fake on in the format "/:FD:/%d" where the %d is the file descriptor of the opened font file. Add checks in all places where font files are opened, look for this special pathname format, and modify the code to just dup() the already open file descriptor in that case. All this is relevant for Linux only, as Collabora Online runs on Linux. Do the above for harfbuzz, cairo, fontconfig, and freetype. In addition make sure that these libraries (except harfbuzz which needs to be a static library and freetype) when bundled, on Linux, are built as shared libraries, and won't be confused with the corresponding system libraries by making sure their sonames are different. Change-Id: Ib059cb27e1637d07bb709249abd0d984f948caa9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140714 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146341 Tested-by: Jenkins
2022-12-17Update HarfBuzz to 6.0.0Khaled Hosny
Change-Id: Id371a53a126f2b95b17e642a9c63adafd5aa3d33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144394 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
2022-11-25add in latest harfbuzz effortCaolán McNamara
the document still fails for me, but in a new way which suggests a possible problem on our side. Change-Id: Ic38259653a43b39f9330adc503d085a896c15d2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143246 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-11-24backport recent libreoffice-related harfbuzz fixesCaolán McNamara
Change-Id: I1ff1b6291e9799d95477334f2726132ddc99442f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143208 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-11-17use harfbuzz upstream fix instead of workaroundCaolán McNamara
drop temp workaround for problem seen with tdf119074-1.odt i.e. apply https://github.com/harfbuzz/harfbuzz/pull/3874 for https://github.com/harfbuzz/harfbuzz/issues/3824 Change-Id: I42373f2282d30d7e45ee88b654d3df40f3a6384b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142815 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-31Update HarfBuzz to 5.1.0Khaled Hosny
Dropping negativeadvance.patch that was applied upstream. Change-Id: I8eba49d2d158c0c29911f4079315ed0bf87b7fa6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137648 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-01try to use also proper debug LDFLAGS for externals librariesLuboš Luňák
This is basically ea68de2968c0dbcd8e7549435e829db06795c16d but for LDFLAGS. A number of external libs cannot use this because their libtool mishandles -fuse-ld. Change-Id: Idee379eb0a3afb475b536519ee3de064b4e218f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133639 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-12use gb_DEBUGINFO_FLAGS consistently in gbuild ExternalProject'sLuboš Luňák
A number of them didn't use it at all, others had it hand-written in various ways. Change-Id: Iaf86325f9cdc032926bac917dc3eef4e34661544 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132818 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-01-31externals: always provide platform configure flagsJan-Marek Glogowski
No idea why we just provided the platform flags when cross- compiling. In the curious case, where the host platform is detected as x86_64-pc-mingw32 per default and we actually want to override it with x86_64-pc-cygwin, we don't do a cross compile, but must override the host platform. But there is additional special handling needed for the omitted cross-platform build in the special case of --host=i686-pc-cygwin and --build=x86_64-pc-cygwin, where we deliberatly ignore cross building; Windows is already a slow build, so try to keep this optimization (AMD64 can execute x86 binaries). There is the theoretical case, where the externals config.guess would have detected something else and that "magically" even worked, while the LO detected triplet would fail, but this should be fixed in the external in any way. Change-Id: Ib7a9719e0e406fe90334b7611dc3f01b51692bfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129153 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-08-10Mark external/harfbuzz/negativeadvance.patch as sent upstreamStephan Bergmann
Change-Id: Ia12ea1fce7a994b519e743edbc18cbd27ccb78bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120210 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-09external/harfbuzz: hb_graphite2_cluster_t::advance can apparently be negativeStephan Bergmann
...as seen with `instdir/program/soffice --headless --convert-to pdf` of doc/abi6073-2.doc from the crash-testing corpus when run under UBSan, > hb-graphite2.cc:361:15: runtime error: -1024 is outside the range of representable values of type 'unsigned int' > #0 in _hb_graphite2_shape at workdir/UnpackedTarball/harfbuzz/src/hb-graphite2.cc:361:15 > #1 in _hb_shape_plan_execute_internal(hb_shape_plan_t*, hb_font_t*, hb_buffer_t*, hb_feature_t const*, unsigned int) at workdir/UnpackedTarball/harfbuzz/src/./hb-shaper-list.hh:38:1 > #2 in hb_shape_plan_execute at workdir/UnpackedTarball/harfbuzz/src/hb-shape-plan.cc:453:14 > #3 in hb_shape_full at workdir/UnpackedTarball/harfbuzz/src/hb-shape.cc:139:19 > #4 in GenericSalLayout::LayoutText(ImplLayoutArgs&, SalLayoutGlyphsImpl const*) at vcl/source/gdi/CommonSalLayout.cxx:495:23 > #5 in OutputDevice::getFallbackLayout(LogicalFontInstance*, int, ImplLayoutArgs&, SalLayoutGlyphs const*) const at vcl/source/outdev/font.cxx:1232:21 > #6 in OutputDevice::ImplGlyphFallbackLayout(std::unique_ptr<SalLayout, std::default_delete<SalLayout> >, ImplLayoutArgs&, SalLayoutGlyphs const*) const at vcl/source/outdev/font.cxx:1300:48 > #7 in OutputDevice::ImplLayout(rtl::OUString const&, int, int, Point const&, long, long const*, SalLayoutFlags, vcl::TextLayoutCache const*, SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:1332:22 > #8 in lcl_CreateLayout(SwTextGlyphsKey const&, __gnu_debug::_Safe_iterator<std::_Rb_tree_iterator<std::pair<SwTextGlyphsKey const, SwTextGlyphsData> >, std::__debug::map<SwTextGlyphsKey, SwTextGlyphsData, std::less<SwTextGlyphsKey>, std::allocator<std::pair<SwTextGlyphsKey const, SwTextGlyphsData> > >, std::bidirectional_iterator_tag>) at sw/source/core/txtnode/fntcache.cxx:233:33 > #9 in SwFntObj::GetCachedSalLayoutGlyphs(SwTextGlyphsKey const&) at sw/source/core/txtnode/fntcache.cxx:257:12 > #10 in SwFont::GetTextBreak(SwDrawTextInfo const&, long) at sw/source/core/txtnode/fntcache.cxx:2551:58 > #11 in SwTextSizeInfo::GetTextBreak(long, o3tl::strong_int<int, Tag_TextFrameIndex>, unsigned short, vcl::TextLayoutCache const*) const at sw/source/core/text/inftxt.cxx:450:20 > #12 in SwTextGuess::Guess(SwTextPortion const&, SwTextFormatInfo&, unsigned short) at sw/source/core/text/guess.cxx:205:26 > #13 in SwTextPortion::Format_(SwTextFormatInfo&) at sw/source/core/text/portxt.cxx:305:32 > #14 in SwTextPortion::Format(SwTextFormatInfo&) at sw/source/core/text/portxt.cxx:456:12 > #15 in SwLineLayout::Format(SwTextFormatInfo&) at sw/source/core/text/porlay.cxx:260:31 (where in frame #4 GenericSalLayout::LayoutText, pHbBuffer->props.direction is HB_DIRECTION_RTL, in case that is relevant). It is unclear to me whether it is sufficient to only change hb_graphite2_cluster_t::advance from signed to unsigned int, as there are other unsigned int variables (like curradv in _hb_graphite2_shape) whose value depend on hb_graphite2_cluster_t::advance, and which thus might also become negative. But unlike the float -> unsigned int conversion that UBSan warned about here (where gr_slot_origin_X() and xscale are float), those are signed int -> unsigned int conversions that do not cause undefined behavior. At least, with this change, the above --convert-to pdf and a full `make check screenshot` succeeded for me under without further UBSan warnings. Change-Id: Ifa6fa930da162b986d3f536f8b3613790b3f19c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120192 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-07-20tdf#143429: update harfbuzz to 2.8.2 versionJulien Nabet
Change-Id: I263dc6da5be3ea55205076a1f4e263fe5bba31fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119232 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-06-28Mark external/harfbuzz/Wunused-but-set-variable.patch as fixed upstreamStephan Bergmann
Change-Id: Iefc8f4f6ff93ec1a11256724b1881689d5eb56d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117992 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-25Silence -Werror,-Wunused-but-set-variable (clang-cl 13 trunk)Stephan Bergmann
...during build of ExternalProject_harfbuzz: > In file included from hb-ot-shape-complex-myanmar.cc:136: > hb-ot-shape-complex-myanmar-machine.rl(108,36): error: variable 'act' set but not used [-Werror,-Wunused-but-set-variable] > unsigned int p, pe, eof, ts, te, act HB_UNUSED; > ^ Change-Id: Ie75a5cfa16c29c02e1b97380ebd63e7d789926f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117850 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-05WASM: add initial support for Emscripten cross buildJan-Marek Glogowski
- configure with: - --host=wasm64-local-emscripten - had to make a few externals optional, so adding: - --disable-nss - --disable-cmis - --disable-curl Change-Id: I48d1c73d2675ad2e2beaf2c341578199efbd24ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111130 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2020-02-16GBUILD_TRACE, support for finding out where the build time is spentLuboš Luňák
See instructions in solenv/gbuild/Trace.mk . This generates a file than can be viewed e.g. in the Chromium tracing view. Change-Id: I5f90647c58ca729375525b6daed2d4918adc8188 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88754 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-30Upgrade to ICU 65.1Eike Rathke
sberg says: On Windows, implicit --enable-extras first causes a build breaker in workdir/UnpackedTarball/icu/source/extras/scrptrun when linking, because Windows link.exe doesn't understand -o. But even with a patch > --- source/extra/scrptrun/Makefile.in > +++ source/extra/scrptrun/Makefile.in > @@ -74,7 +74,7 @@ > && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status > > $(TARGET) : $(OBJECTS) > - $(LINK.cc) -o $@ $^ $(LIBS) > + $(LINK.cc) $(OUTOPT)$@ $^ $(LIBS) > $(POST_BUILD_STEP) > > invoke: linking would still fail with a missing ../../lib/icuucdd.lib, which is apparently expanded from $(LIBS) there, but I have no idea where it should be built but isn't. Lets hope that --disable-extras is sufficient for our needs. Change-Id: I6d0117b230caa41abf488fcd069028e3474700f8 Reviewed-on: https://gerrit.libreoffice.org/81632 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-23external/harfbuzz: Avoid UBSan nullptr-with-nonzero-offsetStephan Bergmann
...(new with Clang 10 trunk), as seen during CppunitTest_emfio_emf: > hb-ot-layout-gsubgpos.hh:390:20: runtime error: applying non-zero offset 2 to null pointer > #0 in OT::hb_ot_apply_context_t::skipping_iterator_t::next() at workdir/UnpackedTarball/harfbuzz/src/./hb-ot-layout-gsubgpos.hh:390:20 > #1 in OT::PairPosFormat1::apply(OT::hb_ot_apply_context_t*) const at workdir/UnpackedTarball/harfbuzz/src/./hb-ot-layout-gpos-table.hh:910:22 > #2 in bool OT::hb_get_subtables_context_t::apply_to<OT::PairPosFormat1>(void const*, OT::hb_ot_apply_context_t*) at workdir/UnpackedTarball/harfbuzz/src/./hb-ot-layout-gsubgpos.hh:625:23 > #3 in OT::hb_get_subtables_context_t::hb_applicable_t::apply(OT::hb_ot_apply_context_t*) const at workdir/UnpackedTarball/harfbuzz/src/./hb-ot-layout-gsubgpos.hh:643:62 > #4 in OT::hb_ot_layout_lookup_accelerator_t::apply(OT::hb_ot_apply_context_t*) const at workdir/UnpackedTarball/harfbuzz/src/./hb-ot-layout-gsubgpos.hh:2624:24 > #5 in apply_forward(OT::hb_ot_apply_context_t*, OT::hb_ot_layout_lookup_accelerator_t const&) at workdir/UnpackedTarball/harfbuzz/src/hb-ot-layout.cc:1811:24 > #6 in void apply_string<GPOSProxy>(OT::hb_ot_apply_context_t*, GPOSProxy::Lookup const&, OT::hb_ot_layout_lookup_accelerator_t const&) at workdir/UnpackedTarball/harfbuzz/src/hb-ot-layout.cc:1864:11 > #7 in void hb_ot_map_t::apply<GPOSProxy>(GPOSProxy const&, hb_ot_shape_plan_t const*, hb_font_t*, hb_buffer_t*) const at workdir/UnpackedTarball/harfbuzz/src/hb-ot-layout.cc:1910:7 > #8 in hb_ot_map_t::position(hb_ot_shape_plan_t const*, hb_font_t*, hb_buffer_t*) const at workdir/UnpackedTarball/harfbuzz/src/hb-ot-layout.cc:1933:3 > #9 in hb_ot_shape_plan_t::position(hb_font_t*, hb_buffer_t*) const at workdir/UnpackedTarball/harfbuzz/src/hb-ot-shape.cc:266:9 > #10 in hb_ot_position_complex(hb_ot_shape_context_t const*) at workdir/UnpackedTarball/harfbuzz/src/hb-ot-shape.cc:951:12 > #11 in hb_ot_position(hb_ot_shape_context_t const*) at workdir/UnpackedTarball/harfbuzz/src/hb-ot-shape.cc:994:3 > #12 in hb_ot_shape_internal(hb_ot_shape_context_t*) at workdir/UnpackedTarball/harfbuzz/src/hb-ot-shape.cc:1065:3 > #13 in _hb_ot_shape at workdir/UnpackedTarball/harfbuzz/src/hb-ot-shape.cc:1088:3 > #14 in hb_shape_plan_execute at workdir/UnpackedTarball/harfbuzz/src/./hb-shaper-list.hh:42:1 > #15 in hb_shape_full at workdir/UnpackedTarball/harfbuzz/src/hb-shape.cc:139:19 > #16 in GenericSalLayout::LayoutText(ImplLayoutArgs&, SalLayoutGlyphs const*) at vcl/source/gdi/CommonSalLayout.cxx:463:23 > #17 in OutputDevice::ImplLayout(rtl::OUString const&, int, int, Point const&, long, long const*, SalLayoutFlags, vcl::TextLayoutCache const*, SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:1312:36 > #18 in OutputDevice::GetTextBoundRect(tools::Rectangle&, rtl::OUString const&, int, int, int, unsigned long, long const*, SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:2334:18 > #19 in drawinglayer::primitive2d::TextLayouterDevice::getTextBoundRect(rtl::OUString const&, unsigned int, unsigned int) const at drawinglayer/source/primitive2d/textlayoutdevice.cxx:297:26 > #20 in drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getB2DRange(drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/textprimitive2d.cxx:305:63 > #21 in drawinglayer::primitive2d::getB2DRangeFromPrimitive2DReference(com::sun::star::uno::Reference<com::sun::star::graphic::XPrimitive2D> const&, drawinglayer::geometry::ViewInformation2D const&) at drawinglayer/source/primitive2d/baseprimitive2d.cxx:175:48 > #22 in drawinglayer::primitive2d::Primitive2DContainer::getB2DRange(drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/baseprimitive2d.cxx:199:36 > #23 in drawinglayer::primitive2d::MetafilePrimitive2D::create2DDecomposition(drawinglayer::primitive2d::Primitive2DContainer&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/metafileprimitive2d.cxx:51:67 > #24 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/baseprimitive2d.cxx:126:17 > #25 in drawinglayer::tools::Primitive2dXmlDump::decomposeAndWrite(drawinglayer::primitive2d::Primitive2DContainer const&, tools::XmlWriter&) at drawinglayer/source/tools/primitive2dxmldump.cxx:332:38 > #26 in drawinglayer::tools::Primitive2dXmlDump::dumpAndParse(drawinglayer::primitive2d::Primitive2DContainer const&, rtl::OUString const&) at drawinglayer/source/tools/primitive2dxmldump.cxx:130:5 > #27 in (anonymous namespace)::Test::checkRectPrimitive(com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::graphic::XPrimitive2D> > const&) at emfio/qa/cppunit/emf/EmfImportTest.cxx:80:34 > #28 in (anonymous namespace)::Test::testWorking() at emfio/qa/cppunit/emf/EmfImportTest.cxx:94:5 and similarly during CppunitTest_vcl_complextext: > hb-ot-layout-gsubgpos.hh:417:20: runtime error: applying non-zero offset 2 to null pointer > #0 in OT::hb_ot_apply_context_t::skipping_iterator_t::prev() at workdir/UnpackedTarball/harfbuzz/src/./hb-ot-layout-gsubgpos.hh:417:20 > #1 in OT::MarkMarkPosFormat1::apply(OT::hb_ot_apply_context_t*) const at workdir/UnpackedTarball/harfbuzz/src/./hb-ot-layout-gpos-table.hh:1541:22 > #2 in bool OT::hb_get_subtables_context_t::apply_to<OT::MarkMarkPosFormat1>(void const*, OT::hb_ot_apply_context_t*) at workdir/UnpackedTarball/harfbuzz/src/./hb-ot-layout-gsubgpos.hh:625:23 > #3 in OT::hb_get_subtables_context_t::hb_applicable_t::apply(OT::hb_ot_apply_context_t*) const at workdir/UnpackedTarball/harfbuzz/src/./hb-ot-layout-gsubgpos.hh:643:62 > #4 in OT::hb_ot_layout_lookup_accelerator_t::apply(OT::hb_ot_apply_context_t*) const at workdir/UnpackedTarball/harfbuzz/src/./hb-ot-layout-gsubgpos.hh:2624:24 > #5 in apply_forward(OT::hb_ot_apply_context_t*, OT::hb_ot_layout_lookup_accelerator_t const&) at workdir/UnpackedTarball/harfbuzz/src/hb-ot-layout.cc:1811:24 > #6 in void apply_string<GPOSProxy>(OT::hb_ot_apply_context_t*, GPOSProxy::Lookup const&, OT::hb_ot_layout_lookup_accelerator_t const&) at workdir/UnpackedTarball/harfbuzz/src/hb-ot-layout.cc:1864:11 > #7 in void hb_ot_map_t::apply<GPOSProxy>(GPOSProxy const&, hb_ot_shape_plan_t const*, hb_font_t*, hb_buffer_t*) const at workdir/UnpackedTarball/harfbuzz/src/hb-ot-layout.cc:1910:7 > #8 in hb_ot_map_t::position(hb_ot_shape_plan_t const*, hb_font_t*, hb_buffer_t*) const at workdir/UnpackedTarball/harfbuzz/src/hb-ot-layout.cc:1933:3 > #9 in hb_ot_shape_plan_t::position(hb_font_t*, hb_buffer_t*) const at workdir/UnpackedTarball/harfbuzz/src/hb-ot-shape.cc:266:9 > #10 in hb_ot_position_complex(hb_ot_shape_context_t const*) at workdir/UnpackedTarball/harfbuzz/src/hb-ot-shape.cc:951:12 > #11 in hb_ot_position(hb_ot_shape_context_t const*) at workdir/UnpackedTarball/harfbuzz/src/hb-ot-shape.cc:994:3 > #12 in hb_ot_shape_internal(hb_ot_shape_context_t*) at workdir/UnpackedTarball/harfbuzz/src/hb-ot-shape.cc:1065:3 > #13 in _hb_ot_shape at workdir/UnpackedTarball/harfbuzz/src/hb-ot-shape.cc:1088:3 > #14 in hb_shape_plan_execute at workdir/UnpackedTarball/harfbuzz/src/./hb-shaper-list.hh:42:1 > #15 in hb_shape_full at workdir/UnpackedTarball/harfbuzz/src/hb-shape.cc:139:19 > #16 in GenericSalLayout::LayoutText(ImplLayoutArgs&, SalLayoutGlyphs const*) at vcl/source/gdi/CommonSalLayout.cxx:463:23 > #17 in OutputDevice::ImplLayout(rtl::OUString const&, int, int, Point const&, long, long const*, SalLayoutFlags, vcl::TextLayoutCache const*, SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:1312:36 > #18 in OutputDevice::GetTextArray(rtl::OUString const&, long*, int, int, vcl::TextLayoutCache const*, SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:961:45 > #19 in VclComplexTextTest::testArabic() at vcl/qa/cppunit/complextext.cxx:81:32 I have no idea whether this even remotely resembles a useful fix, though. Change-Id: I7671b84374cf119e173406bc60f6631a64dfc794 Reviewed-on: https://gerrit.libreoffice.org/81400 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-26harfbuzz: follow main configure's --disable-dependency-trackingChristian Lohmaier
Change-Id: I5ab185ca783e0e3f637c22909e53a67119349ad7 Reviewed-on: https://gerrit.libreoffice.org/78130 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2019-08-23external/harfbuzz configure needs MAKE nowStephan Bergmann
...after 352924a64750bb99aec54feea3af0121603c12a8 "Update HarfBbuzz to 2.6.0", where it started to fail for me on Windows with > config.status: error: in `/cygdrive/c/lo/core/workdir/UnpackedTarball/harfbuzz': > config.status: error: Something went wrong bootstrapping makefile fragments > for automatic dependency tracking. Try re-running configure with the > '--disable-dependency-tracking' option to at least be able to build > the package (albeit without support for automatic dependency tracking). > See `config.log' for more details > make[1]: *** [C:/lo/core/external/harfbuzz/ExternalProject_harfbuzz.mk:24: C:/lo/core/workdir/ExternalProject/harfbuzz/build] Error 1 because it didn't find any `make` (I only have an /opt/lo/bin/make installed). Change-Id: I378448b2cf1c92596220b0142e4e67a83162d972 Reviewed-on: https://gerrit.libreoffice.org/77987 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-20Update HarfBbuzz to 2.6.0Khaled Hosny
Change-Id: I7983dd10fe6599a2473caf0da04a0df3e63e9b2a Reviewed-on: https://gerrit.libreoffice.org/77790 Tested-by: Jenkins Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2019-05-05Fix remaining uses of gb_SYMBOLStephan Bergmann
...after eeeec33ada5923f1f534334b22c15d6e2c6f1d35 "merge --enable-selective-debuginfo into --enable-symbols" had removed it Change-Id: I83aed6e21c4b983d8645707daa65bd85ec16ff6b Reviewed-on: https://gerrit.libreoffice.org/71798 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-03-11Add -frtti to HarfBuzz CXXFLAGS instead of paching configure.acKhaled Hosny
Change-Id: Ibc16c4e9c4a305d6fff764fcf3964a63c5322e14 Reviewed-on: https://gerrit.libreoffice.org/68921 Tested-by: Jenkins Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2019-03-08Don'tbuild HarfBuzz with Core Text support on macOS/iOSKhaled Hosny
HarfBuzz 2.x has native support for AAT fonts which is, according to Chrome developers, sgnificantly faster that HarfBuzz Core Text integration. Change-Id: I4d5e861a1958402a6e3ccb720b10f40828c3db6a Reviewed-on: https://gerrit.libreoffice.org/68919 Tested-by: Jenkins Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2019-03-08ofz#13602 -fsanitize=vptr' not allowed with '-fno-rtti'Caolán McNamara
Change-Id: I77beadee964f08f87f2fe7cc0daef5cb91151b72 Reviewed-on: https://gerrit.libreoffice.org/68912 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-06Record external/harfbuzz/msvc.patch as sent upstreamStephan Bergmann
Change-Id: I47277272170508e9af7617e9b774bbdca05e9ec3 Reviewed-on: https://gerrit.libreoffice.org/68766 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-05Upgrade to latest HarfBuzz 2.3.1Stephan Bergmann
As a side-effect, this gets rid of some Clang -fsanitize=implicit-signed-integer-truncation warnings. The various external/harfbuzz/*.patch no longer applied and appear not to be necessary any more. (But a new external/harfbuzz/msvc.patch became necessary.) <https://dev-www.libreoffice.org/src/harfbuzz-2.3.1.tar.bz2> was downloaded from <https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-2.3.1.tar.bz2>, and HARFBUZZ_SHA256SUM in download.lst matches <https://www.freedesktop.org/ software/harfbuzz/release/harfbuzz-2.3.1.tar.bz2.sha256>. Change-Id: Ic85acd14b4f488b3d88ce1bafc93be271928006e Reviewed-on: https://gerrit.libreoffice.org/68731 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-24Drop unnecessary gb_DEBUG_CFLAGSStephan Bergmann
...which was at maximum set to GCC's -finline-limit=0 -fno-inline (solenv/gbuild/platform/com_GCC_defs.mk). Those options were set for debug builds "since forever", but that looks very much like cargo cult: -fno-inline "is the default when not optimizing" anyway (<https://gcc.gnu.org/onlinedocs/gcc-7.4.0/gcc/Optimize-Options.html>), and it is unclear to me how -finline-limit=0 should have any impact beyond -fno-inline (and maybe was present for ancient compilers that only supported -finline-limit but not -fno-inline?). Change-Id: Id6752d03b1b7ec8763defabc5720d4dd08790874 Reviewed-on: https://gerrit.libreoffice.org/66836 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-23Drop use of obsolete GCC -fno-default-inlineStephan Bergmann
...that is documented as: "Does nothing. Preserved for backward compatibility." ever since <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=160384> from 2010. -fno-default-inline was the only value ever set in gb_DEBUG_CXXFLAGS, so the latter can be removed now. The use of gb_DEBUG_CXXFLAGS had accidentally already been removed from gb_LinkTarget__get_debugcxxflags with e751e24250fda31dde52b3c65ca79f86142dc789 "--enable-optimized should be orthogonal to --enable-debug/--enable-dbgutil", and that leaves gb_LinkTarget__get_debugcflags and gb_LinkTarget__get_debugcxxflags with identical definitions, so replace those two with a single gb_LinkTarget__get_debugflags. Some external modules had used only gb_DEBUG_CXXFLAGS, when this was apparently meant to be used in addition to gb_DEBUG_CFLAGS, so those uses have been changed to gb_DEBUG_CFLAGS now. Change-Id: I84ea0ab1233569b0b02ca057240a71f138352381 Reviewed-on: https://gerrit.libreoffice.org/66808 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>