diff options
author | Jim Raykowski <raykowj@gmail.com> | 2023-04-15 19:53:05 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2023-04-25 19:43:33 +0200 |
commit | 4bc86f6477c3ed5f0e97b0a530acf7e102b613b3 (patch) | |
tree | 7fa32d1191383d0f73456daecf6dbfe275f26b8e /include | |
parent | fb76d7f454522c4e8982b8fe1e75d0eb6f37c12d (diff) |
tdf#38194 tdf#106556 Enhancement to highlight direct formatting,
paragraph style, and character style use in Writer documents
Initial commit to realize direct formatting, paragraph style, and
character style highlighting enhancement requests.
Highlighting of character direct formatting is turned on/off using
.uno:HighlightCharDF. Highlighting of paragraph styles and character
styles is turned on/off using a check box in the Sidebar Styles panel.
Closing the Sidebar also turns paragraph and character style
highlighting off. Paragraph direct formatting is indicated by a hatch
pattern over the paragraph style highlight bar and also by "+ Paragraph
Direct Formatting" appended to the tooltip that appears showing the
name of the paragraph style when the mouse pointer is over the style
highlight bar.
Colors used for styles highlighting are determined by a hash of the
style name. Lightgray is used for character direct formatting.
Known issue:
Tooltip doesn't show for paragraph style highlighting in tables and in
frames where the highlighting bar is drawn outside of the frame.
Change-Id: I6e00ee38c1c169bc7c6542a1782c03b2593e1891
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150451
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/viewsh.hxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 8589b9b0751b..a9713eb2375f 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -35,6 +35,7 @@ #include <editeng/outliner.hxx> #include <functional> #include <unordered_set> +#include <unordered_map> class SfxTabPage; class SfxBaseController; @@ -152,6 +153,8 @@ template<class T> bool checkSfxViewShell(const SfxViewShell* pShell) return dynamic_cast<const T*>(pShell) != nullptr; } +typedef std::unordered_map<OUString, std::pair<Color, int>> StylesHighlighterColorMap; + /** * One SfxViewShell more or less represents one edit window for a document, there can be multiple * ones for a single opened document (SfxObjectShell). @@ -180,6 +183,9 @@ friend class SfxPrinterController; /// Used for async export std::shared_ptr<SfxStoringHelper> m_xHelper; + StylesHighlighterColorMap ParaStylesColorMap; + StylesHighlighterColorMap CharStylesColorMap; + protected: virtual void Activate(bool IsMDIActivate) override; virtual void Deactivate(bool IsMDIActivate) override; @@ -457,6 +463,9 @@ public: bool isBlockedCommand(OUString command); void SetStoringHelper(std::shared_ptr<SfxStoringHelper> xHelper) { m_xHelper = xHelper; } + + StylesHighlighterColorMap& GetStylesHighlighterParaColorMap() { return ParaStylesColorMap; } + StylesHighlighterColorMap& GetStylesHighlighterCharColorMap() { return CharStylesColorMap; } }; #endif // INCLUDED_SFX2_VIEWSH_HXX |