[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 2 commits - sw/source vcl/qa vcl/source
sw/source/core/crsr/crsrsh.cxx |6 +++--- vcl/qa/cppunit/pdfexport/pdfexport.cxx |3 --- vcl/source/gdi/pdfwriter_impl.cxx | 10 ++ 3 files changed, 13 insertions(+), 6 deletions(-) New commits: commit 601dfe1cc547c4ae4a8e87da6d268e04ba44 Author: Michael Stahl AuthorDate: Tue Sep 19 21:18:52 2023 +0200 Commit: Xisco Fauli CommitDate: Thu Sep 21 08:29:30 2023 +0200 tdf#157129 sw: fix wrong cursor position after paste This asserts in SwUndoInserts::UndoImpl(): index.cxx:234: virtual SwContentIndexReg::~SwContentIndexReg(): Assertion `!m_pFirst && !m_pLast && "There are still indices registered"' failed. Because there is a bookmark still registered, because the content was inserted wrongly into a fly frame that contains a SwGrfNode, because earlier the cursor was in a hidden text node and SwCursorShell::UpdateCursorPos() moved it into an as-char anchored image. UpdateCursorPos() should put the cursor only onto a text node. (somehow regression from commit bb733957dd39e6f0b9d80bb59eb0177188794797) Change-Id: If00d1e09a612849a44bb3e2d3bd7bac6fa9ac05f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157071 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit b20ca8d951e8205c8b963c6b7407f984053b4094) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157111 Reviewed-by: Xisco Fauli diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index f2b8ad05f738..49a6e7aaff4d 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1764,8 +1764,8 @@ void SwCursorShell::VisPortChgd( const SwRect & rRect ) /** Set the cursor back into content. -This should only be called if the cursor was move somewhere else (e.g. when -deleting a border). The new position is calculated from its current position +This should only be called if the cursor was moved (e.g. when deleting a +text frame). The new position is calculated from its current position in the layout. */ void SwCursorShell::UpdateCursorPos() @@ -1777,7 +1777,7 @@ void SwCursorShell::UpdateCursorPos() if (isInHiddenTextFrame(pShellCursor) && !ExtendedSelectedAll()) { -SwCursorMoveState aTmpState( CursorMoveState::NONE ); +SwCursorMoveState aTmpState(CursorMoveState::SetOnlyText); aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable(); GetLayout()->GetModelPositionForViewPoint( pShellCursor->GetPoint(), pShellCursor->GetPtPos(), ); commit 58b35faee869383974da0acfdf24577603634b7b Author: Patrick Luby AuthorDate: Tue Sep 19 16:43:46 2023 -0400 Commit: Xisco Fauli CommitDate: Thu Sep 21 08:29:19 2023 +0200 tdf#156842 increase scale for external PDF data For some unknown reason, the scale is 8 times larger than for non-external PDF XObjects. This fix also allows the CppunitTest_vcl_pdfexport to run successfully on macOS. Change-Id: I166914e6ac575c50985efba3fb7a38ec758dea1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157090 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit c2d7c8e5c616980d5fa77ac48babbf27342b2f0a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157114 Reviewed-by: Patrick Luby Reviewed-by: Xisco Fauli diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index d5d8408630aa..0f16c35038ee 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -4174,10 +4174,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testPdfImageHyperlink) // - Expected: 0.0012626264 // - Actual : 0.00126 // i.e. the rounded reciprocal was 794 points, not the original 792. -// FIXME macOS actual value is 0.0001578282, for unknown reasons. -#if !defined MACOSX CPPUNIT_ASSERT_EQUAL(0.0012626264, rtl::math::round(aScale.getY(), 10)); -#endif } CPPUNIT_TEST_FIXTURE(PdfExportTest, testURIs) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index d9abb0885c22..28935f59a5a5 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -8984,6 +8984,16 @@ void PDFWriterImpl::writeReferenceXObject(const ReferenceXObjectEmit& rEmit) sal_Int32 nWrappedFormObject = 0; if (!m_aContext.UseReferenceXObject) { +#ifdef MACOSX +// tdf#156842 increase scale for external PDF data +// For some unknown reason, the scale is 8 times larger than for +// non-external PDF XObjects. +// This fix also allows the CppunitTest_vcl_pdfexport to run +// successfully on macOS. +fScaleX = 8.0 / aSize.Width(); +fScaleY = 8.0 / aSize.Height(); +#endif + // Parse the PDF data, we need that to write the PDF dictionary of our // object.
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 2 commits - sw/source
sw/source/uibase/inc/conttree.hxx |5 sw/source/uibase/utlui/content.cxx | 670 ++--- 2 files changed, 335 insertions(+), 340 deletions(-) New commits: commit c3af56a1fe2fa8b004a445743478da610cf9af22 Author: Jim Raykowski AuthorDate: Sun Jan 1 17:47:11 2023 -0900 Commit: Xisco Fauli CommitDate: Thu Feb 2 19:45:59 2023 + SwNavigator: Improve mouse move handler for bringing objects to attention in the document view Fixes crash that happens in SalInstanceTreeView iter_compare when the mouse enters the content tree at a point that has no tree entry and is then moved over an entry. Moves code to bring entry content to attention in the document view from the mouse move handler to it's own function. Renames the overlay timer handler function and moves it to the area of the code having related functions. Checks added for visible content and if the type has any content to bring to attention. Change-Id: I381eed6ffcf7ddb095c4c09650578a7f7fd874b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145168 Tested-by: Jenkins Reviewed-by: Jim Raykowski Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146507 diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index 1e6bacbcd4db..b4f352bb6950 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -136,8 +136,9 @@ class SwContentTree final : public SfxListener std::unique_ptr m_xOverlayCompareEntry; std::unique_ptr m_xOverlayObject; -void OverlayObject(std::vector&& aRanges); +void OverlayObject(std::vector&& aRanges = {}); +void BringEntryToAttention(const weld::TreeIter& rEntry); void BringFramesToAttention(const std::vector& rFrameFormats); void BringBookmarksToAttention(const std::vector& rNames); void BringURLFieldsToAttention(const SwGetINetAttrs& rINetAttrsArr); @@ -202,7 +203,7 @@ class SwContentTree final : public SfxListener DECL_LINK(QueryTooltipHdl, const weld::TreeIter&, OUString); DECL_LINK(DragBeginHdl, bool&, bool); DECL_LINK(TimerUpdate, Timer *, void); -DECL_LINK(m_aOverlayObjectDelayTimerHdl, Timer *, void); +DECL_LINK(OverlayObjectDelayTimerHdl, Timer *, void); DECL_LINK(MouseMoveHdl, const MouseEvent&, bool); public: diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 745b8bb9e122..adccfd527f2b 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1092,7 +1092,6 @@ SwContentTree::SwContentTree(std::unique_ptr xTreeView, SwNaviga , m_bIsLastReadOnly(false) , m_bIsOutlineMoveable(true) , m_bViewHasChanged(false) -, m_xOverlayCompareEntry(m_xTreeView->make_iterator()) { m_xTreeView->set_size_request(m_xTreeView->get_approximate_digit_width() * 30, m_xTreeView->get_text_height() * 14); @@ -1133,7 +1132,7 @@ SwContentTree::SwContentTree(std::unique_ptr xTreeView, SwNaviga m_aUpdTimer.SetInvokeHandler(LINK(this, SwContentTree, TimerUpdate)); m_aUpdTimer.SetTimeout(1000); -m_aOverlayObjectDelayTimer.SetInvokeHandler(LINK(this, SwContentTree, m_aOverlayObjectDelayTimerHdl)); +m_aOverlayObjectDelayTimer.SetInvokeHandler(LINK(this, SwContentTree, OverlayObjectDelayTimerHdl)); m_aOverlayObjectDelayTimer.SetTimeout(500); } @@ -1153,8 +1152,21 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, rMEvt, bool) { if (m_eState == State::HIDDEN) return false; -if (rMEvt.IsLeaveWindow()) +if (std::unique_ptr xEntry(m_xTreeView->make_iterator()); +m_xTreeView->get_dest_row_at_pos(rMEvt.GetPosPixel(), xEntry.get(), false, false) && +!rMEvt.IsLeaveWindow()) +{ +if (!m_xOverlayCompareEntry) + m_xOverlayCompareEntry.reset(m_xTreeView->make_iterator().release()); +else if (m_xTreeView->iter_compare(*xEntry, *m_xOverlayCompareEntry) == 0) +return false; // The entry under the mouse has not changed. +m_xTreeView->copy_iterator(*xEntry, *m_xOverlayCompareEntry); +BringEntryToAttention(*xEntry); +} +else { +if (m_xOverlayCompareEntry) +m_xOverlayCompareEntry.reset(); m_aOverlayObjectDelayTimer.Stop(); if (m_xOverlayObject && m_xOverlayObject->getOverlayManager()) { @@ -1162,296 +1174,6 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, rMEvt, bool) m_xOverlayObject.reset(); } } -else if (std::unique_ptr xEntry(m_xTreeView->make_iterator()); -m_xTreeView->get_dest_row_at_pos(rMEvt.GetPosPixel(), xEntry.get(), false, false)) -{ -// Remove the overlay object if the pointer is over a different entry than the last time -// it was here. Guard
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 2 commits - sw/source
sw/source/filter/ww8/wrtw8sty.cxx | 46 +++--- 1 file changed, 43 insertions(+), 3 deletions(-) New commits: commit 5633a60164cc81fd33a038ee736bad75c6c2346d Author: Mike Kaganski AuthorDate: Sun Jan 22 08:33:17 2023 +0300 Commit: Xisco Fauli CommitDate: Mon Jan 23 08:55:03 2023 + tdf#153094: Fix default character style index, and document it Thanks Caolán for catching it, and providing the relevant documentation pointers! See https://gerrit.libreoffice.org/c/core/+/145806/1#message-c4a9649a8381bd1885d39923fe278b86bc07a228 Change-Id: I6379579befda583f609f87d973fcfaacf9f1fed6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145963 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit a00556ada3214d7584bebd4d6ac33bf5c25a3467) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145937 Reviewed-by: Xisco Fauli diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 2d9a346365e7..5f26f90e17fa 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -121,15 +121,55 @@ public: // Styles -// Immediately after reserved slots, character styles begin -#define WW8_RESERVED_SLOTS 15 // tdf#153094: the value is important +// According to [MS-DOC] v20221115 2.9.271 STSH, +// "The beginning of the rglpstd array is reserved for specific "fixed-index" application-defined +// styles. A particular fixed-index, application-defined style has the same istd value in every +// stylesheet. The rglpstd MUST contain an LPStd for each of these fixed-index styles and the order +// MUST match the order in the following table. +// +// istd sti of application-defined style (see sti in StdfBase) +// 0 0 +// 1 1 +// 2 2 +// 3 3 +// 4 4 +// 5 5 +// 6 6 +// 7 7 +// 8 8 +// 9 9 +// 10 65 +// 11 105 +// 12 107 +// 13 Reserved for future use +// 14 Reserved for future use" +// +// And [MS-OE376] v20220816 2.1.236 Part 4 Section 2.7.3.9, name (Primary Style Name) +// specifies the following mapping: +// +// stiStyle nameStyle type +// 0 Normalparagraph +// 1 heading 1 paragraph +// 2 heading 2 paragraph +// 3 heading 3 paragraph +// 4 heading 4 paragraph +// 5 heading 5 paragraph +// 6 heading 6 paragraph +// 7 heading 7 paragraph +// 8 heading 8 paragraph +// 9 heading 9 paragraph +// 65 Default Paragraph Fontcharacter +// 105Normal Table table +// 107No List numbering + +#define WW8_RESERVED_SLOTS 15 // GetId( SwCharFormat ) for use in text -> zero is not allowed, // use "Default Char Style" instead sal_uInt16 MSWordExportBase::GetId( const SwCharFormat* pFormat ) const { sal_uInt16 nRet = m_pStyles->GetSlot( pFormat ); -return ( nRet != 0x0fff ) ? nRet : WW8_RESERVED_SLOTS; // Default Char Style +return ( nRet != 0x0fff ) ? nRet : 10; // Default Char Style } // GetId( SwTextFormatColl ) for use in TextNodes -> zero is not allowed, commit 2846b0d07074ed8a29fb9ce38c60e7e585140ee7 Author: Mike Kaganski AuthorDate: Fri Jan 20 11:41:06 2023 +0300 Commit: Xisco Fauli CommitDate: Mon Jan 23 08:54:51 2023 + tdf#153094: it seems that DOC requires WW8_RESERVED_SLOTS = 15 Regression from commit a2a08463e0299d514e6e555ae61c68bb0e4348d0, where I mistakenly assumed that the value is just to accommodate enough entries. I don't know where it's documented, but this fixes the bug. Change-Id: Ifecf5d294222e3a40cb23f7c147694dbdf35e405 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145869 Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski (cherry picked from commit dc2ad435cd148a492aba3f2b18bbba0c769f463e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145806 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index f251f41cff15..2d9a346365e7 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -122,7 +122,7 @@ public: // Styles // Immediately after reserved slots, character styles begin -#define WW8_RESERVED_SLOTS 10 +#define WW8_RESERVED_SLOTS 15 // tdf#153094: the value is important // GetId( SwCharFormat ) for use in text -> zero is not allowed, // use "Default Char Style" instead
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 2 commits - sw/source
sw/source/uibase/inc/conttree.hxx |2 sw/source/uibase/utlui/content.cxx | 555 ++--- 2 files changed, 213 insertions(+), 344 deletions(-) New commits: commit 24ead7e8a237fca3cc7bc9078a0b7378fa63a4a5 Author: Jim Raykowski AuthorDate: Wed Dec 14 06:24:08 2022 -0900 Commit: Noel Grandin CommitDate: Tue Dec 20 06:10:05 2022 + SwNavigator: Fix delete field content deletes one character extra PostIt fields are no longer included in the fields content type since commit bf28e1df0a04cf6a06d9c4cf591e238a45a34ec1 so there is no need to check to delete them from the field content type, if ever this was needed, and fall through to the PostIt content handling which is where the extra character delete happens that is the cause of this bug. Change-Id: I61ded30fd89d87c536f0c050117d5b61fe3a9aef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144201 Tested-by: Jenkins Reviewed-by: Jim Raykowski Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144454 Reviewed-by: Noel Grandin diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 3011c0828765..3ab2041e1898 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5386,22 +5386,17 @@ void SwContentTree::EditEntry(const weld::TreeIter& rEntry, EditEntryMode nMode) break; case ContentTypeId::TEXTFIELD: { -const SwTextFieldContent* pTextFieldCnt = static_cast(pCnt); if (nMode == EditEntryMode::DELETE) { +const SwTextFieldContent* pTextFieldCnt = +static_cast(pCnt); const SwTextField* pTextField = pTextFieldCnt->GetFormatField()->GetTextField(); SwTextField::DeleteTextField(*pTextField); } else -{ -if (pTextFieldCnt->GetFormatField()->GetField()->GetTypeId() != SwFieldTypesEnum::Postit) -{ -nSlot = FN_EDIT_FIELD; -break; -} -} -[[fallthrough]]; // execute FN_POSTIT assuring standard mode first +nSlot = FN_EDIT_FIELD; } +break; case ContentTypeId::POSTIT: { auto& rView = m_pActiveShell->GetView(); commit 18ce4278c37f58887ee830d4f8b2746ed14f20e6 Author: Jim Raykowski AuthorDate: Fri Dec 9 13:36:30 2022 -0900 Commit: Noel Grandin CommitDate: Tue Dec 20 06:09:58 2022 + tdf#152029 cleanup: Bring content to attention in document view when the mouse pointer is over content type and content entries in the Navigator content tree Changes made: * check for content visibility * use m_aActiveContentArray for content types where possible * consolidate repeated code * check pointers before use * stop and clear overlay when hidden shell is shown Change-Id: I2ec41b2508e3f37ea11bfbeb695fc95e0dcca0ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143904 Tested-by: Jenkins Reviewed-by: Jim Raykowski Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144453 Reviewed-by: Noel Grandin diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index af39a41cb1ae..1764377f0312 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -136,6 +136,8 @@ class SwContentTree final : public SfxListener std::unique_ptr m_xOverlayCompareEntry; std::unique_ptr m_xOverlayObject; +void OverlayObject(std::vector&& aRanges); + void BringHeadingsToAttention(const SwOutlineNodes& rOutlineNodesArr); void BringFramesToAttention(const std::vector& rFrameFormats); void BringBookmarksToAttention(const std::vector& rNames); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 7dd41c39b5e0..3011c0828765 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1150,6 +1150,8 @@ SwContentTree::~SwContentTree() IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, rMEvt, bool) { +if (m_eState == State::HIDDEN) +return false; if (rMEvt.IsLeaveWindow()) { m_aOverlayObjectDelayTimer.Stop(); @@ -1180,8 +1182,8 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, rMEvt, bool) { SwContent* pCnt = weld::fromId(m_xTreeView->get_id(*xEntry)); const ContentTypeId nType = pCnt->GetParent()->GetType(); -if (rMEvt.IsEnterWindow() || -m_xTreeView->iter_compare(*xEntry, *m_xOverlayCompareEntry) != 0) +if (!pCnt->IsInvisible() && (rMEvt.IsEnterWindow() || +m_xTreeView->iter_compare(*xEntry, *m_xOverlayCompareEntry)
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 2 commits - sw/source vcl/source
sw/source/uibase/inc/conttree.hxx |1 sw/source/uibase/utlui/content.cxx | 85 - vcl/source/treelist/svimpbox.cxx |9 ++- 3 files changed, 91 insertions(+), 4 deletions(-) New commits: commit ffd8d368b3a780c7b687512540821ad52f2db457 Author: Jim Raykowski AuthorDate: Thu Dec 15 21:23:49 2022 -0900 Commit: Noel Grandin CommitDate: Tue Dec 20 06:09:49 2022 + tdf#152517 Fix gen backend treeview ctrl+minus behavior For gen type backends, makes the cursor node and all sub nodes collapsed on ctrl+minus key input. Change-Id: I53730aca29dd47766cfe8b4cdc81539633ebd8c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144286 Tested-by: Jenkins Reviewed-by: Jim Raykowski Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144452 Reviewed-by: Noel Grandin diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index 63b4d928bfd5..b5efa69aa19d 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -2392,9 +2392,12 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) case KEY_SUBTRACT: if (m_pView->IsExpanded(m_pCursor)) -m_pView->Collapse(m_pCursor); -if (bMod1) -CollapseTo(m_pTree->GetRootLevelParent(m_pCursor)); +{ +if (bMod1) +CollapseTo(m_pCursor); +else +m_pView->Collapse(m_pCursor); +} break; case KEY_MULTIPLY: commit 2ef1800e03890609b24883fa7fd970540280905e Author: Jim Raykowski AuthorDate: Mon Dec 12 00:06:48 2022 -0900 Commit: Noel Grandin CommitDate: Tue Dec 20 06:09:40 2022 + tdf#152029 Bring comment fields to attention in the document view when the mouse pointer is over comment content type and content entries in the Navigator content tree Change-Id: I81f8667231fe0e94f0b81c4c2d4955ba17aaa3da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143979 Tested-by: Jenkins Reviewed-by: Jim Raykowski Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144451 Reviewed-by: Noel Grandin diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index 3cf671ac1bd9..af39a41cb1ae 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -141,6 +141,7 @@ class SwContentTree final : public SfxListener void BringBookmarksToAttention(const std::vector& rNames); void BringURLFieldsToAttention(const SwGetINetAttrs& rINetAttrsArr); void BringReferencesToAttention(std::vector& rTextAttrsArr); +void BringPostItFieldsToAttention(std::vector& rTextAttrsArr); void BringDrawingObjectsToAttention(std::vector& rDrawingObjectsArr); void BringTextFieldsToAttention(std::vector& rTextAttrsArr); void BringFootnotesToAttention(std::vector& rTextAttrsArr); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 37983514e647..7dd41c39b5e0 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -102,6 +102,7 @@ #include #include +#include #include #include #include @@ -1248,6 +1249,15 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, rMEvt, bool) BringReferencesToAttention(aTextAttrArr); } } +else if (nType == ContentTypeId::POSTIT) +{ +if (const SwTextAttr* pTextAttr = + static_cast(pCnt)->GetPostIt()->GetTextField()) +{ +std::vector aTextAttrArr {pTextAttr}; +BringPostItFieldsToAttention(aTextAttrArr); +} +} else if (nType == ContentTypeId::DRAWOBJECT) { if (!pCnt->IsInvisible()) @@ -1372,6 +1382,20 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, rMEvt, bool) } BringReferencesToAttention(aTextAttrArr); } +else if (nType == ContentTypeId::POSTIT) +{ +std::vector aTextAttrArr; +for (size_t i = 0; i < m_aActiveContentArr[nType]->GetMemberCount(); i++) +{ +const SwPostItContent* pPostItContent = static_cast( +m_aActiveContentArr[nType]->GetMember(i)); +if (pPostItContent && !pPostItContent->IsInvisible()) +if (const SwFormatField* pFormatField = pPostItContent->GetPostIt()) +if (const SwTextAttr* pTextAttr = pFormatField->GetTextField()) +