core.git: sw/source
sw/source/uibase/utlui/content.cxx | 91 ++--- 1 file changed, 64 insertions(+), 27 deletions(-) New commits: commit 3a394f3f8a15623e2ffb9fbcad81bbb3b9856abe Author: Jim Raykowski AuthorDate: Sat Apr 13 17:36:49 2024 -0800 Commit: Jim Raykowski CommitDate: Sat May 4 19:28:53 2024 +0200 tdf#160657 Improve Writer Navigator Headings display when alphabetically sorted Make the Headings content display flat (no parent-child hierarchy, no outline-level indentation) when set to alphabetical sort order. Change-Id: I0d215c76462fdc2ff1fafcfd8b8d5b15be17b405 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166068 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 06c4d93f78dd..3e5a2faa8043 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2252,38 +2252,61 @@ bool SwContentTree::RequestingChildren(const weld::TreeIter& rParent) // Add for outline plus/minus if (pCntType->GetType() == ContentTypeId::OUTLINE) { -std::vector> aParentCandidates; -for(size_t i = 0; i < nCount; ++i) +if (pCntType->IsAlphabeticSort()) { -const SwContent* pCnt = pCntType->GetMember(i); -if(pCnt) +for (size_t i = 0; i < nCount; ++i) { -const auto nLevel = static_cast(pCnt)->GetOutlineLevel(); -OUString sEntry = pCnt->GetName(); -if(sEntry.isEmpty()) -sEntry = m_sSpace; -OUString sId(weld::toId(pCnt)); - -auto lambda = [nLevel, this](const std::unique_ptr& entry) +const SwContent* pCnt = pCntType->GetMember(i); +if (pCnt) { -return lcl_IsLowerOutlineContent(*entry, *m_xTreeView, nLevel); -}; +OUString sEntry = pCnt->GetName(); +if (sEntry.isEmpty()) +sEntry = m_sSpace; +OUString sId(weld::toId(pCnt)); -// if there is a preceding outline node candidate with a lower outline level use -// that as a parent, otherwise use the root node -auto aFind = std::find_if(aParentCandidates.rbegin(), aParentCandidates.rend(), lambda); -if (aFind != aParentCandidates.rend()) -insert(aFind->get(), sEntry, sId, false, xChild.get()); -else insert(, sEntry, sId, false, xChild.get()); -m_xTreeView->set_sensitive(*xChild, !pCnt->IsInvisible()); -m_xTreeView->set_extra_row_indent(*xChild, nLevel + 1 - m_xTreeView->get_iter_depth(*xChild)); +m_xTreeView->set_sensitive(*xChild, !pCnt->IsInvisible()); +} +} +} +else +{ +std::vector> aParentCandidates; +for (size_t i = 0; i < nCount; ++i) +{ +const SwContent* pCnt = pCntType->GetMember(i); +if (pCnt) +{ +const auto nLevel += static_cast(pCnt)->GetOutlineLevel(); +OUString sEntry = pCnt->GetName(); +if (sEntry.isEmpty()) +sEntry = m_sSpace; +OUString sId(weld::toId(pCnt)); + +auto lambda = [nLevel, this](const std::unique_ptr& entry) { +return lcl_IsLowerOutlineContent(*entry, *m_xTreeView, nLevel); +}; + +// if there is a preceding outline node candidate with a lower outline level +// use that as a parent, otherwise use the root node +auto aFind = std::find_if(aParentCandidates.rbegin(), + aParentCandidates.rend(), lambda); +if (aFind != aParentCandidates.rend()) +insert(aFind->get(), sEntry, sId, false, xChild.get()); +else +insert(, sEntry, sId, false, xChild.get()); +m_xTreeView->set_sensitive(*xChild, !pCnt->IsInvisible()); +m_xTreeView->set_extra_row_indent( +*xChild, nLevel + 1 - m_xTreeView->get_iter_depth(*xChild)); -// remove any parent candidates equal to or higher than this node -std::erase_if(aParentCandidates, std::not_fn(lambda)); +//
core.git: sw/source sw/uiconfig
sw/source/uibase/utlui/content.cxx | 52 ++- sw/uiconfig/swriter/ui/navigatorpanel.ui |4 ++ 2 files changed, 21 insertions(+), 35 deletions(-) New commits: commit 7938500ad3b384f1f30858cea64e12c84610996d Author: Jim Raykowski AuthorDate: Sat Apr 13 12:56:39 2024 -0800 Commit: Jim Raykowski CommitDate: Sat May 4 19:28:27 2024 +0200 SwNavigator: improve when outline move controls/menu-items are active/visible Makes the outline content context menu not show the up/down/promote/ demote menu items when outline content is set to display by alphabetical sort. With intent to improve code readablility, reworks the SwContentTree::Select function used to set the sensitive state of the up/down/promote/demote buttons. The buttons are disabled for any of the following conditions; the Navigator is in "Zoom" mode, the document is in read-only mode, the selected entry is not an outline content entry, or the outline content is displayed by alphabetical sort. The patch also makes the alphabetical sort setting independent among the floating and sidebar versions. Change-Id: I6ff8fab2ce2fb6f68163ed3860b0440fba875fb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166067 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 994f18cdbee9..06c4d93f78dd 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1753,9 +1753,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) && nContentType != ContentTypeId::POSTIT && nContentType != ContentTypeId::UNKNOWN) { bRemoveSortEntry = false; -const sal_Int32 nMask = 1 << static_cast(nContentType); -sal_uInt64 nSortAlphabeticallyBlock = m_pConfig->GetSortAlphabeticallyBlock(); -xPop->set_active("sort", nSortAlphabeticallyBlock & nMask); +xPop->set_active("sort", pType->IsAlphabeticSort()); } OUString aIdent; @@ -1912,7 +1910,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) if (!bReadonly) { bRemoveSelectEntry = false; -bRemoveChapterEntries = false; +if (!pType->IsAlphabeticSort()) +bRemoveChapterEntries = false; } bRemoveCopyEntry = false; } @@ -2893,20 +2892,8 @@ void SwContentTree::Display( bool bActive ) } else if (State::HIDDEN == m_eState) m_eState = State::ACTIVE; -SwWrtShell* pShell = GetWrtShell(); -const bool bReadOnly = !pShell || pShell->GetView().GetDocShell()->IsReadOnly(); -if(bReadOnly != m_bIsLastReadOnly) -{ -m_bIsLastReadOnly = bReadOnly; -bool bDisable = pShell == nullptr || bReadOnly; -SwNavigationPI* pNavi = GetParentWindow(); -pNavi->m_xContent6ToolBox->set_item_sensitive("chapterup", !bDisable); -pNavi->m_xContent6ToolBox->set_item_sensitive("chapterdown", !bDisable); -pNavi->m_xContent6ToolBox->set_item_sensitive("promote", !bDisable); -pNavi->m_xContent6ToolBox->set_item_sensitive("demote", !bDisable); -pNavi->m_xContent5ToolBox->set_item_sensitive("reminder", !bDisable); -} +SwWrtShell* pShell = GetWrtShell(); if (pShell) { std::unique_ptr xEntry = m_xTreeView->make_iterator(); @@ -3030,10 +3017,11 @@ void SwContentTree::Display( bool bActive ) } // set_cursor unselects all entries, makes passed entry visible, and selects it m_xTreeView->set_cursor(*xSelEntry); -Select(); } } +Select(); + if (!m_bIgnoreDocChange && GetEntryCount() == nOldEntryCount) { m_xTreeView->vadjustment_set_value(nOldScrollPos); @@ -5479,33 +5467,27 @@ IMPL_LINK_NOARG(SwContentTree, SelectHdl, weld::TreeView&, void) } // Here the buttons for moving outlines are en-/disabled. +// The buttons for moving outlines are disabled when the Navigator is in "Zoom" mode or when +// the document is in read-only mode or when the outline content is displayed alphabetically +// sorted or when the selected entry is not outline content. void SwContentTree::Select() { -std::unique_ptr xEntry(m_xTreeView->make_iterator()); -if (!m_xTreeView->get_selected(xEntry.get())) -return; +SwNavigationPI* pNavi = GetParentWindow(); bool bEnable = false; -std::unique_ptr xParentEntry(m_xTreeView->make_iterator(xEntry.get())); -bool bParentEntry = m_xTreeView->iter_parent(*xParentEntry); -while (bParentEntry && (!lcl_IsContentType(*xParentEntry, *m_xTreeView))) -bParentEntry = m_xTreeView->iter_parent(*xParentEntry); -if (!m_bIsLastReadOnly) + +if
core.git: sw/source sw/uiconfig
sw/source/uibase/utlui/content.cxx | 109 +++-- sw/uiconfig/swriter/ui/navigatorcontextmenu.ui | 35 2 files changed, 136 insertions(+), 8 deletions(-) New commits: commit b2b84dfa1d4f5da32f3335c59d618d385173a170 Author: Jim Raykowski AuthorDate: Sun Apr 21 19:23:34 2024 -0800 Commit: Jim Raykowski CommitDate: Thu Apr 25 05:38:42 2024 +0200 tdf#160598 SwNavigator enhancement to delete footnotes/endnotes m_bDocHasChanged is checked first in the tooltip and mouse move handlers to prevent crashes/asserts that happen when SfxPoolItemHolder m_aAttr references a delete poolitem or poolitem data. Without this check the following types of crashes/asserts can happen: Unspecified Application Error Fatal exception: Signal 6 Stack: 0 sal::backtrace_get(unsigned int) at /home/lo/Dev/LO1/core/sal/osl/ unx/backtraceapi.cxx:42 (discriminator 3) 1 (anonymous namespace)::printStack(int) at /home/lo/Dev/LO1/core/sal/ osl/unx/signal.cxx:289 2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at / home/lo/Dev/LO1/core/sal/osl/unx/signal.cxx:330 3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/lo/Dev/LO1/core/sal/osl/unx/signal.cxx:427 4 __restore_rt at libc_sigaction.c:? 5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 6 __GI_raise at ./signal/../sysdeps/posix/raise.c:27 7 __GI_abort at ./stdlib/abort.c:81 (discriminator 21) 8 SalAbort(rtl::OUString const&, bool) at /home/lo/Dev/LO1/core/vcl/ source/app/salplug.cxx:412 9 Application::Abort(rtl::OUString const&) at /home/lo/Dev/LO1/core/ vcl/source/app/svapp.cxx:316 10 desktop::Desktop::Exception(ExceptionCategory) at /home/lo/Dev/LO1/ core/desktop/source/app/app.cxx:1203 (discriminator 2) 11 VCLExceptionSignal_impl(void*, oslSignalInfo*) at /home/lo/Dev/LO1/ core/vcl/source/app/svmain.cxx:176 12 callSignalHandler(oslSignalInfo*) at /home/lo/Dev/LO1/core/sal/osl/ all/signalshared.cxx:47 13 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/lo/Dev/LO1/core/sal/osl/unx/signal.cxx:423 14 __restore_rt at libc_sigaction.c:? 15 SfxPoolItem::Which() const at /home/lo/Dev/LO1/core/include/svl/ poolitem.hxx:225 16 SfxPoolItemHolder::Which() const at /home/lo/Dev/LO1/core/include/ svl/itemset.hxx:74 (discriminator 1) 17 SwTextAttr::GetFootnote() const at /home/lo/Dev/LO1/core/sw/inc/ txatbase.hxx:223 (discriminator 1) 18 SwContentTree::QueryTooltipHdl(weld::TreeIter const&) at /home/lo/ Dev/LO1/core/sw/source/uibase/utlui/content.cxx:4974 19 SwContentTree::LinkStubQueryTooltipHdl(void*, weld::TreeIter const&) at /home/lo/Dev/LO1/core/sw/source/uibase/utlui/content.cxx:4895 20 Link::Call(weld::TreeIter const&) const at /home/lo/Dev/LO1/core/include/tools/link.hxx:111 21 weld::TreeView::signal_query_tooltip(weld::TreeIter const&) at / home/lo/Dev/LO1/core/include/vcl/weld.hxx:977 22 SalInstanceTreeView::TooltipHdl(SvTreeListEntry*) at /home/lo/Dev/ LO1/core/vcl/source/app/salvtables.cxx:5154 23 SalInstanceTreeView::LinkStubTooltipHdl(void*, SvTreeListEntry*) at /home/lo/Dev/LO1/core/vcl/source/app/salvtables.cxx:5151 24 Link::Call(SvTreeListEntry*) const at /home/lo/Dev/LO1/core/include/tools/link.hxx:111 25 SvTreeListBox::RequestHelp(HelpEvent const&) at /home/lo/Dev/LO1/ core/vcl/source/treelist/treelistbox.cxx:3284 26 ImplHandleMouseHelpRequest(vcl::Window*, Point const&) at /home/lo/ Dev/LO1/core/vcl/source/window/winproc.cxx:186 27 ImplHandleMouseEvent(VclPtr const&, NotifyEventType, bool, long, long, unsigned long, unsigned short, MouseEventModifiers) at /home/lo/Dev/LO1/core/vcl/source/window/winproc.cxx:740 28 ImplHandleSalMouseMove(vcl::Window*, SalMouseEvent const*) at /home/ lo/Dev/LO1/core/vcl/source/window/winproc.cxx:2332 29 ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at /home/ lo/Dev/LO1/core/vcl/source/window/winproc.cxx:2665 (discriminator 1) 30 SalFrame::CallCallback(SalEvent, void const*) const at /home/lo/Dev/ LO1/core/vcl/inc/salframe.hxx:312 (discriminator 1) 31 QtFrame::CallCallback(SalEvent, void const*) const at /home/lo/Dev/ LO1/core/vcl/inc/qt5/QtFrame.hxx:228 32 QtWidget::mouseMoveEvent(QMouseEvent*) at /home/lo/Dev/LO1/core/vcl/ qt5/QtWidget.cxx:202 33 QWidget::event(QEvent*) in /lib/x86_64-linux-gnu/libQt5Widgets.so.5 34 QtWidget::event(QEvent*) at /home/lo/Dev/LO1/core/vcl/qt5/ QtWidget.cxx:738 (discriminator 2) 35 QApplicationPrivate::notify_helper(QObject*, QEvent*) in /lib/ x86_64-linux-gnu/libQt5Widgets.so.5 36 QApplication::notify(QObject*, QEvent*) in /lib/x86_64-linux-gnu/ libQt5Widgets.so.5 37 QCoreApplication::notifyInternal2(QObject*, QEvent*) in /lib/x86_64-
core.git: sw/source
sw/source/uibase/utlui/content.cxx | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit 802bc63be79f5622d794345dbbc577b6c603b61b Author: Jim Raykowski AuthorDate: Sat Apr 20 09:52:16 2024 -0800 Commit: Jim Raykowski CommitDate: Wed Apr 24 21:37:44 2024 +0200 SwContentTree: Don't show 'Delete' menu item when read-only Change-Id: Ib3a1ec5635937b2dcb26144f621ee0bf4a0101d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166413 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 25186110de86..a7e3ff3c9289 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1823,10 +1823,12 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) const bool bProtected = weld::fromId(m_xTreeView->get_id(*xEntry))->IsProtect(); const bool bProtectBM = (ContentTypeId::BOOKMARK == nContentType) && m_pActiveShell->getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS); -const bool bEditable = pType->IsEditable() && -((bVisible && !bProtected) || ContentTypeId::REGION == nContentType); -const bool bDeletable = pType->IsDeletable() -&& ((bVisible && !bProtected && !bProtectBM) || ContentTypeId::REGION == nContentType); +const bool bEditable += !bReadonly && pType->IsEditable() + && ((bVisible && !bProtected) || ContentTypeId::REGION == nContentType); +const bool bDeletable = !bReadonly && pType->IsDeletable() +&& ((bVisible && !bProtected && !bProtectBM) +|| ContentTypeId::REGION == nContentType); const bool bRenamable = !bReadonly && (pType->IsRenamable() @@ -1899,7 +1901,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) } bRemoveCopyEntry = false; } -else if (!bReadonly && bEditable) +else if (bEditable) { if(ContentTypeId::INDEX == nContentType) {
core.git: sw/source
sw/source/uibase/inc/content.hxx |2 ++ sw/source/uibase/utlui/content.cxx | 29 - 2 files changed, 18 insertions(+), 13 deletions(-) New commits: commit 74bd60c433cdc135d8a465eb5cea8ee6ce84b436 Author: Jim Raykowski AuthorDate: Sat Apr 20 09:14:00 2024 -0800 Commit: Jim Raykowski CommitDate: Wed Apr 24 21:36:57 2024 +0200 Rework SwContentTree context menu item 'Rename' inclusion Change-Id: Ice211a3026d07a21b1b6e47ee1c16086401714d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166412 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx index c6698f4b0322..f0aad555619c 100644 --- a/sw/source/uibase/inc/content.hxx +++ b/sw/source/uibase/inc/content.hxx @@ -188,6 +188,7 @@ class SwContentType final : public SwTypeNumber boolm_bDataValid :1; boolm_bEdit: 1; // can this type be edited? boolm_bDelete:1; // can this type be deleted? +bool m_bRenamable = false; bool m_bAlphabeticSort = false; @@ -221,6 +222,7 @@ public: boolIsEditable() const {return m_bEdit;} boolIsDeletable() const {return m_bDelete;} +bool IsRenamable() const {return m_bRenamable;} }; #endif diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index eff50a0ea76c..25186110de86 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -379,18 +379,22 @@ SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 case ContentTypeId::TABLE: m_sTypeToken = "table"; m_bEdit = true; +m_bRenamable = true; break; case ContentTypeId::FRAME: m_sTypeToken = "frame"; m_bEdit = true; +m_bRenamable = true; break; case ContentTypeId::GRAPHIC: m_sTypeToken = "graphic"; m_bEdit = true; +m_bRenamable = true; break; case ContentTypeId::OLE: m_sTypeToken = "ole"; m_bEdit = true; +m_bRenamable = true; break; case ContentTypeId::TEXTFIELD: m_bEdit = true; @@ -407,16 +411,19 @@ SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 DocumentSettingId::PROTECT_BOOKMARKS); m_bEdit = true; m_bDelete = !bProtectedBM; +m_bRenamable = !bProtectedBM; } break; case ContentTypeId::REGION: m_sTypeToken = "region"; m_bEdit = true; m_bDelete = true; +m_bRenamable = true; break; case ContentTypeId::INDEX: m_bEdit = true; m_bDelete = true; +m_bRenamable = true; break; case ContentTypeId::REFERENCE: m_bEdit = false; @@ -432,6 +439,7 @@ SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 case ContentTypeId::DRAWOBJECT: m_sTypeToken = "drawingobject"; m_bEdit = true; +m_bRenamable = true; break; default: break; } @@ -1819,15 +1827,11 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) ((bVisible && !bProtected) || ContentTypeId::REGION == nContentType); const bool bDeletable = pType->IsDeletable() && ((bVisible && !bProtected && !bProtectBM) || ContentTypeId::REGION == nContentType); -const bool bRenamable = bEditable && !bReadonly && -(ContentTypeId::TABLE == nContentType || - ContentTypeId::FRAME == nContentType || - ContentTypeId::GRAPHIC == nContentType || - ContentTypeId::OLE == nContentType || - (ContentTypeId::BOOKMARK == nContentType && !bProtectBM) || - ContentTypeId::REGION == nContentType || - ContentTypeId::INDEX == nContentType || - ContentTypeId::DRAWOBJECT == nContentType); +const bool bRenamable += !bReadonly + && (pType->IsRenamable() + || (ContentTypeId::BOOKMARK == nContentType && !bProtectBM)); + // Choose which Delete entry to show. if (bDeletable) { @@ -1932,12 +1936,11 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) xPop->set_active("protectsection", bProtected); xPop->set_active("hidesection", bHidden); } -else if (bEditable) +else bRemoveEditEntry = false; -//Rename
core.git: sw/source
sw/source/core/crsr/trvlfnfl.cxx |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit 5740d3fa83e9725a2771e5f00ba4aaf9965f0be2 Author: Jim Raykowski AuthorDate: Fri Apr 19 21:05:24 2024 -0800 Commit: Jim Raykowski CommitDate: Mon Apr 22 20:51:58 2024 +0200 Resolves tdf#160731 Navigate by recency does not work under gtk3 + wayland I think the lines of code removed by this patch were meant to allow recency to remember the cursor position before being moved to a start/ end/previous/next word or sentence position by an UNO dispatch command. These are already taken care of in the slot execute function void SwTextShell::ExecMoveLingu. Change-Id: I8bf231ea4cbb03125f54332a41c5544f9094b768 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166350 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx index 8cdf807acc55..098bad4b3435 100644 --- a/sw/source/core/crsr/trvlfnfl.cxx +++ b/sw/source/core/crsr/trvlfnfl.cxx @@ -34,9 +34,6 @@ bool SwCursorShell::CallCursorShellFN( FNCursorShell fnCursor ) { -if (SwWrtShell* pWrtSh = dynamic_cast(this)) -pWrtSh->addCurrentPosition(); - SwCallLink aLk( *this ); // watch Cursor-Moves bool bRet = (this->*fnCursor)(); if( bRet ) @@ -47,6 +44,7 @@ bool SwCursorShell::CallCursorShellFN( FNCursorShell fnCursor ) bool SwCursorShell::CallCursorFN( FNCursor fnCursor ) { +// for footnote anchor<->text recency if (SwWrtShell* pWrtSh = dynamic_cast(this)) pWrtSh->addCurrentPosition();
core.git: sw/qa sw/source
sw/qa/extras/uiwriter/data/tdf146190.odt |binary sw/qa/extras/uiwriter/uiwriter9.cxx | 38 +++ sw/source/uibase/inc/wrtsh.hxx |2 - sw/source/uibase/wrtsh/move.cxx | 29 +++ 4 files changed, 48 insertions(+), 21 deletions(-) New commits: commit ca66965507494d0c5e07bfe81334749bc08af409 Author: Jim Raykowski AuthorDate: Sun Apr 14 14:49:48 2024 -0800 Commit: Jim Raykowski CommitDate: Sat Apr 20 18:14:00 2024 +0200 tdf#146190 Fix move to next drawing object using the tab key after double click on a drawing obect in the Navigator doesn't move to the next/previous drawing object when there is a number rule at the current current cursor position and the current cursor position is at the start of a paragraph. This patch reworks the SwWrtShell::GotoDrawingObject function so the document cursor position gets moved to the position of the drawing object when the object is selected. Another way to get expected results is to leave the GotoDrawingObject function as is and move: else if (rSh.GetSelectionType() & (SelectionType::Graphic | SelectionType::Frame | SelectionType::Ole | SelectionType::DrawObject | SelectionType::DbForm)) above the: else if( rSh.GetNumRuleAtCurrCursorPos() && rSh.IsSttOfPara() && !rSh.HasReadonlySel() ) in the SwEditWin::KeyInput function case KEY_TAB: block. SwWrtShell::GotoDrawingObject is made SW_DLLPUBIC by this patch to able to be used by the included unit test. Change-Id: I047b416ae94a9284d304798924e0c5f2be526f85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166089 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/qa/extras/uiwriter/data/tdf146190.odt b/sw/qa/extras/uiwriter/data/tdf146190.odt new file mode 100644 index ..b686cb174bc9 Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf146190.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx b/sw/qa/extras/uiwriter/uiwriter9.cxx index f46d43e537b6..93d608a69247 100644 --- a/sw/qa/extras/uiwriter/uiwriter9.cxx +++ b/sw/qa/extras/uiwriter/uiwriter9.cxx @@ -47,6 +47,9 @@ #include #include +#include +#include + namespace { class SwUiWriterTest9 : public SwModelTestBase @@ -555,6 +558,41 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf158375_ole_object_disable) comphelper::LibreOfficeKit::setActive(false); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf146190) +{ +// Given a document with a number rule at the start of a paragraph and two drawing objects: +createSwDoc("tdf146190.odt"); +SwXTextDocument* pXTextDocument = dynamic_cast(mxComponent.get()); +SwDocShell* pDocShell = pXTextDocument->GetDocShell(); +SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); + +const SdrMarkList& rMrkList = pWrtShell->GetDrawView()->GetMarkedObjectList(); + +// Assert the current cursor position has a number rule and is at the start of a paragraph: +pWrtShell->SttEndDoc(/*bStt=*/true); +CPPUNIT_ASSERT(pWrtShell->GetNumRuleAtCurrCursorPos()); +CPPUNIT_ASSERT(pWrtShell->IsSttOfPara()); + +// Then go to "Shape 1" drawing object using the GotoDrawingObject function: +pWrtShell->GotoDrawingObject(u"Shape 1"); +CPPUNIT_ASSERT_EQUAL(OUString("Shape 1"), rMrkList.GetMark(0)->GetMarkedSdrObj()->GetName()); + +// Move to the next drawing object by Tab key press: +pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_TAB); +Scheduler::ProcessEventsToIdle(); +// Without the fix in place, this test would have failed with: +// equality assertion failed +// - Expected: Shape 2 +// - Actual : Shape 1 +// i.e. Tab did not move to the next drawing object +CPPUNIT_ASSERT_EQUAL(OUString("Shape 2"), rMrkList.GetMark(0)->GetMarkedSdrObj()->GetName()); + +// Tab key press should now select 'Shape 1': +pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_TAB); +Scheduler::ProcessEventsToIdle(); +CPPUNIT_ASSERT_EQUAL(OUString("Shape 1"), rMrkList.GetMark(0)->GetMarkedSdrObj()->GetName()); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index e1727bfc9fdf..6c0d4c2dda0b 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -501,7 +501,7 @@ typedef bool (SwWrtShell::*FNSimpleMove)(); SW_DLLPUBLIC bool GotoTable( const OUString& rName ); void GotoFormatField( const SwFormatField& rField ); const SwRangeRedline* GotoRedline( SwRedlineTable::size_type nArrPos, bool bSelect); -bool GotoDrawingObject(std::u16string_view rName); +SW_DLLPUBLIC bool GotoDrawingObject(std::u16string_view rName); void GotoFootnoteAnchor(const
core.git: sw/source
sw/source/uibase/utlui/content.cxx | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) New commits: commit 857fe51bc8f2d3f3535807a69399c7e2fee971ae Author: Jim Raykowski AuthorDate: Thu Apr 11 17:50:16 2024 -0800 Commit: Jim Raykowski CommitDate: Sun Apr 14 05:08:07 2024 +0200 SwContentTree: remove repeated pointer assignment The selected entry does not change within the CommandHdl function therefore assignment of the pointer to the selected entry SwContentType does not need to be repeated elsewhere in the function. Change-Id: I025ecb9259e2ee46a64d55c75d0c3f3c8cc625ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166018 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 8e301753b236..9e80e06c3292 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1941,31 +1941,22 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) } else { -if (lcl_IsContentType(*xEntry, *m_xTreeView)) -pType = weld::fromId(m_xTreeView->get_id(*xEntry)); -else -pType = weld::fromId( -m_xTreeView->get_id(*xEntry))->GetParent(); -if (pType) +if (ContentTypeId::OUTLINE == nContentType) { -if (ContentTypeId::OUTLINE == nContentType) +bOutline = true; +if (State::HIDDEN != m_eState) { -bOutline = true; -if (State::HIDDEN != m_eState) -{ -lcl_SetOutlineContentEntriesSensitivities(this, *m_xTreeView, *xEntry, - *xSubPopOutlineContent); -bRemoveSendOutlineEntry = false; -} -bRemoveToggleExpandEntry = lcl_InsertExpandCollapseAllItem(*m_xTreeView, *xEntry, - *xPop); +lcl_SetOutlineContentEntriesSensitivities(this, *m_xTreeView, *xEntry, + *xSubPopOutlineContent); +bRemoveSendOutlineEntry = false; } -else if (State::HIDDEN != m_eState && - nContentType == ContentTypeId::POSTIT && - !m_pActiveShell->GetView().GetDocShell()->IsReadOnly() && - pType->GetMemberCount() > 0) -bRemovePostItEntries = false; +bRemoveToggleExpandEntry += lcl_InsertExpandCollapseAllItem(*m_xTreeView, *xEntry, *xPop); } +else if (State::HIDDEN != m_eState && nContentType == ContentTypeId::POSTIT + && !m_pActiveShell->GetView().GetDocShell()->IsReadOnly() + && pType->GetMemberCount() > 0) +bRemovePostItEntries = false; } }
core.git: Branch 'libreoffice-24-2' - sd/source
sd/source/ui/dlg/navigatr.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 419fc9947bdcef8d5ef4e6305be62c07d0d0854a Author: Jim Raykowski AuthorDate: Wed Apr 3 11:27:21 2024 -0800 Commit: Adolfo Jayme Barrientos CommitDate: Sat Apr 13 06:17:26 2024 +0200 Resolves tdf#157403 sidebar SdNavigator does not show new slide/page after file reload Change-Id: I8ba7ffac3c098cf388a67e3454c5986b5a8b1f3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165767 Tested-by: Jenkins Reviewed-by: Jim Raykowski (cherry picked from commit 1dbe90cb078bddaf8bbd333823762744158c92bb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165934 Reviewed-by: Adolfo Jayme Barrientos diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index f1a4a66c1e5f..8741a2c913b4 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -662,7 +662,7 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName ) ::sd::DrawDocShell* pCurrentDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); -SfxObjectShell* pSfxDocShell = SfxObjectShell::GetFirst([](const SfxObjectShell*){return true;}, false); +SfxObjectShell* pSfxDocShell = SfxObjectShell::GetFirst(); while( pSfxDocShell ) { ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( pSfxDocShell ); @@ -691,7 +691,7 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName ) maDocList.push_back( aInfo ); } -pSfxDocShell = SfxObjectShell::GetNext( *pSfxDocShell, [](const SfxObjectShell*){return true;}, false ); +pSfxDocShell = SfxObjectShell::GetNext(*pSfxDocShell); } } mxLbDocs->set_active(nPos);
core.git: sd/source
sd/source/ui/dlg/navigatr.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 1dbe90cb078bddaf8bbd333823762744158c92bb Author: Jim Raykowski AuthorDate: Wed Apr 3 11:27:21 2024 -0800 Commit: Jim Raykowski CommitDate: Fri Apr 12 06:13:22 2024 +0200 Resolves tdf#157403 sidebar SdNavigator does not show new slide/page after file reload Change-Id: I8ba7ffac3c098cf388a67e3454c5986b5a8b1f3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165767 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 5c01c44b618d..46975a6bb046 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -710,7 +710,7 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName ) ::sd::DrawDocShell* pCurrentDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); -SfxObjectShell* pSfxDocShell = SfxObjectShell::GetFirst([](const SfxObjectShell*){return true;}, false); +SfxObjectShell* pSfxDocShell = SfxObjectShell::GetFirst(); while( pSfxDocShell ) { ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( pSfxDocShell ); @@ -739,7 +739,7 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName ) maDocList.push_back( aInfo ); } -pSfxDocShell = SfxObjectShell::GetNext( *pSfxDocShell, [](const SfxObjectShell*){return true;}, false ); +pSfxDocShell = SfxObjectShell::GetNext(*pSfxDocShell); } } mxLbDocs->set_active(nPos);
core.git: sd/source
sd/source/ui/dlg/navigatr.cxx | 61 +++--- 1 file changed, 29 insertions(+), 32 deletions(-) New commits: commit 64f1fbc4a66715aa616ffeff1eb612393fa9fba3 Author: Jim Raykowski AuthorDate: Wed Mar 13 16:26:44 2024 -0800 Commit: Jim Raykowski CommitDate: Wed Apr 10 18:48:39 2024 +0200 tdf#160190 Fix selection stops working in sidebar SdNavigator after formula or OLE insert Change-Id: I945a07fef137aa30afff91ac7c50f180e5f4c3d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164797 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 538f1c68b113..5c01c44b618d 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -164,20 +164,21 @@ void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc ) sd::DrawDocShell* pDocShell = pNonConstDoc->GetDocSh(); ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); +// tdf#160190 +if (!pViewShell) +return; + // tdf#139944 disable navigator in master mode -if (pViewShell) +if (const sd::DrawViewShell* pDrawViewShell = static_cast<::sd::DrawViewShell*>(pViewShell)) { -if (const sd::DrawViewShell* pDrawViewShell = static_cast<::sd::DrawViewShell*>(pViewShell)) +if (pDrawViewShell->GetEditMode() == EditMode::MasterPage) { -if (pDrawViewShell->GetEditMode() == EditMode::MasterPage) -{ -m_xContainer->set_sensitive(false); -mxTlbObjects->clear(); -return; -} -else -m_xContainer->set_sensitive(true); +m_xContainer->set_sensitive(false); +mxTlbObjects->clear(); +return; } +else +m_xContainer->set_sensitive(true); } const OUString& aDocShName( pDocShell->GetName() ); @@ -189,8 +190,7 @@ void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc ) mxLbDocs->set_active_text(aDocShName); } -if (pViewShell) -lcl_select_marked_objects(pViewShell, mxTlbObjects.get()); +lcl_select_marked_objects(pViewShell, mxTlbObjects.get()); } void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) @@ -200,35 +200,33 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) OUString aDocShName( pDocShell->GetName() ); ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); +// tdf#160190 +if (!pViewShell) +return; + // tdf#139944 disable navigator in master mode -if (pViewShell) +if (const sd::DrawViewShell* pDrawViewShell = static_cast<::sd::DrawViewShell*>(pViewShell)) { -if (const sd::DrawViewShell* pDrawViewShell = static_cast<::sd::DrawViewShell*>(pViewShell)) +if (pDrawViewShell->GetEditMode() == EditMode::MasterPage) { -if (pDrawViewShell->GetEditMode() == EditMode::MasterPage) -{ -m_xContainer->set_sensitive(false); -mxTlbObjects->clear(); -RefreshDocumentLB(); -return; -} -else -m_xContainer->set_sensitive(true); +m_xContainer->set_sensitive(false); +mxTlbObjects->clear(); +RefreshDocumentLB(); +return; } +else +m_xContainer->set_sensitive(true); } // Restore the 'ShowAllShapes' flag from the last time (in this session) // that the navigator was shown. -if (pViewShell != nullptr) -{ -::sd::FrameView* pFrameView = pViewShell->GetFrameView(); -if (pFrameView != nullptr) - mxTlbObjects->SetShowAllShapes(pFrameView->IsNavigatorShowingAllShapes(), false); -} +::sd::FrameView* pFrameView = pViewShell->GetFrameView(); +if (pFrameView != nullptr) + mxTlbObjects->SetShowAllShapes(pFrameView->IsNavigatorShowingAllShapes(), false); // Disable the shape filter drop down menu when there is a running slide // show. -if (pViewShell!=nullptr && sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ) +if (sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ) && !sd::SlideShow::IsInteractiveSlideshow( >GetViewShellBase() ) ) // IASS mxToolbox->set_item_sensitive("shapes", false); else @@ -256,8 +254,7 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) } } -if (pViewShell) -lcl_select_marked_objects(pViewShell, mxTlbObjects.get()); +lcl_select_marked_objects(pViewShell, mxTlbObjects.get()); } /**
core.git: sd/source
sd/source/ui/dlg/navigatr.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 833e2ecf43708332b248689304a53b5c50af155d Author: Jim Raykowski AuthorDate: Tue Apr 9 18:00:45 2024 -0800 Commit: Jim Raykowski CommitDate: Wed Apr 10 18:43:06 2024 +0200 tdf#139944 follow up Also refresh the document info list so the objects tree will fill on switching to normal view mode after the Navigator is opened in master view mode. Change-Id: I3749060206408ca2b9b58de541a9c9bf1731ec4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165917 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 893732f86662..538f1c68b113 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -209,6 +209,7 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) { m_xContainer->set_sensitive(false); mxTlbObjects->clear(); +RefreshDocumentLB(); return; } else
core.git: sd/source
sd/source/ui/dlg/navigatr.cxx |5 + sd/source/ui/view/drviews4.cxx |9 + 2 files changed, 6 insertions(+), 8 deletions(-) New commits: commit 748561425774fa40ab685fed80d113f7e8301158 Author: Jim Raykowski AuthorDate: Thu Mar 21 22:15:08 2024 -0800 Commit: Jim Raykowski CommitDate: Sun Apr 7 19:22:05 2024 +0200 SdNavigator: speed up notifications to update the Navigator state Change-Id: I191cd83ffce3f1ded9c67abcdf319034972a0b16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165151 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index af0e37e36d3a..893732f86662 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -460,6 +460,11 @@ IMPL_LINK_NOARG(SdNavigatorWin, ClickObjectHdl, weld::TreeView&, bool) pDrawView->MarkObj(pCursorEntryObject, pDrawView->GetSdrPageView(), true); } +// SID_NAVIGATOR_STATE invalidate is done in DrawViewShell::ExecNavigatorWin +// and DrawDocShell::GotoBookmark. Update the bindings here to speed up Navigator +// state update. +mpBindings->Update(); + // moved here from SetGetFocusHdl. Reset the // focus only if something has been selected in the // document. diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 12a734a6ca45..8c547d8525fc 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -306,16 +306,9 @@ void DrawViewShell::FreshNavigatrTree() SfxViewFrame *pViewFrame = GetViewFrame(); if (!pViewFrame) return; -SfxChildWindow* pWindow = pViewFrame->GetChildWindow( SID_NAVIGATOR ); -if( pWindow ) -{ -SdNavigatorFloat* pNavWin = static_cast( pWindow->GetWindow() ); -if( pNavWin ) -pNavWin->FreshTree( GetDoc() ); -} -// sidebar version SfxBindings& rBindings = pViewFrame->GetBindings(); rBindings.Invalidate(SID_NAVIGATOR_STATE, true); +rBindings.Update(); } void DrawViewShell::MouseButtonDown(const MouseEvent& rMEvt,
core.git: sd/source
sd/source/ui/dlg/navigatr.cxx |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) New commits: commit f41ef630f7fc706d18cce76c3abe76a53f03b2d5 Author: Jim Raykowski AuthorDate: Mon Apr 1 23:18:50 2024 -0800 Commit: Jim Raykowski CommitDate: Sat Apr 6 03:16:52 2024 +0200 SdNavigator: Make the objects tree update after rename Change-Id: Ibec7df5dcf5cf817b1c3574e3f3acd8206c72e20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165668 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 7423a8425eeb..af0e37e36d3a 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -303,12 +303,18 @@ IMPL_LINK(SdNavigatorWin, CommandHdl, const CommandEvent&, rCEvt, bool) void SdNavigatorWin::ExecuteContextMenuAction(std::u16string_view rSelectedPopupEntry) { -if (rSelectedPopupEntry == u"rename" && mpBindings) +if (rSelectedPopupEntry == u"rename") { weld::TreeView& rTreeView = GetObjects().get_treeview(); std::unique_ptr xIter(rTreeView.make_iterator()); if (rTreeView.get_selected(xIter.get())) { +// grab the shell focus so the navigator will update +if (SfxViewShell* pCurSh = SfxViewShell::Current()) +{ +if (vcl::Window* pShellWnd = pCurSh->GetWindow()) +pShellWnd->GrabFocus(); +} if (rTreeView.get_iter_depth(*xIter) > 0) mpBindings->Execute(SID_NAME_GROUP); else
core.git: sd/source
sd/source/ui/dlg/navigatr.cxx | 21 + sd/source/ui/inc/navigatr.hxx |7 ++- 2 files changed, 27 insertions(+), 1 deletion(-) New commits: commit a076bbc5261885d49c592acd46b238bd659ccb41 Author: Jim Raykowski AuthorDate: Thu Mar 21 19:38:21 2024 -0800 Commit: Jim Raykowski CommitDate: Fri Apr 5 20:21:07 2024 +0200 SdNavigator: Make the sidebar panel not visible in outline and slide sorter view modes Inspired by the floating version behavior of not showing when in the outline or slide sorter view mode. Change-Id: I19ecb5751af7798527cf6b08ca766c367f177336 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165150 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 8b955ba07035..7423a8425eeb 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -796,6 +796,27 @@ void SdNavigatorWin::SetDragImage() mxToolbox->set_item_icon_name("dragmode", GetDragTypeSdBmpId(meDragType)); } +// for the sidebar to make the panel invisible when the shell type is outline or slide sorter +void SdNavigatorWin::HandleContextChange(const vcl::EnumContext& eContext) +{ +if (eContext.GetApplication() != vcl::EnumContext::Application::Impress) +return; + +::sd::DrawDocShell* pCurrentDocShell += dynamic_cast<::sd::DrawDocShell*>(SfxObjectShell::Current()); +if (!pCurrentDocShell) +return; + +const ::sd::DrawViewShell* pDrawViewShell += static_cast<::sd::DrawViewShell*>(pCurrentDocShell->GetViewShell()); +if (!pDrawViewShell) +return; + +sd::ViewShell::ShellType eShellType = pDrawViewShell->GetShellType(); +m_xContainer->set_visible(eShellType != sd::ViewShell::ST_OUTLINE +&& eShellType != sd::ViewShell::ST_SLIDE_SORTER); +} + /** * ControllerItem for Navigator */ diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx index 3e8ff9c28d21..a88ab7b4a2d6 100644 --- a/sd/source/ui/inc/navigatr.hxx +++ b/sd/source/ui/inc/navigatr.hxx @@ -25,6 +25,9 @@ #include "sdtreelb.hxx" #include +#include +#include + // forward namespace vcl { class Window; } @@ -97,7 +100,7 @@ public: } -class SD_DLLPUBLIC SdNavigatorWin : public PanelLayout +class SD_DLLPUBLIC SdNavigatorWin : public PanelLayout, public sfx2::sidebar::IContextChangeReceiver { public: typedef ::std::function UpdateRequestFunctor; @@ -122,6 +125,8 @@ public: NavigatorDragType GetNavigatorDragType(); SdPageObjsTLV& GetObjects(); +virtual void HandleContextChange(const vcl::EnumContext& eContext) override; + private: friend class SdNavigatorFloat; friend class SdNavigatorControllerItem;
core.git: sd/source
sd/source/ui/dlg/navigatr.cxx | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) New commits: commit 186c4cd328830c9b3a1769ea7c6a0738e019dae7 Author: Jim Raykowski AuthorDate: Wed Apr 3 23:26:49 2024 -0800 Commit: Jim Raykowski CommitDate: Fri Apr 5 17:44:18 2024 +0200 SdNavigator: fix lcl_select_marked_object page selection ...which makes invalidation of SID_NAVIGATOR_PAGENAME in InitTreeLB unnecessary. Also rename lcl_select_marked_object lcl_select_marked_objects. Change-Id: I6afe0cc59808a476dcb1496e23dbb1b54ec570e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165780 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index cdbfcac41382..8b955ba07035 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -50,6 +50,8 @@ #include #include +#include + /** * SdNavigatorWin - FloatingWindow */ @@ -136,7 +138,7 @@ SdNavigatorWin::~SdNavigatorWin() mxLbDocs.reset(); } -static void lcl_select_marked_object(const sd::ViewShell* pViewShell, SdPageObjsTLV* pTlbObjects) +static void lcl_select_marked_objects(sd::ViewShell* pViewShell, SdPageObjsTLV* pTlbObjects) { if (const SdrView* pView = pViewShell->GetDrawView()) { @@ -148,7 +150,10 @@ static void lcl_select_marked_object(const sd::ViewShell* pViewShell, SdPageObjs pTlbObjects->SelectEntry(rMarkedObject); } else -pTlbObjects->SelectEntry(pViewShell->GetName()); +{ +if (SdPage* pPage = pViewShell->GetActualPage()) +pTlbObjects->SelectEntry(pPage->GetName()); +} } } @@ -185,7 +190,7 @@ void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc ) } if (pViewShell) -lcl_select_marked_object(pViewShell, mxTlbObjects.get()); +lcl_select_marked_objects(pViewShell, mxTlbObjects.get()); } void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) @@ -251,11 +256,7 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) } if (pViewShell) -lcl_select_marked_object(pViewShell, mxTlbObjects.get()); - -SfxViewFrame* pViewFrame = ( ( pViewShell && pViewShell->GetViewFrame() ) ? pViewShell->GetViewFrame() : SfxViewFrame::Current() ); -if( pViewFrame ) -pViewFrame->GetBindings().Invalidate(SID_NAVIGATOR_PAGENAME, true, true); +lcl_select_marked_objects(pViewShell, mxTlbObjects.get()); } /** @@ -589,7 +590,7 @@ IMPL_LINK( SdNavigatorWin, ShapeFilterCallback, const OUString&, rIdent, void ) { pFrameView->SetIsNavigatorShowingAllShapes(bShowAllShapes); } -lcl_select_marked_object(pViewShell, mxTlbObjects.get()); +lcl_select_marked_objects(pViewShell, mxTlbObjects.get()); } } }
core.git: sd/source
sd/source/ui/dlg/navigatr.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 3be164e0c7dc2cc73e32e643e30357e126238588 Author: Jim Raykowski AuthorDate: Mon Apr 1 23:08:40 2024 -0800 Commit: Jim Raykowski CommitDate: Thu Apr 4 10:04:25 2024 +0200 SdNavigator: Show context menu only for active document navigation Change-Id: I3d622f92d411b30e5beea5432e10ae0a907eeb0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165667 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index a329601a2a35..cdbfcac41382 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -285,6 +285,8 @@ IMPL_STATIC_LINK_NOARG(SdNavigatorWin, MouseReleaseHdl, const MouseEvent&, bool) IMPL_LINK(SdNavigatorWin, CommandHdl, const CommandEvent&, rCEvt, bool) { +if (NavDocInfo* pInfo = GetDocInfo(); !pInfo || !pInfo->IsActive()) +return false; if (rCEvt.GetCommand() != CommandEventId::ContextMenu) return false; weld::TreeView& rTreeView = GetObjects().get_treeview();
core.git: sd/source
sd/source/ui/dlg/navigatr.cxx | 51 +- 1 file changed, 36 insertions(+), 15 deletions(-) New commits: commit 878ab17b0fad66fb7accd9573ef7f66403d593b9 Author: Jim Raykowski AuthorDate: Sun Mar 31 13:56:36 2024 -0800 Commit: Jim Raykowski CommitDate: Tue Apr 2 22:43:45 2024 +0200 tdf#139944 SdNavigator: disable in master mode Improve where the disable is done and in addition to making disabled also clear the objects tree. Also fixes a drag and drop ordering scrolling bug introduced by commit 60e32969a98cad348cf8e55e8f93abc3d6e9c70c Change-Id: I702c85bc1ba16837fb7f8c2246bdb29d96e6cc6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165606 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index dbea0b6b4818..a329601a2a35 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -157,6 +157,24 @@ void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc ) { SdDrawDocument* pNonConstDoc = const_cast(pDoc); // const as const can... sd::DrawDocShell* pDocShell = pNonConstDoc->GetDocSh(); +::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); + +// tdf#139944 disable navigator in master mode +if (pViewShell) +{ +if (const sd::DrawViewShell* pDrawViewShell = static_cast<::sd::DrawViewShell*>(pViewShell)) +{ +if (pDrawViewShell->GetEditMode() == EditMode::MasterPage) +{ +m_xContainer->set_sensitive(false); +mxTlbObjects->clear(); +return; +} +else +m_xContainer->set_sensitive(true); +} +} + const OUString& aDocShName( pDocShell->GetName() ); OUString aDocName = pDocShell->GetMedium()->GetName(); if (!mxTlbObjects->IsEqualToDoc(pDoc)) @@ -165,7 +183,8 @@ void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc ) RefreshDocumentLB(); mxLbDocs->set_active_text(aDocShName); } -if (const sd::ViewShell* pViewShell = pDocShell->GetViewShell()) + +if (pViewShell) lcl_select_marked_object(pViewShell, mxTlbObjects.get()); } @@ -176,6 +195,22 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) OUString aDocShName( pDocShell->GetName() ); ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); +// tdf#139944 disable navigator in master mode +if (pViewShell) +{ +if (const sd::DrawViewShell* pDrawViewShell = static_cast<::sd::DrawViewShell*>(pViewShell)) +{ +if (pDrawViewShell->GetEditMode() == EditMode::MasterPage) +{ +m_xContainer->set_sensitive(false); +mxTlbObjects->clear(); +return; +} +else +m_xContainer->set_sensitive(true); +} +} + // Restore the 'ShowAllShapes' flag from the last time (in this session) // that the navigator was shown. if (pViewShell != nullptr) @@ -783,20 +818,6 @@ void SdNavigatorControllerItem::StateChangedAtToolBoxControl( sal_uInt16 nSId, if( !(pInfo && pInfo->IsActive()) ) return; -if (::sd::DrawDocShell* pDrawDocShell = pInfo->GetDrawDocShell()) -{ -const auto pDrawViewShell = -static_cast<::sd::DrawViewShell *>(pDrawDocShell->GetViewShell()); -if (pDrawViewShell) -{ -pNavigatorWin->FreshTree(pDrawDocShell->GetDoc()); -bool bEditModePage(pDrawViewShell->GetEditMode() == EditMode::Page); -pNavigatorWin->mxToolbox->set_sensitive(bEditModePage); -pNavigatorWin->mxLbDocs->set_sensitive(bEditModePage); -pNavigatorWin->mxTlbObjects->set_sensitive(bEditModePage); -} -} - const SfxUInt32Item& rStateItem = dynamic_cast(*pItem); NavState nState = static_cast(rStateItem.GetValue());
core.git: sd/source
sd/source/ui/dlg/sdtreelb.cxx |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit 2d88ea62d4b6663cf8839e5484e2ae8042112f81 Author: Jim Raykowski AuthorDate: Sat Mar 9 16:01:00 2024 -0900 Commit: Jim Raykowski CommitDate: Thu Mar 14 00:23:15 2024 +0100 tdf#160093 Fix SdNavigator empty after inserting formula OLE object or OLE Object... Also fixes empty tree occurance when multiple Draw/Impress documents are opened at once. Change-Id: I03d714bf96700d3a7df661fca91cceda703149f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164607 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 5bed03fa24db..9883ad847ae0 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -1278,10 +1278,9 @@ void SdPageObjsTLV::Fill(const SdDrawDocument* pInDoc, bool bAllPages, const OUS sal_uInt16 nPage = 0; const sal_uInt16 nMaxPages = m_pDoc->GetPageCount(); -sd::DrawViewShell* pDrawViewShell = lcl_getDrawViewShell(m_pDoc); -if (!pDrawViewShell) -return; -PageKind eDrawViewShellPageKind = pDrawViewShell->GetPageKind(); +PageKind eDrawViewShellPageKind = PageKind::Standard; +if (sd::DrawViewShell* pDrawViewShell = lcl_getDrawViewShell(m_pDoc)) +eDrawViewShellPageKind = pDrawViewShell->GetPageKind(); while( nPage < nMaxPages ) {
core.git: officecfg/registry sd/inc sd/Library_sd.mk sd/sdi sd/source sd/uiconfig sd/UIConfig_sdraw.mk
officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu | 14 sd/Library_sd.mk | 1 sd/UIConfig_sdraw.mk | 1 sd/inc/app.hrc | 2 sd/sdi/_drvwsh.sdi | 5 sd/sdi/sdraw.sdi | 16 + sd/source/ui/dlg/SelectLayerDlg.cxx | 45 ++ sd/source/ui/inc/SelectLayerDlg.hxx | 37 ++ sd/source/ui/view/drviews2.cxx | 33 ++ sd/source/ui/view/drviewsj.cxx | 1 sd/uiconfig/sdraw/ui/selectlayerdialog.ui| 152 ++ 11 files changed, 306 insertions(+), 1 deletion(-) New commits: commit 1447900fc5f0d32d8379a95439f524fda9a664c1 Author: Jim Raykowski AuthorDate: Thu Nov 16 19:19:36 2023 -0900 Commit: Jim Raykowski CommitDate: Mon Mar 11 17:34:27 2024 +0100 tdf#122587 Add uno command to set layer of object(s) Change-Id: Iabdd0f7059953760a69d82a3810eb8ed20c2fd9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159982 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu index b46b7b34fac7..370984a7e5d9 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu @@ -1022,6 +1022,20 @@ 1 + + + Set Layer + + + ~Move to Layer... + + + Open a dialog to change the layer of the object + + + 1 + + ~Normal diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index bdf7b146da91..f801a77dbc88 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -245,6 +245,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ sd/source/ui/dlg/navigatr \ sd/source/ui/dlg/sdabstdlg \ sd/source/ui/dlg/sdtreelb \ + sd/source/ui/dlg/SelectLayerDlg \ sd/source/ui/dlg/titledockwin \ sd/source/ui/dlg/unchss \ sd/source/ui/dlg/UndoThemeChange \ diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk index f6d42acba7e2..a84f0f286cae 100644 --- a/sd/UIConfig_sdraw.mk +++ b/sd/UIConfig_sdraw.mk @@ -122,6 +122,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/sdraw,\ sd/uiconfig/sdraw/ui/notebookbar_online \ sd/uiconfig/sdraw/ui/paranumberingtab \ sd/uiconfig/sdraw/ui/queryunlinkimagedialog \ + sd/uiconfig/sdraw/ui/selectlayerdialog \ sd/uiconfig/sdraw/ui/vectorize \ )) diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc index e275e4688258..004b01c6e93d 100644 --- a/sd/inc/app.hrc +++ b/sd/inc/app.hrc @@ -111,7 +111,7 @@ #define SID_PAGEMODE(SID_SD_START+46) #define SID_LAYERMODE (SID_SD_START+47) #define SID_TOGGLELAYERVISIBILITY (SID_SD_START+48) -// FREE +#define SID_SETLAYER(SID_SD_START+49) #define SID_MASTERPAGE (SID_SD_START+50) // Navigation between slides #define SID_GO_TO_NEXT_PAGE (SID_SD_START+51) diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index d5e1a5f51e8d..0d4bed12a9a7 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -198,6 +198,11 @@ interface DrawView ExecMethod = FuTemporary ; StateMethod = GetMenuState ; ] +SID_SETLAYER +[ +ExecMethod = FuTemporary ; +StateMethod = GetMenuState ; +] SID_NAVIGATOR // ole : no, status : ? [ ExecMethod = FuTemporary ; diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi index 7bb752c687ac..ce0eb521e9ec 100644 --- a/sd/sdi/sdraw.sdi +++ b/sd/sdi/sdraw.sdi @@ -2623,6 +2623,22 @@ SfxBoolItem ToggleLayerVisibility SID_TOGGLELAYERVISIBILITY GroupId = SfxGroupId::Modify; ] +SfxVoidItem SetLayer SID_SETLAYER +[ +AutoUpdate = FALSE, +FastCall = FALSE, +ReadOnlyDoc = FALSE, +Toggle = FALSE, +Container = FALSE, +RecordAbsolute = FALSE, +RecordPerSet; + +AccelConfig = TRUE, +MenuConfig = TRUE, +ToolBoxConfig = TRUE, +GroupId = SfxGroupId::Modify; +] + SfxVoidItem AssignLayout SID_ASSIGN_LAYOUT (SfxUInt32Item WhatPage ID_VAL_WHATPAGE, SfxUInt32Item WhatLayout ID_VAL_WHATLAYOUT) [ diff --git a/sd/source/ui/dlg/SelectLayerDlg.cxx b/sd/source/ui/dlg/SelectLayerDlg.cxx new file mode 100644 index ..399f9db5d3c0 --- /dev/null +++ b/sd/source/ui/dlg/SelectLayerDlg.cxx @@ -0,0 +1,45 @@
core.git: include/svx sd/inc sd/source svx/source sw/qa sw/source
include/svx/fontworkgallery.hxx |5 - sd/inc/strings.hrc |1 + sd/source/ui/dlg/sdtreelb.cxx | 27 +-- svx/source/tbxctrls/fontworkgallery.cxx | 24 ++-- svx/source/toolbars/fontworkbar.cxx |2 +- sw/qa/extras/accessibility/dialogs.cxx |2 +- sw/source/uibase/uiview/viewdraw.cxx|2 +- 7 files changed, 55 insertions(+), 8 deletions(-) New commits: commit 1fd359790ed4a27902248d92ee343a4aeaf63c8e Author: Jim Raykowski AuthorDate: Fri Jun 2 08:08:18 2023 -0800 Commit: Jim Raykowski CommitDate: Sun Mar 10 02:43:41 2024 +0100 tdf#90242 Navigator: Improve custom shape naming This patch makes the Draw/Impress Navigator display the name retrieved by SdrCustomShapeGeometryItem::GetPropertyValueByName("Type") for custom shape objects when the custom shape is unnamed and the Navigator is set to show all objects. For Writer and Calc, this patch makes inserted fontwork custom shape objects be automatically named 'Fontwork N'. Change-Id: Ice34461fe7a4b26d01b2d93e871a956dc55392f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152568 Tested-by: Jenkins Reviewed-by: Stéphane Guillou Reviewed-by: Jim Raykowski diff --git a/include/svx/fontworkgallery.hxx b/include/svx/fontworkgallery.hxx index 8e5eceb8f033..21c418584570 100644 --- a/include/svx/fontworkgallery.hxx +++ b/include/svx/fontworkgallery.hxx @@ -60,6 +60,8 @@ class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FontWorkGalleryDialog final : public wel std::unique_ptr maCtlFavorites; std::unique_ptr mxOKButton; +css::uno::Reference mxFrame; + voidinitFavorites(sal_uInt16 nThemeId); voidinsertSelectedFontwork(); voidfillFavorites(sal_uInt16 nThemeId); @@ -69,7 +71,8 @@ class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FontWorkGalleryDialog final : public wel DECL_DLLPRIVATE_LINK(QueryTooltipHandler, const weld::TreeIter&, OUString); public: -FontWorkGalleryDialog(weld::Window* pParent, SdrView& rView); +FontWorkGalleryDialog(weld::Window* pParent, SdrView& rView, + css::uno::Reference xFrame); virtual ~FontWorkGalleryDialog() override; // SJ: if the SdrObject** is set, the SdrObject is not inserted into the page when executing the dialog diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc index 5056a8030966..2522768a6a7b 100644 --- a/sd/inc/strings.hrc +++ b/sd/inc/strings.hrc @@ -245,6 +245,7 @@ #define STR_GRAPHICS_STYLE_FAMILY NC_("STR_GRAPHICS_STYLE_FAMILY", "Drawing Styles") #define STR_PRESENTATIONS_STYLE_FAMILY NC_("STR_PRESENTATIONS_STYLE_FAMILY", "Presentation Styles") #define STR_CELL_STYLE_FAMILY NC_("STR_CELL_STYLE_FAMILY", "Cell Styles") +#define STR_NAVIGATOR_CUSTOMSHAPE NC_("STR_NAVIGATOR_CUSTOMSHAPE", "Custom Shape") #define STR_NAVIGATOR_SHAPE_BASE_NAME NC_("STR_NAVIGATOR_SHAPE_BASE_NAME", "Shape %1") #define STR_SET_BACKGROUND_PICTURE NC_("STR_SET_BACKGROUND_PICTURE", "Set Background Image" ) #define STR_RESET_LAYOUT NC_("STR_RESET_LAYOUT", "Reset Slide Layout") diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 63c26bc5635c..5bed03fa24db 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -58,6 +58,11 @@ #include #include +#include +#include +#include +#include + using namespace com::sun::star; namespace { @@ -918,7 +923,25 @@ OUString SdPageObjsTLV::GetObjectName( && aRet.isEmpty() && pObject!=nullptr) { -aRet = SdResId(STR_NAVIGATOR_SHAPE_BASE_NAME) + " (" + pObject->TakeObjNameSingul() +")"; +OUString sObjName; +if (pObject->GetObjIdentifier() == SdrObjKind::CustomShape) +{ +// taken from SdrObjCustomShape::GetCustomShapeName +OUString aEngine(pObject->GetMergedItem(SDRATTR_CUSTOMSHAPE_ENGINE).GetValue()); +if (aEngine.isEmpty() || aEngine == "com.sun.star.drawing.EnhancedCustomShapeEngine") +{ +OUString sShapeType; +const SdrCustomShapeGeometryItem& rGeometryItem += pObject->GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY); +const uno::Any* pAny = rGeometryItem.GetPropertyValueByName("Type"); +if (pAny && (*pAny >>= sShapeType)) +sObjName = SdResId(STR_NAVIGATOR_CUSTOMSHAPE) + u": " + sShapeType; +} +} +else +sObjName = pObject->TakeObjNameSingul(); + +aRet = SdResId(STR_NAVIGATOR_SHAPE_BASE_NAME) + " (" + sObjName +")"; aRet = aRet.replaceFirst("%1", OUString::number(pObject->GetOrdNum() + 1)); } @@ -1223,7 +1246,7 @@ void
core.git: sw/source
sw/source/core/crsr/crsrsh.cxx | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) New commits: commit cf6c6db51eada17408c412173331db0820a23e5d Author: Jim Raykowski AuthorDate: Tue Feb 27 19:22:50 2024 -0900 Commit: Jim Raykowski CommitDate: Tue Mar 5 07:21:02 2024 +0100 tdf#49994 Fix text selection over pages for multi column tables with repeated headings Change-Id: I6cddeb132ff4f8ff27ea03701067d7a3d4c4cf82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/79113 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 04c904f13905..3e9ca93b3380 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1994,22 +1994,27 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) { pTableFrame = nullptr; -SwMoveFnCollection const & fnPosSect = *pPos < *pITmpCursor->GetMark() -? fnSectionStart -: fnSectionEnd; - // then only select inside the Box if( m_pTableCursor ) { +SwMoveFnCollection const & fnPosSect = *pPos < *pITmpCursor->GetMark() +? fnSectionStart +: fnSectionEnd; + m_pCurrentCursor->SetMark(); *m_pCurrentCursor->GetMark() = *m_pTableCursor->GetMark(); m_pCurrentCursor->GetMkPos() = m_pTableCursor->GetMkPos(); m_pTableCursor->DeleteMark(); m_pTableCursor->SwSelPaintRects::Hide(); -} -*m_pCurrentCursor->GetPoint() = *m_pCurrentCursor->GetMark(); -GoCurrSection( *m_pCurrentCursor, fnPosSect ); +*m_pCurrentCursor->GetPoint() = *m_pCurrentCursor->GetMark(); +GoCurrSection( *m_pCurrentCursor, fnPosSect ); +} +else +{ +eFlags &= SwCursorShell::UPDOWN; +*m_pCurrentCursor->GetPoint() = *m_pCurrentCursor->GetMark(); +} } }
core.git: include/sfx2 sfx2/source
include/sfx2/sidebar/TabBar.hxx |2 -- sfx2/source/sidebar/TabBar.cxx | 12 +--- 2 files changed, 1 insertion(+), 13 deletions(-) New commits: commit 0daeee1a7d0e530f1cce40f86a26ed01f07ee7da Author: Jim Raykowski AuthorDate: Mon Feb 26 17:22:42 2024 -0900 Commit: Jim Raykowski CommitDate: Fri Mar 1 00:29:51 2024 +0100 tdf#159837 Drop unneeded TabBar EventNotify KEYINPUT handling code to make qt and windows VCL backends respond to shortcuts when the keyboard focus is on a TabBar tab. commit 51f8e04eaaea50b779e3882e87628a6e625e0fd8 done to make the Shift+Ctrl+F10 short cut, used to dock/undock the sidebar, work from the sidebar tabbar appears no longer necessary. Simply passing the KEYINPUT event on to InterimItemWindow::EventNotify seems to be enough. Change-Id: Idfa8be4260d31e686acf1b49e89549deb9463a41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164051 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx index 6ef0fc9c3ddd..bdaa442c58ef 100644 --- a/include/sfx2/sidebar/TabBar.hxx +++ b/include/sfx2/sidebar/TabBar.hxx @@ -128,8 +128,6 @@ private: DECL_LINK(OnToolboxClicked, weld::Toggleable&, void); SidebarController* pParentSidebarController; -std::unique_ptr mpAccel; - }; diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx index 9d92d24cd93a..3ccaa7ebd454 100644 --- a/sfx2/source/sidebar/TabBar.cxx +++ b/sfx2/source/sidebar/TabBar.cxx @@ -185,17 +185,7 @@ bool TabBar::EventNotify(NotifyEvent& rEvent) NotifyEventType nType = rEvent.GetType(); if(NotifyEventType::KEYINPUT == nType) { -const vcl::KeyCode& rKeyCode = rEvent.GetKeyEvent()->GetKeyCode(); -if (!mpAccel) -{ -mpAccel = svt::AcceleratorExecute::createAcceleratorHelper(); -mpAccel->init(comphelper::getProcessComponentContext(), mxFrame); -} -const OUString aCommand(mpAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyCode))); -if (".uno:Sidebar" == aCommand || -(rKeyCode.IsMod1() && rKeyCode.IsShift() && rKeyCode.GetCode() == KEY_F10)) -return InterimItemWindow::EventNotify(rEvent); -return true; +return InterimItemWindow::EventNotify(rEvent); } else if(NotifyEventType::COMMAND == nType) {
core.git: sw/uiconfig
sw/uiconfig/swriter/ui/navigatorpanel.ui |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit f34292a105fd1660fbef5f6811ea37ffdfff6c50 Author: Jim Raykowski AuthorDate: Mon Feb 26 22:54:02 2024 -0900 Commit: Jim Raykowski CommitDate: Tue Feb 27 15:04:40 2024 +0100 tdf#141728 follow up: don't expand spin control when sidebar is resized Change-Id: I9b231fd67f089e6fcd02329e255e22152e3ed3f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164003 Tested-by: Jenkins Reviewed-by: Vernon, Stuart Foote Reviewed-by: Jim Raykowski diff --git a/sw/uiconfig/swriter/ui/navigatorpanel.ui b/sw/uiconfig/swriter/ui/navigatorpanel.ui index 829b082623ef..e7c3020cdbdf 100644 --- a/sw/uiconfig/swriter/ui/navigatorpanel.ui +++ b/sw/uiconfig/swriter/ui/navigatorpanel.ui @@ -329,14 +329,12 @@ True -False -True +True icons True False -True True
core.git: sw/source sw/uiconfig
sw/source/uibase/utlui/navipi.cxx| 16 +++- sw/uiconfig/swriter/ui/navigatorpanel.ui |4 +--- 2 files changed, 4 insertions(+), 16 deletions(-) New commits: commit a75ad49a45e7b632820de2f046534b7ff2687424 Author: Jim Raykowski AuthorDate: Sat Feb 24 19:42:36 2024 -0900 Commit: Jim Raykowski CommitDate: Sun Feb 25 18:28:08 2024 +0100 tdf#159875 SwNavigator: improve toggle master view visibility handling This patch sets the visibility of the toolbar container that contains the 'Toggle Master View' toolbutton in the first row of the Navigator's toolbox tools as opposed to the current method of setting the toolbutton item visibility. In this way extra space is not given to the toolbar when it is not visible. Change-Id: I6f2ff97728698b3de4812bb9524b2489beac24ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163898 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 946f7b67dc91..bb8338e3fe9e 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -295,7 +295,6 @@ IMPL_LINK(SwNavigationPI, ToolBoxSelectHdl, const OUString&, rCommand, void) bool bGlobalMode = IsGlobalMode(); m_pConfig->SetGlobalActive(bGlobalMode); m_xGlobalToolBox->set_item_active("globaltoggle", bGlobalMode); -m_xContent1ToolBox->set_item_active("contenttoggle", bGlobalMode); } else if (rCommand == "save") { @@ -511,11 +510,6 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xDocListBox->set_help_id(HID_NAVIGATOR_LISTBOX); m_xDocListBox->set_size_request(42, -1); // set a nominal width so it takes width of surroundings -if (!IsGlobalDoc()) -{ -m_xContent1ToolBox->set_item_visible("contenttoggle", false); -} - bool bFloatingNavigator = ParentIsFloatingWindow(m_xNavigatorDlg); m_xContentTree->ShowTree(); @@ -557,6 +551,8 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, pActView->GetWrtShellPtr()->IsGlblDocSaveLinks()); if (m_pConfig->IsGlobalActive()) ToggleTree(); +else +m_xContent1ToolBox->set_visible(true); if (bFloatingNavigator) m_xGlobalTree->grab_focus(); } @@ -668,13 +664,7 @@ void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/, { SwWrtShell* pWrtShell = pActView->GetWrtShellPtr(); m_xContentTree->SetActiveShell(pWrtShell); -bool bGlobal = IsGlobalDoc(); -m_xContent1ToolBox->set_item_visible("contenttoggle", bGlobal); -if ((!bGlobal && IsGlobalMode()) || (!IsGlobalMode() && m_pConfig->IsGlobalActive())) -{ -ToggleTree(); -} -if (bGlobal) +if (IsGlobalDoc()) { m_xGlobalToolBox->set_item_active("save", pWrtShell->IsGlblDocSaveLinks()); } diff --git a/sw/uiconfig/swriter/ui/navigatorpanel.ui b/sw/uiconfig/swriter/ui/navigatorpanel.ui index 6b7a198e601a..829b082623ef 100644 --- a/sw/uiconfig/swriter/ui/navigatorpanel.ui +++ b/sw/uiconfig/swriter/ui/navigatorpanel.ui @@ -209,7 +209,6 @@ False True 6 -12 True @@ -224,12 +223,11 @@ 3 -True True icons False - + True False Toggle Master View
core.git: sw/uiconfig
sw/uiconfig/swriter/ui/navigatorpanel.ui |1 + 1 file changed, 1 insertion(+) New commits: commit 61f34fde10e6f5cad7d23826b4dad716fef43e6c Author: Jim Raykowski AuthorDate: Thu Feb 22 21:01:34 2024 -0900 Commit: Jim Raykowski CommitDate: Sat Feb 24 21:53:51 2024 +0100 tdf#141728 follow up: provide a bit of space between controls Provides space between the 'Navigate By' and go to page spin control without there is none for non gtk VCL backends. Change-Id: Ia9a07f0699c9dc174179a9789b4ae7ae6c1300af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163799 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/uiconfig/swriter/ui/navigatorpanel.ui b/sw/uiconfig/swriter/ui/navigatorpanel.ui index c90b2e71e628..6b7a198e601a 100644 --- a/sw/uiconfig/swriter/ui/navigatorpanel.ui +++ b/sw/uiconfig/swriter/ui/navigatorpanel.ui @@ -221,6 +221,7 @@ True False +3 True
core.git: vcl/source
vcl/source/window/toolbox.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 45e3abcb79fb1ccf7d813a7b080a8ad70bdcb5b1 Author: Jim Raykowski AuthorDate: Thu Feb 22 22:47:10 2024 -0900 Commit: Jim Raykowski CommitDate: Fri Feb 23 17:56:13 2024 +0100 tdf#159837 Make keyboard shortcuts work when focus is in toolbar for SalInstanceBuilder based VCL backends Change-Id: I36764e7199a0f7292b331da3d187fbe939b4becc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163800 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index fc9effe58065..272263072a36 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -4435,7 +4435,9 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) // do nothing to avoid key presses going into the document // while the toolbox has the focus // just forward function and special keys and combinations with Alt-key -if( aKeyGroup == KEYGROUP_FKEYS || aKeyGroup == KEYGROUP_MISC || aKeyCode.IsMod2() ) +// and Ctrl-key +if( aKeyGroup == KEYGROUP_FKEYS || aKeyGroup == KEYGROUP_MISC || aKeyCode.IsMod2() +|| aKeyCode.IsMod1() ) bForwardKey = true; } }
core.git: sw/source sw/uiconfig
sw/source/uibase/inc/navipi.hxx | 14 - sw/source/uibase/ribbar/workctrl.cxx |2 sw/source/uibase/utlui/navipi.cxx| 230 +-- sw/uiconfig/swriter/ui/navigatorpanel.ui | 30 ++-- 4 files changed, 94 insertions(+), 182 deletions(-) New commits: commit 139199ee9c09d25624191132adbe4fd29365eb7a Author: Jim Raykowski AuthorDate: Thu Feb 22 00:03:01 2024 -0900 Commit: Jim Raykowski CommitDate: Thu Feb 22 19:24:37 2024 +0100 tdf#141728 Revamp sw navigator go to page spin control - makes the go to page spin control visible only when Navigate By is set to Page and hides Previous/Next navigation buttons during this time - makes the go to page control track the page number in the document view - reduces the preferred width of the Navigate By control to help reduce the width of sidebar Navigator Change-Id: I8d876a919ac18e69cf62381310389c00671d8596 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163723 Tested-by: Jenkins Tested-by: Heiko Tietze Reviewed-by: Heiko Tietze Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx index b47b17e13bc7..ff0731621b87 100644 --- a/sw/source/uibase/inc/navipi.hxx +++ b/sw/source/uibase/inc/navipi.hxx @@ -49,6 +49,7 @@ class SwNavigationPI final : public PanelLayout ::sfx2::sidebar::ControllerItem m_aDocFullName; ::sfx2::sidebar::ControllerItem m_aPageStats; +::sfx2::sidebar::ControllerItem m_aNavElement; std::unique_ptr m_xContent1ToolBox; std::unique_ptr m_xContent2ToolBox; @@ -62,13 +63,12 @@ class SwNavigationPI final : public PanelLayout std::unique_ptr m_xUpdateMenu; std::unique_ptr m_xInsertMenu; std::unique_ptr m_xGlobalToolBox; -std::unique_ptr m_xEdit; +std::unique_ptr m_xGotoPageSpinButton; std::unique_ptr m_xContentBox; std::unique_ptr m_xContentTree; std::unique_ptr m_xGlobalBox; std::unique_ptr m_xGlobalTree; std::unique_ptr m_xDocListBox; -Idlem_aPageChgIdle; OUStringm_sContentFileName; VclPtr m_xNavigatorDlg; @@ -102,15 +102,9 @@ class SwNavigationPI final : public PanelLayout DECL_LINK( DoneLink, SfxPoolItem const *, void ); DECL_LINK( HeadingsMenuSelectHdl, const OUString&, void ); DECL_LINK( GlobalMenuSelectHdl, const OUString&, void ); -DECL_LINK( ChangePageHdl, Timer*, void ); -DECL_LINK( PageEditModifyHdl, weld::SpinButton&, void ); -DECL_LINK( EditActionHdl, weld::Entry&, bool ); DECL_LINK( SetFocusChildHdl, weld::Container&, void ); DECL_LINK( NavigateByComboBoxSelectHdl, weld::ComboBox&, void ); -DECL_LINK( PageModifiedHdl, weld::Entry&, void ); - -bool EditAction(); -void UsePage(); +DECL_LINK(GotoPageSpinButtonValueChangedHdl, weld::SpinButton&, void); void UpdateInitShow(); @@ -122,6 +116,8 @@ class SwNavigationPI final : public PanelLayout void UpdateNavigateBy(); +void SetContent3And4ToolBoxVisibility(); + public: static std::unique_ptr Create(weld::Widget* pParent, diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index 9a9b288e142f..cdfcf0d64383 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -598,7 +598,7 @@ NavElementBox_Base::NavElementBox_Base(std::unique_ptr xComboBox : m_xComboBox(std::move(xComboBox)) ,m_xFrame(std::move(xFrame)) { -m_xComboBox->set_size_request(150, -1); +m_xComboBox->set_size_request(100, -1); m_xComboBox->make_sorted(); m_xComboBox->freeze(); diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index dd3899039a2a..946f7b67dc91 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -148,6 +148,15 @@ IMPL_LINK(SwNavigationPI, NavigateByComboBoxSelectHdl, weld::ComboBox&, rComboBo UpdateNavigateBy(); } +void SwNavigationPI::SetContent3And4ToolBoxVisibility() +{ +if (IsGlobalMode()) +return; +bool bIsMoveTypePage = SwView::GetMoveType() == NID_PGE; +m_xContent3ToolBox->set_visible(!bIsMoveTypePage); +m_xContent4ToolBox->set_visible(bIsMoveTypePage); +} + // Filling of the list box for outline view or documents // The PI will be set to full size void SwNavigationPI::FillBox() @@ -177,23 +186,6 @@ void SwNavigationPI::FillBox() } } -void SwNavigationPI::UsePage() -{ -SwView *pView = GetCreateView(); -SwWrtShell *pSh = pView ? >GetWrtShell() : nullptr; -m_xEdit->set_value(1); -if (pSh) -{ -const sal_uInt16 nPageCnt = pSh->GetPageCnt(); -sal_uInt16 nPhyPage, nVirPage; -pSh->GetPageNum(nPhyPage, nVirPage); - -m_xEdit->set_max(nPageCnt); -m_xEdit->set_width_chars(3); -m_xEdit->set_value(nPhyPage); -} -} - // Select handler of the toolboxes
core.git: sd/qa sd/source
sd/qa/uitest/data/tdf128787.odp |binary sd/qa/uitest/impress_tests2/tdf128787.py | 48 +++ sd/source/ui/view/drviews2.cxx | 31 3 files changed, 74 insertions(+), 5 deletions(-) New commits: commit 60e37a4b85226f7a4430cd98347724a4ef0bde66 Author: Jim Raykowski AuthorDate: Fri Feb 9 20:48:02 2024 -0900 Commit: Jim Raykowski CommitDate: Thu Feb 15 20:37:54 2024 +0100 tdf#128787 sd: Make StyleNewByExample and StyleUpdateByExample work when no arguments are supplied Change-Id: I245aa0f6b212e049dce6bdf9e079495119aeadbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163208 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/qa/uitest/data/tdf128787.odp b/sd/qa/uitest/data/tdf128787.odp new file mode 100644 index ..d21bbbeaaefb Binary files /dev/null and b/sd/qa/uitest/data/tdf128787.odp differ diff --git a/sd/qa/uitest/impress_tests2/tdf128787.py b/sd/qa/uitest/impress_tests2/tdf128787.py new file mode 100644 index ..78cb03c367d4 --- /dev/null +++ b/sd/qa/uitest/impress_tests2/tdf128787.py @@ -0,0 +1,48 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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/. +# + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, select_by_text + +class tdf128787(UITestCase): + + def test_tdf128787(self): +with self.ui_test.load_file(get_url_for_data_file("tdf128787.odp")) as document: +xImpressDoc = self.xUITest.getTopFocusWindow() +xEditWin = xImpressDoc.getChild("impress_win") + +# Without opening the StyleListPanel, executing_dialog_through_command +# .uno:StyleNewByExample doesn't work as expected in the test environment. +# Perhaps this is required so the styles are loaded. The sidebar can be closed after +# this and .uno:StyleNewByExample will work but for this test this is not wanted. +xEditWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "StyleListPanel"})) + +# wait until the template panel is available +xTemplatePanel = self.ui_test.wait_until_child_is_available('TemplatePanel') + +# select the image +xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Image 1"})) + +# New Style from Selection [uno:StyleNewByExample] +with self.ui_test.execute_dialog_through_command(".uno:StyleNewByExample") as xDialog: +# Enter a name in the Create Style dialog and press OK +stylename = xDialog.getChild("stylename") +stylename.executeAction("TYPE", mkPropertyValues({"TEXT": "New Style"})) + +# make sure filter is set "Hierarchical"' so the 'treeview' tree is used +xFilter = xTemplatePanel.getChild('filter') +select_by_text(xFilter, "Hierarchical") + +xTreeView = xTemplatePanel.getChild('treeview') +# "New Style" should be the first child of the first child in the tree +xItem = xTreeView.getChild(0).getChild(0) +self.assertEqual("New Style", get_state_as_dict(xItem)['Text']) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 04651d87fe2f..84778fd2dbf5 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -193,6 +193,8 @@ #include #include +#include + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -3163,7 +3165,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_STYLE_UPDATE_BY_EXAMPLE: case SID_STYLE_NEW_BY_EXAMPLE: { -if( rReq.GetSlot() == SID_STYLE_EDIT && !rReq.GetArgs() ) +if (!rReq.GetArgs() +&& (nSId == SID_STYLE_EDIT || nSId == SID_STYLE_UPDATE_BY_EXAMPLE + || nSId == SID_STYLE_NEW_BY_EXAMPLE)) { SfxStyleSheet* pStyleSheet = mpDrawView->GetStyleSheet(); if( pStyleSheet && pStyleSheet->GetFamily() == SfxStyleFamily::Page) @@ -3186,11 +3190,28 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SfxAllItemSet aSet(GetDoc()->GetPool()); -SfxStringItem aStyleNameItem( SID_STYLE_EDIT, pStyleSheet->GetName() ); -aSet.Put(aStyleNameItem); +aSet.Put(SfxUInt16Item(SID_STYLE_FAMILY, + static_cast(pStyleSheet->GetFamily(; -SfxUInt16Item aStyleFamilyItem( SID_STYLE_FAMILY, static_cast(pStyleSheet->GetFamily()) ); -
core.git: sd/qa sd/source
sd/qa/unit/misc-tests.cxx | 42 + sd/source/ui/view/drviews1.cxx |3 ++ 2 files changed, 45 insertions(+) New commits: commit 6b6849107562b258aa8858e94ff3c07160f07062 Author: Jim Raykowski AuthorDate: Sat Nov 25 15:14:04 2023 -0900 Commit: Jim Raykowski CommitDate: Mon Feb 5 20:38:18 2024 +0100 tdf#157117 sd: fix page switched to after last page is deleted Makes the new last page in the document be the page switched to after a page delete of the last page in the document. Before the patch, when the draw view has focus (not the slide sorter), deleting the last page in the document results in a switch to the first page. Change-Id: I8d3904e85254228e01d423f15312981d11fc9755 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159963 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx index 1bbf8364fd3e..342f720a6e6e 100644 --- a/sd/qa/unit/misc-tests.cxx +++ b/sd/qa/unit/misc-tests.cxx @@ -84,6 +84,7 @@ public: void testTdf136956(); void testTdf39519(); void testEncodedTableStyles(); +void testTdf157117(); CPPUNIT_TEST_SUITE(SdMiscTest); CPPUNIT_TEST(testTdf99396); @@ -107,6 +108,7 @@ public: CPPUNIT_TEST(testTdf136956); CPPUNIT_TEST(testTdf39519); CPPUNIT_TEST(testEncodedTableStyles); +CPPUNIT_TEST(testTdf157117); CPPUNIT_TEST_SUITE_END(); }; @@ -955,6 +957,46 @@ void SdMiscTest::testEncodedTableStyles() } } +void SdMiscTest::testTdf157117() +{ +createSdImpressDoc(); +SdXImpressDocument* pXImpressDocument = dynamic_cast(mxComponent.get()); +CPPUNIT_ASSERT(pXImpressDocument); +sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); + +// insert two pages to make a total of 3 pages +dispatchCommand(mxComponent, ".uno:InsertPage", {}); +dispatchCommand(mxComponent, ".uno:InsertPage", {}); + +// assert the document has 3 standard pages +SdDrawDocument* pDocument = pXImpressDocument->GetDoc(); +CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), pDocument->GetSdPageCount(PageKind::Standard)); + +// alternate page insert method +//uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); +//uno::Reference xDrawPages = xDrawPagesSupplier->getDrawPages(); +//xDrawPages->insertNewByIndex(0); +//xDrawPages->insertNewByIndex(0); +//CPPUNIT_ASSERT_EQUAL(xDrawPages->getCount(), 3); + +// move to the last page +dispatchCommand(mxComponent, ".uno:LastPage", {}); + +SdPage* pPage = pViewShell->GetActualPage(); +auto nPageNum = pPage->GetPageNum(); +// assert move to last page +CPPUNIT_ASSERT_EQUAL(2, (nPageNum - 1) / 2); + +// delete the last page +dispatchCommand(mxComponent, ".uno:DeletePage", {}); +pPage = pViewShell->GetActualPage(); +nPageNum = pPage->GetPageNum(); + +// Check that the new last page is moved to. Before, the first page was always moved to when +// the last page was deleted. +CPPUNIT_ASSERT_EQUAL(1, (nPageNum - 1) / 2); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdMiscTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index a48ab7a11546..a481e944e7c6 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -689,6 +689,9 @@ void DrawViewShell::ResetActualPage() sal_uInt16 nCurrentPageNum = maTabControl->GetPagePos(nCurrentPageId); sal_uInt16 nPageCount = (meEditMode == EditMode::Page)?GetDoc()->GetSdPageCount(mePageKind):GetDoc()->GetMasterSdPageCount(mePageKind); +if (nCurrentPageNum >= nPageCount) +nCurrentPageNum = nPageCount - 1; + if (meEditMode == EditMode::Page) {
core.git: Branch 'libreoffice-24-2' - toolkit/source vcl/source
toolkit/source/awt/vclxmenu.cxx |7 ++- vcl/source/app/salvtables.cxx |6 ++ vcl/source/window/menu.cxx | 10 +++--- 3 files changed, 15 insertions(+), 8 deletions(-) New commits: commit 2212b3d09bbd09a7a70095c18e8f43cd4b2019d5 Author: Jim Raykowski AuthorDate: Wed Nov 8 12:25:47 2023 -0900 Commit: Xisco Fauli CommitDate: Thu Feb 1 12:04:16 2024 +0100 tdf#158101 Make non-gtk backends context popup menu item visibility behavior like gtk For context popup menus, gtk's native popup menu hides disabled menu items. This patch makes this the behavior for non-gtk backends while preserving the intent of commit a0955317900075371d6adb7f924af24c22f02d09 to make VCL PopupMenu respect the officecfg::Office::Common::View::Menu::DontHideDisabledEntry setting. Change-Id: Ice59f2b5ec20dac9d1b0891ccbd83dbbcd308078 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159192 Tested-by: Jenkins Reviewed-by: Jim Raykowski (cherry picked from commit 1ac7350a7032a760be22cce845eab7efe435827d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162825 Reviewed-by: Xisco Fauli diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 37785849c551..20d3d5d2d18a 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -481,8 +481,13 @@ sal_Int16 VCLXMenu::execute( if ( !mpMenu || !IsPopupMenu() ) return 0; } +PopupMenu* pPopupMenu = static_cast(pMenu.get()); +MenuFlags nMenuFlags = pPopupMenu->GetMenuFlags(); +// #102790# context menus shall never show disabled entries +nMenuFlags |= MenuFlags::HideDisabledEntries; +pPopupMenu->SetMenuFlags(nMenuFlags); // cannot call this with mutex locked because it will call back into us -return static_cast(pMenu.get())->Execute( +return pPopupMenu->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ), VCLRectangle( rPos ), static_cast(nFlags) | PopupMenuFlags::NoMouseUpClose ); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 95beb907f6c0..50ecd194bdcd 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1068,6 +1068,12 @@ void SalInstanceToolbar::set_menu_item_active(const OUString& rIdent, bool bActi { if (bActive) { +MenuFlags nMenuFlags = pPopup->GetMenuFlags(); +if (officecfg::Office::Common::View::Menu::DontHideDisabledEntry::get()) +nMenuFlags &= ~MenuFlags::HideDisabledEntries; +else +nMenuFlags |= MenuFlags::HideDisabledEntries; +pPopup->SetMenuFlags(nMenuFlags); tools::Rectangle aRect = m_xToolBox->GetItemRect(nItemId); pPopup->Execute(m_xToolBox, aRect, PopupMenuFlags::ExecuteDown); } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 82d630742ab5..a0a03be455cb 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2863,9 +2863,12 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang if (bRealExecute) nPopupModeFlags |= FloatWinPopupFlags::NewLevel; +// MenuFlags get clobbered in the Activate function. Restore them after calling. +MenuFlags nMenuFlagsSaved = GetMenuFlags(); bInCallback = true; // set it here, if Activate overridden Activate(); bInCallback = false; +SetMenuFlags(nMenuFlagsSaved); if (pParentWin->isDisposed()) return false; @@ -2884,13 +2887,6 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang else nMenuFlags &= ~MenuFlags::HideDisabledEntries; } -else -{ - if (officecfg::Office::Common::View::Menu::DontHideDisabledEntry::get()) - nMenuFlags &= ~MenuFlags::HideDisabledEntries; - else - nMenuFlags |= MenuFlags::HideDisabledEntries; -} sal_uInt16 nVisibleEntries = ImplGetVisibleItemCount(); if ( !nVisibleEntries )
core.git: sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk
sw/UIConfig_swriter.mk|1 sw/inc/bitmaps.hlst |2 sw/inc/strings.hrc|6 sw/source/uibase/dochdl/swdtflvr.cxx | 18 - sw/source/uibase/inc/conttree.hxx |3 sw/source/uibase/inc/navicfg.hxx | 10 sw/source/uibase/inc/navicont.hxx | 12 - sw/source/uibase/inc/navipi.hxx |8 sw/source/uibase/inc/swcont.hxx | 10 sw/source/uibase/inc/wrtsh.hxx|3 sw/source/uibase/utlui/content.cxx| 254 -- sw/source/uibase/utlui/navicfg.cxx| 42 +-- sw/source/uibase/utlui/navipi.cxx | 61 - sw/source/uibase/wrtsh/wrtsh2.cxx | 208 +- sw/uiconfig/swriter/ui/navigatorcontextmenu.ui| 14 - sw/uiconfig/swriter/ui/navigatordraginsertmenu.ui |9 sw/uiconfig/swriter/ui/navigatorpanel.ui | 61 - 17 files changed, 388 insertions(+), 334 deletions(-) New commits: commit 95d1e7f0873a2bbb9ab4b0aa171fec29d36c3f55 Author: Jim Raykowski AuthorDate: Thu Dec 28 15:13:52 2023 -0900 Commit: Jim Raykowski CommitDate: Sun Jan 28 21:46:57 2024 +0100 tdf#36310 Insert cross reference from Navigator by DnD This enhancement provides the ability to insert cross-references by drag and drop from the Navigator. It replaces the 'drag mode' way of inserting a hyperlink, section link, and section copy with a popup menu on drop that shows insert-as kinds available for the dragged content type. There is an oddity with X11 that on drop the mouse pointer does not change from a drag pointer to a menu item select pointer for approximately 5 seconds and during that time the popup menu items can't be selected. Change-Id: Id72cbdbd81106fc0e70784fcba7f1dd3a43ad81e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161575 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index a371b4928ea5..43ab167dd197 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -243,6 +243,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/mmsendmails \ sw/uiconfig/swriter/ui/mmsalutationpage \ sw/uiconfig/swriter/ui/navigatorcontextmenu \ + sw/uiconfig/swriter/ui/navigatordraginsertmenu \ sw/uiconfig/swriter/ui/navigatorpanel \ sw/uiconfig/swriter/ui/notebookbar \ sw/uiconfig/swriter/ui/notebookbar_compact \ diff --git a/sw/inc/bitmaps.hlst b/sw/inc/bitmaps.hlst index b1f30b0932f1..80ab4eb3b17a 100644 --- a/sw/inc/bitmaps.hlst +++ b/sw/inc/bitmaps.hlst @@ -97,8 +97,6 @@ inline constexpr OUString RID_BMP_NAVI_TEXTFIELD = u"sw/res/nc20005.png"_ustr; inline constexpr OUString RID_BMP_NAVI_FOOTNOTE = u"sw/res/nc20012.png"_ustr; inline constexpr OUString RID_BMP_NAVI_ENDNOTE = u"sw/res/nc20013.png"_ustr; inline constexpr OUString RID_BMP_DROP_REGION = u"sw/res/sc20235.png"_ustr; -inline constexpr OUString RID_BMP_DROP_LINK = u"sw/res/sc20238.png"_ustr; -inline constexpr OUString RID_BMP_DROP_COPY = u"sw/res/sc20239.png"_ustr; inline constexpr OUString RID_BMP_WRAP_RIGHT = u"sw/res/wr03.png"_ustr; inline constexpr OUString RID_BMP_WRAP_CONTOUR_RIGHT = u"sw/res/wr09.png"_ustr; diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 2986e03b9a85..9e0cf978aa3b 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -421,6 +421,9 @@ #define STR_HIDDEN_CHANGES_DETAIL3 NC_("STR_HIDDEN_CHANGES_DETAIL3", "Document contains tracked changes.") #define STR_FLDREF_FOOTNOTE NC_("STR_FLDREF_FOOTNOTE", "Footnote") #define STR_FLDREF_ENDNOTE NC_("STR_FLDREF_ENDNOTE", "Endnote") +#define STR_HYPERLINK NC_("STR_HYPERLINK", "Hyperlink") +#define STR_SECTIONLINK NC_("STR_SECTIONLINK", "Section Link") +#define STR_SECTIONCOPY NC_("STR_SECTIONCOPY", "Section Copy") // Undo #define STR_CANT_UNDO NC_("STR_CANT_UNDO", "not possible") @@ -699,9 +702,6 @@ #define STR_EXPANDALL NC_("STR_EXPANDALL", "Expand All") #define STR_COLLAPSEALL NC_("STR_COLLAPSEALL", "Collapse All") -#define STR_HYPERLINK NC_("STR_HYPERLINK", "Insert as Hyperlink") -#define STR_LINK_REGION NC_("STR_LINK_REGION", "Insert as Link") -#define STR_COPY_REGION NC_("STR_COPY_REGION", "Insert as Copy") #define STR_DISPLAY NC_("STR_DISPLAY", "Display") #define STR_ACTIVE_VIEW NC_("STR_ACTIVE_VIEW", "Active Window") #define STR_HIDDEN
core.git: toolkit/source vcl/source
toolkit/source/awt/vclxmenu.cxx |7 ++- vcl/source/app/salvtables.cxx |6 ++ vcl/source/window/menu.cxx | 10 +++--- 3 files changed, 15 insertions(+), 8 deletions(-) New commits: commit 1ac7350a7032a760be22cce845eab7efe435827d Author: Jim Raykowski AuthorDate: Wed Nov 8 12:25:47 2023 -0900 Commit: Jim Raykowski CommitDate: Thu Jan 25 09:10:40 2024 +0100 tdf#158101 Make non-gtk backends context popup menu item visibility behavior like gtk For context popup menus, gtk's native popup menu hides disabled menu items. This patch makes this the behavior for non-gtk backends while preserving the intent of commit a0955317900075371d6adb7f924af24c22f02d09 to make VCL PopupMenu respect the officecfg::Office::Common::View::Menu::DontHideDisabledEntry setting. Change-Id: Ice59f2b5ec20dac9d1b0891ccbd83dbbcd308078 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159192 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 37785849c551..20d3d5d2d18a 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -481,8 +481,13 @@ sal_Int16 VCLXMenu::execute( if ( !mpMenu || !IsPopupMenu() ) return 0; } +PopupMenu* pPopupMenu = static_cast(pMenu.get()); +MenuFlags nMenuFlags = pPopupMenu->GetMenuFlags(); +// #102790# context menus shall never show disabled entries +nMenuFlags |= MenuFlags::HideDisabledEntries; +pPopupMenu->SetMenuFlags(nMenuFlags); // cannot call this with mutex locked because it will call back into us -return static_cast(pMenu.get())->Execute( +return pPopupMenu->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ), VCLRectangle( rPos ), static_cast(nFlags) | PopupMenuFlags::NoMouseUpClose ); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 7482a086b1be..2327b376b8ce 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1068,6 +1068,12 @@ void SalInstanceToolbar::set_menu_item_active(const OUString& rIdent, bool bActi { if (bActive) { +MenuFlags nMenuFlags = pPopup->GetMenuFlags(); +if (officecfg::Office::Common::View::Menu::DontHideDisabledEntry::get()) +nMenuFlags &= ~MenuFlags::HideDisabledEntries; +else +nMenuFlags |= MenuFlags::HideDisabledEntries; +pPopup->SetMenuFlags(nMenuFlags); tools::Rectangle aRect = m_xToolBox->GetItemRect(nItemId); pPopup->Execute(m_xToolBox, aRect, PopupMenuFlags::ExecuteDown); } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 2dbba65ba245..387d74b0d1b3 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2860,9 +2860,12 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang if (bRealExecute) nPopupModeFlags |= FloatWinPopupFlags::NewLevel; +// MenuFlags get clobbered in the Activate function. Restore them after calling. +MenuFlags nMenuFlagsSaved = GetMenuFlags(); bInCallback = true; // set it here, if Activate overridden Activate(); bInCallback = false; +SetMenuFlags(nMenuFlagsSaved); if (pParentWin->isDisposed()) return false; @@ -2881,13 +2884,6 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang else nMenuFlags &= ~MenuFlags::HideDisabledEntries; } -else -{ - if (officecfg::Office::Common::View::Menu::DontHideDisabledEntry::get()) - nMenuFlags &= ~MenuFlags::HideDisabledEntries; - else - nMenuFlags |= MenuFlags::HideDisabledEntries; -} sal_uInt16 nVisibleEntries = ImplGetVisibleItemCount(); if ( !nVisibleEntries )
core.git: Branch 'libreoffice-24-2-0' - sw/source
sw/source/uibase/utlui/content.cxx | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) New commits: commit 553b91ef4204d0d6473f45ceadb76d6e24a08879 Author: Jim Raykowski AuthorDate: Fri Jan 12 23:56:43 2024 -0900 Commit: Michael Weghorn CommitDate: Wed Jan 24 09:27:42 2024 +0100 tdf#159147 Fix crash when editing hyperlink while navigator is open by assuring the SwURLFieldContent::SwTextINetFormat pointer is still valid before trying to bring the hyperlink content to attention Change-Id: I7f672576ab2869c5483284b543e99e46a558acc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162013 Tested-by: Jenkins Tested-by: Xisco Fauli Reviewed-by: Jim Raykowski (cherry picked from commit b2500f0e32b33eec2740dc370238f66fb8b50ffb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162212 Reviewed-by: Xisco Fauli (cherry picked from commit a6ce9960c37928cb8a27383dc8e10125011131c9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162216 Reviewed-by: Hossein Reviewed-by: Michael Stahl Reviewed-by: Ilmari Lauhakangas Tested-by: Michael Weghorn Reviewed-by: Michael Weghorn diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 72fd76cbe1ce..3bf29979ddf3 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -6077,8 +6077,24 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) } else if (nType == ContentTypeId::URLFIELD) { -BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), - *static_cast(pCnt)->GetINetAttr())}); +// tdf#159147 - Assure the SwURLFieldContent::SwTextINetFormat pointer is valid +// before bringing to attention. +const SwTextINetFormat* pTextINetFormat += static_cast(pCnt)->GetINetAttr(); +const SwCharFormats* pFormats = m_pActiveShell->GetDoc()->GetCharFormats(); +for (auto n = pFormats->size(); 1 < n;) +{ +SwIterator aIter(*(*pFormats)[--n]); +for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) +{ +if (pTextINetFormat == pFnd) +{ +BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), + *pTextINetFormat)}); +break; +} +} +} } else if (nType == ContentTypeId::REFERENCE) {
core.git: sw/uiconfig
sw/uiconfig/swriter/ui/navigatorpanel.ui | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) New commits: commit 0854ec14b04a8b7a7ec9be88e8aa19105eead1a3 Author: Jim Raykowski AuthorDate: Thu Jan 4 09:26:01 2024 -0900 Commit: Jim Raykowski CommitDate: Wed Jan 24 08:17:50 2024 +0100 Resave with newer Glade version Change-Id: I346e62a90c28012aeb403de263f0aa2f01a4a8fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161778 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/uiconfig/swriter/ui/navigatorpanel.ui b/sw/uiconfig/swriter/ui/navigatorpanel.ui index 11ec47912f22..4b8d45fc41fc 100644 --- a/sw/uiconfig/swriter/ui/navigatorpanel.ui +++ b/sw/uiconfig/swriter/ui/navigatorpanel.ui @@ -1,5 +1,5 @@ - + @@ -263,6 +263,7 @@ True +False Toggle Master View sw/res/sc20244.png @@ -337,6 +338,7 @@ True +False False @@ -346,6 +348,7 @@ True +False False @@ -413,6 +416,7 @@ True +False Content Navigation View sw/res/sc20234.png @@ -439,6 +443,7 @@ True +False Header sw/res/sc20179.png @@ -455,6 +460,7 @@ True +False Footer sw/res/sc20177.png @@ -471,6 +477,7 @@ True +False Anchor-Text sw/res/sc20182.png @@ -487,6 +494,7 @@ True +False Set Reminder sw/res/sc20183.png @@ -513,6 +521,7 @@ True +False Show Up to Outline Level sw/res/sc20236.png @@ -541,6 +550,7 @@ True +False List Box On/Off sw/res/sc20233.png @@ -567,6 +577,7 @@ True +False Promote Outline Level sw/res/sc20172.png @@ -583,6 +594,7 @@ True +False Demote Outline Level sw/res/sc20173.png @@ -599,6 +611,7 @@ True +False Move Heading Up sw/res/sc20174.png @@ -615,6 +628,7 @@ True +False Move Heading Down sw/res/sc20171.png @@ -641,6 +655,7 @@ True +False Drag Mode sw/res/sc20235.png @@ -764,6 +779,7 @@ True +False Toggle Master View sw/res/sc20244.png @@ -790,6 +806,7 @@ True +False Edit sw/res/sc20245.png @@ -806,6 +823,7 @@ True +False Update sw/res/sc20246.png @@ -822,6 +840,7 @@
core.git: sw/source
sw/source/uibase/inc/navipi.hxx|1 sw/source/uibase/utlui/content.cxx |9 -- sw/source/uibase/utlui/navipi.cxx | 52 - 3 files changed, 13 insertions(+), 49 deletions(-) New commits: commit d034a0da1a298bb129d7a7cecff460794649dea0 Author: Jim Raykowski AuthorDate: Sun Dec 31 15:53:11 2023 -0900 Commit: Jim Raykowski CommitDate: Wed Jan 24 08:16:45 2024 +0100 SwNavigator: status array no more What REGIONMODE_ARY has to do with the active, inactive, and hidden status of documents shown in the document list box is beyond me. This patch removes this strangeness and fixes the 'Active Window' entry so when selected the content tree shows the content of the document entry appended with (active), which is always the document in the view afaik. My guess at the idea for the 'Active Window' entry is to not have to search for the entry marked 'active'. Change-Id: I27a8183fb430e9d5ef465dae323319cdb397fc4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161510 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx index f87474ab7cba..1d899f15acc5 100644 --- a/sw/source/uibase/inc/navipi.hxx +++ b/sw/source/uibase/inc/navipi.hxx @@ -72,7 +72,6 @@ class SwNavigationPI final : public PanelLayout std::unique_ptr m_xDocListBox; Idlem_aPageChgIdle; OUStringm_sContentFileName; -OUStringm_aStatusArr[4]; VclPtr m_xNavigatorDlg; diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index f753547173b4..86e94f754841 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5318,11 +5318,14 @@ void SwContentTree::ShowHiddenShell() } // Mode Change: Show active view +// only called from IMPL_LINK(SwNavigationPI, DocListBoxSelectHdl, weld::ComboBox&, rBox, void) void SwContentTree::ShowActualView() { -m_eState = State::ACTIVE; -Display(true); -GetParentWindow()->UpdateListBox(); +if (SwView* pView = m_pDialog->GetCreateView()) +{ +SetConstantShell(pView->GetWrtShellPtr()); +m_pDialog->UpdateListBox(); +} } IMPL_LINK_NOARG(SwContentTree, SelectHdl, weld::TreeView&, void) diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 3fd5b7f9b682..c3929875becc 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -487,17 +487,6 @@ void SwNavigationPI::ZoomIn() m_xContent6ToolBox->set_item_active("listbox", false); } -namespace { - -enum StatusIndex -{ -IDX_STR_HIDDEN = 0, -IDX_STR_ACTIVE = 1, -IDX_STR_INACTIVE = 2 -}; - -} - std::unique_ptr SwNavigationPI::Create(weld::Widget* pParent, const css::uno::Reference& rxFrame, SfxBindings* pBindings) @@ -637,30 +626,6 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xContent1ToolBox->set_item_visible("contenttoggle", false); } -const TranslateId REGIONNAME_ARY[] = -{ -STR_HYPERLINK, -STR_LINK_REGION, -STR_COPY_REGION -}; - -const TranslateId REGIONMODE_ARY[] = -{ -STR_HIDDEN, -STR_ACTIVE, -STR_INACTIVE -}; - -static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == SAL_N_ELEMENTS(REGIONMODE_ARY), "### unexpected size!"); -static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == static_cast(RegionMode::EMBEDDED) + 1, "### unexpected size!"); - -for (sal_uInt16 i = 0; i <= static_cast(RegionMode::EMBEDDED); ++i) -{ -m_aStatusArr[i] = SwResId(REGIONMODE_ARY[i]); -} - -m_aStatusArr[3] = SwResId(STR_ACTIVE_VIEW); - bool bFloatingNavigator = ParentIsFloatingWindow(m_xNavigatorDlg); SetRegionDropMode(m_pConfig->GetRegionMode()); @@ -723,7 +688,7 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xContentTree->set_accessible_name(SwResId(STR_ACCESS_TL_CONTENT)); m_xGlobalTree->set_accessible_name(SwResId(STR_ACCESS_TL_GLOBAL)); -m_xDocListBox->set_accessible_name(m_aStatusArr[3]); +m_xDocListBox->set_accessible_name(SwResId(STR_ACTIVE_VIEW)); m_aExpandedSize = m_xContainer->get_preferred_size(); @@ -930,10 +895,10 @@ void SwNavigationPI::UpdateListBox() if (pView == pActView) { nAct = nCount; -sEntry += m_aStatusArr[IDX_STR_ACTIVE]; +sEntry += SwResId(STR_ACTIVE); } else -sEntry += m_aStatusArr[IDX_STR_INACTIVE]; +sEntry += SwResId(STR_INACTIVE); sEntry += ")"; m_xDocListBox->append_text(sEntry); @@ -944,16 +909,13 @@ void SwNavigationPI::UpdateListBox() } pView = SwModule::GetNextView(pView); } -m_xDocListBox->append_text(m_aStatusArr[3]); // "Active Window" +
core.git: Branch 'libreoffice-7-6' - sw/source
sw/source/uibase/utlui/content.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 2e65401cf50ca25e16a0f3d4b624e2b48c97644c Author: Jim Raykowski AuthorDate: Thu Jan 18 21:52:37 2024 -0900 Commit: Caolán McNamara CommitDate: Sun Jan 21 13:17:35 2024 +0100 tdf#159147 followup Avoid unnecessary looping by immediate return from the function after bringing content to attention. Change-Id: I670dc5d0991d96e7ce2872d329e969f9c341d163 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162291 Tested-by: Jenkins Reviewed-by: Jim Raykowski (cherry picked from commit a08197e7c376c72685260ae923483ae99f929d35) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162280 Reviewed-by: Caolán McNamara diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index f5af1e759738..bcc6aaebb383 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5670,13 +5670,13 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) for (auto n = pFormats->size(); 1 < n;) { SwIterator aIter(*(*pFormats)[--n]); -for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) +for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next()) { if (pTextINetFormat == pFnd) { BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), *pTextINetFormat)}); -break; +return; } } }
core.git: Branch 'libreoffice-24-2' - sw/source
sw/source/uibase/utlui/content.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit cafcc50570f9edaaebe74d2152bae5df1cc2edfe Author: Jim Raykowski AuthorDate: Thu Jan 18 21:52:37 2024 -0900 Commit: Caolán McNamara CommitDate: Sun Jan 21 13:17:25 2024 +0100 tdf#159147 followup Avoid unnecessary looping by immediate return from the function after bringing content to attention. Change-Id: I670dc5d0991d96e7ce2872d329e969f9c341d163 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162291 Tested-by: Jenkins Reviewed-by: Jim Raykowski (cherry picked from commit a08197e7c376c72685260ae923483ae99f929d35) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162279 Reviewed-by: Caolán McNamara diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 3bf29979ddf3..4e6704140334 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -6085,13 +6085,13 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) for (auto n = pFormats->size(); 1 < n;) { SwIterator aIter(*(*pFormats)[--n]); -for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) +for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next()) { if (pTextINetFormat == pFnd) { BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), *pTextINetFormat)}); -break; +return; } } }
core.git: sw/source
sw/source/uibase/utlui/content.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit a08197e7c376c72685260ae923483ae99f929d35 Author: Jim Raykowski AuthorDate: Thu Jan 18 21:52:37 2024 -0900 Commit: Jim Raykowski CommitDate: Fri Jan 19 16:43:57 2024 +0100 tdf#159147 followup Avoid unnecessary looping by immediate return from the function after bringing content to attention. Change-Id: I670dc5d0991d96e7ce2872d329e969f9c341d163 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162291 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index c5f2b3e3afa9..f753547173b4 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -6100,13 +6100,13 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) for (auto n = pFormats->size(); 1 < n;) { SwIterator aIter(*(*pFormats)[--n]); -for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) +for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next()) { if (pTextINetFormat == pFnd) { BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), *pTextINetFormat)}); -break; +return; } } }
core.git: Branch 'libreoffice-7-6' - sw/source
sw/source/uibase/utlui/content.cxx | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) New commits: commit 421f5394c29763a4f766a4fe4656bb948979ee1d Author: Jim Raykowski AuthorDate: Fri Jan 12 23:56:43 2024 -0900 Commit: Xisco Fauli CommitDate: Wed Jan 17 20:27:01 2024 +0100 tdf#159147 Fix crash when editing hyperlink while navigator is open by assuring the SwURLFieldContent::SwTextINetFormat pointer is still valid before trying to bring the hyperlink content to attention Change-Id: I7f672576ab2869c5483284b543e99e46a558acc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162013 Tested-by: Jenkins Tested-by: Xisco Fauli Reviewed-by: Jim Raykowski (cherry picked from commit b2500f0e32b33eec2740dc370238f66fb8b50ffb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162213 Reviewed-by: Xisco Fauli diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index cd6528752fef..f5af1e759738 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5662,8 +5662,24 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) } else if (nType == ContentTypeId::URLFIELD) { -BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), - *static_cast(pCnt)->GetINetAttr())}); +// tdf#159147 - Assure the SwURLFieldContent::SwTextINetFormat pointer is valid +// before bringing to attention. +const SwTextINetFormat* pTextINetFormat += static_cast(pCnt)->GetINetAttr(); +const SwCharFormats* pFormats = m_pActiveShell->GetDoc()->GetCharFormats(); +for (auto n = pFormats->size(); 1 < n;) +{ +SwIterator aIter(*(*pFormats)[--n]); +for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) +{ +if (pTextINetFormat == pFnd) +{ +BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), + *pTextINetFormat)}); +break; +} +} +} } else if (nType == ContentTypeId::REFERENCE) {
core.git: Branch 'libreoffice-24-2' - sw/source
sw/source/uibase/utlui/content.cxx | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) New commits: commit e8877f971a4b50e58bbbe3df1e14cde1a2e0d694 Author: Jim Raykowski AuthorDate: Fri Jan 12 23:56:43 2024 -0900 Commit: Xisco Fauli CommitDate: Wed Jan 17 20:26:44 2024 +0100 tdf#159147 Fix crash when editing hyperlink while navigator is open by assuring the SwURLFieldContent::SwTextINetFormat pointer is still valid before trying to bring the hyperlink content to attention Change-Id: I7f672576ab2869c5483284b543e99e46a558acc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162013 Tested-by: Jenkins Tested-by: Xisco Fauli Reviewed-by: Jim Raykowski (cherry picked from commit b2500f0e32b33eec2740dc370238f66fb8b50ffb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162212 Reviewed-by: Xisco Fauli diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 72fd76cbe1ce..3bf29979ddf3 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -6077,8 +6077,24 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) } else if (nType == ContentTypeId::URLFIELD) { -BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), - *static_cast(pCnt)->GetINetAttr())}); +// tdf#159147 - Assure the SwURLFieldContent::SwTextINetFormat pointer is valid +// before bringing to attention. +const SwTextINetFormat* pTextINetFormat += static_cast(pCnt)->GetINetAttr(); +const SwCharFormats* pFormats = m_pActiveShell->GetDoc()->GetCharFormats(); +for (auto n = pFormats->size(); 1 < n;) +{ +SwIterator aIter(*(*pFormats)[--n]); +for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) +{ +if (pTextINetFormat == pFnd) +{ +BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), + *pTextINetFormat)}); +break; +} +} +} } else if (nType == ContentTypeId::REFERENCE) {
core.git: sw/source
sw/source/uibase/utlui/content.cxx | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) New commits: commit b2500f0e32b33eec2740dc370238f66fb8b50ffb Author: Jim Raykowski AuthorDate: Fri Jan 12 23:56:43 2024 -0900 Commit: Jim Raykowski CommitDate: Wed Jan 17 16:48:22 2024 +0100 tdf#159147 Fix crash when editing hyperlink while navigator is open by assuring the SwURLFieldContent::SwTextINetFormat pointer is still valid before trying to bring the hyperlink content to attention Change-Id: I7f672576ab2869c5483284b543e99e46a558acc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162013 Tested-by: Jenkins Tested-by: Xisco Fauli Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 2f0bdc06f739..c5f2b3e3afa9 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -6092,8 +6092,24 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) } else if (nType == ContentTypeId::URLFIELD) { -BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), - *static_cast(pCnt)->GetINetAttr())}); +// tdf#159147 - Assure the SwURLFieldContent::SwTextINetFormat pointer is valid +// before bringing to attention. +const SwTextINetFormat* pTextINetFormat += static_cast(pCnt)->GetINetAttr(); +const SwCharFormats* pFormats = m_pActiveShell->GetDoc()->GetCharFormats(); +for (auto n = pFormats->size(); 1 < n;) +{ +SwIterator aIter(*(*pFormats)[--n]); +for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) +{ +if (pTextINetFormat == pFnd) +{ +BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), + *pTextINetFormat)}); +break; +} +} +} } else if (nType == ContentTypeId::REFERENCE) {
core.git: sw/source
sw/source/uibase/utlui/content.cxx |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit 4c8c57d542a7c9becef166d3fefdf5320500a012 Author: Jim Raykowski AuthorDate: Sun Jan 14 14:10:21 2024 -0900 Commit: Jim Raykowski CommitDate: Tue Jan 16 19:56:09 2024 +0100 SwNavigator: remove useless code The comment states: -> the user data here are no longer valid! meaning sOldSelEntryId = m_xTreeView->get_id(*xOldSelEntry) isn't valid here. Change-Id: Ie5591a93a96eefb97b7563af69753f4a105696eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162068 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 831642462675..2f0bdc06f739 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2850,14 +2850,12 @@ void SwContentTree::Display( bool bActive ) std::unique_ptr xOldSelEntry(m_xTreeView->make_iterator()); if (!m_xTreeView->get_selected(xOldSelEntry.get())) xOldSelEntry.reset(); -OUString sOldSelEntryId; size_t nEntryRelPos = 0; // relative position to their parent size_t nOldEntryCount = GetEntryCount(); sal_Int32 nOldScrollPos = 0; if (xOldSelEntry) { UpdateLastSelType(); -sOldSelEntryId = m_xTreeView->get_id(*xOldSelEntry); nOldScrollPos = m_xTreeView->vadjustment_get_value(); std::unique_ptr xParentEntry = m_xTreeView->make_iterator(xOldSelEntry.get()); while (m_xTreeView->get_iter_depth(*xParentEntry)) @@ -3004,7 +3002,7 @@ void SwContentTree::Display( bool bActive ) bool bNext; while ((bNext = m_xTreeView->iter_next(*xIter) && lcl_IsContent(*xIter, *m_xTreeView))) { -if (m_xTreeView->get_id(*xIter) == sOldSelEntryId || nPos == nEntryRelPos) +if (nPos == nEntryRelPos) { m_xTreeView->copy_iterator(*xIter, *xSelEntry); break;
core.git: sfx2/source
sfx2/source/dialog/StyleList.cxx | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) New commits: commit 6c0081f3cd37541f8c0fe0fba69cc38c9b0a229b Author: Jim Raykowski AuthorDate: Tue Jan 9 17:44:31 2024 -0900 Commit: Jim Raykowski CommitDate: Wed Jan 10 16:57:24 2024 +0100 tdf#158992 Only show style spotlight for styles that are used in order to reduce visual clutter Change-Id: I23ab3119fcb1dde0079db4cebb9fc4460ccb76bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161847 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index e7bdd9e3b4a3..888d03c4ee30 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -735,19 +735,27 @@ static void lcl_Insert(weld::TreeView& rTreeView, const OUString& rName, SfxStyl static void FillBox_Impl(weld::TreeView& rBox, StyleTree_Impl* pEntry, const std::vector& rEntries, SfxStyleFamily eStyleFamily, - const weld::TreeIter* pParent, bool blcl_insert, SfxViewShell* pViewShell) + const weld::TreeIter* pParent, bool blcl_insert, SfxViewShell* pViewShell, + SfxStyleSheetBasePool* pStyleSheetPool) { std::unique_ptr xResult = rBox.make_iterator(); const OUString& rName = pEntry->getName(); - if (blcl_insert) -lcl_Insert(rBox, rName, eStyleFamily, pParent, xResult.get(), pViewShell); +{ +const SfxStyleSheetBase* pStyle = nullptr; +if (pStyleSheetPool) +pStyle = pStyleSheetPool->Find(rName, eStyleFamily); +if (pStyle && pStyle->IsUsed()) +lcl_Insert(rBox, rName, eStyleFamily, pParent, xResult.get(), pViewShell); +else +rBox.insert(pParent, -1, , , nullptr, nullptr, false, xResult.get()); +} else rBox.insert(pParent, -1, , , nullptr, nullptr, false, xResult.get()); for (size_t i = 0; i < pEntry->getChildren().size(); ++i) FillBox_Impl(rBox, pEntry->getChildren()[i].get(), rEntries, eStyleFamily, xResult.get(), - blcl_insert, pViewShell); + blcl_insert, pViewShell, pStyleSheetPool); } namespace SfxTemplate @@ -1046,7 +1054,8 @@ void StyleList::FillTreeBox(SfxStyleFamily eFam) for (sal_uInt16 i = 0; i < nCount; ++i) { -FillBox_Impl(*m_xTreeBox, aArr[i].get(), aEntries, eFam, nullptr, blcl_insert, pViewShell); +FillBox_Impl(*m_xTreeBox, aArr[i].get(), aEntries, eFam, nullptr, blcl_insert, pViewShell, + m_pStyleSheetPool); aArr[i].reset(); } @@ -1241,7 +1250,13 @@ void StyleList::UpdateStyles(StyleFlags nFlags) || (eFam == SfxStyleFamily::Char && m_bHighlightCharStyles))) { for (nPos = 0; nPos < nCount; ++nPos) -lcl_Insert(*m_xFmtLb, aStrings[nPos], eFam, nullptr, nullptr, pViewShell); +{ +pStyle = m_pStyleSheetPool->Find(aStrings[nPos], eFam); +if (pStyle && pStyle->IsUsed()) +lcl_Insert(*m_xFmtLb, aStrings[nPos], eFam, nullptr, nullptr, pViewShell); +else +m_xFmtLb->append(aStrings[nPos], aStrings[nPos]); +} } else {
core.git: Branch 'libreoffice-24-2' - sd/source sd/uiconfig
sd/source/ui/animations/CustomAnimationList.cxx |2 +- sd/uiconfig/simpress/ui/customanimationspanel.ui | 10 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) New commits: commit 1fbd5001854e27415796beff0de48df0912a7b47 Author: Jim Raykowski AuthorDate: Sun Dec 31 17:19:09 2023 -0900 Commit: Xisco Fauli CommitDate: Tue Jan 9 09:49:16 2024 +0100 tdf#158710 Fix animation list custom rendering for vcl gen plugin Change-Id: I5d2eb9e74392036a99b90fca1c5a49ac7bee828b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161511 Tested-by: Jenkins Reviewed-by: Jim Raykowski (cherry picked from commit 7e378516bc596d0308bcb1c974760c224f516ea6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161421 Reviewed-by: Xisco Fauli diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 69d0e9f7dce3..39b3d488d2ad 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -449,7 +449,7 @@ CustomAnimationList::CustomAnimationList(std::unique_ptr xTreeVi mxTreeView->connect_drag_begin(LINK(this, CustomAnimationList, DragBeginHdl)); mxTreeView->connect_custom_get_size(LINK(this, CustomAnimationList, CustomGetSizeHdl)); mxTreeView->connect_custom_render(LINK(this, CustomAnimationList, CustomRenderHdl)); -mxTreeView->set_column_custom_renderer(0, true); +mxTreeView->set_column_custom_renderer(1, true); } CustomAnimationListDropTarget::CustomAnimationListDropTarget(CustomAnimationList& rTreeView) diff --git a/sd/uiconfig/simpress/ui/customanimationspanel.ui b/sd/uiconfig/simpress/ui/customanimationspanel.ui index dda5cda5d1cc..277736f13280 100644 --- a/sd/uiconfig/simpress/ui/customanimationspanel.ui +++ b/sd/uiconfig/simpress/ui/customanimationspanel.ui @@ -111,14 +111,18 @@ - -6 + - + 0 + + + + +6
core.git: Branch 'libreoffice-7-6' - sd/source sd/uiconfig
sd/source/ui/animations/CustomAnimationList.cxx |2 +- sd/uiconfig/simpress/ui/customanimationspanel.ui | 10 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) New commits: commit 3004515ce6d9c9c655105af901837e95bae7fb9a Author: Jim Raykowski AuthorDate: Sun Dec 31 17:19:09 2023 -0900 Commit: Xisco Fauli CommitDate: Tue Jan 9 09:49:21 2024 +0100 tdf#158710 Fix animation list custom rendering for vcl gen plugin Change-Id: I5d2eb9e74392036a99b90fca1c5a49ac7bee828b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161511 Tested-by: Jenkins Reviewed-by: Jim Raykowski (cherry picked from commit 7e378516bc596d0308bcb1c974760c224f516ea6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161558 Reviewed-by: Stéphane Guillou Reviewed-by: Xisco Fauli diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 0128f210eb77..fecbfa38c52e 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -449,7 +449,7 @@ CustomAnimationList::CustomAnimationList(std::unique_ptr xTreeVi mxTreeView->connect_drag_begin(LINK(this, CustomAnimationList, DragBeginHdl)); mxTreeView->connect_custom_get_size(LINK(this, CustomAnimationList, CustomGetSizeHdl)); mxTreeView->connect_custom_render(LINK(this, CustomAnimationList, CustomRenderHdl)); -mxTreeView->set_column_custom_renderer(0, true); +mxTreeView->set_column_custom_renderer(1, true); } CustomAnimationListDropTarget::CustomAnimationListDropTarget(CustomAnimationList& rTreeView) diff --git a/sd/uiconfig/simpress/ui/customanimationspanel.ui b/sd/uiconfig/simpress/ui/customanimationspanel.ui index dda5cda5d1cc..277736f13280 100644 --- a/sd/uiconfig/simpress/ui/customanimationspanel.ui +++ b/sd/uiconfig/simpress/ui/customanimationspanel.ui @@ -111,14 +111,18 @@ - -6 + - + 0 + + + + +6
core.git: sd/source sd/uiconfig
sd/source/ui/animations/CustomAnimationList.cxx |2 +- sd/uiconfig/simpress/ui/customanimationspanel.ui | 10 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) New commits: commit 7e378516bc596d0308bcb1c974760c224f516ea6 Author: Jim Raykowski AuthorDate: Sun Dec 31 17:19:09 2023 -0900 Commit: Jim Raykowski CommitDate: Mon Jan 1 05:13:35 2024 +0100 tdf#158710 Fix animation list custom rendering for vcl gen plugin Change-Id: I5d2eb9e74392036a99b90fca1c5a49ac7bee828b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161511 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 69d0e9f7dce3..39b3d488d2ad 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -449,7 +449,7 @@ CustomAnimationList::CustomAnimationList(std::unique_ptr xTreeVi mxTreeView->connect_drag_begin(LINK(this, CustomAnimationList, DragBeginHdl)); mxTreeView->connect_custom_get_size(LINK(this, CustomAnimationList, CustomGetSizeHdl)); mxTreeView->connect_custom_render(LINK(this, CustomAnimationList, CustomRenderHdl)); -mxTreeView->set_column_custom_renderer(0, true); +mxTreeView->set_column_custom_renderer(1, true); } CustomAnimationListDropTarget::CustomAnimationListDropTarget(CustomAnimationList& rTreeView) diff --git a/sd/uiconfig/simpress/ui/customanimationspanel.ui b/sd/uiconfig/simpress/ui/customanimationspanel.ui index dda5cda5d1cc..277736f13280 100644 --- a/sd/uiconfig/simpress/ui/customanimationspanel.ui +++ b/sd/uiconfig/simpress/ui/customanimationspanel.ui @@ -111,14 +111,18 @@ - -6 + - + 0 + + + + +6
core.git: sd/source
sd/source/ui/dlg/LayerTabBar.cxx | 95 ++- sd/source/ui/inc/LayerTabBar.hxx |9 +++ 2 files changed, 103 insertions(+), 1 deletion(-) New commits: commit d6a94c51130f62b17b29060fab6befe576e8c078 Author: Jim Raykowski AuthorDate: Sun Nov 12 17:52:09 2023 -0900 Commit: Jim Raykowski CommitDate: Sat Dec 23 20:10:25 2023 +0100 tdf#157244 Enhancement to identify objects in a layer Show an invert overlay on objects of a layer after a 1/2 second delay when the mouse pointer is on a layer tab. Change-Id: Ifcb2d82d73b8745ad9aecddd18b22193525ed756 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159358 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index 96b96068f331..ece1e0884bcf 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -39,6 +39,12 @@ #include #include +#include +#include +#include +#include +#include + namespace sd { /** @@ -47,12 +53,17 @@ namespace sd { LayerTabBar::LayerTabBar(DrawViewShell* pViewSh, vcl::Window* pParent) : TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL ) ), DropTargetHelper( this ), -pDrViewSh(pViewSh) +pDrViewSh(pViewSh), +m_aBringLayerObjectsToAttentionDelayTimer("LayerTabBar m_aBringLayerObjectsToAttentionDelayTimer") { EnableEditMode(); SetSizePixel(Size(0, 0)); SetMaxPageWidth( 150 ); SetHelpId( HID_SD_TABBAR_LAYERS ); + +m_aBringLayerObjectsToAttentionDelayTimer.SetInvokeHandler( +LINK(this, LayerTabBar, BringLayerObjectsToAttentionDelayTimerHdl)); +m_aBringLayerObjectsToAttentionDelayTimer.SetTimeout(500); } LayerTabBar::~LayerTabBar() @@ -137,6 +148,87 @@ void LayerTabBar::Select() pDispatcher->Execute(SID_SWITCHLAYER, SfxCallMode::SYNCHRON); } +void LayerTabBar::MouseMove(const MouseEvent ) +{ +sal_uInt16 nPageId = 0; +if (!rMEvt.IsLeaveWindow()) +nPageId = GetPageId(rMEvt.GetPosPixel()); +BringLayerObjectsToAttention(nPageId); +return; +} + +void LayerTabBar::BringLayerObjectsToAttention(const sal_uInt16 nPageId) +{ +if (nPageId == m_nBringLayerObjectsToAttentionLastPageId) +return; + +m_aBringLayerObjectsToAttentionDelayTimer.Stop(); + +m_nBringLayerObjectsToAttentionLastPageId = nPageId; + +std::vector aRanges; + +if (nPageId != 0) +{ +OUString aLayerName(GetLayerName(nPageId)); +if (pDrViewSh->GetView()->GetSdrPageView()->IsLayerVisible(aLayerName)) +{ +SdrLayerAdmin& rLayerAdmin = pDrViewSh->GetDoc()->GetLayerAdmin(); +SdrObjListIter aIter(pDrViewSh->GetActualPage(), SdrIterMode::DeepWithGroups); +while (aIter.IsMore()) +{ +SdrObject* pObj = aIter.Next(); +assert(pObj != nullptr); +if (pObj && (aLayerName == rLayerAdmin.GetLayerPerID(pObj->GetLayer())->GetName())) +{ +::tools::Rectangle aRect(pObj->GetLogicRect()); +if (!aRect.IsEmpty()) +aRanges.emplace_back(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom()); +// skip over objects in groups +if (pObj->IsGroupObject()) +{ +SdrObjListIter aSubListIter(pObj->GetSubList(), SdrIterMode::DeepWithGroups); +while (aSubListIter.IsMore()) +{ +aIter.Next(); +aSubListIter.Next(); +} +} +} +} +} +} + +if (m_xOverlayObject && m_xOverlayObject->getOverlayManager()) +m_xOverlayObject->getOverlayManager()->remove(*m_xOverlayObject); +if (aRanges.empty()) +m_xOverlayObject.reset(); +else +{ +m_xOverlayObject.reset(new sdr::overlay::OverlaySelection( + sdr::overlay::OverlayType::Invert, + Color(), std::move(aRanges), true/*unused for Invert type*/)); +m_aBringLayerObjectsToAttentionDelayTimer.Start(); +} +} + +IMPL_LINK_NOARG(LayerTabBar, BringLayerObjectsToAttentionDelayTimerHdl, Timer *, void) +{ +m_aBringLayerObjectsToAttentionDelayTimer.Stop(); +if (m_xOverlayObject) +{ +if (SdrView* pView = pDrViewSh->GetDrawView()) +{ +if (SdrPaintWindow* pPaintWindow = pView->GetPaintWindow(0)) +{ +const rtl::Reference& xOverlayManager = +pPaintWindow->GetOverlayManager(); +xOverlayManager->add(*m_xOverlayObject); +} +} +} +} + void LayerTabBar::MouseButtonDown(const MouseEvent& rMEvt) { bool bSetPageID=false; @@ -302,6 +394,7 @@ void
core.git: icon-themes/breeze icon-themes/breeze_dark icon-themes/colibre icon-themes/colibre_dark icon-themes/elementary icon-themes/karasa_jaga icon-themes/sifr icon-themes/sifr_dark icon-themes/suka
icon-themes/breeze/sw/res/brokenlink.png|binary icon-themes/breeze_dark/sw/res/brokenlink.png |binary icon-themes/colibre/sw/res/brokenlink.png |binary icon-themes/colibre_dark/sw/res/brokenlink.png |binary icon-themes/elementary/sw/res/brokenlink.png|binary icon-themes/karasa_jaga/sw/res/brokenlink.png |binary icon-themes/sifr/sw/res/brokenlink.png |binary icon-themes/sifr_dark/sw/res/brokenlink.png |binary icon-themes/sukapura/sw/res/brokenlink.png |binary icon-themes/sukapura_dark/sw/res/brokenlink.png |binary sw/inc/bitmaps.hlst |1 + sw/source/uibase/utlui/content.cxx | 22 +++--- 12 files changed, 20 insertions(+), 3 deletions(-) New commits: commit 4c2c900970d6484c6a92900213ece5c415e40f2d Author: Jim Raykowski AuthorDate: Tue Dec 19 16:37:09 2023 -0900 Commit: Jim Raykowski CommitDate: Thu Dec 21 21:45:23 2023 +0100 tdf#158114 SwNavigator: Make images with broken links easier to find This patch makes an icon display in image entries with broken links to make it easier to find images with broken links. Change-Id: I470c9959e169d4cc53a44e0a64e88af35e671db0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161045 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/icon-themes/breeze/sw/res/brokenlink.png b/icon-themes/breeze/sw/res/brokenlink.png new file mode 100644 index ..1a84e0f4103f Binary files /dev/null and b/icon-themes/breeze/sw/res/brokenlink.png differ diff --git a/icon-themes/breeze_dark/sw/res/brokenlink.png b/icon-themes/breeze_dark/sw/res/brokenlink.png new file mode 100644 index ..1a84e0f4103f Binary files /dev/null and b/icon-themes/breeze_dark/sw/res/brokenlink.png differ diff --git a/icon-themes/colibre/sw/res/brokenlink.png b/icon-themes/colibre/sw/res/brokenlink.png new file mode 100644 index ..48805b24315b Binary files /dev/null and b/icon-themes/colibre/sw/res/brokenlink.png differ diff --git a/icon-themes/colibre_dark/sw/res/brokenlink.png b/icon-themes/colibre_dark/sw/res/brokenlink.png new file mode 100644 index ..48805b24315b Binary files /dev/null and b/icon-themes/colibre_dark/sw/res/brokenlink.png differ diff --git a/icon-themes/elementary/sw/res/brokenlink.png b/icon-themes/elementary/sw/res/brokenlink.png new file mode 100644 index ..afde18fba6f4 Binary files /dev/null and b/icon-themes/elementary/sw/res/brokenlink.png differ diff --git a/icon-themes/karasa_jaga/sw/res/brokenlink.png b/icon-themes/karasa_jaga/sw/res/brokenlink.png new file mode 100644 index ..6bd97a1f0e94 Binary files /dev/null and b/icon-themes/karasa_jaga/sw/res/brokenlink.png differ diff --git a/icon-themes/sifr/sw/res/brokenlink.png b/icon-themes/sifr/sw/res/brokenlink.png new file mode 100644 index ..958a1258bb33 Binary files /dev/null and b/icon-themes/sifr/sw/res/brokenlink.png differ diff --git a/icon-themes/sifr_dark/sw/res/brokenlink.png b/icon-themes/sifr_dark/sw/res/brokenlink.png new file mode 100644 index ..1f392ce92932 Binary files /dev/null and b/icon-themes/sifr_dark/sw/res/brokenlink.png differ diff --git a/icon-themes/sukapura/sw/res/brokenlink.png b/icon-themes/sukapura/sw/res/brokenlink.png new file mode 100644 index ..e47a7444efe4 Binary files /dev/null and b/icon-themes/sukapura/sw/res/brokenlink.png differ diff --git a/icon-themes/sukapura_dark/sw/res/brokenlink.png b/icon-themes/sukapura_dark/sw/res/brokenlink.png new file mode 100644 index ..6621242f3211 Binary files /dev/null and b/icon-themes/sukapura_dark/sw/res/brokenlink.png differ diff --git a/sw/inc/bitmaps.hlst b/sw/inc/bitmaps.hlst index 50682d32ebc9..b1f30b0932f1 100644 --- a/sw/inc/bitmaps.hlst +++ b/sw/inc/bitmaps.hlst @@ -84,6 +84,7 @@ inline constexpr OUString RID_BMP_NAVI_TABLE = u"sw/res/nc20001.png"_ustr; inline constexpr OUString RID_BMP_NAVI_FRAME = u"sw/res/nc20002.png"_ustr; inline constexpr OUString RID_BMP_NAVI_GRAPHIC = u"sw/res/nc20003.png"_ustr; inline constexpr OUString RID_BMP_NAVI_GRAPHIC_LINK = u"sw/res/nc20007.png"_ustr; +inline constexpr OUString RID_BMP_NAVI_GRAPHIC_BROKENLINK = u"sw/res/brokenlink.png"_ustr; inline constexpr OUString RID_BMP_NAVI_OLE = u"sw/res/nc20004.png"_ustr; inline constexpr OUString RID_BMP_NAVI_BOOKMARK = u"sw/res/nc20005.png"_ustr; inline constexpr OUString RID_BMP_NAVI_REGION = u"sw/res/nc20006.png"_ustr; diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 4ee3c315e4df..f182eee59cf1 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -121,6 +121,8 @@ #include +#include + #define CTYPE_CNT 0 #define CTYPE_CTT 1 @@ -593,7 +595,8 @@ void SwContentType::FillMemberList(bool* pbContentChanged) if(ContentTypeId::GRAPHIC == m_nContentType)
core.git: officecfg/registry sw/source
officecfg/registry/schema/org/openoffice/Office/Writer.xcs |7 +++ sw/source/uibase/inc/navicfg.hxx | 12 ++ sw/source/uibase/utlui/content.cxx | 23 +++-- sw/source/uibase/utlui/navicfg.cxx |5 ++ 4 files changed, 43 insertions(+), 4 deletions(-) New commits: commit bb0a2be91930fbae07657f214b53117b9e8cc204 Author: Jim Raykowski AuthorDate: Fri Nov 24 00:40:30 2023 -0900 Commit: Jim Raykowski CommitDate: Wed Dec 13 07:23:38 2023 +0100 tdf#158276 tdf#86395 Make alphabetical sort setting persist by using a bitwise storage approach inspired by the ActiveBlock setting where each content type corresponds to one bit position of the stored integer, e.g., bookmarks content type corresponds to bit 5. Change-Id: I50de26e44a8d2afb917f3a651eef9a8f704b751f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159916 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index 61054ae8eca9..2bd5995a1e5d 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -5197,6 +5197,13 @@ false + + + + Specifies whether the contents of a content type are alphabetically sorted in the Navigator list box. Each content type corresponds to one bit position of the stored int. A bit with value 1 indicates alphabetical sorting for the corresponding content type. + +0 + diff --git a/sw/source/uibase/inc/navicfg.hxx b/sw/source/uibase/inc/navicfg.hxx index ad4bb10afb70..b39614f9f63f 100644 --- a/sw/source/uibase/inc/navicfg.hxx +++ b/sw/source/uibase/inc/navicfg.hxx @@ -37,6 +37,8 @@ class SwNavigationConfig final : public utl::ConfigItem o3tl::enumarray mContentTypeTrack; +sal_Int32 m_nSortAlphabeticallyBlock = 0; // persists content type alphabetical sort setting + static css::uno::Sequence GetPropertyNames(); virtual void ImplCommit() override; @@ -125,6 +127,16 @@ public: } boolIsNavigateOnSelect() const {return m_bIsNavigateOnSelect;} + +sal_Int32 GetSortAlphabeticallyBlock() const {return m_nSortAlphabeticallyBlock;} +void SetSortAlphabeticallyBlock(sal_Int32 nSet) +{ +if(m_nSortAlphabeticallyBlock != nSet) +{ +SetModified(); +m_nSortAlphabeticallyBlock = nSet; +} +} }; #endif diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 8d46ef52303a..72fd76cbe1ce 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -431,6 +431,13 @@ SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 break; default: break; } + +const int nShift = static_cast(m_nContentType); +assert(nShift > -1); +const sal_Int32 nMask = 1 << nShift; +const sal_Int32 nBlock = SW_MOD()->GetNavigationConfig()->GetSortAlphabeticallyBlock(); +m_bAlphabeticSort = nBlock & nMask; + FillMemberList(); } @@ -1739,10 +1746,12 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) const ContentTypeId nContentType = pType->GetType(); if (nContentType != ContentTypeId::FOOTNOTE && nContentType != ContentTypeId::ENDNOTE -&& nContentType != ContentTypeId::POSTIT) +&& nContentType != ContentTypeId::POSTIT && nContentType != ContentTypeId::UNKNOWN) { bRemoveSortEntry = false; -xPop->set_active("sort", pType->IsAlphabeticSort()); +const sal_Int32 nMask = 1 << static_cast(nContentType); +sal_uInt64 nSortAlphabeticallyBlock = m_pConfig->GetSortAlphabeticallyBlock(); +xPop->set_active("sort", nSortAlphabeticallyBlock & nMask); } OUString aIdent; @@ -4960,7 +4969,15 @@ void SwContentTree::ExecuteContextMenuAction(const OUString& rSelectedPopupEntry pCntType = weld::fromId(rId); else pCntType = const_cast(weld::fromId(rId)->GetParent()); -pCntType->SetAlphabeticSort(!pCntType->IsAlphabeticSort()); + +// toggle and persist alphabetical sort setting +const int nShift = static_cast(pCntType->GetType()); +assert(nShift > -1); +const sal_Int32 nMask = 1 << nShift; +const sal_Int32 nBlock = m_pConfig->GetSortAlphabeticallyBlock(); +pCntType->SetAlphabeticSort(~nBlock & nMask); +m_pConfig->SetSortAlphabeticallyBlock(nBlock ^ nMask); + pCntType->FillMemberList(); Display(true); return; diff --git a/sw/source/uibase/utlui/navicfg.cxx b/sw/source/uibase/utlui/navicfg.cxx index
core.git: sw/source
sw/source/uibase/utlui/content.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit c58efbfce1ca80942a731881cf82ea0367edc579 Author: Jim Raykowski AuthorDate: Wed Dec 6 12:44:47 2023 -0900 Commit: Julien Nabet CommitDate: Thu Dec 7 14:02:03 2023 +0100 use std::erase_if instead of std::remove_if + std::erase Change-Id: Ib505c89d224c9d8418ff3b1138f26d3d6e576120 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160406 Reviewed-by: Julien Nabet Tested-by: Jenkins diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 29ab1b964c26..d7e0a61d0b33 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2306,8 +2306,7 @@ bool SwContentTree::RequestingChildren(const weld::TreeIter& rParent) m_xTreeView->set_image(*xChild, bHidden ? RID_BMP_HIDE : RID_BMP_NO_HIDE); // remove any parent candidates equal to or higher than this node - aParentCandidates.erase(std::remove_if(aParentCandidates.begin(), aParentCandidates.end(), - std::not_fn(lambda)), aParentCandidates.end()); +std::erase_if(aParentCandidates, std::not_fn(lambda)); // add this node as a parent candidate for any following nodes at a higher region level aParentCandidates.emplace_back(m_xTreeView->make_iterator(xChild.get()));
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/inc/conttree.hxx |4 + sw/source/uibase/utlui/content.cxx | 91 - 2 files changed, 93 insertions(+), 2 deletions(-) New commits: commit 8286c9ebe47aaf24b055f51136a8cb06f1e6429c Author: Jim Raykowski AuthorDate: Mon Nov 27 22:51:28 2023 -0900 Commit: Jim Raykowski CommitDate: Tue Dec 5 21:52:22 2023 +0100 tdf#157729 SwNavigator: enhancement to group comments by threads Change-Id: I64bc02e64d540a2bf602d2124deda1990dfb9f7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160011 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index 9e1653fd08e3..b693a7da97a4 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -106,8 +106,10 @@ class SwContentTree final : public SfxListener SwWrtShell* m_pActiveShell; // the active or a const. open view SwNavigationConfig* m_pConfig; +// these maps store the expand state of nodes with children std::map< void*, bool > mOutLineNodeMap; -std::map m_aRegionNodeExpandMap; // stores expand state of nodes with children +std::map m_aRegionNodeExpandMap; +std::map m_aPostItNodeExpandMap; sal_Int32 m_nActiveBlock; // used to restore content types expand state sal_Int32 m_nHiddenBlock; diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 4ca633697cdd..29ab1b964c26 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -119,6 +119,8 @@ #include +#include + #define CTYPE_CNT 0 #define CTYPE_CTT 1 @@ -2312,6 +2314,45 @@ bool SwContentTree::RequestingChildren(const weld::TreeIter& rParent) } } } +else if (pCntType->GetType() == ContentTypeId::POSTIT) +{ +std::vector> aParentCandidates; +for(size_t i = 0; i < nCount; ++i) +{ +const SwPostItContent* pCnt = +static_cast(pCntType->GetMember(i)); + +OUString sEntry = pCnt->GetName(); +OUString sId(weld::toId(pCnt)); + +const SwPostItField* pPostItField = +static_cast(pCnt->GetPostIt()->GetField()); +auto lambda = [, this](const std::unique_ptr& xEntry) +{ +SwPostItContent* pParentCandidateCnt = + weld::fromId(m_xTreeView->get_id(*xEntry)); +return pPostItField->GetParentPostItId() == +static_cast(pParentCandidateCnt->GetPostIt() + ->GetField())->GetPostItId(); +}; + +// if a parent candidate is not found use the passed root node +auto aFind = std::find_if(aParentCandidates.rbegin(), aParentCandidates.rend(), lambda); +if (aFind != aParentCandidates.rend()) +insert(aFind->get(), sEntry, sId, false, xChild.get()); +else +insert(, sEntry, sId, false, xChild.get()); + +m_xTreeView->set_sensitive(*xChild, !pCnt->IsInvisible()); + +// clear parent candidates when encountering a postit that doesn't have a parent +// following postits can't have a parent that is in these candidates +if (pPostItField->GetParentPostItId() == 0) +aParentCandidates.clear(); + + aParentCandidates.emplace_back(m_xTreeView->make_iterator(xChild.get())); +} +} else InsertContent(rParent); @@ -2485,6 +2526,47 @@ void SwContentTree::Expand(const weld::TreeIter& rParent, m_aRegionNodeExpandMap[key] = true; } } +else if (m_nRootType == ContentTypeId::POSTIT || (m_nRootType == ContentTypeId::UNKNOWN && + eParentContentTypeId == ContentTypeId::POSTIT)) +{ +if (bParentIsContentType) +{ +std::map aCurrentPostItNodeExpandMap; +if (RequestingChildren(rParent)) +{ +std::unique_ptr xChild(m_xTreeView->make_iterator()); +while (m_xTreeView->iter_next(*xChild) && lcl_IsContent(*xChild, *m_xTreeView)) +{ +if (m_xTreeView->iter_has_child(*xChild)) +{ + assert(dynamic_cast(weld::fromId(m_xTreeView->get_id(*xChild; +const void* key = +static_cast(weld::fromId( + m_xTreeView->get_id(*xChild))->GetPostIt()); +bool bExpandNode = +
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/inc/conttree.hxx |4 sw/source/uibase/utlui/content.cxx | 183 +++-- 2 files changed, 97 insertions(+), 90 deletions(-) New commits: commit 7a555725dad87b977154961beeb5c0da2a856709 Author: Jim Raykowski AuthorDate: Thu Nov 23 16:54:51 2023 -0900 Commit: Jim Raykowski CommitDate: Wed Nov 29 07:59:38 2023 +0100 SwNavigator: Rework the SwContentTree Expand function in effort to improve readability and operation. Change-Id: I7bfe485e24ee4cda3a3d99c522177950ad9ad399 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159887 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index a8094c40303a..9e1653fd08e3 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -109,10 +109,10 @@ class SwContentTree final : public SfxListener std::map< void*, bool > mOutLineNodeMap; std::map m_aRegionNodeExpandMap; // stores expand state of nodes with children -sal_Int32 m_nActiveBlock; // used to restore content types/categories expand state +sal_Int32 m_nActiveBlock; // used to restore content types expand state sal_Int32 m_nHiddenBlock; size_t m_nEntryCount; -ContentTypeId m_nRootType; +ContentTypeId m_nRootType;// content type that is currently displayed in the tree ContentTypeId m_nLastSelType; sal_uInt8 m_nOutlineLevel; diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 352a6daa9bba..4ca633697cdd 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2364,122 +2364,129 @@ SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt) return pRetObj; } -void SwContentTree::Expand(const weld::TreeIter& rParent, std::vector>* pNodesToExpand) +void SwContentTree::Expand(const weld::TreeIter& rParent, + std::vector>* pNodesToExpand) { -if (!(m_xTreeView->iter_has_child(rParent) || m_xTreeView->get_children_on_demand(rParent))) +if (!m_xTreeView->iter_has_child(rParent) && !m_xTreeView->get_children_on_demand(rParent)) return; -if (m_nRootType == ContentTypeId::UNKNOWN || m_nRootType == ContentTypeId::OUTLINE || -m_nRootType == ContentTypeId::REGION) +// pNodesToExpand is used by the Display function to restore the trees expand structure for +// hierarchical content types, e.g., OUTLINE and REGION. +if (pNodesToExpand) +pNodesToExpand->emplace_back(m_xTreeView->make_iterator()); + +// rParentId is a string representation of a pointer to SwContentType or SwContent +const OUString& rParentId = m_xTreeView->get_id(rParent); +// bParentIsContentType tells if the passed rParent tree entry is a content type or content +const bool bParentIsContentType = lcl_IsContentType(rParent, *m_xTreeView); +// eParentContentTypeId is the content type of the passed rParent tree entry +const ContentTypeId eParentContentTypeId = +bParentIsContentType ? weld::fromId(rParentId)->GetType() : + weld::fromId(rParentId)->GetParent()->GetType(); + +if (m_nRootType == ContentTypeId::UNKNOWN && bParentIsContentType) { -if (lcl_IsContentType(rParent, *m_xTreeView)) +// m_nActiveBlock and m_nHiddenBlock are used to persist the content type expand state for +// the all content view mode +const sal_Int32 nOr = 1 << static_cast(eParentContentTypeId); //linear -> Bitposition +if (State::HIDDEN != m_eState) { -ContentTypeId eContentTypeId = - weld::fromId(m_xTreeView->get_id(rParent))->GetType(); -const sal_Int32 nOr = 1 << static_cast(eContentTypeId); //linear -> Bitposition -if (State::HIDDEN != m_eState) -{ -m_nActiveBlock |= nOr; -m_pConfig->SetActiveBlock(m_nActiveBlock); -} -else -m_nHiddenBlock |= nOr; -if (eContentTypeId == ContentTypeId::OUTLINE) -{ -std::map< void*, bool > aCurrOutLineNodeMap; +m_nActiveBlock |= nOr; +m_pConfig->SetActiveBlock(m_nActiveBlock); +} +else +m_nHiddenBlock |= nOr; +} + +if (m_nRootType == ContentTypeId::OUTLINE || (m_nRootType == ContentTypeId::UNKNOWN && + eParentContentTypeId == ContentTypeId::OUTLINE)) +{ +if (bParentIsContentType) +{ +std::map< void*, bool > aCurrOutLineNodeMap; -SwWrtShell* pShell = GetWrtShell(); -bool bParentHasChild = RequestingChildren(rParent); -if (pNodesToExpand) -
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8f2c10f051c4d3e587b859210e9430ada7876a7a Author: Jim Raykowski AuthorDate: Tue Nov 28 10:49:31 2023 -0900 Commit: Jim Raykowski CommitDate: Wed Nov 29 07:03:54 2023 +0100 SwNavigator: Allow Sections, Indexes, and Headings tracking when in a table and Table tracking is off Change-Id: I0f5d069b80948aada9fee1338c29fc7809ffbe45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160056 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index ff354273ff82..352a6daa9bba 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -4226,8 +4226,8 @@ void SwContentTree::UpdateTracking() OUString aName = m_pActiveShell->GetTableFormat()->GetName(); lcl_SelectByContentTypeAndName(this, *m_xTreeView, SwResId(STR_CONTENT_TYPE_TABLE), aName); +return; } -return; } // indexes if (const SwTOXBase* pTOX = m_pActiveShell->GetCurTOX(); pTOX &&
[Libreoffice-commits] core.git: sw/source sw/uiconfig
sw/source/uibase/inc/content.hxx |2 + sw/source/uibase/utlui/content.cxx | 44 ++--- sw/uiconfig/swriter/ui/navigatorcontextmenu.ui | 16 + 3 files changed, 58 insertions(+), 4 deletions(-) New commits: commit 01a02ee7f1dbe7501a89b41e62599fba6a8b33f3 Author: Jim Raykowski AuthorDate: Sat Nov 18 18:56:56 2023 -0900 Commit: Jim Raykowski CommitDate: Wed Nov 29 04:24:57 2023 +0100 tdf#157681 SwNavigator: Add Protect and Hide menu items to Sections context menu Change-Id: I6a79c06abe2cf4dd44d491046d8ee73d35dfe6ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159718 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx index 77cb156b744c..c6698f4b0322 100644 --- a/sw/source/uibase/inc/content.hxx +++ b/sw/source/uibase/inc/content.hxx @@ -72,6 +72,8 @@ class SwRegionContent final : public SwContent m_nRegionLevel(nLevel), m_pSectionFormat(pSectionFormat){} sal_uInt8 GetRegionLevel() const {return m_nRegionLevel;} const SwSectionFormat* GetSectionFormat() const {return m_pSectionFormat;} + +bool IsProtect() const override; }; class SwURLFieldContent final : public SwContent diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 07fd64dc3bf9..ff354273ff82 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -260,6 +260,11 @@ bool SwURLFieldContent::IsProtect() const return m_pINetAttr->IsProtect(); } +bool SwRegionContent::IsProtect() const +{ +return m_pSectionFormat->GetSection()->IsProtect(); +} + SwGraphicContent::~SwGraphicContent() { } @@ -810,7 +815,7 @@ void SwContentType::FillMemberList(bool* pbContentChanged) m_bAlphabeticSort ? 0 : getYPos(pNodeIndex->GetNode()), pFormat)); -if(!pFormat->IsVisible()) +if (!pFormat->IsVisible() || pSection->IsHidden()) pCnt->SetInvisible(); m_pMember->insert(std::move(pCnt)); } @@ -1718,6 +1723,9 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) bool bRemoveSortEntry = true; +bool bRemoveProtectSection = true; +bool bRemoveHideSection = true; + if (xEntry) { const SwContentType* pType; @@ -1811,7 +1819,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) && m_pActiveShell->getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS); const bool bEditable = pType->IsEditable() && ((bVisible && !bProtected) || ContentTypeId::REGION == nContentType); -const bool bDeletable = pType->IsDeletable() && bVisible && !bProtected && !bProtectBM; +const bool bDeletable = pType->IsDeletable() +&& ((bVisible && !bProtected && !bProtectBM) || ContentTypeId::REGION == nContentType); const bool bRenamable = bEditable && !bReadonly && (ContentTypeId::TABLE == nContentType || ContentTypeId::FRAME == nContentType || @@ -1913,8 +1922,17 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) } else if(ContentTypeId::REGION == nContentType) { -bRemoveSelectEntry = false; bRemoveEditEntry = false; +bRemoveProtectSection = false; +bRemoveHideSection = false; +SwContent* pCnt = weld::fromId(m_xTreeView->get_id(*xEntry)); + assert(dynamic_cast(static_cast(pCnt))); +const SwSectionFormat* pSectionFormat += static_cast(pCnt)->GetSectionFormat(); +bool bHidden = pSectionFormat->GetSection()->IsHidden(); +bRemoveSelectEntry = bHidden || !bVisible; +xPop->set_active("protectsection", bProtected); +xPop->set_active("hidesection", bHidden); } else if (bEditable) bRemoveEditEntry = false; @@ -2106,6 +2124,10 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) xPop->remove("endnotetracking"); if (bRemoveSortEntry) xPop->remove("sort"); +if (bRemoveProtectSection) +xPop->remove("protectsection"); +if (bRemoveHideSection) +xPop->remove("hidesection"); bool bSetSensitiveCollapseAllCategories = false; if (!m_bIsRoot && xEntry) @@ -4811,7 +4833,21 @@ void SwContentTree::ExecuteContextMenuAction(const OUString& rSelectedPopupEntry if
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/uitest/navigator/tdf40427.py | 22 +++- sw/source/uibase/inc/content.hxx |4 sw/source/uibase/inc/conttree.hxx |1 sw/source/uibase/utlui/content.cxx | 188 ++--- 4 files changed, 174 insertions(+), 41 deletions(-) New commits: commit 468c5110226c7f5b3079852a27adde45dc32dc76 Author: Jim Raykowski AuthorDate: Wed Nov 22 00:00:57 2023 -0900 Commit: Jim Raykowski CommitDate: Mon Nov 27 18:56:38 2023 +0100 tdf#158103 Enhancement to display Sections as an expandable/ collapsible hierarchy in the Writer Navigator Change-Id: I86bc17d11b4c5bf0ca0496e4ab62a0d77ddb625f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159812 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-by: Jim Raykowski diff --git a/sw/qa/uitest/navigator/tdf40427.py b/sw/qa/uitest/navigator/tdf40427.py index f394bf37aa06..aaab63ffdd4d 100644 --- a/sw/qa/uitest/navigator/tdf40427.py +++ b/sw/qa/uitest/navigator/tdf40427.py @@ -19,6 +19,20 @@ class tdf40427(UITestCase): if name == get_state_as_dict(xItem)['Text']: return xItem + def expand_all(self, xTreeItem): +count = len(xTreeItem.getChildren()) +for i in xTreeItem.getChildren(): +xTreeItem.getChild(i).executeAction("EXPAND", ()) +count += self.expand_all(xTreeItem.getChild(i)) +return count + + def get_names(self, xTreeItem): +names = [] +for i in xTreeItem.getChildren(): +names.append(get_state_as_dict(xTreeItem.getChild(str(i)))['Text']) +names += self.get_names(xTreeItem.getChild(i)) +return names + def test_tdf40427(self): with self.ui_test.load_file(get_url_for_data_file("tdf40427_SectionPositions.odt")) as document: xMainWindow = self.xUITest.getTopFocusWindow() @@ -53,6 +67,7 @@ class tdf40427(UITestCase): xSections = self.get_item(xContentTree, 'Sections') self.assertEqual('Sections', get_state_as_dict(xSections)['Text']) xSections.executeAction("EXPAND", ()) +totalSectionsCount = self.expand_all(xSections) refSectionNames = [ 'SectionZ', @@ -69,11 +84,10 @@ class tdf40427(UITestCase): 'SectionB', # High on screen, but late in list because it's on second page 'SectionC', ] -self.assertEqual(len(refSectionNames), len(xSections.getChildren())) +self.assertEqual(len(refSectionNames), totalSectionsCount) + +actSectionNames = self.get_names(xSections) -actSectionNames = [] -for i in range(len(refSectionNames)): - actSectionNames.append(get_state_as_dict(xSections.getChild(str(i)))['Text']) # Without the fix in place, this would fail with # AssertionError: Lists differ: ['SectionZ', 'SectionY', 'SectionT3', 'SectionT1', 'SectionT2'[100 chars]onC'] != ['SectionZ', 'SectionB', 'SectionF3', 'SectionFinF3', 'Section[100 chars]onA'] self.assertEqual(refSectionNames, actSectionNames) diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx index c2a922189894..77cb156b744c 100644 --- a/sw/source/uibase/inc/content.hxx +++ b/sw/source/uibase/inc/content.hxx @@ -212,8 +212,8 @@ public: Invalidate(); } -bool GetSortType() const {return m_bAlphabeticSort;} -void SetSortType(bool bAlphabetic) {m_bAlphabeticSort = bAlphabetic;} +bool IsAlphabeticSort() const {return m_bAlphabeticSort;} +void SetAlphabeticSort(bool bAlphabetic) {m_bAlphabeticSort = bAlphabetic;} voidInvalidate(); // only nMemberCount is read again diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index 9c6db5b5a5eb..a8094c40303a 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -107,6 +107,7 @@ class SwContentTree final : public SfxListener SwNavigationConfig* m_pConfig; std::map< void*, bool > mOutLineNodeMap; +std::map m_aRegionNodeExpandMap; // stores expand state of nodes with children sal_Int32 m_nActiveBlock; // used to restore content types/categories expand state sal_Int32 m_nHiddenBlock; diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 770f8b41e705..07fd64dc3bf9 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -217,6 +217,11 @@ namespace rPos = *pPos; } } + +bool lcl_IsLowerRegionContent(const weld::TreeIter& rEntry, const weld::TreeView& rTreeView, sal_uInt8 nLevel) +{ +return weld::fromId(rTreeView.get_id(rEntry))->GetRegionLevel() < nLevel; +} } // Content, contains names and reference at the content type. @@ -1727,7 +1732,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) && nContentType !=
[Libreoffice-commits] core.git: officecfg/registry sd/source
officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu | 4 ++-- sd/source/ui/dlg/LayerTabBar.cxx | 2 +- sd/source/ui/view/drviews7.cxx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) New commits: commit 7f79b0caf194ff9d7dfa2f85379a5c752c905476 Author: Jim Raykowski AuthorDate: Tue Nov 14 13:55:27 2023 -0900 Commit: Jim Raykowski CommitDate: Thu Nov 16 04:48:08 2023 +0100 tdf#158179 Fix layer tab menu layer visibility check menu item Renames/reworks the layer tab context menu visibility check menu item from 'Show Layer' to 'Hide layer' and fixes a bug that causes the check menu item to be set as the layer visibility setting of the previously selected layer tab. Change-Id: I81f1910f95df50255e61115b5d8de8ed3ef8bd89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159427 Tested-by: Jenkins Tested-by: Heiko Tietze Reviewed-by: Heiko Tietze diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu index 311c5d3dff2e..de8d13e78222 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu @@ -999,10 +999,10 @@ Toggle Layer Visibility - ~Show Layer + ~Hide Layer - ~Show Layer (Shift+Click) + ~Hide Layer (Shift+Click) 1 diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index 7e09228e6ed4..96b96068f331 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -134,7 +134,7 @@ bool LayerTabBar::IsRealNameOfStandardLayer(std::u16string_view rName) void LayerTabBar::Select() { SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher(); -pDispatcher->Execute(SID_SWITCHLAYER, SfxCallMode::ASYNCHRON); +pDispatcher->Execute(SID_SWITCHLAYER, SfxCallMode::SYNCHRON); } void LayerTabBar::MouseButtonDown(const MouseEvent& rMEvt) diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 223493fb29e0..d8dbbac0362d 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1278,7 +1278,7 @@ void DrawViewShell::GetMenuState( SfxItemSet ) } if ( !aActiveLayer.isEmpty() && pPV ) -rSet.Put( SfxBoolItem(SID_TOGGLELAYERVISIBILITY, pPageView->IsLayerVisible(aActiveLayer)) ); +rSet.Put( SfxBoolItem(SID_TOGGLELAYERVISIBILITY, !pPageView->IsLayerVisible(aActiveLayer)) ); // are the modules available?
[Libreoffice-commits] core.git: cui/source sw/source
cui/source/inc/backgrnd.hxx | 17 +- cui/source/inc/cuitabarea.hxx |1 cui/source/tabpages/backgrnd.cxx| 212 +--- sw/source/uibase/shells/textsh1.cxx |1 4 files changed, 116 insertions(+), 115 deletions(-) New commits: commit 167fb166e4097c4a855c08a70cdf70c19d4d87ac Author: Jim Raykowski AuthorDate: Tue Oct 17 17:21:33 2023 -0800 Commit: Jim Raykowski CommitDate: Fri Nov 3 03:18:38 2023 +0100 tdf#157801 Fix direct formatting is applied after pressing OK in the Character properties dialog when the Highlighting tab Color page is open and the color has not been changed This is noticeable when character highlighting direct formatting is already at paragraph level. The expected result of opening the properties dialog, and immediately pressing OK without changing anything (or alternatively, after changing something there and then pressing Reset then OK), is no changes in applied properties at all. Inspiration for rework of the background tab page. With this patch XATTR_FILL items need not be included in the InAttrs set, for example, as part of this patch, the XATTR_FILLSTYLE, XATTR_FILLCOLOR range is removed from the sw_CharDialog core set. Change-Id: Ic2de53a29579c33820fc381d354a4afebe048a5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158100 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx index 450fbdaaa27f..3d50d69e95f4 100644 --- a/cui/source/inc/backgrnd.hxx +++ b/cui/source/inc/backgrnd.hxx @@ -37,23 +37,28 @@ class SvxBrushItem; class SvxBkgTabPage : public SvxAreaTabPage { -static const WhichRangesContainer pPageRanges; +static const WhichRangesContainer pBkgRanges; std::unique_ptr m_xTblLBox; -boolbHighlighting : 1; -boolbCharBackColor : 1; -SfxItemSet maSet; -std::unique_ptr m_pResetSet; +bool m_bHighlighting = false; +bool m_bCharBackColor = false; + +// m_aAttrSet is used to convert between SvxBrushItem and XFILL item attributes and also to +// allow for cell, row, and table backgrounds to be set in one Table dialog opening. +SfxItemSet m_aAttrSet; sal_Int32 m_nActPos = -1; DECL_LINK(TblDestinationHdl_Impl, weld::ComboBox&, void); + +void SetActiveTableDestinationBrushItem(); + public: SvxBkgTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); virtual ~SvxBkgTabPage() override; // returns the area of the which-values -static WhichRangesContainer GetRanges() { return pPageRanges; } +static WhichRangesContainer GetRanges() { return pBkgRanges; } static std::unique_ptr Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); virtual bool FillItemSet( SfxItemSet* ) override; diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 2fbfcd1435ac..0917fcb91dc8 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -253,7 +253,6 @@ protected: void SetOptimalSize(weld::DialogController* pController); void SelectFillType( weld::Toggleable& rButton, const SfxItemSet* _pSet = nullptr ); -SfxTabPage* GetFillTabPage() { return m_xFillTabPage.get(); } bool IsBtnClicked() const { return m_bBtnClicked; } diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 5706f98c310a..56bccfacdffe 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -36,7 +36,7 @@ using namespace css; #define TBL_DEST_ROW1 #define TBL_DEST_TBL2 -const WhichRangesContainer SvxBkgTabPage::pPageRanges(svl::Items< +const WhichRangesContainer SvxBkgTabPage::pBkgRanges(svl::Items< SID_ATTR_BRUSH, SID_ATTR_BRUSH, SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR >); @@ -63,32 +63,13 @@ static sal_uInt16 lcl_GetTableDestSlot(sal_Int32 nTblDest) SvxBkgTabPage::SvxBkgTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs) : SvxAreaTabPage(pPage, pController, rInAttrs), -bHighlighting(false), -bCharBackColor(false), -maSet(rInAttrs) +m_aAttrSet(*rInAttrs.GetPool(), + rInAttrs.GetRanges().MergeRange(XATTR_FILL_FIRST, XATTR_FILL_LAST)) { m_xBtnGradient->hide(); m_xBtnHatch->hide(); m_xBtnBitmap->hide(); m_xBtnPattern->hide(); - -SfxObjectShell* pDocSh = SfxObjectShell::Current(); - -XColorListRef pColorTable; -if ( pDocSh ) -if (auto pItem = pDocSh->GetItem( SID_COLOR_TABLE )) -pColorTable = pItem->GetColorList(); - -if ( !pColorTable.is() ) -pColorTable = XColorList::CreateStdColorList(); - -XBitmapListRef pBitmapList; -if ( pDocSh ) -if (auto pItem = pDocSh->GetItem(
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx | 86 +++-- 1 file changed, 45 insertions(+), 41 deletions(-) New commits: commit d2676b3e4b43aa4e17007bacdd0d98573ebd1ad2 Author: Jim Raykowski AuthorDate: Sat Oct 28 21:21:38 2023 -0800 Commit: Jim Raykowski CommitDate: Fri Nov 3 00:15:23 2023 +0100 SwNavigator: Improve field content sorting Shave some time off sorting field content entries for documents with large number of fields by eliminating a second sort and the loop used to determine if a second sort is done because a field is found in a frame. Also corrects ordering of fields in nested frames which prior to this patch are placed at the beginning of the field content entries. Change-Id: I5fbd67b6fb0ac1ef49a5df7721bb209d4cba4013 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158606 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 43bb9e78bb5f..3a4322ad1532 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -200,6 +200,23 @@ namespace pCNd = aIdx.GetNodes().GoNext(); return pCNd->IsTextNode() ? static_cast(pCNd)->GetText() : OUString(); } + +void getAnchorPos(SwPosition& rPos) +{ +// get the top most anchor position of the position +if (SwFrameFormat* pFlyFormat = rPos.GetNode().GetFlyFormat()) +{ +SwNode* pAnchorNode; +SwFrameFormat* pTmp = pFlyFormat; +while (pTmp && (pAnchorNode = pTmp->GetAnchor().GetAnchorNode()) && + (pTmp = pAnchorNode->GetFlyFormat())) +{ +pFlyFormat = pTmp; +} +if (const SwPosition* pPos = pFlyFormat->GetAnchor().GetContentAnchor()) +rPos = *pPos; +} +} } // Content, contains names and reference at the content type. @@ -628,55 +645,42 @@ void SwContentType::FillMemberList(bool* pbContentChanged) } if (!m_bAlphabeticSort) { -const SwNodeOffset nEndOfExtrasIndex = m_pWrtShell->GetNodes().GetEndOfExtras().GetIndex(); -bool bHasEntryInFly = false; - +const SwNodeOffset nEndOfExtrasIndex = +m_pWrtShell->GetNodes().GetEndOfExtras().GetIndex(); // use stable sort array to list fields in document model order std::stable_sort(aArr.begin(), aArr.end(), - [](const SwTextField* a, const SwTextField* b){ + [, this]( + const SwTextField* a, const SwTextField* b){ SwPosition aPos(a->GetTextNode(), a->GetStart()); SwPosition bPos(b->GetTextNode(), b->GetStart()); -return aPos < bPos;}); - -// determine if there is a text field in a fly frame -for (SwTextField* pTextField : aArr) -{ -if (!bHasEntryInFly) +// use anchor position for entries that are located in flys +if (nEndOfExtrasIndex >= aPos.GetNodeIndex()) +getAnchorPos(aPos); +if (nEndOfExtrasIndex >= bPos.GetNodeIndex()) +getAnchorPos(bPos); +if (aPos == bPos) { -if (nEndOfExtrasIndex >= pTextField->GetTextNode().GetIndex()) +// probably in same or nested fly frame +// sort using layout position +SwRect aCharRect, bCharRect; +std::shared_ptr pPamForTextField; +if (SwTextFrame* pFrame = static_cast( + a->GetTextNode().getLayoutFrame(m_pWrtShell->GetLayout( { -// Not a node of BodyText -// Are we in a fly? -if (pTextField->GetTextNode().GetFlyFormat()) -{ -bHasEntryInFly = true; -break; -} +SwTextField::GetPamForTextField(*a, pPamForTextField); +if (pPamForTextField) +pFrame->GetCharRect(aCharRect, *pPamForTextField->GetPoint()); +} +if (SwTextFrame* pFrame = static_cast( + b->GetTextNode().getLayoutFrame(m_pWrtShell->GetLayout( +{ +SwTextField::GetPamForTextField(*b, pPamForTextField); +if (pPamForTextField) +
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sw/source
sw/source/uibase/utlui/content.cxx | 43 - 1 file changed, 15 insertions(+), 28 deletions(-) New commits: commit 5728686b2f133e7a0e23544ecaebc34bfdde434b Author: Jim Raykowski AuthorDate: Sun Oct 8 23:13:51 2023 -0800 Commit: Michael Stahl CommitDate: Wed Oct 18 10:57:35 2023 +0200 SwNavigator: Fix Indexes tracking Restores Indexes tracking when the document cursor is in TOX content which was lost in commit ca34204a39716ec9aa621e60ea50fb3c058c55f6. Change-Id: Ib0fed4b7a20b5d08b5c52eef28d13cf0044d87d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157693 Tested-by: Jenkins Reviewed-by: Jim Raykowski (cherry picked from commit 79df80b642179fdd621538e8a7894a2f055ba16a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158031 Reviewed-by: Michael Stahl diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 5114761fe939..cd6528752fef 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -3932,36 +3932,23 @@ void SwContentTree::UpdateTracking() return; } // hyperlinks -if (SwContentAtPos aContentAtPos(IsAttrAtPos::InetAttr); - m_pActiveShell->GetContentAtPos(m_pActiveShell->GetCursorDocPos(), aContentAtPos) && -!(m_bIsRoot && m_nRootType != ContentTypeId::URLFIELD)) +// not in ToxContent tdf#148312 +if (const SwSection* pSection = m_pActiveShell->GetCurrSection(); !pSection +|| (pSection && pSection->GetType() != SectionType::ToxContent)) { -// There is no need to search for hyperlinks in ToxContent tdf#148312 -if (const SwTextINetFormat* pTextINetFormat = -static_txtattr_cast(aContentAtPos.pFndTextAttr)) -{ -if (const SwTextNode* pTextNode = pTextINetFormat->GetpTextNode()) -{ -if (const SwSectionNode* pSectNd = pTextNode->FindSectionNode()) -{ -SectionType eType = pSectNd->GetSection().GetType(); -if (SectionType::ToxContent == eType) -{ -m_xTreeView->set_cursor(-1); -Select(); -return; -} -} -} +if (SwContentAtPos aContentAtPos(IsAttrAtPos::InetAttr); + m_pActiveShell->GetContentAtPos(m_pActiveShell->GetCursorDocPos(), aContentAtPos) +&& (!m_bIsRoot || m_nRootType == ContentTypeId::URLFIELD)) +{ +// Because hyperlink item names do not need to be unique, finding the corresponding +// item in the tree by name may result in incorrect selection. Find the item in the +// tree by comparing the SwTextINetFormat pointer at the document cursor position to +// that stored in the item SwURLFieldContent. +if (mTrackContentType[ContentTypeId::URLFIELD]) +lcl_SelectByContentTypeAndAddress(this, *m_xTreeView, ContentTypeId::URLFIELD, + aContentAtPos.pFndTextAttr); +return; } -// Because hyperlink item names do not need to be unique, finding the corresponding item -// in the tree by name may result in incorrect selection. Find the item in the tree by -// comparing the SwTextINetFormat pointer at the document cursor position to that stored -// in the item SwURLFieldContent. -if (mTrackContentType[ContentTypeId::URLFIELD]) -lcl_SelectByContentTypeAndAddress(this, *m_xTreeView, ContentTypeId::URLFIELD, - aContentAtPos.pFndTextAttr); -return; } // fields, comments if (SwField* pField = m_pActiveShell->GetCurField(); pField &&
[Libreoffice-commits] core.git: include/sfx2 officecfg/registry sfx2/source sw/inc sw/sdi sw/source sw/uiconfig
include/sfx2/sfxsids.hrc|3 include/sfx2/templdlg.hxx | 14 + officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 33 +++ sfx2/source/dialog/templdlg.cxx | 88 -- sw/inc/view.hxx |2 sw/sdi/_viewsh.sdi | 12 + sw/sdi/swriter.sdi | 34 +++ sw/source/uibase/uiview/view0.cxx | 28 +++ sw/uiconfig/swriter/menubar/menubar.xml |8 9 files changed, 204 insertions(+), 18 deletions(-) New commits: commit 6320a4c21cf54d32c778417ee077d67fd0bad050 Author: Jim Raykowski AuthorDate: Mon Oct 16 06:48:35 2023 -0800 Commit: Jim Raykowski CommitDate: Wed Oct 18 04:13:55 2023 +0200 tdf#156114 UNO commands / menu entries to enable PS/CS spotlight Change-Id: I2796b595ef961c477dea85c337ad343599aea7cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158055 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index 9789cc8a0ac1..55327feb0034 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -388,6 +388,9 @@ class SvxZoomItem; #define SID_STYLE_UPD_BY_EX_NAME TypedWhichId(SID_SFX_START + 1585) #define SID_STYLE_REFERENCE TypedWhichId(SID_SFX_START + 1602) +#define SID_SPOTLIGHT_PARASTYLES TypedWhichId(SID_SFX_START + 1605) +#define SID_SPOTLIGHT_CHARSTYLES TypedWhichId(SID_SFX_START + 1606) + #define SID_TEMPLATE_NAME TypedWhichId(SID_SFX_START + 660) #define SID_TEMPLATE_REGIONNAME TypedWhichId(SID_SFX_START + 662) #define SID_TEMPLATE_LOAD TypedWhichId(SID_SFX_START + 663) diff --git a/include/sfx2/templdlg.hxx b/include/sfx2/templdlg.hxx index 5dd5b8b6b178..254fcc790fb0 100644 --- a/include/sfx2/templdlg.hxx +++ b/include/sfx2/templdlg.hxx @@ -24,11 +24,14 @@ #include #include #include +#include class SfxBindings; class SfxTemplateDialog_Impl; -class UNLESS_MERGELIBS(SFX2_DLLPUBLIC) SfxTemplatePanelControl final : public PanelLayout +class UNLESS_MERGELIBS(SFX2_DLLPUBLIC) SfxTemplatePanelControl final +: public PanelLayout, + public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface { public: SfxTemplatePanelControl(SfxBindings* pBindings, weld::Widget* pParent); @@ -37,7 +40,16 @@ public: weld::Builder* get_builder() { return m_xBuilder.get(); } weld::Container* get_container() { return m_xContainer.get(); } +virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, + const SfxPoolItem* pState) override; + +virtual void GetControlState(const sal_uInt16 /*nSId*/, + boost::property_tree::ptree& /*rState*/) override{}; + private: +::sfx2::sidebar::ControllerItem m_aSpotlightParaStyles; +::sfx2::sidebar::ControllerItem m_aSpotlightCharStyles; + std::unique_ptr pImpl; }; diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index c0d820c0e43b..44a98e183ccc 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -429,6 +429,31 @@ Spotlight Character Direct Formatting + + Character Direct Formatting + + + 1 + + + + + Spotlight Paragraph Styles + + + Paragraph Styles + + + 1 + + + + + Spotlight Character Styles + + + Character Styles + 1 @@ -4214,6 +4239,14 @@ Open the Accessibility Check Deck + + + Spotlight + + + 1 + + diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 7f44bf64d366..db21ee720c2d 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -107,17 +107,6 @@ IMPL_LINK(SfxCommonTemplateDialog_Impl, OnAsyncExecuteDrop, void*, pStyleList, v ActionSelect("new", m_aStyleList); } -SfxTemplatePanelControl::SfxTemplatePanelControl(SfxBindings* pBindings, weld::Widget* pParent) -: PanelLayout(pParent, "TemplatePanel", "sfx/ui/templatepanel.ui") -, pImpl(new SfxTemplateDialog_Impl(pBindings, this)) -{ -OSL_ASSERT(pBindings!=nullptr); -} - -SfxTemplatePanelControl::~SfxTemplatePanelControl() -{ -} - namespace
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/glbltree.cxx | 28 +++- 1 file changed, 27 insertions(+), 1 deletion(-) New commits: commit 2a05fd0fd2b6c4ad8fd900565f3640f1ef47a165 Author: Jim Raykowski AuthorDate: Mon Oct 9 20:22:04 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Oct 17 07:24:37 2023 +0200 tdf#144349 related: Make master document navigator track Text content Done, with a related patch to make the master document navigator track TOX content, to make the Navigator less likely not to have an item selected, which may be enough to resolve tdf#155741 - Allow insertion of items into master without a selected item Change-Id: I1a9d2a12a01ca2c5f3f162e8da932c04ced9a461 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157741 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index fe18195e7c22..8c8fef089161 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -787,12 +787,12 @@ IMPL_LINK_NOARG(SwGlobalTree, Timeout, Timer *, void) } } +// track GlobalDocContentType at the cursor position in the document void SwGlobalTree::UpdateTracking() { if (!m_pActiveShell) return; -// track section at cursor position in document m_xTreeView->unselect_all(); const SwSection* pActiveShellCurrSection = m_pActiveShell->GetCurrSection(); @@ -816,6 +816,32 @@ void SwGlobalTree::UpdateTracking() } } } +else +{ +const SwCursor* pCursor = m_pActiveShell->GetCursor(); +const SwNode& rNode = pCursor->GetPoint()->GetNode(); +if (rNode.IsTextNode()) +{ +// only the first text node in each series of text nodes is stored in the +// SwGlblDocContents array +SwNodeIndex aIdx(rNode); +do +{ +--aIdx; +} while (aIdx.GetNode().IsTextNode()); +++aIdx; +SwNodeOffset aTextNodeIndex(aIdx.GetNode().GetIndex()); +for (const std::unique_ptr& rGlblDocContent : *m_pSwGlblDocContents) +{ +if (rGlblDocContent->GetType() == GlobalDocContentType::GLBLDOC_UNKNOWN +&& rGlblDocContent->GetDocPos() == aTextNodeIndex) +{ +const OUString& rId(weld::toId(rGlblDocContent.get())); +m_xTreeView->select(m_xTreeView->find_id(rId)); +} +} +} +} Select(); }
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/glbltree.cxx | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) New commits: commit b97aa4eada3164b20f663a9817e92af78495109f Author: Jim Raykowski AuthorDate: Sun Oct 8 22:42:09 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Oct 17 05:20:05 2023 +0200 tdf#144349 related: Make master document navigator track TOX content Done, with a related patch to make the master document navigator track 'Text' content, to make the Navigator less likely not to have an item selected, which may be enough to resolve tdf#155741 - Allow insertion of items into master without a selected item Change-Id: I6df1b668c502cadbe057229e031ede9aa4f4089a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157695 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 26dd58f5b7ea..fe18195e7c22 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -801,7 +801,20 @@ void SwGlobalTree::UpdateTracking() const SwSection* pSection = pActiveShellCurrSection; while (SwSection* pParent = pSection->GetParent()) pSection = pParent; -m_xTreeView->select_text(pSection->GetSectionName()); +for (const std::unique_ptr& rGlblDocContent : *m_pSwGlblDocContents) +{ +if (rGlblDocContent->GetType() == GlobalDocContentType::GLBLDOC_UNKNOWN) +continue; +if ((pSection->GetType() == SectionType::ToxContent + && rGlblDocContent->GetTOX() == pSection->GetTOXBase()) +|| (pSection->GetType() != SectionType::ToxContent +&& rGlblDocContent->GetSection() == pSection)) +{ +const OUString& rId(weld::toId(rGlblDocContent.get())); +m_xTreeView->select(m_xTreeView->find_id(rId)); +break; +} +} } Select();
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/wrtsh/wrtsh1.cxx | 35 --- 1 file changed, 8 insertions(+), 27 deletions(-) New commits: commit 148394645cf753e8548b7cff6effe4ae69ca0fbd Author: Jim Raykowski AuthorDate: Thu Oct 12 14:36:38 2023 -0800 Commit: Jim Raykowski CommitDate: Sun Oct 15 08:55:46 2023 +0200 tdf#154701 Fix move paragraph not working properly with outline folding Change-Id: Ibb4706fae198fada0f143b1b25149fcbcc5c41d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157899 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 9dc476fb18ba..912283dd20fc 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -2334,7 +2334,7 @@ bool SwWrtShell::IsOutlineContentVisible(const size_t nPos) // no layout frame means outline folding is set to include sub levels and the outline node has // a parent outline node with outline content visible attribute false (folded outline content) -if (!pOutlineNode->GetTextNode()->getLayoutFrame(nullptr)) +if (!pOutlineNode->GetTextNode()->getLayoutFrame(GetLayout())) return false; // try the next node to determine if this outline node has visible content @@ -2357,7 +2357,7 @@ bool SwWrtShell::IsOutlineContentVisible(const size_t nPos) return GetAttrOutlineContentVisible(nPos); if (aIdx.GetNode().IsTextNode()) -return aIdx.GetNode().GetTextNode()->getLayoutFrame(nullptr); +return aIdx.GetNode().GetTextNode()->getLayoutFrame(GetLayout()); if (aIdx.GetNode().IsTableNode()) { SwTable& rTable = aIdx.GetNode().GetTableNode()->GetTable(); @@ -2592,43 +2592,24 @@ void SwWrtShell::MakeAllFoldedOutlineContentVisible(bool bMakeVisible) } else { -if (SdrView* pSdrView = GetDrawView(); pSdrView && pSdrView->IsTextEdit() ) -{ -bool bLockView = IsViewLocked(); -LockView(true); -EndTextEdit(); -LockView(bLockView); -} -if (IsSelFrameMode() || IsObjSelected()) -{ -UnSelectFrame(); -LeaveSelFrameMode(); -GetView().LeaveDrawCreate(); -EnterStdMode(); -} - -// Get current frame in which the cursor is positioned for use in placing the cursor. -const SwFrame* pCurrFrame = GetCurrFrame(false); +AssureStdMode(); +// Get the outline position of the cursor so the cursor can be place at a visible outline +// node if it is not visible after InvalidateOutlineContentVisiblity below. SwOutlineNodes::size_type nPos = GetOutlinePos(); StartAction(); InvalidateOutlineContentVisibility(); EndAction(); -// If needed, find visible outline node frame to place cursor. -if (!pCurrFrame || !pCurrFrame->isFrameAreaDefinitionValid() || pCurrFrame->IsInDtor() || -(nPos != SwOutlineNodes::npos && - !GetNodes().GetOutLineNds()[nPos]->GetTextNode()->getLayoutFrame(nullptr))) +// If needed, find a visible outline node to place the cursor. +if (nPos != SwOutlineNodes::npos && !IsOutlineContentVisible(nPos)) { while (nPos != SwOutlineNodes::npos && - !GetNodes().GetOutLineNds()[nPos]->GetTextNode()->getLayoutFrame(nullptr)) + !GetNodes().GetOutLineNds()[nPos]->GetTextNode()->getLayoutFrame(GetLayout())) --nPos; if (nPos != SwOutlineNodes::npos) -{ -EnterStdMode(); GotoOutline(nPos); -} } } GetView().GetDocShell()->Broadcast(SfxHint(SfxHintId::DocChanged));
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 18f35dffae44e741ea492ed5304f2d2d9d000f2d Author: Jim Raykowski AuthorDate: Thu Oct 12 09:01:27 2023 -0800 Commit: Jim Raykowski CommitDate: Sat Oct 14 20:38:44 2023 +0200 tdf#152029 related: Remove attention overlay on document view change Fixes stale overlay that can happen when Navigator use causes a document view change. For example, when the Navigator is used to change a heading level or to delete a heading by key input. Change-Id: If4c0aa2e31f088a8fa12d7ed02012033c4d13509 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157892 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 9d96415c5c35..64e2c4aad25b 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -3272,6 +3272,7 @@ void SwContentTree::Notify(SfxBroadcaster & rBC, SfxHint const& rHint) break; } case SfxHintId::DocChanged: +OverlayObject(); if (!m_bIgnoreDocChange) { m_bDocHasChanged = true;
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx | 43 - 1 file changed, 15 insertions(+), 28 deletions(-) New commits: commit 79df80b642179fdd621538e8a7894a2f055ba16a Author: Jim Raykowski AuthorDate: Sun Oct 8 23:13:51 2023 -0800 Commit: Jim Raykowski CommitDate: Fri Oct 13 21:28:48 2023 +0200 SwNavigator: Fix Indexes tracking Restores Indexes tracking when the document cursor is in TOX content which was lost in commit ca34204a39716ec9aa621e60ea50fb3c058c55f6. Change-Id: Ib0fed4b7a20b5d08b5c52eef28d13cf0044d87d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157693 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 7456d2a28e12..9d96415c5c35 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -3981,36 +3981,23 @@ void SwContentTree::UpdateTracking() return; } // hyperlinks -if (SwContentAtPos aContentAtPos(IsAttrAtPos::InetAttr); - m_pActiveShell->GetContentAtPos(m_pActiveShell->GetCursorDocPos(), aContentAtPos) && -!(m_bIsRoot && m_nRootType != ContentTypeId::URLFIELD)) +// not in ToxContent tdf#148312 +if (const SwSection* pSection = m_pActiveShell->GetCurrSection(); !pSection +|| (pSection && pSection->GetType() != SectionType::ToxContent)) { -// There is no need to search for hyperlinks in ToxContent tdf#148312 -if (const SwTextINetFormat* pTextINetFormat = -static_txtattr_cast(aContentAtPos.pFndTextAttr)) -{ -if (const SwTextNode* pTextNode = pTextINetFormat->GetpTextNode()) -{ -if (const SwSectionNode* pSectNd = pTextNode->FindSectionNode()) -{ -SectionType eType = pSectNd->GetSection().GetType(); -if (SectionType::ToxContent == eType) -{ -m_xTreeView->set_cursor(-1); -Select(); -return; -} -} -} +if (SwContentAtPos aContentAtPos(IsAttrAtPos::InetAttr); + m_pActiveShell->GetContentAtPos(m_pActiveShell->GetCursorDocPos(), aContentAtPos) +&& (!m_bIsRoot || m_nRootType == ContentTypeId::URLFIELD)) +{ +// Because hyperlink item names do not need to be unique, finding the corresponding +// item in the tree by name may result in incorrect selection. Find the item in the +// tree by comparing the SwTextINetFormat pointer at the document cursor position to +// that stored in the item SwURLFieldContent. +if (mTrackContentType[ContentTypeId::URLFIELD]) +lcl_SelectByContentTypeAndAddress(this, *m_xTreeView, ContentTypeId::URLFIELD, + aContentAtPos.pFndTextAttr); +return; } -// Because hyperlink item names do not need to be unique, finding the corresponding item -// in the tree by name may result in incorrect selection. Find the item in the tree by -// comparing the SwTextINetFormat pointer at the document cursor position to that stored -// in the item SwURLFieldContent. -if (mTrackContentType[ContentTypeId::URLFIELD]) -lcl_SelectByContentTypeAndAddress(this, *m_xTreeView, ContentTypeId::URLFIELD, - aContentAtPos.pFndTextAttr); -return; } // fields, comments if (SwField* pField = m_pActiveShell->GetCurField(); pField &&
[Libreoffice-commits] core.git: sw/source sw/uiconfig
sw/source/uibase/inc/content.hxx |7 -- sw/source/uibase/utlui/content.cxx | 29 +++-- sw/uiconfig/swriter/ui/navigatorcontextmenu.ui |9 +++ 3 files changed, 37 insertions(+), 8 deletions(-) New commits: commit 6afffcee5fcf7c9719abe7176468d20602e750bf Author: Jim Raykowski AuthorDate: Tue Oct 10 19:06:21 2023 -0800 Commit: Jim Raykowski CommitDate: Thu Oct 12 19:13:59 2023 +0200 tdf#42787 SwNavigator: Add ability to delete Sections Change-Id: If259772d6b84cdae48b75083c569fcf862416baf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157802 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx index f7666e97244b..c2a922189894 100644 --- a/sw/source/uibase/inc/content.hxx +++ b/sw/source/uibase/inc/content.hxx @@ -60,15 +60,18 @@ class SwRegionContent final : public SwContent { sal_uInt8 m_nRegionLevel; +const SwSectionFormat* m_pSectionFormat; public: SwRegionContent(const SwContentType* pCnt, const OUString& rName, sal_uInt8 nLevel, -tools::Long nYPos) : +tools::Long nYPos, +const SwSectionFormat* pSectionFormat) : SwContent(pCnt, rName, nYPos), -m_nRegionLevel(nLevel){} +m_nRegionLevel(nLevel), m_pSectionFormat(pSectionFormat){} sal_uInt8 GetRegionLevel() const {return m_nRegionLevel;} +const SwSectionFormat* GetSectionFormat() const {return m_pSectionFormat;} }; class SwURLFieldContent final : public SwContent diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index c9a30aaddfe4..7456d2a28e12 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -378,7 +378,7 @@ SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 case ContentTypeId::REGION: m_sTypeToken = "region"; m_bEdit = true; -m_bDelete = false; +m_bDelete = true; break; case ContentTypeId::INDEX: m_bEdit = true; @@ -796,8 +796,10 @@ void SwContentType::FillMemberList(bool* pbContentChanged) pParentFormat = pParentFormat->GetParent(); } -std::unique_ptr pCnt(new SwRegionContent(this, sSectionName, -nLevel, m_bAlphabeticSort ? 0 : getYPos(pNodeIndex->GetNode(; +auto pCnt(std::make_unique(this, sSectionName, nLevel, +m_bAlphabeticSort ? 0 : getYPos(pNodeIndex->GetNode()), +pFormat)); + if(!pFormat->IsVisible()) pCnt->SetInvisible(); m_pMember->insert(std::move(pCnt)); @@ -1661,6 +1663,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) bRemoveDeleteImageEntry = true, bRemoveDeleteOLEObjectEntry = true, bRemoveDeleteBookmarkEntry = true, + bRemoveDeleteRegionEntry = true, bRemoveDeleteHyperlinkEntry = true, bRemoveDeleteReferenceEntry = true, bRemoveDeleteIndexEntry= true, @@ -1783,8 +1786,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) && m_pActiveShell->getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS); const bool bEditable = pType->IsEditable() && ((bVisible && !bProtected) || ContentTypeId::REGION == nContentType); -const bool bDeletable = pType->IsDeletable() && -((bVisible && !bProtected && !bProtectBM) || ContentTypeId::REGION == nContentType); +const bool bDeletable = pType->IsDeletable() && bVisible && !bProtected && !bProtectBM; const bool bRenamable = bEditable && !bReadonly && (ContentTypeId::TABLE == nContentType || ContentTypeId::FRAME == nContentType || @@ -1817,6 +1819,9 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) case ContentTypeId::BOOKMARK: bRemoveDeleteBookmarkEntry = false; break; +case ContentTypeId::REGION: +bRemoveDeleteRegionEntry = false; +break; case ContentTypeId::URLFIELD: bRemoveDeleteHyperlinkEntry = false; break; @@ -1962,6 +1967,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) xPop->remove("deleteoleobject"); if (bRemoveDeleteBookmarkEntry)
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx | 24 +++- sw/source/uibase/wrtsh/wrtsh1.cxx |7 +++ 2 files changed, 30 insertions(+), 1 deletion(-) New commits: commit ceceb574251d6ed3ce4da2fdcae398cb72488dfa Author: Jim Raykowski AuthorDate: Fri Oct 6 21:38:45 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Oct 10 06:30:57 2023 +0200 tdf#156980 SwNavigator: Make headings delete even if they have folded outline content Change-Id: If952d8d845c2eeec86231014b924f1632d2f5efe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157667 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index a8b939b774be..c9a30aaddfe4 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -4871,12 +4871,13 @@ void SwContentTree::ExecuteContextMenuAction(const OUString& rSelectedPopupEntry void SwContentTree::DeleteOutlineSelections() { +const SwOutlineNodes& rOutlineNodes = m_pActiveShell->GetNodes().GetOutLineNds(); auto nChapters(0); m_pActiveShell->StartAction(); m_pActiveShell->EnterAddMode(); -m_xTreeView->selected_foreach([this, ](weld::TreeIter& rEntry){ +m_xTreeView->selected_foreach([this, , ](weld::TreeIter& rEntry){ ++nChapters; if (m_xTreeView->iter_has_child(rEntry) && !m_xTreeView->get_row_expanded(rEntry)) // only count children if not expanded @@ -4884,6 +4885,27 @@ void SwContentTree::DeleteOutlineSelections() nChapters += m_xTreeView->iter_n_children(rEntry); } SwOutlineNodes::size_type nActPos = weld::fromId(m_xTreeView->get_id(rEntry))->GetOutlinePos(); +if (m_pActiveShell->GetViewOptions()->IsShowOutlineContentVisibilityButton()) +{ +// make folded content visible so it can be selected +if (!m_pActiveShell->IsOutlineContentVisible(nActPos)) +m_pActiveShell->MakeOutlineContentVisible(nActPos); +if (!m_xTreeView->get_row_expanded(rEntry)) +{ +// include children +SwNode* pNode = rOutlineNodes[nActPos]; +const int nLevel = pNode->GetTextNode()->GetAttrOutlineLevel() - 1; +for (auto nPos = nActPos + 1; nPos < rOutlineNodes.size(); ++nPos) +{ +pNode = rOutlineNodes[nPos]; +const int nNextLevel = pNode->GetTextNode()->GetAttrOutlineLevel() - 1; +if (nNextLevel <= nLevel) +break; +if (!m_pActiveShell->IsOutlineContentVisible(nNextLevel)) +m_pActiveShell->MakeOutlineContentVisible(nNextLevel); +} +} +} m_pActiveShell->SttSelect(); m_pActiveShell->MakeOutlineSel(nActPos, nActPos, !m_xTreeView->get_row_expanded(rEntry), false); // select children if not expanded // The outline selection may already be to the start of the following outline paragraph diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 921d71415d95..9dc476fb18ba 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -2662,6 +2662,13 @@ bool SwWrtShell::HasFoldedOutlineContentSelected() const SwOutlineNodes::size_type nPos; for (SwNodeIndex aIdx = aPointIdx; aIdx <= aMarkIdx; ++aIdx) { +// To allow delete when the start of the selection is at the start of a +// paragraph and the end of the selection is at the start of a paragraph and there +// are no folded outline content nodes in between. +if (aIdx == aMarkIdx && aPaM.GetPoint()->GetContentIndex() == 0 && +aPaM.GetMark()->GetContentIndex() == 0) +return false; + if (GetDoc()->GetNodes().GetOutLineNds().Seek_Entry(&(aIdx.GetNode()), ) && !GetAttrOutlineContentVisible(nPos)) return true;
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/glbltree.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit cd746546df895338b13992cb064a4b85d1cfaeac Author: Jim Raykowski AuthorDate: Tue Sep 19 18:39:22 2023 -0800 Commit: Jim Raykowski CommitDate: Sat Oct 7 01:51:04 2023 +0200 Master Document Navigator: Improve sensitivity of tool box items Change-Id: I45f16267d7a46aacb5fb5ad4d138a63acfb687c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157579 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 367f9a65dd2a..26dd58f5b7ea 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -803,6 +803,8 @@ void SwGlobalTree::UpdateTracking() pSection = pParent; m_xTreeView->select_text(pSection->GetSectionName()); } + +Select(); } void SwGlobalTree::GotoContent(const SwGlblDocContent* pCont)
[Libreoffice-commits] core.git: sw/source
sw/source/core/access/AccessibilityIssue.cxx | 13 +++-- sw/source/uibase/docvw/PostItMgr.cxx | 21 --- sw/source/uibase/inc/wrtsh.hxx |2 + sw/source/uibase/utlui/content.cxx | 37 ++- sw/source/uibase/wrtsh/select.cxx| 31 ++ 5 files changed, 43 insertions(+), 61 deletions(-) New commits: commit a3c7d25122f615c1e3232e535afef2f8ad33d186 Author: Jim Raykowski AuthorDate: Wed Oct 4 16:26:00 2023 -0800 Commit: Jim Raykowski CommitDate: Fri Oct 6 18:51:41 2023 +0200 tdf#157584 Fix accessibility check doesn't move footnote into view when a frame object is currently selected This patch introduces the function SwWrtShell::AssureStdMode to fix this bug and to replace duplicated code. Change-Id: I4106db983f79c92eea96a67b510393b2ac09a6d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157575 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/core/access/AccessibilityIssue.cxx b/sw/source/core/access/AccessibilityIssue.cxx index 8056408a5b02..d3a4a1754240 100644 --- a/sw/source/core/access/AccessibilityIssue.cxx +++ b/sw/source/core/access/AccessibilityIssue.cxx @@ -72,13 +72,16 @@ void AccessibilityIssue::gotoIssue() const and the vector is being mutated there and so the instance is overwritten with something else. */ AccessibilityIssue TempIssueObject(*this); +SwWrtShell* pWrtShell = TempIssueObject.m_pDoc->GetDocShell()->GetWrtShell(); + +pWrtShell->AssureStdMode(); + switch (TempIssueObject.m_eIssueObject) { case IssueObject::GRAPHIC: case IssueObject::OLE: case IssueObject::TEXTFRAME: { -SwWrtShell* pWrtShell = TempIssueObject.m_pDoc->GetDocShell()->GetWrtShell(); bool bSelected = pWrtShell->GotoFly(TempIssueObject.m_sObjectID, FLYCNTTYPE_ALL, true); // bring issue to attention @@ -121,7 +124,6 @@ void AccessibilityIssue::gotoIssue() const break; case IssueObject::SHAPE: { -SwWrtShell* pWrtShell = TempIssueObject.m_pDoc->GetDocShell()->GetWrtShell(); if (pWrtShell->IsFrameSelected()) pWrtShell->LeaveSelFrameMode(); pWrtShell->GotoDrawingObject(TempIssueObject.m_sObjectID); @@ -142,7 +144,6 @@ void AccessibilityIssue::gotoIssue() const break; case IssueObject::FORM: { -SwWrtShell* pWrtShell = TempIssueObject.m_pDoc->GetDocShell()->GetWrtShell(); bool bIsDesignMode = pWrtShell->GetView().GetFormShell()->IsDesignMode(); if (bIsDesignMode || (!bIsDesignMode && pWrtShell->WarnSwitchToDesignModeDialog())) { @@ -167,7 +168,6 @@ void AccessibilityIssue::gotoIssue() const break; case IssueObject::TABLE: { -SwWrtShell* pWrtShell = TempIssueObject.m_pDoc->GetDocShell()->GetWrtShell(); pWrtShell->GotoTable(TempIssueObject.m_sObjectID); // bring issue to attention @@ -186,11 +186,9 @@ void AccessibilityIssue::gotoIssue() const break; case IssueObject::TEXT: { -SwWrtShell* pWrtShell = TempIssueObject.m_pDoc->GetDocShell()->GetWrtShell(); SwContentNode* pContentNode = TempIssueObject.m_pNode->GetContentNode(); SwPosition aPoint(*pContentNode, TempIssueObject.m_nStart); SwPosition aMark(*pContentNode, TempIssueObject.m_nEnd); -pWrtShell->EnterStdMode(); pWrtShell->StartAllAction(); SwPaM* pPaM = pWrtShell->GetCursor(); *pPaM->GetPoint() = aPoint; @@ -207,7 +205,6 @@ void AccessibilityIssue::gotoIssue() const break; case IssueObject::FOOTENDNOTE: { -SwWrtShell* pWrtShell = TempIssueObject.m_pDoc->GetDocShell()->GetWrtShell(); if (TempIssueObject.m_pTextFootnote) { pWrtShell->GotoFootnoteAnchor(*TempIssueObject.m_pTextFootnote); @@ -235,7 +232,7 @@ void AccessibilityIssue::gotoIssue() const default: break; } -TempIssueObject.m_pDoc->GetDocShell()->GetView()->GetEditWin().GrabFocus(); +pWrtShell->GetView().GetEditWin().GrabFocus(); } bool AccessibilityIssue::canQuickFixIssue() const diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 1cd06889f4bc..9419e6ad009d 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -2383,26 +2383,7 @@ sal_uInt16 SwPostItMgr::SearchReplace(const SwFormatField , const i18nuti void SwPostItMgr::AssureStdModeAtShell() { -// deselect any drawing or frame and leave editing mode -SdrView* pSdrView = mpWrtShell->GetDrawView(); -if ( pSdrView && pSdrView->IsTextEdit() ) -{ -bool bLockView =
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/view.hxx | 16 sw/source/core/access/AccessibilityIssue.cxx | 86 ++ sw/source/uibase/uiview/view.cxx | 104 ++- 3 files changed, 205 insertions(+), 1 deletion(-) New commits: commit c603d37223d4f7c3594515fb2bbac22015bc146b Author: Jim Raykowski AuthorDate: Fri Sep 22 16:35:05 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Oct 3 06:50:02 2023 +0200 tdf#157370 Bring A11y issue to attention in the document view when issue is clicked on in the A11y sidebar Change-Id: I9122e608e88568fa2d91b6cf4616b0f61db8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157200 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index dee2363dedd9..c6add7e23364 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -32,6 +32,8 @@ #include "swtypes.hxx" #include "shellid.hxx" +#include + class SwTextFormatColl; class SwPageDesc; class SwFrameFormat; @@ -68,6 +70,7 @@ enum class SotExchangeDest; class SwCursorShell; enum class SvxSearchCmd; enum class SelectionType : sal_Int32; +class SwNode; namespace com::sun::star::view { class XSelectionSupplier; } namespace sfx2 { class FileDialogHelper; } @@ -716,6 +719,19 @@ public: virtual std::optional getLOKPayload(int nType, int nViewId) const override; bool IsHighlightCharDF() { return m_bIsHighlightCharDF; } + +private: +AutoTimer m_aBringToAttentionBlinkTimer; +size_t m_nBringToAttentionBlinkTimeOutsRemaining; + +std::unique_ptr m_xBringToAttentionOverlayObject; + +DECL_LINK(BringToAttentionBlinkTimerHdl, Timer*, void); + +public: +void BringToAttention(std::vector&& aRanges = {}); +void BringToAttention(const tools::Rectangle& rRect); +void BringToAttention(const SwNode* pNode); }; inline tools::Long SwView::GetXScroll() const diff --git a/sw/source/core/access/AccessibilityIssue.cxx b/sw/source/core/access/AccessibilityIssue.cxx index 6ec39238cda9..8056408a5b02 100644 --- a/sw/source/core/access/AccessibilityIssue.cxx +++ b/sw/source/core/access/AccessibilityIssue.cxx @@ -28,6 +28,11 @@ #include #include +#include +#include +#include +#include + namespace sw { AccessibilityIssue::AccessibilityIssue(sfx::AccessibilityIssueID eIssueID) @@ -75,6 +80,21 @@ void AccessibilityIssue::gotoIssue() const { SwWrtShell* pWrtShell = TempIssueObject.m_pDoc->GetDocShell()->GetWrtShell(); bool bSelected = pWrtShell->GotoFly(TempIssueObject.m_sObjectID, FLYCNTTYPE_ALL, true); + +// bring issue to attention +if (bSelected) +{ +if (const SwFlyFrameFormat* pFlyFormat += m_pDoc->FindFlyByName(TempIssueObject.m_sObjectID, SwNodeType::NONE)) +{ +if (SwFlyFrame* pFlyFrame += SwIterator(*pFlyFormat).First()) +{ + pWrtShell->GetView().BringToAttention(pFlyFrame->getFrameArea().SVRect()); +} +} +} + if (bSelected && pWrtShell->IsFrameSelected()) { pWrtShell->HideCursor(); @@ -82,8 +102,19 @@ void AccessibilityIssue::gotoIssue() const } if (!bSelected && TempIssueObject.m_eIssueObject == IssueObject::TEXTFRAME) +{ pWrtShell->GotoDrawingObject(TempIssueObject.m_sObjectID); +// bring issue to attention +if (SdrPage* pPage += pWrtShell->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0)) +{ +if (SdrObject* pObj = pPage->GetObjByName(TempIssueObject.m_sObjectID)) +{ + pWrtShell->GetView().BringToAttention(pObj->GetLogicRect()); +} +} +} if (comphelper::LibreOfficeKit::isActive()) pWrtShell->ShowCursor(); } @@ -94,6 +125,17 @@ void AccessibilityIssue::gotoIssue() const if (pWrtShell->IsFrameSelected()) pWrtShell->LeaveSelFrameMode(); pWrtShell->GotoDrawingObject(TempIssueObject.m_sObjectID); + +// bring issue to attention +if (SdrPage* pPage += pWrtShell->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0)) +{ +if (SdrObject* pObj = pPage->GetObjByName(TempIssueObject.m_sObjectID)) +{ + pWrtShell->GetView().BringToAttention(pObj->GetLogicRect()); +} +} + if (comphelper::LibreOfficeKit::isActive()) pWrtShell->ShowCursor(); } @@ -107,6 +149,17 @@ void AccessibilityIssue::gotoIssue() const if (!bIsDesignMode)
[Libreoffice-commits] core.git: sw/source
sw/source/core/edit/edglbldc.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 9389102ee5e6adbb0f8b10f8aee60d1899d91d27 Author: Jim Raykowski AuthorDate: Mon Sep 18 12:22:02 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Oct 3 03:29:39 2023 +0200 tdf#157315 Don't set mark after inserting a file in a Master document Removes setting a mark after inserting a file. Setting a mark here causes a selection to be made on mouse click in the document after inserting a file which probably isn't what is expected. Change-Id: I3e7597dfecb04c9b3cfba8081fa74dffcf0d78dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157032 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx index e7772379a8aa..9e71db2fd62d 100644 --- a/sw/source/core/edit/edglbldc.cxx +++ b/sw/source/core/edit/edglbldc.cxx @@ -153,7 +153,6 @@ void SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos, pMyDoc->GetIDocumentUndoRedo().StartUndo( SwUndoId::START, nullptr ); rPos.Adjust(SwNodeOffset(-1)); pMyDoc->getIDocumentContentOperations().AppendTextNode( rPos ); -pCursor->SetMark(); } InsertSection( rNew );
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx | 114 ++--- 1 file changed, 95 insertions(+), 19 deletions(-) New commits: commit 9f2b1f30c98a351ec0330db9f131d608c29a3336 Author: Jim Raykowski AuthorDate: Mon Sep 25 16:06:15 2023 -0800 Commit: Jim Raykowski CommitDate: Sat Sep 30 21:19:20 2023 +0200 tdf#152029 Improve bringing sections to attention Makes bringing nested sections to attention behave better Change-Id: I086f301b095191eac90c547b61e0cec590b03705 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157261 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 77fd3a6f5eb8..d850a21b004a 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -116,6 +116,8 @@ #include #include +#include + #define CTYPE_CNT 0 #define CTYPE_CTT 1 @@ -6052,28 +6054,102 @@ void SwContentTree::BringTypesWithFlowFramesToAttention(const std::vectorIsContentNode()) -pFrame = pNode->GetContentNode()->getLayoutFrame(m_pActiveShell->GetLayout()); -else +if (pNode->IsContentNode() || pNode->IsTableNode()) { -// section and table nodes -SwNode2Layout aTmp(*pNode, pNode->GetIndex() - 1); -pFrame = aTmp.NextFrame(); +if (pNode->IsContentNode()) +pFrame = pNode->GetContentNode()->getLayoutFrame(m_pActiveShell->GetLayout()); +else // table node +{ +SwNode2Layout aTmp(*pNode, pNode->GetIndex() - 1); +pFrame = aTmp.NextFrame(); +} +while (pFrame) +{ +const SwRect& rFrameRect = pFrame->getFrameArea(); +if (!rFrameRect.IsEmpty()) +aRanges.emplace_back(rFrameRect.Left(), bIncludeTopMargin ? rFrameRect.Top() : + rFrameRect.Top() + pFrame->GetTopMargin(), + rFrameRect.Right(), rFrameRect.Bottom()); +if (!pFrame->IsFlowFrame()) +break; +const SwFlowFrame *pFollow = SwFlowFrame::CastFlowFrame(pFrame)->GetFollow(); +if (!pFollow) +break; +pFrame = >GetFrame(); +} } -while (pFrame) +else if (pNode->IsSectionNode()) { -const SwRect& rFrameRect = pFrame->getFrameArea(); -if (!rFrameRect.IsEmpty()) -aRanges.emplace_back(rFrameRect.Left(), - bIncludeTopMargin ? rFrameRect.Top() : - rFrameRect.Top() + pFrame->GetTopMargin(), - rFrameRect.Right(), rFrameRect.Bottom()); -if (!pFrame->IsFlowFrame()) -break; -const SwFlowFrame *pFollow = SwFlowFrame::CastFlowFrame(pFrame)->GetFollow(); -if (!pFollow) -break; -pFrame = >GetFrame(); +const SwNode* pEndOfSectionNode = pNode->EndOfSectionNode(); +SwNodeIndex aIdx(*pNode); +while (() != pEndOfSectionNode) +{ +if (aIdx.GetNode().IsContentNode()) +{ +if ((pFrame = aIdx.GetNode().GetContentNode()-> + getLayoutFrame(m_pActiveShell->GetLayout( +{ +if (pFrame->IsInSct()) +pFrame = pFrame->FindSctFrame(); +if (pFrame) +{ +const SwRect& rFrameRect = pFrame->getFrameArea(); +if (!rFrameRect.IsEmpty()) +aRanges.emplace_back(rFrameRect.Left(), rFrameRect.Top(), + rFrameRect.Right(), rFrameRect.Bottom()); +} +} +++aIdx; +while (!aIdx.GetNode().IsEndNode() && !aIdx.GetNode().IsSectionNode()) +++aIdx; +continue; +} +if (!aIdx.GetNode().IsSectionNode()) +{ +++aIdx; +continue; +} +SwNode2Layout aTmp(aIdx.GetNode(), aIdx.GetNode().GetIndex() - 1); +pFrame = aTmp.NextFrame(); +if (pFrame) +{ +if (!pFrame->getFrameArea().IsEmpty()) +{ +const SwRect& rFrameRect = pFrame->getFrameArea(); +aRanges.emplace_back(rFrameRect.Left(), rFrameRect.Top(), + rFrameRect.Right(), rFrameRect.Bottom()); +
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/menu.cxx | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) New commits: commit a0955317900075371d6adb7f924af24c22f02d09 Author: Jim Raykowski AuthorDate: Fri Sep 15 21:26:32 2023 -0800 Commit: Jim Raykowski CommitDate: Wed Sep 27 07:12:30 2023 +0200 tdf#139935 Part B: Show all menu items possible/potential actions, but grey-out and deactivate, when not applicable This patch makes VCL PopupMenu respect the officecfg::Office::Common::View::Menu::DontHideDisabledEntry setting. Change-Id: I4df0de82585b602e12481ae46bc4f94c2588970d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156979 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 9a90b03ef93b..60673fbe434e 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -57,6 +57,8 @@ #include #include +#include + namespace vcl { @@ -2872,8 +2874,12 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang nMenuFlags &= ~MenuFlags::HideDisabledEntries; } else -// #102790# context menus shall never show disabled entries -nMenuFlags |= MenuFlags::HideDisabledEntries; +{ + if (officecfg::Office::Common::View::Menu::DontHideDisabledEntry::get()) + nMenuFlags &= ~MenuFlags::HideDisabledEntries; + else + nMenuFlags |= MenuFlags::HideDisabledEntries; +} sal_uInt16 nVisibleEntries = ImplGetVisibleItemCount(); if ( !nVisibleEntries )
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) New commits: commit 5e9c8d21874eea8cb5adf2ecab1905295af2308f Author: Jim Raykowski AuthorDate: Sun Sep 24 12:58:04 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Sep 26 02:47:10 2023 +0200 tdf#152029 Fix sections not brought to attention in master document SwSectionFormats::FindFormatByName doesn't seem to find section formats by name for sections of a document contained in a master document. This causes the document sections to not be brought to attention by hovering the mouse over the section entry in the Navigator. This patch makes the document sections be brought to attention by using an approach similiar to what is done to fill the sections entries in the Navigator content tree. Change-Id: I10e265d23a311440ac91d44b3185f807b205edb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157231 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index d8a6e71daa04..77fd3a6f5eb8 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5719,12 +5719,23 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) { BringBookmarksToAttention(std::vector {pCnt->GetName()}); } -else if (nType == ContentTypeId::REGION|| nType == ContentTypeId::INDEX) +else if (nType == ContentTypeId::REGION || nType == ContentTypeId::INDEX) { -const SwSectionFormats& rFormats = m_pActiveShell->GetDoc()->GetSections(); -const SwSectionFormat* pFormat = rFormats.FindFormatByName(pCnt->GetName()); -if (pFormat) - BringTypesWithFlowFramesToAttention({pFormat->GetSectionNode()}); +size_t nSectionFormatCount = m_pActiveShell->GetSectionFormatCount(); +for (size_t i = 0; i < nSectionFormatCount; ++i) +{ +const SwSectionFormat& rSectionFormat = m_pActiveShell->GetSectionFormat(i); +if (!rSectionFormat.IsInNodesArr()) +continue; +const SwSection* pSection = rSectionFormat.GetSection(); +if (!pSection) +continue; +if (pCnt->GetName() == pSection->GetSectionName()) +{ + BringTypesWithFlowFramesToAttention({rSectionFormat.GetSectionNode()}); +break; +} +} } else if (nType == ContentTypeId::URLFIELD) {
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) New commits: commit bb3a60cfdbed880e482229e0eed08b5e2e7e311b Author: Jim Raykowski AuthorDate: Wed Sep 20 22:26:36 2023 -0800 Commit: Jim Raykowski CommitDate: Fri Sep 22 11:07:51 2023 +0200 tdf#152029 Fix bringing a heading to attention brings a section to attention when the heading is the first content node in the section Change-Id: I37a8e03fc4aa7c59d82449d467279587c494b416 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157163 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 44a6413072f6..d8a6e71daa04 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -6040,8 +6040,15 @@ void SwContentTree::BringTypesWithFlowFramesToAttention(const std::vectorGetIndex() - 1); -SwFrame* pFrame = aTmp.NextFrame(); +const SwFrame* pFrame; +if (pNode->IsContentNode()) +pFrame = pNode->GetContentNode()->getLayoutFrame(m_pActiveShell->GetLayout()); +else +{ +// section and table nodes +SwNode2Layout aTmp(*pNode, pNode->GetIndex() - 1); +pFrame = aTmp.NextFrame(); +} while (pFrame) { const SwRect& rFrameRect = pFrame->getFrameArea(); @@ -6052,7 +6059,7 @@ void SwContentTree::BringTypesWithFlowFramesToAttention(const std::vectorIsFlowFrame()) break; -SwFlowFrame *pFollow = SwFlowFrame::CastFlowFrame(pFrame)->GetFollow(); +const SwFlowFrame *pFollow = SwFlowFrame::CastFlowFrame(pFrame)->GetFollow(); if (!pFollow) break; pFrame = >GetFrame();
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit b97f7b6bee733e108d8214d5387b2dc019d93d8f Author: Jim Raykowski AuthorDate: Wed Sep 20 21:50:23 2023 -0800 Commit: Jim Raykowski CommitDate: Thu Sep 21 18:00:55 2023 +0200 tdf#152029 Don't include frame area top margin in the bring table to attention overlay Change-Id: I13b8c09640dfc269330a3786b6449139f5f64661 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157131 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 8b77b9cc1449..44a6413072f6 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5700,7 +5700,7 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) { SwTable* pTable = SwTable::FindTable(pFrameFormat); if (pTable) - BringTypesWithFlowFramesToAttention({pTable->GetTableNode()}); + BringTypesWithFlowFramesToAttention({pTable->GetTableNode()}, false); } } else if (nType == ContentTypeId::FRAME || nType == ContentTypeId::GRAPHIC || @@ -5804,7 +5804,7 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) aNodesArr.push_back(pTable->GetTableNode()); } } -BringTypesWithFlowFramesToAttention(aNodesArr); +BringTypesWithFlowFramesToAttention(aNodesArr, false); } else if (nType == ContentTypeId::FRAME || nType == ContentTypeId::GRAPHIC || nType == ContentTypeId::OLE) @@ -6033,7 +6033,8 @@ void SwContentTree::BringBookmarksToAttention(const std::vector& rName } void SwContentTree::BringTypesWithFlowFramesToAttention(const std::vector& rNodes, -const bool bIncludeTopMargin){ +const bool bIncludeTopMargin) +{ std::vector aRanges; for (const auto* pNode : rNodes) {
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/glbltree.cxx |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit 91ca15e3f8ae13b22531745a634459a2d9b4596a Author: Jim Raykowski AuthorDate: Sat Sep 16 15:12:42 2023 -0800 Commit: Jim Raykowski CommitDate: Wed Sep 20 02:35:53 2023 +0200 tdf#139923 Part A: Master Navigator: Fix Insert popup menu Makes Master Navigator content tree popup menu item 'Insert' submenu items set sensitivity settings work for SalInstanceMenu. GtkInstanceMenu doesn't seem to require additional menu declarations for submenu items to be able to set sensitivity. Change-Id: Ifec28429927591f80859e3b20765c59374a64faa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156980 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 9ce80bf0f3fe..367f9a65dd2a 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -272,6 +272,7 @@ IMPL_LINK(SwGlobalTree, CommandHdl, const CommandEvent&, rCEvt, bool) { std::unique_ptr xBuilder(Application::CreateBuilder(m_xTreeView.get(), "modules/swriter/ui/mastercontextmenu.ui")); std::unique_ptr xPopup = xBuilder->weld_menu("navmenu"); +std::unique_ptr xSubPopup = xBuilder->weld_menu("insertmenu"); const MenuEnableFlags nEnableFlags = GetEnableFlags(); @@ -280,10 +281,10 @@ IMPL_LINK(SwGlobalTree, CommandHdl, const CommandEvent&, rCEvt, bool) xPopup->set_sensitive("editlink", bool(nEnableFlags & MenuEnableFlags::EditLink)); //disabling if applicable -xPopup->set_sensitive("insertindex", bool(nEnableFlags & MenuEnableFlags::InsertIdx )); -xPopup->set_sensitive("insertfile", bool(nEnableFlags & MenuEnableFlags::InsertFile)); -xPopup->set_sensitive("insertnewfile", bool(nEnableFlags & MenuEnableFlags::InsertFile)); -xPopup->set_sensitive("inserttext", bool(nEnableFlags & MenuEnableFlags::InsertText)); +xSubPopup->set_sensitive("insertindex", bool(nEnableFlags & MenuEnableFlags::InsertIdx )); +xSubPopup->set_sensitive("insertfile", bool(nEnableFlags & MenuEnableFlags::InsertFile)); +xSubPopup->set_sensitive("insertnewfile", bool(nEnableFlags & MenuEnableFlags::InsertFile)); +xSubPopup->set_sensitive("inserttext", bool(nEnableFlags & MenuEnableFlags::InsertText)); xPopup->set_sensitive("update", bool(nEnableFlags & MenuEnableFlags::Update)); xPopup->set_sensitive("insert", bool(nEnableFlags & MenuEnableFlags::InsertIdx));
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/inc/conttree.hxx |3 ++- sw/source/uibase/utlui/content.cxx | 15 +-- 2 files changed, 11 insertions(+), 7 deletions(-) New commits: commit 80a24870491385ba145757bf517c5f1cf7939017 Author: Jim Raykowski AuthorDate: Sat Sep 16 21:33:49 2023 -0800 Commit: Jim Raykowski CommitDate: Sun Sep 17 22:38:40 2023 +0200 tdf#152029 Don't include frame area top margin in the bring headings to attention overlay Change-Id: I1ddd842b01d2a134a281f97d9377a3d41b3ecb41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156981 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index ee04aeabac40..3f3483351daf 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -151,7 +151,8 @@ class SwContentTree final : public SfxListener void BringDrawingObjectsToAttention(std::vector& rDrawingObjectsArr); void BringTextFieldsToAttention(std::vector& rTextAttrsArr); void BringFootnotesToAttention(std::vector& rTextAttrsArr); -void BringTypesWithFlowFramesToAttention(const std::vector& rNodes); +void BringTypesWithFlowFramesToAttention(const std::vector& rNodes, + const bool bIncludeTopMargin = true); /** * Before any data will be deleted, the last active entry has to be found. diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index ca6a16dbe10d..8b77b9cc1449 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5690,7 +5690,8 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) if (nType == ContentTypeId::OUTLINE) { BringTypesWithFlowFramesToAttention({m_pActiveShell->GetNodes(). - GetOutLineNds()[static_cast(pCnt)->GetOutlinePos()]}); + GetOutLineNds()[static_cast(pCnt)->GetOutlinePos()]}, +/*bIncludeTopMargin*/ false); } else if (nType == ContentTypeId::TABLE) { @@ -5786,7 +5787,7 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) std::vector aNodesArr( m_pActiveShell->GetNodes().GetOutLineNds().begin(), m_pActiveShell->GetNodes().GetOutLineNds().end()); -BringTypesWithFlowFramesToAttention(aNodesArr); +BringTypesWithFlowFramesToAttention(aNodesArr, /*bIncludeTopMargin*/ false); } else if (nType == ContentTypeId::TABLE) { @@ -6031,8 +6032,8 @@ void SwContentTree::BringBookmarksToAttention(const std::vector& rName OverlayObject(std::move(aRanges)); } -void SwContentTree::BringTypesWithFlowFramesToAttention(const std::vector& rNodes) -{ +void SwContentTree::BringTypesWithFlowFramesToAttention(const std::vector& rNodes, +const bool bIncludeTopMargin){ std::vector aRanges; for (const auto* pNode : rNodes) { @@ -6044,8 +6045,10 @@ void SwContentTree::BringTypesWithFlowFramesToAttention(const std::vectorgetFrameArea(); if (!rFrameRect.IsEmpty()) -aRanges.emplace_back(rFrameRect.Left(), rFrameRect.Top(), rFrameRect.Right(), - rFrameRect.Bottom()); +aRanges.emplace_back(rFrameRect.Left(), + bIncludeTopMargin ? rFrameRect.Top() : + rFrameRect.Top() + pFrame->GetTopMargin(), + rFrameRect.Right(), rFrameRect.Bottom()); if (!pFrame->IsFlowFrame()) break; SwFlowFrame *pFollow = SwFlowFrame::CastFlowFrame(pFrame)->GetFollow();
[Libreoffice-commits] core.git: vcl/source
vcl/source/treelist/treelistbox.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit 4b2543693ed3ffb4d9f0d70f53f32127115c128d Author: Jim Raykowski AuthorDate: Sat Sep 9 21:21:03 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Sep 12 00:45:51 2023 +0200 tdf#156890 SalInstanceTreeView: Indent the entry context bitmap when the bitmap is too large to center without it touching the expand button Change-Id: If4e307ed50eff9bdebe6c377847283ae2eea9543 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156787 Tested-by: Jenkins Tested-by: Heiko Tietze Reviewed-by: Heiko Tietze Reviewed-by: Jim Raykowski diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 94d561ced049..e944214c5b88 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -1452,6 +1452,9 @@ void SvTreeListBox::SetTabs() else nStartPos += nContextWidthDIV2; AddTab( nStartPos, TABFLAGS_CONTEXTBMP ); +// add an indent if the context bitmap can't be centered without touching the expander +if (nContextBmpWidthMax > nIndent + (nNodeWidthPixel / 2)) +nStartPos += nIndent; nStartPos += nContextWidthDIV2; // right edge of context bitmap // only set a distance if there are bitmaps if( nContextBmpWidthMax ) @@ -2584,6 +2587,10 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, tools::Long nLine, vcl: SvViewDataEntry* pViewDataEntry = GetViewDataEntry( ); const bool bSeparator(rEntry.GetFlags() & SvTLEntryFlags::IS_SEPARATOR); +const auto nMaxContextBmpWidthBeforeIndentIsNeeded = +nIndent + GetExpandedNodeBmp().GetSizePixel().Width() / 2; +const bool bHasButtonsAtRoot = nWindowStyle & WB_HASBUTTONSATROOT; + const size_t nTabCount = aTabs.size(); const size_t nItemCount = rEntry.ItemCount(); size_t nCurTab = 0; @@ -2618,6 +2625,13 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, tools::Long nLine, vcl: else nX = nTabPos + pTab->CalcOffset(aSize.Width(), nNextTabPos - nTabPos); +// add an indent if the context bitmap can't be centered without touching the expander +if (nCurTab == 0 && !(nTreeFlags & SvTreeFlags::CHKBTN) && bHasButtonsAtRoot && +pTab->nFlags & SvLBoxTabFlags::ADJUST_CENTER && +!(pTab->nFlags & SvLBoxTabFlags::FORCE) && +aSize.Width() > nMaxContextBmpWidthBeforeIndentIsNeeded) +nX += nIndent; + aEntryPos.setX( nX ); aEntryPos.setY( nLine );
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/wrtsh/wrtsh1.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 10689e0f24e96781664e734fe23d109af6df77f1 Author: Jim Raykowski AuthorDate: Wed Sep 6 21:02:48 2023 -0800 Commit: Jim Raykowski CommitDate: Sat Sep 9 02:41:12 2023 +0200 Improve the HasFoldedOutlineContentSelected function Return false immediatly if there are no outline nodes in the document since then there can be no folded outline content selected. Adjust selection that includes the end of content node so that the end of content node is not included in the selection. This fixes a crash that occurs when outline folding is enabled and Master document 'Text' is deleted by using the Navigator popup menu item 'Delete'. Change-Id: I28be127566c3820b3e78834495bbb354cf2d01aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156631 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index af96916885d5..923fabb06167 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -2643,12 +2643,19 @@ bool SwWrtShell::GetAttrOutlineContentVisible(const size_t nPos) const bool SwWrtShell::HasFoldedOutlineContentSelected() const { +// No need to check for selection over folded outline content when there are no outline nodes. +if (GetDoc()->GetNodes().GetOutLineNds().empty()) +return false; for(const SwPaM& rPaM : GetCursor()->GetRingContainer()) { SwPaM aPaM(*rPaM.GetMark(), *rPaM.GetPoint()); aPaM.Normalize(); SwNodeIndex aPointIdx(aPaM.GetPoint()->GetNode()); SwNodeIndex aMarkIdx(aPaM.GetMark()->GetNode()); +// Prevent crash in the for loop below by adjusting the mark if it is set to the end of +// content node. +if (aMarkIdx.GetNode() == GetDoc()->GetNodes().GetEndOfContent()) +--aMarkIdx; if (aPointIdx == aMarkIdx) continue; // Return true if any nodes in PaM are folded outline content nodes.
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/control/charwin.cxx |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit d88779fc86385dde1215fd28b78a69eacc6b4f97 Author: Jim Raykowski AuthorDate: Thu Aug 31 10:06:21 2023 -0800 Commit: Jim Raykowski CommitDate: Fri Sep 1 00:37:22 2023 +0200 tdf#156538 follow up: Use better tooltip activation rectangle This patch corrects the tooltip only being shown when the mouse pointer is in the top third of the window when using gtk3. Change-Id: I9d705c064bc4654ed660842215ffd59edc14891b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156358 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx index 999aa2e4a95d..475583c890b0 100644 --- a/sfx2/source/control/charwin.cxx +++ b/sfx2/source/control/charwin.cxx @@ -102,10 +102,9 @@ OUString SvxCharView::GetCharInfoText() OUString SvxCharView::RequestHelp(tools::Rectangle& rHelpRect) { -OUString sCharInfoText(GetCharInfoText()); -// Gtk3 requires a help rectangle be supplied for the tooltip to display, X11 does not. -mxVirDev->GetTextBoundRect(rHelpRect, sCharInfoText); -return sCharInfoText; +// Gtk3 requires a rectangle be specified for the tooltip to display, X11 does not. +rHelpRect = tools::Rectangle(Point(), GetOutputSizePixel()); +return GetCharInfoText(); } bool SvxCharView::MouseButtonDown(const MouseEvent& rMEvt)
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 33ae7c12bbdf19b76ced472ca8aed6cf66477bbe Author: Jim Raykowski AuthorDate: Tue Aug 29 18:32:40 2023 -0800 Commit: Jim Raykowski CommitDate: Wed Aug 30 05:29:25 2023 +0200 tdf#156978 SwNavigator: fix gtk3 crash on treeview get_sensitive Change-Id: Ife866103b61940138cd044c666e0556760dcefa8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156272 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index e836bbee122b..d2c69794e9e2 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2976,7 +2976,7 @@ bool SwContentTree::HasContentChanged() // treeview from the content type member arrays if content change is detected. const SwContent* pCnt = pArrType->GetMember(j); -if (pCnt->IsInvisible() != m_xTreeView->get_sensitive(*xEntry, -1)) +if (pCnt->IsInvisible() != m_xTreeView->get_sensitive(*xEntry, 0)) return true; OUString sEntryText = m_xTreeView->get_text(*xEntry); @@ -3060,7 +3060,7 @@ bool SwContentTree::HasContentChanged() const SwContent* pCnt = pArrType->GetMember(j); -if (pCnt->IsInvisible() != m_xTreeView->get_sensitive(*xEntry, -1)) +if (pCnt->IsInvisible() != m_xTreeView->get_sensitive(*xEntry, 0)) { bContentChanged = true; break;
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx | 54 + 1 file changed, 37 insertions(+), 17 deletions(-) New commits: commit f24f352da00b3e9a57e723c83008fc5854c38227 Author: Jim Raykowski AuthorDate: Wed Aug 16 21:03:48 2023 -0800 Commit: Jim Raykowski CommitDate: Sat Aug 26 05:36:46 2023 +0200 tdf#156282 Make 'Fold/Unfold Including Sub Levels' menu items show for outline folding 'Include sub levels' mode In addition, when sub outlines are not visible in the document view, grey them out in the Navigator content tree instead of not including them. Change-Id: Icbdd254734df6c2fa95a7477a704e313b73d1cb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155881 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index bca6c625adc3..54593eead31f 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -452,7 +452,7 @@ void SwContentType::FillMemberList(bool* pbContentChanged) { SwTextNode* pNode = rOutlineNodes[i]->GetTextNode(); const sal_uInt8 nLevel = pNode->GetAttrOutlineLevel() - 1; -if (nLevel >= m_nOutlineLevel || !pNode->getLayoutFrame(m_pWrtShell->GetLayout())) +if (nLevel >= m_nOutlineLevel) continue; double nYPos = m_bAlphabeticSort ? 0 : static_cast(getYPos(*pNode)); if (nEndOfExtrasIndex >= pNode->GetIndex() && pNode->GetFlyFormat()) @@ -466,6 +466,8 @@ void SwContentType::FillMemberList(bool* pbContentChanged) aEntry = SwNavigationPI::CleanEntry(aEntry); auto pCnt(std::make_unique(this, aEntry, i, nLevel, m_pWrtShell->IsOutlineMovable(i), nYPos)); +if (!pNode->getLayoutFrame(m_pWrtShell->GetLayout())) +pCnt->SetInvisible(); m_pMember->insert(std::move(pCnt)); } @@ -1426,16 +1428,6 @@ static void lcl_SetOutlineContentEntriesSensitivities(SwContentTree* pThis, cons bool bIsRoot = lcl_IsContentType(rEntry, rContentTree); -if (const SwWrtShell* pSh = pThis->GetActiveWrtShell()) -{ -if (pSh->GetViewOptions()->IsTreatSubOutlineLevelsAsContent()) -{ -if (!bIsRoot) - rPop.set_sensitive(OUString::number(TOGGLE_OUTLINE_CONTENT_VISIBILITY), true); -return; -} -} - const SwNodes& rNodes = pThis->GetWrtShell()->GetNodes(); const SwOutlineNodes& rOutlineNodes = rNodes.GetOutLineNds(); size_t nOutlinePos = weld::GetAbsPos(rContentTree, rEntry); @@ -2945,7 +2937,7 @@ bool SwContentTree::HasContentChanged() return false; } -// root content navigation view +// single content type navigation view if(m_bIsRoot) { std::unique_ptr xRootEntry(m_xTreeView->make_iterator()); @@ -2983,8 +2975,9 @@ bool SwContentTree::HasContentChanged() // the member data in the array. The Display function will clear and recreate the // treeview from the content type member arrays if content change is detected. const SwContent* pCnt = pArrType->GetMember(j); -OUString sSubId(weld::toId(pCnt)); -m_xTreeView->set_id(*xEntry, sSubId); + +if (pCnt->IsInvisible() != m_xTreeView->get_sensitive(*xEntry, -1)) +return true; OUString sEntryText = m_xTreeView->get_text(*xEntry); if (sEntryText != pCnt->GetName() && @@ -2992,9 +2985,16 @@ bool SwContentTree::HasContentChanged() { return true; } + +// Set_id needs to be done here because FillMemberList clears the content type member +// list and refills with new data making the previously set id invalid. If there is no +// content change detected the Dispay function will not be called and the tree entry +// user data will not be set to the new content member pointer address. +OUString sSubId(weld::toId(pCnt)); +m_xTreeView->set_id(*xEntry, sSubId); } } -// all content navigation view +// all content types navigation view else { // Fill member list for each content type and check for content change. If content change @@ -3059,8 +3059,12 @@ bool SwContentTree::HasContentChanged() } const SwContent* pCnt = pArrType->GetMember(j); -OUString sSubId(weld::toId(pCnt)); -m_xTreeView->set_id(*xEntry, sSubId); + +if (pCnt->IsInvisible() != m_xTreeView->get_sensitive(*xEntry, -1)) +{ +bContentChanged = true; +break; +
[Libreoffice-commits] core.git: sd/source
sd/source/ui/dlg/sdtreelb.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 6761b79e7b48a5885adecf445f0206f141888613 Author: Jim Raykowski AuthorDate: Sat Aug 19 17:41:02 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Aug 22 19:46:29 2023 +0200 tdf#156610 tdf#139633 SdNavigator: Fix object not selected for entry that context menu is shown for, GtkInstance only Commit fdb504add8e21c137a37fde48fedb93638e8ee97 introduced a hack to make inplace editing work for the SalInstance of the treeview that, for Gtk3, breaks object selection before the entry popup menu is displayed which causes the menu item Rename... not to always work as expected. Sal doesn't notice this because the mouse pressed signal is seen when there is a popup menu handler set. Gtk3 does not fire the mouse pressed signal when a popup menu handler set. This patch makes object selection always happen before the popup menu is shown. Change-Id: I562ddf99bd15a48631170a7d70821021a4139295 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155867 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index e6e72c8884e0..63c26bc5635c 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -301,6 +301,7 @@ IMPL_LINK(SdPageObjsTLV, CommandHdl, const CommandEvent&, rCEvt, bool) if (rCEvt.GetCommand() == CommandEventId::ContextMenu) { +m_bMouseReleased = false; m_xTreeView->grab_focus(); // select clicked entry @@ -314,7 +315,9 @@ IMPL_LINK(SdPageObjsTLV, CommandHdl, const CommandEvent&, rCEvt, bool) Select(); } -return m_aPopupMenuHdl.Call(rCEvt); +bool bRet = m_aPopupMenuHdl.Call(rCEvt); +m_bMouseReleased = true; +return bRet; } return false; @@ -842,7 +845,7 @@ void SdPageObjsTLV::Select() { m_nSelectEventId = nullptr; -// hack to make inplace editing work for x11 +// m_bMouseReleased is a hack to make inplace editing work for X11 if (m_bMouseReleased) return;
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 6c149bffd798d401db0945f6f3ee8ab777020298 Author: Jim Raykowski AuthorDate: Tue Aug 15 21:05:05 2023 -0800 Commit: Jim Raykowski CommitDate: Sun Aug 20 07:44:04 2023 +0200 SwNavigator: Save some cycles by using break instead of continue When a content change is detected the Display function will clear and recreate the content tree from the content type member arrays, therefore, when a content change is detected there is no need to continue the loop here to set tree entry user data, which may have been the reason for using continue. Change-Id: Id1bc6fe6dddac54aa7299d3921c9352dc2314f79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155730 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 5238dde260b6..bca6c625adc3 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -3055,7 +3055,7 @@ bool SwContentTree::HasContentChanged() { SAL_WARN("sw.ui", "unexpected missing entry"); bContentChanged = true; -continue; +break; } const SwContent* pCnt = pArrType->GetMember(j); @@ -3067,7 +3067,7 @@ bool SwContentTree::HasContentChanged() !(sEntryText == m_sSpace && pCnt->GetName().isEmpty())) { bContentChanged = true; -continue; +break; } } }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sfx2/source
sfx2/source/sidebar/FocusManager.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit ef4ac09618a859d7399c9b27030228745a5f Author: Jim Raykowski AuthorDate: Thu Aug 3 21:26:44 2023 -0800 Commit: Adolfo Jayme Barrientos CommitDate: Wed Aug 16 13:03:37 2023 +0200 tdf#156557 Sidebar: Make Shift+Tab kb navigation behave as expected This patch makes Shift+Tab change keyboard focus to the last panel control of the previous panel when focus is currently on a panel title. It also makes Shift+Tab change keyboard focus to the Tabbar hamburger menu when focus is currently on the "Close Sidebar Deck" button. Change-Id: I3ff849655afc4f01dba2268055292eee573adf43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155333 Tested-by: Jenkins Reviewed-by: Michael Weghorn (cherry picked from commit e2db54b9bf48b79802154d5fc9460fc432ea69a0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155396 Reviewed-by: Adolfo Jayme Barrientos diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx index d0c38461b9ae..b77d30a75ba3 100644 --- a/sfx2/source/sidebar/FocusManager.cxx +++ b/sfx2/source/sidebar/FocusManager.cxx @@ -297,6 +297,11 @@ bool FocusManager::MoveFocusInsideDeckTitle ( FocusPanelContent(0); bConsumed = true; } +else if (nDirection < 0) +{ +FocusButton(0); +bConsumed = true; +} break; default: break; @@ -369,6 +374,8 @@ bool FocusManager::HandleKeyEvent( { case PC_PanelTitle: case PC_PanelToolBox: +if (rKeyCode.IsShift()) +break; MoveFocusInsidePanel(aLocation, nDirection); bConsumed = true; break;
[Libreoffice-commits] core.git: sd/source
sd/source/ui/dlg/navigatr.cxx | 14 -- sd/source/ui/dlg/sdtreelb.cxx |6 +- sd/source/ui/inc/sdtreelb.hxx |1 + 3 files changed, 18 insertions(+), 3 deletions(-) New commits: commit b363a689bf5b434113648373f98ee46aa00c09d7 Author: Jim Raykowski AuthorDate: Sat Aug 12 21:54:57 2023 -0800 Commit: Jim Raykowski CommitDate: Wed Aug 16 08:01:37 2023 +0200 tdf#156610 tdf#139633 SDNavigator: Fix object naming/renaming implementation This patch makes the Rename... menu item open the Name dialog and makes name editing start in the tree when a selected entry is left- clicked on and released without moving the mouse pointer to begin a drag operation. Change-Id: I8d8b93895b797d7e1be860a17a5c1fe6d82e474e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155647 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index ca6bc100cad9..f1a4a66c1e5f 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -264,8 +264,18 @@ IMPL_LINK(SdNavigatorWin, CommandHdl, const CommandEvent&, rCEvt, bool) void SdNavigatorWin::ExecuteContextMenuAction(std::u16string_view rSelectedPopupEntry) { -if (rSelectedPopupEntry == u"rename") -GetObjects().start_editing(); +if (rSelectedPopupEntry == u"rename" && mpBindings) +{ +weld::TreeView& rTreeView = GetObjects().get_treeview(); +std::unique_ptr xIter(rTreeView.make_iterator()); +if (rTreeView.get_selected(xIter.get())) +{ +if (rTreeView.get_iter_depth(*xIter) > 0) +mpBindings->Execute(SID_NAME_GROUP); +else +mpBindings->Execute(SID_RENAMEPAGE); +} +} } IMPL_LINK(SdNavigatorWin, SelectToolboxHdl, const OUString&, rCommand, void) diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 56e93bd7dfe0..e6e72c8884e0 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -354,6 +354,7 @@ IMPL_LINK(SdPageObjsTLV, KeyInputHdl, const KeyEvent&, rKEvt, bool) IMPL_LINK(SdPageObjsTLV, MousePressHdl, const MouseEvent&, rMEvt, bool) { +m_bMouseReleased = false; m_bEditing = false; m_bSelectionHandlerNavigates = rMEvt.GetClicks() == 1; m_bNavigationGrabsFocus = rMEvt.GetClicks() != 1; @@ -362,6 +363,7 @@ IMPL_LINK(SdPageObjsTLV, MousePressHdl, const MouseEvent&, rMEvt, bool) IMPL_LINK_NOARG(SdPageObjsTLV, MouseReleaseHdl, const MouseEvent&, bool) { +m_bMouseReleased = true; if (m_aMouseReleaseHdl.IsSet() && m_aMouseReleaseHdl.Call(MouseEvent())) return false; @@ -758,6 +760,7 @@ SdPageObjsTLV::SdPageObjsTLV(std::unique_ptr xTreeView) m_xTreeView->set_size_request(m_xTreeView->get_approximate_digit_width() * 28, m_xTreeView->get_text_height() * 8); +m_xTreeView->set_column_editables({true}); } IMPL_LINK(SdPageObjsTLV, EditEntryAgain, void*, p, void) @@ -839,7 +842,8 @@ void SdPageObjsTLV::Select() { m_nSelectEventId = nullptr; -if (IsEditingActive()) +// hack to make inplace editing work for x11 +if (m_bMouseReleased) return; m_bLinkableSelected = true; diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx index 38255a66e16f..712a6ebf3860 100644 --- a/sd/source/ui/inc/sdtreelb.hxx +++ b/sd/source/ui/inc/sdtreelb.hxx @@ -102,6 +102,7 @@ private: */ bool m_bNavigationGrabsFocus; +bool m_bMouseReleased = true; // hack for x11 inplace editing bool m_bEditing = false; SelectionMode m_eSelectionMode;
[Libreoffice-commits] core.git: include/sfx2 sfx2/inc sfx2/source sfx2/uiconfig solenv/sanitizers
include/sfx2/charwin.hxx |7 sfx2/inc/charmapcontrol.hxx|3 sfx2/source/control/charmapcontrol.cxx | 22 + sfx2/source/control/charwin.cxx| 39 +++ sfx2/uiconfig/ui/charmapcontrol.ui | 370 + solenv/sanitizers/ui/sfx.suppr |1 6 files changed, 260 insertions(+), 182 deletions(-) New commits: commit 717fa28e88f382ad86b2be2fdbc24f4f60bc524d Author: Jim Raykowski AuthorDate: Fri Aug 4 21:27:15 2023 -0800 Commit: Jim Raykowski CommitDate: Wed Aug 16 07:50:25 2023 +0200 tdf#156538 Enhancement to show character information in the insert special characters control This patch makes a tooltip show when the mouse pointer is over a character window in the special characters control. It also adds a label that is used to display character information of the highlighted character. Code for creating the character information text shown in the tooltip and label was referenced from SvxCharacterMap. Change-Id: I4b62e63b27310cbe9e9661ff51c2db206e9e3507 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155547 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/include/sfx2/charwin.hxx b/include/sfx2/charwin.hxx index d0a8f86d2e51..75a6fad12a38 100644 --- a/include/sfx2/charwin.hxx +++ b/include/sfx2/charwin.hxx @@ -35,6 +35,7 @@ private: boolmaHasInsert; OUStringm_sText; +Link maFocusInHdl; Link maMouseClickHdl; Link maClearClickHdl; Link maClearAllClickHdl; @@ -44,6 +45,7 @@ private: virtual bool MouseButtonDown(const MouseEvent&) override; virtual void GetFocus() override; virtual void LoseFocus() override; +virtual OUString RequestHelp(tools::Rectangle) override; virtual bool KeyInput(const KeyEvent&) override; virtual bool Command(const CommandEvent&) override; virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; @@ -54,6 +56,7 @@ public: vcl::Font const & GetFont() const { return maFont; } voidSetText( const OUString& rText ); OUString const & GetText() const { return m_sText; } +OUString GetCharInfoText(); voidSetHasInsert( bool bInsert ); voidInsertCharToDoc(); @@ -61,6 +64,7 @@ public: Sizeget_preferred_size() const { return GetDrawingArea()->get_preferred_size(); } +void setFocusInHdl(const Link ); void setMouseClickHdl(const Link ); void setClearClickHdl(const Link ); void setClearAllClickHdl(const Link ); @@ -96,7 +100,8 @@ public: voidinit(bool bHasInsert, const Link , const Link , - const Link ); + const Link , + const Link = Link()); voidgetFavCharacterList(); voidupdateFavCharControl(); diff --git a/sfx2/inc/charmapcontrol.hxx b/sfx2/inc/charmapcontrol.hxx index c6045154583e..72f0328da2af 100644 --- a/sfx2/inc/charmapcontrol.hxx +++ b/sfx2/inc/charmapcontrol.hxx @@ -45,9 +45,12 @@ private: std::unique_ptr m_xRecentLabel; std::unique_ptr m_xDlgBtn; +std::unique_ptr m_xCharInfoLabel; +DECL_LINK(CharFocusInHdl, SvxCharView*, void); DECL_LINK(CharClickHdl, SvxCharView*, void); DECL_LINK(OpenDlgHdl, weld::Button&, void); +DECL_LINK(DlgBtnFocusInHdl, weld::Widget&, void); DECL_LINK(UpdateRecentHdl, void*, void); }; diff --git a/sfx2/source/control/charmapcontrol.cxx b/sfx2/source/control/charmapcontrol.cxx index c71dbc8bb402..76e37174fd49 100644 --- a/sfx2/source/control/charmapcontrol.cxx +++ b/sfx2/source/control/charmapcontrol.cxx @@ -105,7 +105,8 @@ SfxCharmapContainer::SfxCharmapContainer(weld::Builder& rBuilder, const VclPtr , const Link& rUpdateFavHdl, - const Link& rUpdateRecentHdl) + const Link& rUpdateRecentHdl, + const Link ) { m_aUpdateFavHdl = rUpdateFavHdl; m_aUpdateRecentHdl = rUpdateRecentHdl; @@ -118,10 +119,12 @@ void SfxCharmapContainer::init(bool bHasInsert, const Link for(int i = 0; i < 16; i++) { m_aRecentCharView[i].SetHasInsert(bHasInsert); +m_aRecentCharView[i].setFocusInHdl(rFocusInHdl); m_aRecentCharView[i].setMouseClickHdl(rMouseClickHdl); m_aRecentCharView[i].setClearClickHdl(LINK(this, SfxCharmapContainer, RecentClearClickHdl)); m_aRecentCharView[i].setClearAllClickHdl(LINK(this, SfxCharmapContainer, RecentClearAllClickHdl)); m_aFavCharView[i].SetHasInsert(bHasInsert); +m_aFavCharView[i].setFocusInHdl(rFocusInHdl); m_aFavCharView[i].setMouseClickHdl(rMouseClickHdl); m_aFavCharView[i].setClearClickHdl(LINK(this, SfxCharmapContainer, FavClearClickHdl));
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/sidebar/FocusManager.cxx | 42 --- 1 file changed, 29 insertions(+), 13 deletions(-) New commits: commit 383e68da6c429c243c1e7be6699acaa942b712bc Author: Jim Raykowski AuthorDate: Mon Aug 7 21:20:04 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Aug 8 21:21:03 2023 +0200 tdf#125797 Sidebar: Skip over disabled tabbar tabs This patch makes keyboard navigation of the sidebar tabbar skip over disabled tabs. Tabs become disabled when a document is set in read- only mode. They can also be disabled by user customization of the tabbar. Change-Id: Iafabfe27fbeaea60acf66527eafbb5396edaf647 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155442 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx index ee03a52a3c17..74a3a1ef0ff3 100644 --- a/sfx2/source/sidebar/FocusManager.cxx +++ b/sfx2/source/sidebar/FocusManager.cxx @@ -380,9 +380,19 @@ bool FocusManager::HandleKeyEvent( case PC_DeckToolBox: { -// Moves to the first deck activation button that is visible -sal_Int32 nIndex(1); -while(!maButtons[nIndex]->get_visible() && ++nIndex > 0); +// Moves to the first deck activation button that is visible and sensitive +sal_Int32 nIndex(0); +sal_Int32 nButtons(maButtons.size()); +if (nButtons > 1) +{ +nIndex = 1; +// Finds the next visible button that is sensitive +while((!maButtons[nIndex]->get_visible() || + !maButtons[nIndex]->get_sensitive()) && ++nIndex < nButtons); +// Wrap to the menu button when going past the last button +if (nIndex >= nButtons) +nIndex = 0; +} FocusButton(nIndex); bConsumed = true; } @@ -420,9 +430,10 @@ bool FocusManager::HandleKeyEvent( FocusDeckTitle(); else { -// Focus the last button. +// Set focus to the last visible sensitive button. sal_Int32 nIndex(maButtons.size()-1); -while(!maButtons[nIndex]->get_visible() && --nIndex > 0); +while((!maButtons[nIndex]->get_visible() || + !maButtons[nIndex]->get_sensitive()) && --nIndex > 0); FocusButton(nIndex); } bConsumed = true; @@ -439,8 +450,9 @@ bool FocusManager::HandleKeyEvent( else nIndex = aLocation.mnIndex - 1; -// Finds the previous visible button -while(!maButtons[nIndex]->get_visible() && --nIndex > 0); +// Finds the previous visible sensitive button +while((!maButtons[nIndex]->get_visible() || + !maButtons[nIndex]->get_sensitive()) && --nIndex > 0); FocusButton(nIndex); bConsumed = true; } @@ -470,14 +482,18 @@ bool FocusManager::HandleKeyEvent( if (rKeyCode.GetCode() == KEY_RIGHT) break; -sal_Int32 nIndex; -if (o3tl::make_unsigned(aLocation.mnIndex) >= maButtons.size() - 1) +sal_Int32 nButtons(maButtons.size()); + +sal_Int32 nIndex = aLocation.mnIndex + 1; +if (nIndex >= nButtons) nIndex = 0; -else -nIndex = aLocation.mnIndex + 1; -// Finds the next visible button -while(!maButtons[nIndex]->get_visible() && ++nIndex > 0); +// Finds the next visible sensitive button +while((!maButtons[nIndex]->get_visible() || + !maButtons[nIndex]->get_sensitive()) && ++nIndex < nButtons); +// Wrap to the menu button when going past the last button +if (nIndex >= nButtons) +nIndex = 0; FocusButton(nIndex); bConsumed = true; }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/sidebar/FocusManager.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit e2db54b9bf48b79802154d5fc9460fc432ea69a0 Author: Jim Raykowski AuthorDate: Thu Aug 3 21:26:44 2023 -0800 Commit: Jim Raykowski CommitDate: Fri Aug 4 18:24:16 2023 +0200 tdf#156557 Sidebar: Make Shift+Tab kb navigation behave as expected This patch makes Shift+Tab change keyboard focus to the last panel control of the previous panel when focus is currently on a panel title. It also makes Shift+Tab change keyboard focus to the Tabbar hamburger menu when focus is currently on the "Close Sidebar Deck" button. Change-Id: I3ff849655afc4f01dba2268055292eee573adf43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155333 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx index d0c38461b9ae..b77d30a75ba3 100644 --- a/sfx2/source/sidebar/FocusManager.cxx +++ b/sfx2/source/sidebar/FocusManager.cxx @@ -297,6 +297,11 @@ bool FocusManager::MoveFocusInsideDeckTitle ( FocusPanelContent(0); bConsumed = true; } +else if (nDirection < 0) +{ +FocusButton(0); +bConsumed = true; +} break; default: break; @@ -369,6 +374,8 @@ bool FocusManager::HandleKeyEvent( { case PC_PanelTitle: case PC_PanelToolBox: +if (rKeyCode.IsShift()) +break; MoveFocusInsidePanel(aLocation, nDirection); bConsumed = true; break;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - svx/source
svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx |9 - 1 file changed, 8 insertions(+), 1 deletion(-) New commits: commit 617558caec55960183c19ec8bedd701a674c8984 Author: Jim Raykowski AuthorDate: Wed Jul 19 21:35:16 2023 -0800 Commit: Xisco Fauli CommitDate: Tue Aug 1 17:19:11 2023 +0200 tdf#154038 tdf#83618 fix wrong line spacing value Impress and Writer seem to require different MapUnit values for fixed line spacing metric values to be correctly calculated. This patch initially sets the MapUnit unit value to Map100thMM, which is what it was before commit 849b837d1a3b185a8dd893a8f6eaed53605bcab1, which works for Impress. For Writer, the value is set to MapTwip. Change-Id: I49e9b80aa4d3fbda1f19101903d2a4459089024c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154665 Tested-by: Jenkins Reviewed-by: Jim Raykowski (cherry picked from commit efbdd13f96888ae06717afafb1e4014ce502aa3e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155170 Reviewed-by: Xisco Fauli diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index fee659817a14..4c756a5b1224 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -32,6 +32,8 @@ #include +#include + #define DEFAULT_LINE_SPACING 200 #define FIX_DIST_DEF 283 #define LINESPACE_1 100 @@ -134,7 +136,12 @@ void ParaLineSpacingControl::Initialize() if( bItemStateSet && (eState == SfxItemState::DEFAULT || eState == SfxItemState::SET) ) { const SvxLineSpacingItem* currSPItem = pItem; -MapUnit eUnit = pCurrent->GetPool().GetMetric(currSPItem->Which()); +// It seems draw/impress and writer require different MapUnit values for fixed line spacing +// metric values to be correctly calculated. +MapUnit eUnit = MapUnit::Map100thMM; // works for draw/impress +if (vcl::CommandInfoProvider::GetModuleIdentifier(pCurrent->GetFrame().GetFrameInterface()) +== "com.sun.star.text.TextDocument") +eUnit = MapUnit::MapTwip; // works for writer meLNSpaceUnit = eUnit; switch( currSPItem->GetLineSpaceRule() )
[Libreoffice-commits] core.git: svx/source
svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx |9 - 1 file changed, 8 insertions(+), 1 deletion(-) New commits: commit efbdd13f96888ae06717afafb1e4014ce502aa3e Author: Jim Raykowski AuthorDate: Wed Jul 19 21:35:16 2023 -0800 Commit: Jim Raykowski CommitDate: Sun Jul 23 20:27:05 2023 +0200 tdf#154038 tdf#83618 fix wrong line spacing value Impress and Writer seem to require different MapUnit values for fixed line spacing metric values to be correctly calculated. This patch initially sets the MapUnit unit value to Map100thMM, which is what it was before commit 849b837d1a3b185a8dd893a8f6eaed53605bcab1, which works for Impress. For Writer, the value is set to MapTwip. Change-Id: I49e9b80aa4d3fbda1f19101903d2a4459089024c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154665 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index fee659817a14..4c756a5b1224 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -32,6 +32,8 @@ #include +#include + #define DEFAULT_LINE_SPACING 200 #define FIX_DIST_DEF 283 #define LINESPACE_1 100 @@ -134,7 +136,12 @@ void ParaLineSpacingControl::Initialize() if( bItemStateSet && (eState == SfxItemState::DEFAULT || eState == SfxItemState::SET) ) { const SvxLineSpacingItem* currSPItem = pItem; -MapUnit eUnit = pCurrent->GetPool().GetMetric(currSPItem->Which()); +// It seems draw/impress and writer require different MapUnit values for fixed line spacing +// metric values to be correctly calculated. +MapUnit eUnit = MapUnit::Map100thMM; // works for draw/impress +if (vcl::CommandInfoProvider::GetModuleIdentifier(pCurrent->GetFrame().GetFrameInterface()) +== "com.sun.star.text.TextDocument") +eUnit = MapUnit::MapTwip; // works for writer meLNSpaceUnit = eUnit; switch( currSPItem->GetLineSpaceRule() )
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/dochdl/swdtflvr.cxx |9 +++-- sw/source/uibase/docvw/edtdd.cxx |4 +--- sw/source/uibase/inc/navicont.hxx|2 +- sw/source/uibase/utlui/content.cxx |4 +++- 4 files changed, 12 insertions(+), 7 deletions(-) New commits: commit c6b404c39569b6bc972b821a13f6bba0a68d8d9d Author: Jim Raykowski AuthorDate: Sun Jul 16 22:22:18 2023 -0800 Commit: Jim Raykowski CommitDate: Sun Jul 23 06:48:13 2023 +0200 tdf#156111 SwNavigator hyperlink dnd enhancement Enhancement to use the selected document text dropped on as the hyperlink name for hyperlinks created by drag-and-drop from the Navigator. Change-Id: I6c458b24574cae28ab390644b8a3e1982675c4c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154508 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 201b7fa1b5d2..0974a424e921 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -1724,7 +1724,12 @@ bool SwTransferable::PasteData( TransferableDataHelper& rData, if( pPt ) { // external Drop -if( bPasteSelection ? !pMod->m_pXSelection : !pMod->m_pDragDrop ) +if ((bPasteSelection ? !pMod->m_pXSelection : !pMod->m_pDragDrop) && +// The following condition is used for tdf#156111 to prevent a selection from being +// cleared by the default case of the nDestination switch. +!(rSh.GetCursorCnt() == 1 && rSh.TestCurrPam(*pPt) && +nDestination == SotExchangeDest::SWDOC_FREE_AREA && +nFormat == SotClipboardFormatId::SONLK)) { switch( nDestination ) { @@ -1929,7 +1934,7 @@ bool SwTransferable::PasteData( TransferableDataHelper& rData, if( pPt ) { NaviContentBookmark aBkmk; -if( aBkmk.Paste( rData ) ) +if (aBkmk.Paste(rData, rSh.GetSelText())) { if(bIsDefault) { diff --git a/sw/source/uibase/docvw/edtdd.cxx b/sw/source/uibase/docvw/edtdd.cxx index bf23cc24391e..287d2969f632 100644 --- a/sw/source/uibase/docvw/edtdd.cxx +++ b/sw/source/uibase/docvw/edtdd.cxx @@ -260,9 +260,7 @@ SotExchangeDest SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject * { SwWrtShell = m_rView.GetWrtShell(); const Point aDocPt( PixelToLogic( rPixPnt ) ); -if( rSh.TestCurrPam( aDocPt ) -|| rSh.IsOverReadOnlyPos( aDocPt ) -|| rSh.DocPtInsideInputField( aDocPt ) ) +if (rSh.IsOverReadOnlyPos(aDocPt) || rSh.DocPtInsideInputField(aDocPt)) return SotExchangeDest::NONE; SdrObject *pObj = nullptr; diff --git a/sw/source/uibase/inc/navicont.hxx b/sw/source/uibase/inc/navicont.hxx index f8c81ae3dcef..604c1c982c76 100644 --- a/sw/source/uibase/inc/navicont.hxx +++ b/sw/source/uibase/inc/navicont.hxx @@ -48,7 +48,7 @@ public: const OUString& GetDescription() const { return m_aDescription; } RegionMode GetDefaultDragType() const { return m_nDefaultDrag; } voidCopy( TransferDataContainer& rData ) const; -boolPaste( const TransferableDataHelper& rData ); +boolPaste( const TransferableDataHelper& rData, const OUString& rsDesc ); }; #endif diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index c2af6a16304d..a57df3fd0630 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5553,7 +5553,7 @@ void NaviContentBookmark::Copy( TransferDataContainer& rData ) const rData.CopyByteString(SotClipboardFormatId::SONLK, sStrBuf); } -bool NaviContentBookmark::Paste( const TransferableDataHelper& rData ) +bool NaviContentBookmark::Paste( const TransferableDataHelper& rData, const OUString& rsDesc ) { OUString sStr; bool bRet = rData.GetString( SotClipboardFormatId::SONLK, sStr ); @@ -5564,6 +5564,8 @@ bool NaviContentBookmark::Paste( const TransferableDataHelper& rData ) m_aDescription = sStr.getToken(0, NAVI_BOOKMARK_DELIM, nPos ); m_nDefaultDrag= static_cast( o3tl::toInt32(o3tl::getToken(sStr, 0, NAVI_BOOKMARK_DELIM, nPos )) ); m_nDocSh = o3tl::toInt32(o3tl::getToken(sStr, 0, NAVI_BOOKMARK_DELIM, nPos )); +if (!rsDesc.isEmpty()) +m_aDescription = rsDesc; } return bRet; }
[Libreoffice-commits] core.git: sw/inc
sw/inc/strings.hrc |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit de586d8bb1ee72f25729b86cac61e7ddf5839f08 Author: Jim Raykowski AuthorDate: Sun Jul 16 23:04:00 2023 -0800 Commit: Jim Raykowski CommitDate: Thu Jul 20 19:13:52 2023 +0200 tdf#141102 related: Improve names of menu items used to fold and unfold outline content including sub level outline content Change-Id: I686b3acdec910a7b6ae11b498eea3e4c01b6ada8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154558 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 16df1a234e3c..185bc5d89661 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -693,8 +693,8 @@ #define STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY NC_("STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY", "Click to toggle outline folding") #define STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY_EXT NC_("STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY_EXT", "right-click to include sub levels") #define STR_OUTLINE_CONTENT_VISIBILITY_TOGGLE NC_("STR_OUTLINE_CONTENT_VISIBILITY_TOGGLE", "Toggle") -#define STR_OUTLINE_CONTENT_VISIBILITY_SHOW_ALL NC_("STR_OUTLINE_CONTENT_VISIBILITY_SHOW_ALL", "Unfold All") -#define STR_OUTLINE_CONTENT_VISIBILITY_HIDE_ALL NC_("STR_OUTLINE_CONTENT_VISIBILITY_HIDE_ALL", "Fold All") +#define STR_OUTLINE_CONTENT_VISIBILITY_SHOW_ALL NC_("STR_OUTLINE_CONTENT_VISIBILITY_SHOW_ALL", "Unfold Including Sub Levels") +#define STR_OUTLINE_CONTENT_VISIBILITY_HIDE_ALL NC_("STR_OUTLINE_CONTENT_VISIBILITY_HIDE_ALL", "Fold Including Sub Levels") #define STR_OUTLINE_LEVELS_SHOWN_TITLE NC_("STR_OUTLINE_LEVELS_SHOWN_TITLE", "Show Up to Outline Level") #define STR_OUTLINE_LEVELS_SHOWN_SPIN_LABEL NC_("STR_OUTLINE_LEVELS_SHOWN_SPIN_LABEL", "Level (1–10):") #define STR_OUTLINE_LEVELS_SHOWN_HELP_LABEL NC_("STR_OUTLINE_LEVELS_SHOWN_HELP_LABEL", "Enter maximum outline level allowed for a displayed heading.")
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 2 commits - sw/source
sw/source/uibase/utlui/content.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 3813aa6c8306fce85bb9b9d090ee48766ae87653 Author: Jim Raykowski AuthorDate: Sat Jul 1 19:52:43 2023 -0800 Commit: Xisco Fauli CommitDate: Tue Jul 4 21:07:27 2023 +0200 tdf#156112 SwNavigator: Disallow footnote and endnote dnd Change-Id: I892f8a34f43629f3e76aa187299dc8c805b72545 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153855 Tested-by: Jenkins Reviewed-by: Jim Raykowski (cherry picked from commit 4f9294ec702a82765c04c8652dddec4dda1e6075) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153891 Reviewed-by: Xisco Fauli diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 6f02872cda43..c2af6a16304d 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2752,6 +2752,8 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, case ContentTypeId::INDEX: case ContentTypeId::REFERENCE : case ContentTypeId::TEXTFIELD: +case ContentTypeId::FOOTNOTE: +case ContentTypeId::ENDNOTE: // cannot be inserted, neither as URL nor as section break; case ContentTypeId::URLFIELD: commit 7d5870ba7a505db8251a34448a11643eae14936e Author: Jim Raykowski AuthorDate: Sun Jul 2 21:02:56 2023 -0800 Commit: Xisco Fauli CommitDate: Tue Jul 4 21:07:19 2023 +0200 tdf#156128 Make drawing object hyperlinks created by dnd from Navigator functional Change-Id: Ic12f3c43c079865e31c3bb89d9f277d3567d8c01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153887 Tested-by: Jenkins Reviewed-by: Jim Raykowski (cherry picked from commit c4515f6be4a0ec923d85fd6b4c85bfaafb0b26ae) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153924 Reviewed-by: Xisco Fauli diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 1284dc7a0d0e..6f02872cda43 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -394,6 +394,7 @@ SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 m_bEdit = true; break; case ContentTypeId::DRAWOBJECT: +m_sTypeToken = "drawingobject"; m_bEdit = true; break; default: break;
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit c4515f6be4a0ec923d85fd6b4c85bfaafb0b26ae Author: Jim Raykowski AuthorDate: Sun Jul 2 21:02:56 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Jul 4 06:42:12 2023 +0200 tdf#156128 Make drawing object hyperlinks created by dnd from Navigator functional Change-Id: Ic12f3c43c079865e31c3bb89d9f277d3567d8c01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153887 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 4d134a0c947c..c2af6a16304d 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -394,6 +394,7 @@ SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 m_bEdit = true; break; case ContentTypeId::DRAWOBJECT: +m_sTypeToken = "drawingobject"; m_bEdit = true; break; default: break;
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 4f9294ec702a82765c04c8652dddec4dda1e6075 Author: Jim Raykowski AuthorDate: Sat Jul 1 19:52:43 2023 -0800 Commit: Jim Raykowski CommitDate: Sun Jul 2 22:46:48 2023 +0200 tdf#156112 SwNavigator: Disallow footnote and endnote dnd Change-Id: I892f8a34f43629f3e76aa187299dc8c805b72545 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153855 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 1284dc7a0d0e..4d134a0c947c 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2751,6 +2751,8 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, case ContentTypeId::INDEX: case ContentTypeId::REFERENCE : case ContentTypeId::TEXTFIELD: +case ContentTypeId::FOOTNOTE: +case ContentTypeId::ENDNOTE: // cannot be inserted, neither as URL nor as section break; case ContentTypeId::URLFIELD:
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sd/source
sd/source/ui/dlg/sdtreelb.cxx | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) New commits: commit 2ce4de98f4d0226e8f7e43f8cd1b5f4b4901c230 Author: Jim Raykowski AuthorDate: Sat Jun 10 17:16:29 2023 -0800 Commit: Xisco Fauli CommitDate: Thu Jun 15 08:56:16 2023 +0200 SdNavigator: Improve unique name detection Commit ace75043781b5fe36546ec75574a14617f4feb30 added the ability to rename page and object names from the Navigator. An approach that searches entry names in the tree was used to check for unique naming. This does not guarantee uniquess as the name may already be used for an object in another view, for example, Notes view. This patch guarantees name uniqueness by checking the document model to see if an object with the name already exists. Change-Id: Iad419420d6010b94380c55b7dc71a8d4abbec784 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152843 Tested-by: Jenkins Reviewed-by: Jim Raykowski (cherry picked from commit ec60d354359067f8c5c686ef2239ee705916de43) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153018 Reviewed-by: Xisco Fauli diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 45b078df0cb0..56e93bd7dfe0 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -783,27 +783,9 @@ IMPL_LINK(SdPageObjsTLV, EditedEntryHdl, const IterString&, rIterString, bool) return true; // If the new name is empty or not unique, start editing again. -bool bUniqueName = true; -std::unique_ptr xEntry(m_xTreeView->make_iterator()); -if (!rIterString.second.isEmpty()) -{ -if (m_xTreeView->get_iter_first(*xEntry)) -{ -do -{ -// skip self! -if (m_xTreeView->iter_compare(*xEntry, rIterString.first) != 0 && -m_xTreeView->get_text(*xEntry) == rIterString.second) -{ -bUniqueName = false; -break; -} -} while(m_xTreeView->iter_next(*xEntry)); -} -} -if (rIterString.second.isEmpty() || !bUniqueName) +if (rIterString.second.isEmpty() || m_pDoc->GetObj(rIterString.second)) { -m_xTreeView->copy_iterator(rIterString.first, *xEntry); +std::unique_ptr xEntry(m_xTreeView->make_iterator()); Application::PostUserEvent(LINK(this, SdPageObjsTLV, EditEntryAgain), xEntry.release()); return false; }
[Libreoffice-commits] core.git: sd/source
sd/source/ui/dlg/sdtreelb.cxx | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) New commits: commit ec60d354359067f8c5c686ef2239ee705916de43 Author: Jim Raykowski AuthorDate: Sat Jun 10 17:16:29 2023 -0800 Commit: Jim Raykowski CommitDate: Wed Jun 14 03:54:21 2023 +0200 SdNavigator: Improve unique name detection Commit ace75043781b5fe36546ec75574a14617f4feb30 added the ability to rename page and object names from the Navigator. An approach that searches entry names in the tree was used to check for unique naming. This does not guarantee uniquess as the name may already be used for an object in another view, for example, Notes view. This patch guarantees name uniqueness by checking the document model to see if an object with the name already exists. Change-Id: Iad419420d6010b94380c55b7dc71a8d4abbec784 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152843 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 45b078df0cb0..56e93bd7dfe0 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -783,27 +783,9 @@ IMPL_LINK(SdPageObjsTLV, EditedEntryHdl, const IterString&, rIterString, bool) return true; // If the new name is empty or not unique, start editing again. -bool bUniqueName = true; -std::unique_ptr xEntry(m_xTreeView->make_iterator()); -if (!rIterString.second.isEmpty()) -{ -if (m_xTreeView->get_iter_first(*xEntry)) -{ -do -{ -// skip self! -if (m_xTreeView->iter_compare(*xEntry, rIterString.first) != 0 && -m_xTreeView->get_text(*xEntry) == rIterString.second) -{ -bUniqueName = false; -break; -} -} while(m_xTreeView->iter_next(*xEntry)); -} -} -if (rIterString.second.isEmpty() || !bUniqueName) +if (rIterString.second.isEmpty() || m_pDoc->GetObj(rIterString.second)) { -m_xTreeView->copy_iterator(rIterString.first, *xEntry); +std::unique_ptr xEntry(m_xTreeView->make_iterator()); Application::PostUserEvent(LINK(this, SdPageObjsTLV, EditEntryAgain), xEntry.release()); return false; }