core.git: cui/source
cui/source/customize/acccfg.cxx | 12 cui/source/inc/acccfg.hxx |2 -- 2 files changed, 14 deletions(-) New commits: commit 60a77c7ef46f6fa82b016c7605ec3451de291344 Author: Jim Raykowski AuthorDate: Mon Nov 4 17:49:37 2024 -0900 Commit: Jim Raykowski CommitDate: Tue Nov 5 19:48:12 2024 +0100 Resolves tdf#163770 BASIC Macro dialog Assign should select the macro name in Function list box in the Customize dialog Keyboard tab In SfxAcceleratorConfigPage Reset, RadioHdl is called just before m_xGroupLBox->SelectMacro. In RadioHdl an idle timer is started whos handler gets fired after m_xGroupLBox->SelectMacro is called in Reset. This makes the selection made in the functions list box by m_xGroupLBox->SelectMacro in Reset get bonked by the call to m_xGroupLBox->GroupSelected in SelectHdl called from the idle timer handler. m_xGroupLBox->GroupSelected always selects the first function in the function list box. This patch fixes this selection bonk by calling SelectHdl directly from RadioHdl instead of calling SelectHdl from an idle timer handler. Change-Id: I15d26d4611948d61e0a258e9a350d8c952b2b211 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176038 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 04924b9a8f57..a83cc24e520e 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -863,7 +863,6 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage(weld::Container* pPage, , aFilterCfgStr(CuiResId(RID_CUISTR_FILTERNAME_CFG)) , m_bStylesInfoInitialized(false) , m_aUpdateDataTimer("SfxAcceleratorConfigPage UpdateDataTimer") -, m_aFillGroupIdle("SfxAcceleratorConfigPage m_aFillGroupIdle") , m_xEntriesBox(m_xBuilder->weld_tree_view(u"shortcuts"_ustr)) , m_xOfficeButton(m_xBuilder->weld_radio_button(u"office"_ustr)) , m_xModuleButton(m_xBuilder->weld_radio_button(u"module"_ustr)) @@ -933,15 +932,10 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage(weld::Container* pPage, m_aUpdateDataTimer.SetInvokeHandler(LINK(this, SfxAcceleratorConfigPage, ImplUpdateDataHdl)); m_aUpdateDataTimer.SetTimeout(EDIT_UPDATEDATA_TIMEOUT); - -m_aFillGroupIdle.SetInvokeHandler(LINK(this, SfxAcceleratorConfigPage, TimeOut_Impl)); -m_aFillGroupIdle.SetPriority(TaskPriority::HIGHEST); } SfxAcceleratorConfigPage::~SfxAcceleratorConfigPage() { -m_aFillGroupIdle.Stop(); - // free memory - remove all dynamic user data for (int i = 0, nCount = m_xEntriesBox->n_children(); i < nCount; ++i) { @@ -1310,15 +1304,9 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, RadioHdl, weld::Toggleable&, void) if (m_xEntriesBox->n_children()) m_xEntriesBox->select(0); -m_aFillGroupIdle.Start(); -} - -IMPL_LINK_NOARG(SfxAcceleratorConfigPage, TimeOut_Impl, Timer*, void) -{ // activating the selection, typically "all commands", can take a long time // -> show wait cursor and disable input weld::WaitObject aWaitObject(GetFrameWeld()); - weld::TreeView& rTreeView = m_xGroupLBox->get_widget(); SelectHdl(rTreeView); } diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx index e9207d5a1add..32e4b7602d8b 100644 --- a/cui/source/inc/acccfg.hxx +++ b/cui/source/inc/acccfg.hxx @@ -105,8 +105,6 @@ private: Timer m_aUpdateDataTimer; i18nutil::SearchOptions2 m_options; -Idle m_aFillGroupIdle; - std::unique_ptr m_xEntriesBox; std::unique_ptr m_xOfficeButton; std::unique_ptr m_xModuleButton;
core.git: basic/source
basic/source/uno/namecont.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 8816296c12c8f75db97ab548d73c1318b98a Author: Jim Raykowski AuthorDate: Fri Oct 18 12:02:25 2024 -0800 Commit: Andreas Heinisch CommitDate: Mon Oct 21 14:09:32 2024 +0200 Resolves tdf#163515 - Basic Macro Organizer: After renaming a document macro library the original library also remains Change-Id: Ife89e1e164d288702d30e6b79f5e703ab9467e4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175182 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 90014a790dc5..a554edb9d8c6 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -2611,9 +2611,6 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU bMovedSuccessful = true; pImplLib->implSetModified( true ); -// Remove old library from container -maNameContainer->removeByName( Name ); -maModifiable.setModified( true ); } } catch(const Exception& ) @@ -2627,7 +2624,10 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU } if( bMovedSuccessful ) { - maNameContainer->insertByName( NewName, aLibAny ) ; +// Remove the old library from the container and insert it back with the new name +maNameContainer->removeByName(Name); +maNameContainer->insertByName(NewName, aLibAny); +maModifiable.setModified(true); } }
core.git: sw/source
sw/source/uibase/utlui/content.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 5cf912b08e4a22f66ab1ec5fa601ba3e50e3c4cc Author: Jim Raykowski AuthorDate: Tue Oct 15 20:55:33 2024 -0800 Commit: Jim Raykowski CommitDate: Wed Oct 16 20:58:11 2024 +0200 Resolves: tdf#163448 An unsaved new document don't allow moving headings with Content Navigation View option (by drag and drop) Change-Id: Id1f4cbc0538e75abfb2a133d2d6fb82ddaf580fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174986 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 331a4b4f308f..828c295d77a0 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1267,6 +1267,8 @@ IMPL_LINK(SwContentTree, DragBeginHdl, bool&, rUnsetDragIcon, bool) continue; m_aDndOutlinesSelected.push_back(pOutlineContent->GetOutlinePos()); } while (m_xTreeView->iter_next_sibling(*xEntry) && m_xTreeView->is_selected(*xEntry)); + +bDisallow = false; } rtl::Reference xContainer = new TransferDataContainer;
core.git: Branch 'libreoffice-24-8' - sw/source
sw/source/uibase/inc/conttree.hxx |2 +- sw/source/uibase/utlui/content.cxx | 22 ++ 2 files changed, 11 insertions(+), 13 deletions(-) New commits: commit f7b102bc705d3bd98f7d2efa52c24eb6e2573642 Author: Jim Raykowski AuthorDate: Mon Oct 14 12:22:05 2024 -0800 Commit: Adolfo Jayme Barrientos CommitDate: Tue Oct 15 19:29:56 2024 +0200 tdf#163191 Fix crash when dragging headings in Writer navigator by keeping track of the selected entry positions in SwOutlineNodes instead of iterators in the content tree. Change-Id: Iad0a477d6e3b25a1d602e3f827f2590c441eb236 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174912 Reviewed-by: Patrick Luby Reviewed-by: Jim Raykowski Tested-by: Jenkins (cherry picked from commit dfeefe2e97a5412a445a3a508acb2d9ae05138e5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174942 Reviewed-by: Adolfo Jayme Barrientos diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index d58123287e07..add857b4f84b 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -131,7 +131,7 @@ class SwContentTree final : public SfxListener boolm_bViewHasChanged :1; // outline root mode drag & drop -std::vector> m_aDndOutlinesSelected; +std::vector m_aDndOutlinesSelected; bool m_bDocHasChanged = true; bool m_bIgnoreDocChange = false; // used to prevent tracking update diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 07878125f241..52ef6d0967af 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1250,24 +1250,22 @@ IMPL_LINK(SwContentTree, DragBeginHdl, bool&, rUnsetDragIcon, bool) // Only move drag entry and continuous selected siblings: m_aDndOutlinesSelected.clear(); -std::unique_ptr xScratch(m_xTreeView->make_iterator()); +std::unique_ptr xScratch(m_xTreeView->make_iterator(xEntry.get())); // Find first selected of continuous siblings -while (true) +while (m_xTreeView->iter_previous_sibling(*xScratch) && m_xTreeView->is_selected(*xScratch)) { -m_xTreeView->copy_iterator(*xEntry, *xScratch); -if (!m_xTreeView->iter_previous_sibling(*xScratch)) -break; -if (!m_xTreeView->is_selected(*xScratch)) -break; m_xTreeView->copy_iterator(*xScratch, *xEntry); } // Record continuous selected siblings do { - m_aDndOutlinesSelected.push_back(m_xTreeView->make_iterator(xEntry.get())); -} -while (m_xTreeView->iter_next_sibling(*xEntry) && m_xTreeView->is_selected(*xEntry)); +SwOutlineContent* pOutlineContent += weld::fromId(m_xTreeView->get_id(*xEntry)); +if (!pOutlineContent) // shouldn't happen +continue; +m_aDndOutlinesSelected.push_back(pOutlineContent->GetOutlinePos()); +} while (m_xTreeView->iter_next_sibling(*xEntry) && m_xTreeView->is_selected(*xEntry)); } rtl::Reference xContainer = new TransferDataContainer; @@ -4653,9 +4651,9 @@ void SwContentTree::MoveOutline(SwOutlineNodes::size_type nTargetPos) bool bFirstMove = true; -for (const auto& source : m_aDndOutlinesSelected) +for (const SwOutlineNodes::size_type& nPos : m_aDndOutlinesSelected) { -SwOutlineNodes::size_type nSourcePos = weld::fromId(m_xTreeView->get_id(*source))->GetOutlinePos(); +SwOutlineNodes::size_type nSourcePos = nPos; // Done on the first selection move if (bFirstMove) // only do once
core.git: sw/source
sw/source/uibase/inc/conttree.hxx |2 +- sw/source/uibase/utlui/content.cxx | 22 ++ 2 files changed, 11 insertions(+), 13 deletions(-) New commits: commit dfeefe2e97a5412a445a3a508acb2d9ae05138e5 Author: Jim Raykowski AuthorDate: Mon Oct 14 12:22:05 2024 -0800 Commit: Jim Raykowski CommitDate: Tue Oct 15 03:54:06 2024 +0200 tdf#163191 Fix crash when dragging headings in Writer navigator by keeping track of the selected entry positions in SwOutlineNodes instead of iterators in the content tree. Change-Id: Iad0a477d6e3b25a1d602e3f827f2590c441eb236 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174912 Reviewed-by: Patrick Luby Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index a06ef17c1bdf..4a732f4e56ca 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -133,7 +133,7 @@ class SwContentTree final : public SfxListener boolm_bViewHasChanged :1; // outline root mode drag & drop -std::vector> m_aDndOutlinesSelected; +std::vector m_aDndOutlinesSelected; bool m_bDocHasChanged = true; bool m_bIgnoreDocChange = false; // used to prevent tracking update diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 1694f0e0e75b..331a4b4f308f 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1251,24 +1251,22 @@ IMPL_LINK(SwContentTree, DragBeginHdl, bool&, rUnsetDragIcon, bool) // Only move drag entry and continuous selected siblings: m_aDndOutlinesSelected.clear(); -std::unique_ptr xScratch(m_xTreeView->make_iterator()); +std::unique_ptr xScratch(m_xTreeView->make_iterator(xEntry.get())); // Find first selected of continuous siblings -while (true) +while (m_xTreeView->iter_previous_sibling(*xScratch) && m_xTreeView->is_selected(*xScratch)) { -m_xTreeView->copy_iterator(*xEntry, *xScratch); -if (!m_xTreeView->iter_previous_sibling(*xScratch)) -break; -if (!m_xTreeView->is_selected(*xScratch)) -break; m_xTreeView->copy_iterator(*xScratch, *xEntry); } // Record continuous selected siblings do { - m_aDndOutlinesSelected.push_back(m_xTreeView->make_iterator(xEntry.get())); -} -while (m_xTreeView->iter_next_sibling(*xEntry) && m_xTreeView->is_selected(*xEntry)); +SwOutlineContent* pOutlineContent += weld::fromId(m_xTreeView->get_id(*xEntry)); +if (!pOutlineContent) // shouldn't happen +continue; +m_aDndOutlinesSelected.push_back(pOutlineContent->GetOutlinePos()); +} while (m_xTreeView->iter_next_sibling(*xEntry) && m_xTreeView->is_selected(*xEntry)); } rtl::Reference xContainer = new TransferDataContainer; @@ -5022,9 +5020,9 @@ void SwContentTree::MoveOutline(SwOutlineNodes::size_type nTargetPos) bool bFirstMove = true; -for (const auto& source : m_aDndOutlinesSelected) +for (const SwOutlineNodes::size_type& nPos : m_aDndOutlinesSelected) { -SwOutlineNodes::size_type nSourcePos = weld::fromId(m_xTreeView->get_id(*source))->GetOutlinePos(); +SwOutlineNodes::size_type nSourcePos = nPos; // Done on the first selection move if (bFirstMove) // only do once
core.git: sw/source
sw/source/uibase/utlui/content.cxx |1 + sw/source/uibase/utlui/navipi.cxx |1 + 2 files changed, 2 insertions(+) New commits: commit c69b16a0f859d71a101e2c138887e7975ec71e2a Author: Jim Raykowski AuthorDate: Mon Oct 14 08:47:17 2024 -0800 Commit: Jim Raykowski CommitDate: Mon Oct 14 22:34:17 2024 +0200 Resolves tdf#163411 NAVIGATOR: In Content Navigation View buttons to move heading disappear after first use Change-Id: I816ff3a7e5016d6316b63c49e5620617fe5a068f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174907 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 5b7416b9bbcf..1694f0e0e75b 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -4104,6 +4104,7 @@ void SwContentTree::ExecCommand(std::u16string_view rCmd, bool bOutlineWithChild return false; }); } +UpdateContentFunctionsToolbar(); } else { diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 8fcb96144228..f11c31fbe531 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -679,6 +679,7 @@ void SwNavigationPI::UpdateContentFunctionsToolbar() eContentTypeId = pContentType->GetType(); if (eContentTypeId == ContentTypeId::OUTLINE) { +// todo: make buttons sensitive to movability (think position and protection) m_xHeadingsContentFunctionsToolbar->show(); } else if (m_xContentTree->IsSelectedEntryCurrentDocCursorPosition(*xEntry))
core.git: sw/inc sw/source
sw/inc/strings.hrc| 31 +++- sw/source/uibase/utlui/navipi.cxx | 72 +++--- 2 files changed, 88 insertions(+), 15 deletions(-) New commits: commit 9f95e65730b273643d79d9a32cd11a8d5a40464c Author: Jim Raykowski AuthorDate: Fri Jul 19 22:04:12 2024 -0800 Commit: Adolfo Jayme Barrientos CommitDate: Wed Oct 9 07:27:16 2024 +0200 Resolves tdf#161919 Two programatically composed UI strings not suitable for localization Change-Id: I20a914d9d158817b7c9605afc1972a91117fb5a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170789 Reviewed-by: Adolfo Jayme Barrientos Tested-by: Jenkins diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 1bc9271c860e..ae2b24845615 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -722,8 +722,35 @@ #define STR_NEW_FILENC_("STR_NEW_FILE", "New Document") #define STR_INSERT_TEXT NC_("STR_INSERT_TEXT", "Text") #define STR_DELETE NC_("STR_DELETE", "Delete") -#define STR_DELETE_CONTENT_TYPE NC_("STR_DELETE_CONTENT_TYPE", "Delete All %1") -#define STR_DELETE_CONTENT NC_("STR_DELETE_CONTENT", "Delete %1") +#define STR_DELETE_ALL_TABLES NC_("STR_DELETE_ALL_TABLES", "Delete All Tables") +#define STR_DELETE_ALL_FRAMES NC_("STR_DELETE_ALL_FRAMES", "Delete All Frames") +#define STR_DELETE_ALL_GRAPHIC NC_("STR_DELETE_ALL_GRAPHIC", "Delete All Images") +#define STR_DELETE_ALL_OLE_OBJECTS NC_("STR_DELETE_ALL_OLE_OBJECTS", "Delete All OLE Objects") +#define STR_DELETE_ALL_BOOKMARKS NC_("STR_DELETE_ALL_BOOKMARKS", "Delete All Bookmarks") +#define STR_DELETE_ALL_REGIONS NC_("STR_DELETE_ALL_REGIONS", "Delete All Sections") +#define STR_DELETE_ALL_URLFIELDS NC_("STR_DELETE_ALL_URLFIELDS", "Delete All Hyperlinks") +#define STR_DELETE_ALL_REFERENCES NC_("STR_DELETE_ALL_REFERENCES", "Delete All References") +#define STR_DELETE_ALL_INDEXES NC_("STR_DELETE_ALL_INDEXES", "Delete All Indexes") +#define STR_DELETE_ALL_POSTITS NC_("STR_DELETE_ALL_POSTITS", "Delete All Comments") +#define STR_DELETE_ALL_DRAWOBJECTS NC_("STR_DELETE_ALL_DRAWOBJECTS", "Delete All Drawing Objects") +#define STR_DELETE_ALL_TEXTFIELDS NC_("STR_DELETE_ALL_TEXTFIELDS", "Delete All Fields") +#define STR_DELETE_ALL_FOOTNOTES NC_("STR_DELETE_ALL_FOOTNOTES", "Delete All Footnotes") +#define STR_DELETE_ALL_ENDNOTES NC_("STR_DELETE_ALL_ENDNOTES", "Delete All Endnotes") +#define STR_DELETE_OUTLINE NC_("STR_DELETE_OUTLINE", "Delete Heading") +#define STR_DELETE_TABLENC_("STR_DELETE_TABLE", "Delete Table") +#define STR_DELETE_FRAMENC_("STR_DELETE_FRAME", "Delete Frame") +#define STR_DELETE_GRAPHIC NC_("STR_DELETE_GRAPHIC", "Delete Image") +#define STR_DELETE_OLE_OBJECT NC_("STR_DELETE_OLE_OBJECT", "Delete OLE Object") +#define STR_DELETE_BOOKMARK NC_("STR_DELETE_BOOKMARK", "Delete Bookmark") +#define STR_DELETE_REGION NC_("STR_DELETE_REGION", "Delete Section") +#define STR_DELETE_URLFIELD NC_("STR_DELETE_URLFIELD", "Delete Hyperlink") +#define STR_DELETE_REFERENCENC_("STR_DELETE_REFERENCE", "Delete Reference") +#define STR_DELETE_INDEXNC_("STR_DELETE_INDEX", "Delete Index") +#define STR_DELETE_POSTIT NC_("STR_DELETE_POSTIT", "Delete Comment") +#define STR_DELETE_DRAWOBJECT NC_("STR_DELETE_DRAWOBJECT", "Delete Drawing Object") +#define STR_DELETE_TEXTFIELDNC_("STR_DELETE_TEXTFIELD", "Delete Field") +#define STR_DELETE_FOOTNOTE NC_("STR_DELETE_FOOTNOTE", "Delete Footnote") +#define STR_DELETE_ENDNOTE NC_("STR_DELETE_ENDNOTE", "Delete Endnote") #define STR_DELETE_ENTRYNC_("STR_DELETE_ENTRY", "~Delete") #define STR_UPDATE_SEL NC_("STR_UPDATE_SEL", "Selection") #define STR_UPDATE_INDEXNC_("STR_UPDATE_INDEX", "Indexes") diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index b2bd8684a1dd..8fcb96144228 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -649,7 +649,7 @@ void SwNavigationPI::UpdateContentFunctionsToolbar() return; bool bUseDeleteFunctionsToolbar = true; -OUString aContentTypeName; // used in creation of delete button tooltip +ContentTypeId eContentTypeId = ContentTypeId::UNKNOWN; const bool bContentType = weld::fromId(rTreeView.get_id(*xEntry))->G
core.git: sw/source
sw/source/uibase/docvw/AnnotationWin2.cxx |2 ++ sw/source/uibase/utlui/content.cxx| 12 2 files changed, 14 insertions(+) New commits: commit 6573d0ed5479fd543303e82ec23195bdc101ceb4 Author: Jim Raykowski AuthorDate: Mon Sep 23 07:16:39 2024 -0800 Commit: Jim Raykowski CommitDate: Wed Sep 25 07:05:46 2024 +0200 Resolves tdf#152297 Track comments in the Navigator also by focus inside the comment box Change-Id: I7ced30c606d89a11012e21bfce18939b7660f038 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173824 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index f786c1f038f5..437ee6baa220 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -991,6 +991,8 @@ void SwAnnotationWin::ActivatePostIt() //ctrl+tab cycles between text and button so we don't waste time searching //thousands of SwAnnotationWins SetStyle(GetStyle() | WB_DIALOGCONTROL); + + mrView.GetDocShell()->Broadcast(SfxHint(SfxHintId::SwNavigatorUpdateTracking)); } void SwAnnotationWin::DeactivatePostIt() diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index b2571a7a68ff..5b7416b9bbcf 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -4499,6 +4499,18 @@ void SwContentTree::UpdateTracking() lcl_SelectByContentTypeAndAddress(this, *m_xTreeView, eCntTypeId, pField); return; } +if (SwPostItMgr* pPostItMgr = m_pActiveShell->GetPostItMgr(); +pPostItMgr && pPostItMgr->HasActiveAnnotationWin() +&& !(m_bIsRoot && m_nRootType != ContentTypeId::POSTIT)) +{ +if (mTrackContentType[ContentTypeId::POSTIT]) +{ +if (const SwField* pField = pPostItMgr->GetActiveSidebarWin()->GetPostItField()) +lcl_SelectByContentTypeAndAddress(this, *m_xTreeView, ContentTypeId::POSTIT, + pField); +} +return; +} // table if (m_pActiveShell->IsCursorInTable() && !(m_bIsRoot && m_nRootType != ContentTypeId::TABLE))
core.git: sw/inc sw/source
sw/inc/strings.hrc |1 + sw/source/uibase/sidebar/QuickFindPanel.cxx |8 2 files changed, 9 insertions(+) New commits: commit d5b76e32f99738301c253840ff089cfc830874dc Author: Jim Raykowski AuthorDate: Mon Sep 23 18:25:17 2024 -0800 Commit: Jim Raykowski CommitDate: Tue Sep 24 18:56:01 2024 +0200 tdf#163100 Need more FIND details This enhancement patch for the quick find panel makes the document order index of the match entry selected in the finds list be shown in the found times label at the bottom of the panel. For example, selecting the 6th entry in the finds list for a search that has 25 matches will display "Match 6 of 25 matches." Change-Id: Iea39e754b0cd75d3ca446781a4b8d2e8651e7d08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173835 Reviewed-by: Vernon, Stuart Foote Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 96ed8bab484d..6e7e81c383bc 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -1399,6 +1399,7 @@ #define STR_EDIT_FOOTNOTE NC_("STR_EDIT_FOOTNOTE", "Edit Footnote/Endnote") #define STR_NB_REPLACED NC_("STR_NB_REPLACED", "Search key replaced XX times.") #define STR_SEARCH_KEY_FOUND_TIMES NNC_("STR_SEARCH_KEY_FOUND_TIMES", "One match found.", "%1 matches found.") +#define STR_SEARCH_KEY_FOUND_XOFN NNC_("STR_SEARCH_KEY_FOUND_XOFN", "Match one of one match found.", "Match %1 of %2 matches found.") #define STR_SRCVIEW_ROW NC_("STR_SRCVIEW_ROW", "Row ") #define STR_SRCVIEW_COL NC_("STR_SRCVIEW_COL", "Column ") #define STR_SAVEAS_SRC NC_("STR_SAVEAS_SRC", "~Export source...") diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx b/sw/source/uibase/sidebar/QuickFindPanel.cxx index 483d6415d121..016878aa2521 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.cxx +++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx @@ -378,6 +378,14 @@ IMPL_LINK_NOARG(QuickFindPanel, SearchFindsListSelectionChangedHandler, weld::Tr } m_pWrtShell->EndAction(); +// tdf#163100 Need more FIND details +// Set the found times label to show "Match X of N matches found." +auto nSearchFindFoundTimes = m_vPaMs.size(); +OUString sText = SwResId(STR_SEARCH_KEY_FOUND_XOFN, nSearchFindFoundTimes); +sText = sText.replaceFirst("%1", OUString::number(sId.toUInt32() + 1)); +sText = sText.replaceFirst("%2", OUString::number(nSearchFindFoundTimes)); +m_xSearchFindFoundTimesLabel->set_label(sText); + SwShellCursor* pShellCursor = m_pWrtShell->GetCursor_(); std::vector vRanges; for (const SwRect& rRect : *pShellCursor)
core.git: sw/source
sw/source/uibase/uiview/viewmdi.cxx | 12 1 file changed, 12 deletions(-) New commits: commit d925bfdb152e47772d1b3436f73c3193b3023c29 Author: Jim Raykowski AuthorDate: Mon Sep 16 22:15:30 2024 -0800 Commit: Jim Raykowski CommitDate: Tue Sep 17 19:49:35 2024 +0200 Resolves tdf#152440 BOOK VIEW: Switching page view to book view or from book view results in a switch to a semi-random page Change-Id: I2e3e63430fb2ed04d2f71cf2e716844b85f440f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173510 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index e1bbb2fe6094..f211396116d7 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -222,12 +222,6 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType, void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly ) { -const bool bUnLockView = !m_pWrtShell->IsViewLocked(); -m_pWrtShell->LockView( true ); -m_pWrtShell->LockPaint(LockPaintReason::ViewLayout); - -{ - SwActContext aActContext(m_pWrtShell.get()); if ( !GetViewFrame().GetFrame().IsInPlace() && !bViewOnly ) @@ -260,12 +254,6 @@ void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly m_pVRuler->ForceUpdate(); m_pHRuler->ForceUpdate(); -} - -m_pWrtShell->UnlockPaint(); -if( bUnLockView ) -m_pWrtShell->LockView( false ); - SfxBindings& rBnd = GetViewFrame().GetBindings(); rBnd.Invalidate( SID_ATTR_VIEWLAYOUT ); rBnd.Invalidate( SID_ATTR_ZOOMSLIDER);
core.git: sw/source
sw/source/uibase/app/docst.cxx | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) New commits: commit fb39ae1bc7e4b1cbfc3108efca52ec310faf7363 Author: Jim Raykowski AuthorDate: Thu Sep 12 22:54:43 2024 -0800 Commit: Jim Raykowski CommitDate: Sat Sep 14 01:04:31 2024 +0200 Resolves tdf#133041 New list style is not added back after undoing and then redoing it by following the approach used by commit c4d82fc21c5e155472f6a30244b3fce806ada85c Change-Id: I09c877aecdcf49d4be5451e247bf1010856c2d39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173312 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 21184a6168a2..eba940a48dfc 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -824,10 +824,10 @@ void SwDocShell::Edit( else nMask = SfxStyleSearchBits::UserDefined; -if ( nFamily == SfxStyleFamily::Para || nFamily == SfxStyleFamily::Char || nFamily == SfxStyleFamily::Frame ) +if (nFamily == SfxStyleFamily::Para || nFamily == SfxStyleFamily::Char +|| nFamily == SfxStyleFamily::Frame || nFamily == SfxStyleFamily::Pseudo) { -// Prevent undo append from being done during paragraph, character, and frame style Make -// Do it after ok return from style dialog when derived from style is known +// Do Make undo append after an OK return from the style dialog below ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo()); pStyle = &m_xBasePool->Make( rName, nFamily, nMask ); } @@ -1055,6 +1055,16 @@ void SwDocShell::Edit( } } break; +case SfxStyleFamily::Pseudo: +{ +if (GetDoc()->GetIDocumentUndoRedo().DoesUndo()) +{ +GetDoc()->GetIDocumentUndoRedo().AppendUndo( + std::make_unique(xTmp->GetNumRule(), + *GetDoc())); +} +} +break; default: break; }
core.git: basctl/source
basctl/source/basicide/moduldl2.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit e589ea5eb50dcc1a6894084df3cdaa02060835b9 Author: Jim Raykowski AuthorDate: Wed Aug 28 19:17:27 2024 -0800 Commit: Jim Raykowski CommitDate: Mon Sep 2 19:45:52 2024 +0200 Fix Basic Macro Organizer library list after import of library with Insert as reference (read-only) option checked The last entry in the list always shows the link location of the just imported library. This will only be correct if the imported library is alphabetically the last entry in the list. Change-Id: I03472dc75582e92b87923faf96d14615b8adecf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172561 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index c59eff1706a9..d8b24af7f9e3 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -902,7 +902,9 @@ void LibPage::InsertLib() } // insert listbox entry +m_xLibBox->make_unsorted(); ImpInsertLibEntry( aLibName, m_xLibBox->n_children() ); +m_xLibBox->make_sorted(); m_xLibBox->set_cursor( m_xLibBox->find_text(aLibName) ); bChanges = true; }
core.git: include/sfx2 sw/inc sw/source
include/sfx2/weldutils.hxx |4 +++- sw/inc/view.hxx |2 ++ sw/source/uibase/sidebar/QuickFindPanel.cxx | 21 + sw/source/uibase/sidebar/QuickFindPanel.hxx |1 + 4 files changed, 27 insertions(+), 1 deletion(-) New commits: commit 9f79c01035fb5851bcba1f8fc646437be84f7194 Author: Jim Raykowski AuthorDate: Sun Aug 25 12:50:41 2024 -0800 Commit: Jim Raykowski CommitDate: Mon Sep 2 19:45:00 2024 +0200 Related: tdf#162580 When upgrading from Find toolbar search to advanced Find and Replace search dialog, inherit (pre-fill) search field's term from current value of find bar's focused search entry Makes the Writer quick find panel behave as such. Change-Id: I2164f443d6ef120d86b001499f67795eaeaf224d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172375 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/include/sfx2/weldutils.hxx b/include/sfx2/weldutils.hxx index 8ed6671a66b0..571d8c237c20 100644 --- a/include/sfx2/weldutils.hxx +++ b/include/sfx2/weldutils.hxx @@ -37,7 +37,7 @@ private: weld::Builder* m_pBuilder; bool m_bSideBar; -DECL_DLLPRIVATE_LINK(SelectHdl, const OUString&, void); +DECL_LINK(SelectHdl, const OUString&, void); DECL_DLLPRIVATE_LINK(ToggleMenuHdl, const OUString&, void); DECL_DLLPRIVATE_LINK(ChangedIconSizeHandler, LinkParamNone*, void); @@ -61,6 +61,8 @@ public: void dispose(); ~ToolbarUnoDispatcher(); + +void Select(const OUString& rCommand) { SelectHdl(rCommand); } }; #endif diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index 64ad634276a4..9d096d9171d8 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -671,6 +671,8 @@ public: SAL_DLLPRIVATE virtual std::unique_ptr CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet) override; static SvxSearchItem* GetSearchItem() { return s_pSrchItem; } +static void SetSearchItem(SvxSearchItem* pSearchItem) { s_pSrchItem = pSearchItem; } + /// See SfxViewShell::getPart(). int getPart() const override; /// See SfxViewShell::dumpAsXml(). diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx b/sw/source/uibase/sidebar/QuickFindPanel.cxx index 0df67a256742..483d6415d121 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.cxx +++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx @@ -130,6 +130,9 @@ QuickFindPanel::QuickFindPanel(weld::Widget* pParent, const uno::Referenceconnect_clicked( LINK(this, QuickFindPanel, SearchOptionsToolbarClickedHandler)); +m_xFindAndReplaceToolbar->connect_clicked( +LINK(this, QuickFindPanel, FindAndReplaceToolbarClickedHandler)); + m_xSearchFindsList->connect_custom_get_size( LINK(this, QuickFindPanel, SearchFindsListCustomGetSizeHandler)); m_xSearchFindsList->connect_custom_render(LINK(this, QuickFindPanel, SearchFindsListRender)); @@ -174,6 +177,24 @@ IMPL_LINK_NOARG(QuickFindPanel, SearchOptionsToolbarClickedHandler, const OUStri } } +// tdf#162580 related: When upgrading from Find toolbar search to advanced Find and Replace +// search dialog, inherit (pre-fill) search field's term from current value of find bar's +// focused search entry +IMPL_LINK(QuickFindPanel, FindAndReplaceToolbarClickedHandler, const OUString&, rCommand, void) +{ +if (!SwView::GetSearchDialog()) +{ +SvxSearchItem* pSearchItem = SwView::GetSearchItem(); +if (!pSearchItem) +{ +pSearchItem = new SvxSearchItem(SID_SEARCH_ITEM); +SwView::SetSearchItem(pSearchItem); +} +pSearchItem->SetSearchString(m_xSearchFindEntry->get_text()); +} +m_xFindAndReplaceToolbarDispatch->Select(rCommand); +} + QuickFindPanel::~QuickFindPanel() { m_xSearchFindEntry.reset(); diff --git a/sw/source/uibase/sidebar/QuickFindPanel.hxx b/sw/source/uibase/sidebar/QuickFindPanel.hxx index 10d3664832cb..2875229bb9c2 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.hxx +++ b/sw/source/uibase/sidebar/QuickFindPanel.hxx @@ -80,6 +80,7 @@ private: DECL_LINK(SearchFindsListRowActivatedHandler, weld::TreeView&, bool); DECL_LINK(SearchFindsListMousePressHandler, const MouseEvent&, bool); DECL_LINK(SearchOptionsToolbarClickedHandler, const OUString&, void); +DECL_LINK(FindAndReplaceToolbarClickedHandler, const OUString&, void); void FillSearchFindsList(); };
core.git: basctl/source basctl/uiconfig vcl/source
basctl/source/basicide/moduldl2.cxx|2 ++ basctl/uiconfig/basicide/ui/libpage.ui | 12 +++- vcl/source/app/salvtables.cxx |3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) New commits: commit 41ad19c719decfdce1f26359277db6bb2836 Author: Jim Raykowski AuthorDate: Wed Aug 28 17:54:34 2024 -0800 Commit: Jim Raykowski CommitDate: Fri Aug 30 06:54:47 2024 +0200 Resolves: tdf#146800 Linked libraries don't show shource path in Macro Organizer for VCL plugins that use SalInstanceTreeView Change-Id: Ide1ea8a14e956836573e8a3aacd2b289d76616ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172560 Reviewed-by: Caolán McNamara Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 386e26b31733..c59eff1706a9 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -1229,6 +1229,8 @@ void LibPage::SetCurLib() if (nEntry_ == -1 && m_xLibBox->n_children()) nEntry_ = 0; m_xLibBox->set_cursor(nEntry_); + +m_xLibBox->columns_autosize(); } void LibPage::ImpInsertLibEntry( const OUString& rLibName, int nPos ) diff --git a/basctl/uiconfig/basicide/ui/libpage.ui b/basctl/uiconfig/basicide/ui/libpage.ui index 61f98ca36986..7cb16fc6a4c1 100644 --- a/basctl/uiconfig/basicide/ui/libpage.ui +++ b/basctl/uiconfig/basicide/ui/libpage.ui @@ -112,17 +112,18 @@ True True liststore1 -False +False 1 -True +False - + 6 +Name - + 0 @@ -138,8 +139,9 @@ - + 6 +Location diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 7e18d15c470e..d3b4152738ab 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3910,7 +3910,8 @@ void SalInstanceTreeView::columns_autosize() if (aWidths.size() > 2) { std::vector aColWidths; -for (size_t i = 1; i < aWidths.size() - 1; ++i) +aColWidths.push_back(aWidths[1] + aWidths[0]); +for (size_t i = 2; i < aWidths.size() - 1; ++i) aColWidths.push_back(aWidths[i] - aWidths[i - 1]); set_column_fixed_widths(aColWidths); }
core.git: sfx2/source
sfx2/source/sidebar/TabBar.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit d80363beb10fd43045913bb4b54268b1df26737a Author: Jim Raykowski AuthorDate: Mon Aug 26 16:47:03 2024 -0800 Commit: Jim Raykowski CommitDate: Tue Aug 27 07:06:20 2024 +0200 Resolves: tdf#120748 Using the mouse wheel to change tabs in the sidebar tabbar leaves the key input focus in a control that is not visible Change-Id: I9d0b85607b660e3059c6cd528528d773bc3b8ef3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172449 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx index 9ce9778a711b..eb495f58578b 100644 --- a/sfx2/source/sidebar/TabBar.cxx +++ b/sfx2/source/sidebar/TabBar.cxx @@ -218,6 +218,7 @@ bool TabBar::EventNotify(NotifyEvent& rEvent) try { (*pItem)->maDeckActivationFunctor((*pItem)->msDeckId); +GrabFocusToDocument(); } catch(const css::uno::Exception&) {}; return true;
core.git: sw/qa sw/source
sw/qa/uitest/writer_tests/trackedChanges.py |7 +-- sw/source/uibase/inc/redlndlg.hxx |2 + sw/source/uibase/misc/redlndlg.cxx | 54 +++- 3 files changed, 34 insertions(+), 29 deletions(-) New commits: commit 7ae0542f7208573b18dadb0dee550f34ce8e41f4 Author: Jim Raykowski AuthorDate: Sat Aug 3 12:57:22 2024 -0800 Commit: Jim Raykowski CommitDate: Mon Aug 26 01:04:57 2024 +0200 resolves: tdf#162337 Initial selection of tracked change when Manage Changes dialog is initially opened Restores behavior of tracked change selection in the document and tree entry selection in the Manage Changes dialog on opening to that of commit d9466e9e09f8aa618f722d9d7bef7469aa51dc14 with the exception that the tracked change selected when the cursor is after the last tracked change in the document is now wrapped to the first tracked change in the document, see commit 8e6203bd8f4390698f83a74a04f901437a9a61a3. Change-Id: Ic1be06bb99787393d7962bd19fc791959408956e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171451 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/qa/uitest/writer_tests/trackedChanges.py b/sw/qa/uitest/writer_tests/trackedChanges.py index d013be0343e3..a256889a8a8b 100644 --- a/sw/qa/uitest/writer_tests/trackedChanges.py +++ b/sw/qa/uitest/writer_tests/trackedChanges.py @@ -279,7 +279,9 @@ class trackedchanges(UITestCase): self.assertEqual(3, len(tables)) # goto to the start of the document to reject from the first tracked table row change -self.xUITest.executeCommand(".uno:GoToStartOfDoc") +self.xUITest.executeCommand(".uno:GoToStartOfDoc") # start of cell +self.xUITest.executeCommand(".uno:GoToStartOfDoc") # start of table +self.xUITest.executeCommand(".uno:GoToStartOfDoc") # start of document # Reject with self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges", close_button="close") as xTrackDlg: @@ -291,9 +293,6 @@ class trackedchanges(UITestCase): changesList.getChild(0).executeAction("SELECT", tuple()) -# jump to the parent to allow rejecting the table change -changesList.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) - # Without the fix in place, it would have crashed here for i in (3, 2, 1, 0): xAccBtn = xTrackDlg.getChild("reject") diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx index ef8c0cd8dce3..e38fd83f68b3 100644 --- a/sw/source/uibase/inc/redlndlg.hxx +++ b/sw/source/uibase/inc/redlndlg.hxx @@ -85,6 +85,8 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg final : public SfxListener SvxTPView* m_pTPView; SvxRedlinTable* m_pTable; // PB 2006/02/02 #i48648 now SvHeaderTabListBox +bool m_bInitialSelect = true; + DECL_DLLPRIVATE_LINK(SortByComboBoxChangedHdl, SvxTPView*, void); DECL_DLLPRIVATE_LINK( AcceptHdl, SvxTPView*, void ); diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 028ca49873d0..2f758048d14b 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -266,7 +266,8 @@ SwRedlineAcceptDlg::~SwRedlineAcceptDlg() void SwRedlineAcceptDlg::Init(SwRedlineTable::size_type nStart) { std::optional oWait; -if (SwView *pView = GetActiveView()) +SwView* pView = GetActiveView(); +if (pView) oWait.emplace(*pView->GetDocShell(), false); weld::TreeView& rTreeView = m_pTable->GetWidget(); m_aUsedSeqNo.clear(); @@ -274,6 +275,33 @@ void SwRedlineAcceptDlg::Init(SwRedlineTable::size_type nStart) // tdf#162018 keep the selected entry selected const SwRedlineData* pSelectedEntryRedlineData = lcl_get_selected_redlinedata(rTreeView); +// tdf#162337 tracked change selection when the Manage Changes dialog is initially opened +if (pView && m_bInitialSelect) +{ +m_bInitialSelect = false; +SwWrtShell* pSh = pView->GetWrtShellPtr(); +if (pSh) +{ +const SwRangeRedline* pCurrRedline = pSh->GetCurrRedline(); +if (pCurrRedline) +{ +// Select current redline +SwRedlineTable::size_type nPos += pSh->FindRedlineOfData(pCurrRedline->GetRedlineData()); +pSh->GotoRedline(nPos, true); +pSh->SetInSelect(); +} +else +{ +// Select the next redline if there is one +pSh->AssureStdMode(); +pCurrRedline = pSh->SelNextRedline(); +} +if (pCurrRedline) +pSelectedEntryRedlineData = &pCurrRedline->GetRedlineData(); +} +} + rTreeView.freeze(); if (nSta
core.git: basctl/uiconfig
basctl/uiconfig/basicide/ui/libpage.ui | 134 - 1 file changed, 67 insertions(+), 67 deletions(-) New commits: commit 472644f5a30b47f7855ee988a207bab8960e954d Author: Jim Raykowski AuthorDate: Sat Aug 24 21:28:46 2024 -0800 Commit: Jim Raykowski CommitDate: Sun Aug 25 16:47:15 2024 +0200 Resave with newer Glade version Change-Id: I00b96d10f7890631f915beeb0c41f714685e34db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172367 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/basctl/uiconfig/basicide/ui/libpage.ui b/basctl/uiconfig/basicide/ui/libpage.ui index 6047b0c906a9..61f98ca36986 100644 --- a/basctl/uiconfig/basicide/ui/libpage.ui +++ b/basctl/uiconfig/basicide/ui/libpage.ui @@ -1,5 +1,5 @@ - + @@ -17,44 +17,44 @@ True -False -6 -12 +False +6 +12 - + True -False +False True True -12 -12 +12 +12 - + True -False +False True -6 -12 +6 +12 True -False +False L_ocation: -True -location +True +location 0 -0 -0 +0 +0 True -False +False True @@ -63,58 +63,58 @@ -0 -1 +0 +1 -0 -0 +0 +0 - + True -False +False True True -6 -12 +6 +12 True -False +False _Library: -True -library +True +library 0 -0 -0 +0 +0 True -True +True True True -in +in --1 +-1 True -True -True +True +True True True liststore1 -False -1 -True +False +1 +True @@ -157,30 +157,30 @@ -0 -1 +0 +1 -0 -1 +0 +1 True -False +False vertical 6 -start +start _Edit True -True -True -True +True +True +True Opens the Basic editor so that you can modify the selected library. @@ -197,9 +197,9 @@ _Password... True -True -True -True +True +True +True Assigns or edits the password for the selected library. @@ -216,9 +216,9 @@ _New... True -True -True -True +True +True +True Creates a new library. @@ -236,9 +236,9 @@ _Import... True -True -True -True +True +True +True
core.git: sw/source sw/uiconfig
sw/source/uibase/utlui/content.cxx | 134 + sw/uiconfig/swriter/ui/navigatorcontextmenu.ui | 125 +-- 2 files changed, 228 insertions(+), 31 deletions(-) New commits: commit d5143c058bfdc0f5674c3e0a88fae2f9cbe28a0a Author: Jim Raykowski AuthorDate: Wed Jul 17 12:52:54 2024 -0800 Commit: Jim Raykowski CommitDate: Sun Aug 18 01:38:55 2024 +0200 tdf#156926 related: Ability to Delete all images in Writer Adds the ability to delete all content of a content type, excluding the Headings content type, using the content type's context menu in Writer Navigator. Change-Id: Ie5666b6b9b7ef2f3cdb63957b1b42b236b8674db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170643 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 9877ef40b676..9c7f1acff11e 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1695,25 +1695,38 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) bool bRemovePostItEntries = true; bool bRemoveUpdateIndexEntry = true; -bool bRemoveReadonlyIndexEntry = true;bool bRemoveCopyEntry = true; +bool bRemoveReadonlyIndexEntry = true; +bool bRemoveCopyEntry = true; bool bRemoveEditEntry = true; bool bRemoveUnprotectEntry = true; bool bRemoveDeleteChapterEntry = true, + bRemoveDeleteAllTablesEntry = true, bRemoveDeleteTableEntry = true, + bRemoveDeleteAllFramesEntry = true, bRemoveDeleteFrameEntry = true, + bRemoveDeleteAllImagesEntry = true, bRemoveDeleteImageEntry = true, + bRemoveDeleteAllOLEObjectsEntry = true, bRemoveDeleteOLEObjectEntry = true, + bRemoveDeleteAllBookmarksEntry = true, bRemoveDeleteBookmarkEntry = true, + bRemoveDeleteAllRegionsEntry = true, bRemoveDeleteRegionEntry = true, + bRemoveDeleteAllHyperlinksEntry = true, bRemoveDeleteHyperlinkEntry = true, + bRemoveDeleteAllReferencesEntry = true, bRemoveDeleteReferenceEntry = true, + bRemoveDeleteAllIndexesEntry = true, bRemoveDeleteIndexEntry= true, + bRemoveDeleteAllCommentsEntry = true, bRemoveDeleteCommentEntry = true, + bRemoveDeleteAllDrawingObjectsEntry = true, bRemoveDeleteDrawingObjectEntry = true, + bRemoveDeleteAllFieldsEntry = true, bRemoveDeleteFieldEntry = true, bRemoveDeleteAllFootnotesEntry = true, - bRemoveDeleteAllEndnotesEntry = true, bRemoveDeleteFootnoteEntry = true, + bRemoveDeleteAllEndnotesEntry = true, bRemoveDeleteEndnoteEntry = true; bool bRemoveRenameEntry = true; bool bRemoveSelectEntry = true; @@ -1976,6 +1989,56 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) && !m_pActiveShell->GetView().GetDocShell()->IsReadOnly() && pType->GetMemberCount() > 0) { +// Choose which Delete All entry to show. +if (pType->IsDeletable() && IsDeletable(*xEntry)) +{ +switch (nContentType) +{ +case ContentTypeId::TABLE: +bRemoveDeleteAllTablesEntry = false; +break; +case ContentTypeId::FRAME: +bRemoveDeleteAllFramesEntry = false; +break; +case ContentTypeId::GRAPHIC: +bRemoveDeleteAllImagesEntry = false; +break; +case ContentTypeId::OLE: +bRemoveDeleteAllOLEObjectsEntry = false; +break; +case ContentTypeId::BOOKMARK: +bRemoveDeleteAllBookmarksEntry = false; +break; +case ContentTypeId::REGION: +bRemoveDeleteAllRegionsEntry = false; +break; +case ContentTypeId::URLFIELD: +bRemoveDeleteAllHyperlinksEntry = false; +break; +case ContentTypeId::REFERENCE: +bRemoveDeleteAllReferencesEntry = false; +break; +case ContentTypeId::INDEX: +bRemoveDeleteAllIndexesEntry = false; +break; +case ContentTypeId::POSTIT: +bRemoveDeleteAllCommentsEntry = false; +break; +case ContentTypeId::DRAWOBJECT: +bRemoveDeleteAllD
core.git: sw/source
sw/source/uibase/utlui/content.cxx | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) New commits: commit dd93375dcebe4eb7d7cc9696c18728f83aaed86e Author: Jim Raykowski AuthorDate: Thu Aug 15 09:43:13 2024 -0800 Commit: Jim Raykowski CommitDate: Fri Aug 16 09:16:57 2024 +0200 related tdf#63967: Ability to Quickly Get Word Count of Sections Using Navigator Adds word count information of headings outline content to the headings content tooltip. Change-Id: I31163d95139cdc1ef770591684e9cb585ed49a8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171920 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 82bd41151cca..9877ef40b676 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5226,8 +5226,23 @@ IMPL_LINK(SwContentTree, QueryTooltipHdl, const weld::TreeIter&, rEntry, OUStrin sEntry = static_cast(pUserData)->GetName(); break; case ContentTypeId::OUTLINE: +{ assert(dynamic_cast(static_cast(pUserData))); -sEntry = static_cast(pUserData)->GetName(); +SwOutlineContent* pOutlineContent = static_cast(pUserData); +SwOutlineNodes::size_type nOutlinePos = pOutlineContent->GetOutlinePos(); +const SwNodes& rNodes = m_pActiveShell->GetDoc()->GetNodes(); +const SwOutlineNodes& rOutlineNodes = rNodes.GetOutLineNds(); +SwNode* pStartNode = rOutlineNodes[nOutlinePos]; +SwNode* pEndNode = &rNodes.GetEndOfContent(); +if (nOutlinePos + 1 < rOutlineNodes.size()) +pEndNode = rOutlineNodes[nOutlinePos + 1]; +SwPaM aPaM(*pStartNode, *pEndNode); +SwDocStat aDocStat; +SwDoc::CountWords(aPaM, aDocStat); +sEntry = pOutlineContent->GetName() + " " + SwResId(FLD_STAT_WORD) + ": " + + OUString::number(aDocStat.nWord) + " " + SwResId(FLD_STAT_CHAR) + ": " + + OUString::number(aDocStat.nChar); +} break; case ContentTypeId::GRAPHIC: assert(dynamic_cast(static_cast(pUserData)));
core.git: sw/source
sw/source/uibase/docvw/edtwin.cxx | 12 1 file changed, 12 insertions(+) New commits: commit 4437f5874203298715157cd858caf8cf7992342b Author: Jim Raykowski AuthorDate: Tue Aug 6 08:06:03 2024 -0800 Commit: Jim Raykowski CommitDate: Mon Aug 12 17:59:04 2024 +0200 Resolves: tdf#112932 Pressing enter in read-ony Table of Content doesnt jump to heading Allows jump to heading using the Enter key or key modifier one in combination with the Enter key (Ctrl+Enter) when table of content is in protected mode. This changes the previous behavior of only allowing the Enter key to jump to the heading when the document is in read-only mode to also allowing key modifier one in combination with the Enter key to jump to the heading. Change-Id: Ib7451cef40d3ecf56295c2b23a6e663fad18fece Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171554 Reviewed-by: Heiko Tietze Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 99843fb243f2..6351f6e2b1b9 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -1699,6 +1699,17 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) End }; SwKeyState eKeyState = bIsViewReadOnly ? SwKeyState::CheckDocReadOnlyKeys : SwKeyState::CheckKey; + +// tdf#112932 Pressing enter in read-ony Table of Content doesnt jump to heading +if (!bIsViewReadOnly +&& ((rKeyCode.GetModifier() | rKeyCode.GetCode()) == KEY_RETURN +|| (rKeyCode.GetModifier() | rKeyCode.GetCode()) == (KEY_MOD1 | KEY_RETURN))) +{ +const SwTOXBase* pTOXBase = rSh.GetCurTOX(); +if (pTOXBase && SwEditShell::IsTOXBaseReadonly(*pTOXBase)) +eKeyState = SwKeyState::CheckDocReadOnlyKeys; +} + SwKeyState eNextKeyState = SwKeyState::End; sal_uInt8 nDir = 0; @@ -2350,6 +2361,7 @@ KEYINPUT_CHECKTABLE_INSDEL: } break; case KEY_RETURN: +case KEY_RETURN | KEY_MOD1: { const SelectionType nSelectionType = rSh.GetSelectionType(); if(nSelectionType & SelectionType::Frame)
core.git: sd/source
sd/source/ui/animations/CustomAnimationList.cxx | 33 1 file changed, 23 insertions(+), 10 deletions(-) New commits: commit cee67dd7d7348f853066a160eed4618dc4ab52ff Author: Jim Raykowski AuthorDate: Thu Aug 8 21:31:23 2024 -0800 Commit: Jim Raykowski CommitDate: Sat Aug 10 23:09:08 2024 +0200 Resolves: tdf#162392 Impress Sidebar 'Animation' deck text overlaps by reworking the custom animation list entry item custom rendering layout a bit. Change-Id: I1c71dd5ef40de5369890b0b9aea1294baa3be120 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171659 Tested-by: Jenkins Reviewed-by: Vernon, Stuart Foote Reviewed-by: Jim Raykowski diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 23ab28669174..3d233e39322d 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -298,7 +298,7 @@ Size CustomAnimationListEntryItem::GetSize(const vcl::RenderContext& rRenderCont if (width < (rRenderContext.GetTextWidth( msEffectName ) + 2*nIconWidth)) width = rRenderContext.GetTextWidth( msEffectName ) + 2*nIconWidth; -Size aSize(width, rRenderContext.GetTextHeight()); +Size aSize(width, rRenderContext.GetTextHeight() * 2); if (aSize.Height() < nItemMinHeight) aSize.setHeight(nItemMinHeight); return aSize; @@ -351,27 +351,34 @@ void CustomAnimationListEntryItem::PaintEffect(vcl::RenderContext& rRenderContex Point aPos(rRect.TopLeft()); int nItemHeight = rRect.GetHeight(); +Size nImageSize = Image(StockImage::Yes, BMP_CUSTOMANIMATION_AFTER_PREVIOUS).GetSizePixel(); + sal_Int16 nNodeType = mpEffect->getNodeType(); -if (nNodeType == EffectNodeType::ON_CLICK ) +if (nNodeType == EffectNodeType::ON_CLICK) { -rRenderContext.DrawImage(aPos, Image(StockImage::Yes, BMP_CUSTOMANIMATION_ON_CLICK)); +Image aImage(Image(StockImage::Yes, BMP_CUSTOMANIMATION_ON_CLICK)); +nImageSize = aImage.GetSizePixel(); +aPos.AdjustY(nItemHeight / 4 - nImageSize.Height() / 2); +rRenderContext.DrawImage(aPos, aImage); } else if (nNodeType == EffectNodeType::AFTER_PREVIOUS) { -rRenderContext.DrawImage(aPos, Image(StockImage::Yes, BMP_CUSTOMANIMATION_AFTER_PREVIOUS)); +Image aImage(Image(StockImage::Yes, BMP_CUSTOMANIMATION_AFTER_PREVIOUS)); +nImageSize = aImage.GetSizePixel(); +aPos.AdjustY(nItemHeight / 4 - nImageSize.Height() / 2); +rRenderContext.DrawImage(aPos, aImage); } else if (nNodeType == EffectNodeType::WITH_PREVIOUS) { //FIXME With previous image not defined in CustomAnimation.src } -aPos.AdjustX(nIconWidth); +aPos = rRect.TopLeft(); +aPos.AdjustX(nImageSize.Width() + 5); //TODO, full width of widget ? rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(msDescription, rRect.GetWidth())); -aPos.AdjustY(nIconWidth); - OUString sImage; switch (mpEffect->getPresetClass()) { @@ -404,13 +411,19 @@ void CustomAnimationListEntryItem::PaintEffect(vcl::RenderContext& rRenderContex if (!sImage.isEmpty()) { Image aImage(StockImage::Yes, sImage); +nImageSize = aImage.GetSizePixel(); Point aImagePos(aPos); -aImagePos.AdjustY((nItemHeight/2 - aImage.GetSizePixel().Height()) >> 1 ); +aImagePos.AdjustY(nItemHeight * 3 / 4 - nImageSize.Height() / 2); rRenderContext.DrawImage(aImagePos, aImage); } +else +{ +Image aImage(StockImage::Yes, BMP_CUSTOMANIMATION_ENTRANCE_EFFECT); +nImageSize = aImage.GetSizePixel(); +} -aPos.AdjustX(nIconWidth ); -aPos.AdjustY((nItemHeight/2 - rRenderContext.GetTextHeight()) >> 1 ); +aPos.AdjustX(nImageSize.Width() + 5); +aPos.AdjustY(nItemHeight / 2); rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(msEffectName, rRect.GetWidth())); rRenderContext.Pop();
core.git: sw/source
sw/source/uibase/misc/redlndlg.cxx |9 + 1 file changed, 9 insertions(+) New commits: commit c60dd66d89dab2174aa71c26c653f68908c7ba78 Author: Jim Raykowski AuthorDate: Wed Jul 24 12:17:59 2024 -0800 Commit: Jim Raykowski CommitDate: Thu Jul 25 01:54:41 2024 +0200 tdf#162018 Unexpected loss in focus in the "Manage Changes" window when adding a change in the document (Track changes mode), round 4 Addresses "situation 4" when a new change makes a change to an entire previous change or to multiple previously tracked changes. Change-Id: I02175db6c7bc1258f8e7c05835b05ff79b7d7b83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170984 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index b812b7039722..028ca49873d0 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -479,7 +479,10 @@ void SwRedlineAcceptDlg::Activate() // Redline-Parents were inserted, changed or deleted i = CalcDiff(i, false); if (i == SwRedlineTable::npos) +{ +lcl_reselect(rTreeView, pSelectedEntryRedlineData); return; +} continue; } @@ -491,7 +494,10 @@ void SwRedlineAcceptDlg::Activate() // Redline-Children were deleted i = CalcDiff(i, true); if (i == SwRedlineTable::npos) +{ +lcl_reselect(rTreeView, pSelectedEntryRedlineData); return; +} continue; } else @@ -503,7 +509,10 @@ void SwRedlineAcceptDlg::Activate() // Redline-Children were inserted, changed or deleted i = CalcDiff(i, true); if (i == SwRedlineTable::npos) +{ +lcl_reselect(rTreeView, pSelectedEntryRedlineData); return; +} // here was a continue; targetted to the outer loop // now a break will do, as there is nothing after it in the outer loop
core.git: sw/source
sw/source/uibase/misc/redlndlg.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit cac1b706ecf9b1b95c2ca31e029135533fd6bf83 Author: Jim Raykowski AuthorDate: Mon Jul 22 11:54:30 2024 -0800 Commit: Jim Raykowski CommitDate: Thu Jul 25 01:47:07 2024 +0200 related tdf#161717 Use a better approach to determine RedlinData ::pData type Casting a void* RedlineData::pDate to either a SwRedlineDataParent* or SwRedlineDataChild* works because of the order and variable types declared in the SwRedlineDataChild and SwRedlineDataParent classes match until an OUString is declared in SwRedlineDataParent. That explains why the non-patched code behaves as expected even though testing if the entry has children to determine which cast to do is flawed. Better is to test the iterator depth which is what this patch does. Change-Id: I24ca0990a4edbd50a7e3dc5d0be4c5312c240921 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170860 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 3c66afd1a2e1..b812b7039722 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -572,10 +572,10 @@ void SwRedlineAcceptDlg::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) rTreeView.all_foreach([&rTreeView, &rRedlineData](weld::TreeIter& rIter) { RedlinData* pRedlinData = weld::fromId(rTreeView.get_id(rIter)); const SwRedlineData* pRedlineData; -if (rTreeView.iter_has_child(rIter)) -pRedlineData = static_cast(pRedlinData->pData)->pData; -else +if (rTreeView.get_iter_depth(rIter)) pRedlineData = static_cast(pRedlinData->pData)->pChild; +else +pRedlineData = static_cast(pRedlinData->pData)->pData; if (pRedlineData == &rRedlineData) { rTreeView.set_cursor(rIter);
core.git: sw/source
sw/source/uibase/utlui/content.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit ac0a497d09d8b4c0b624f788c8db34081fb8caa9 Author: Jim Raykowski AuthorDate: Mon Jul 22 14:36:03 2024 -0800 Commit: Jim Raykowski CommitDate: Tue Jul 23 21:08:51 2024 +0200 related tdf#160817 SwNavigator: update content functions toolbar on right-click selection of entry to show context menu for Change-Id: I045bd02103a37c94d6eb3fc1885ab19de79685c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170885 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 27c220998b79..cf1e5e0d4843 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1600,6 +1600,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) m_xTreeView->set_cursor(0); } +UpdateContentFunctionsToolbar(); + std::unique_ptr xBuilder(Application::CreateBuilder(m_xTreeView.get(), u"modules/swriter/ui/navigatorcontextmenu.ui"_ustr)); std::unique_ptr xPop = xBuilder->weld_menu(u"navmenu"_ustr);
core.git: sw/qa sw/source
sw/qa/uitest/writer_tests/trackedChanges.py |2 sw/source/uibase/misc/redlndlg.cxx | 71 ++-- 2 files changed, 48 insertions(+), 25 deletions(-) New commits: commit 863b90e33c4b9964a697684887aeb42cc538b019 Author: Jim Raykowski AuthorDate: Sun Jul 21 09:44:57 2024 -0800 Commit: Jim Raykowski CommitDate: Tue Jul 23 18:11:28 2024 +0200 Resolves tdf#162018 Unexpected loss in focus in the "Manage Changes" window when adding a change in the document (Track changes mode), round 3 Done to address loss of selection when an entry is added to the beginning of the changes list. The patch reworks round 1 and 2 to handle any entry insert position. It also keeps the selected entry selected after a sort by document order. Change-Id: Icb6f6b6b80ad9ddc5d008a00d195ceb7c1d6dc3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170828 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/qa/uitest/writer_tests/trackedChanges.py b/sw/qa/uitest/writer_tests/trackedChanges.py index 93b2374ed820..d013be0343e3 100644 --- a/sw/qa/uitest/writer_tests/trackedChanges.py +++ b/sw/qa/uitest/writer_tests/trackedChanges.py @@ -289,6 +289,8 @@ class trackedchanges(UITestCase): # Now: 4 changes (2 deleted/inserted rows and 2 deleted/inserted tables) self.assertEqual(4, len(changesList.getChildren())) +changesList.getChild(0).executeAction("SELECT", tuple()) + # jump to the parent to allow rejecting the table change changesList.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 5bbac52db74d..3c66afd1a2e1 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -144,6 +144,48 @@ SwModelessRedlineAcceptDlg::~SwModelessRedlineAcceptDlg() mbInDestruction = true; } +namespace +{ +const SwRedlineData* lcl_get_selected_redlinedata(weld::TreeView& rTreeView) +{ +std::unique_ptr xEntry(rTreeView.make_iterator()); +if (rTreeView.get_selected(xEntry.get())) +{ +RedlinData* pRedlinData = weld::fromId(rTreeView.get_id(*xEntry)); +if (rTreeView.get_iter_depth(*xEntry)) +return static_cast(pRedlinData->pData)->pChild; +else +return static_cast(pRedlinData->pData)->pData; +} +return nullptr; +} + +void lcl_reselect(weld::TreeView& rTreeView, const SwRedlineData* pSelectedEntryRedlineData) +{ +if (!pSelectedEntryRedlineData) +{ +rTreeView.set_cursor(-1); +return; +} +rTreeView.all_foreach( +[&rTreeView, &pSelectedEntryRedlineData](weld::TreeIter& rIter) +{ +RedlinData* pRedlinData = weld::fromId(rTreeView.get_id(rIter)); +const SwRedlineData* pRedlineData; +if (rTreeView.get_iter_depth(rIter)) +pRedlineData = static_cast(pRedlinData->pData)->pChild; +else +pRedlineData = static_cast(pRedlinData->pData)->pData; +if (pRedlineData == pSelectedEntryRedlineData) +{ +rTreeView.set_cursor(rIter); +return true; +} +return false; +}); +} +} + SwRedlineAcceptDlg::SwRedlineAcceptDlg(std::shared_ptr xParent, weld::Builder *pBuilder, weld::Container *pContentArea, bool bAutoFormat) : m_xParentDlg(std::move(xParent)) @@ -230,13 +272,7 @@ void SwRedlineAcceptDlg::Init(SwRedlineTable::size_type nStart) m_aUsedSeqNo.clear(); // tdf#162018 keep the selected entry selected -const OUString& rId = rTreeView.get_selected_id(); -auto reselect = [&rTreeView, &rId]() { -rTreeView.select_id(rId); -std::unique_ptr xEntry(rTreeView.make_iterator()); -if (rTreeView.get_selected(xEntry.get())) -rTreeView.set_cursor(*xEntry); -}; +const SwRedlineData* pSelectedEntryRedlineData = lcl_get_selected_redlinedata(rTreeView); rTreeView.freeze(); if (nStart) @@ -254,7 +290,7 @@ void SwRedlineAcceptDlg::Init(SwRedlineTable::size_type nStart) InsertParents(nStart); InitAuthors(); -reselect(); +lcl_reselect(rTreeView, pSelectedEntryRedlineData); } void SwRedlineAcceptDlg::InitAuthors() @@ -421,13 +457,7 @@ void SwRedlineAcceptDlg::Activate() // tdf#162018 keep the selected entry selected weld::TreeView& rTreeView = m_pTable->GetWidget(); -const OUString& rId = rTreeView.get_selected_id(); -auto reselect = [&rTreeView, &rId]() { -rTreeView.select_id(rId); -std::unique_ptr xEntry(rTreeView.make_iterator()); -if (rTreeView.get_selected(xEntry.get())) -rTreeView.set_cursor(*xEntry); -}; +const SwRedlineData* pSelectedEntryRedlineData = lcl_get_selected
core.git: sw/qa sw/source
sw/qa/uitest/writer_tests/trackedChanges.py | 10 +++ sw/qa/uitest/writer_tests7/tdf90401.py |2 + sw/source/uibase/misc/redlndlg.cxx | 36 3 files changed, 38 insertions(+), 10 deletions(-) New commits: commit de9a7a593630d3319e0e311b641c7c52c96b9e4a Author: Jim Raykowski AuthorDate: Tue Jul 16 21:58:37 2024 -0800 Commit: Jim Raykowski CommitDate: Sat Jul 20 20:48:23 2024 +0200 Resolves tdf#162018 Unexpected loss in focus in the "Manage Changes" window when adding a change in the document (Track changes mode), round 2 Addresses two situations where the list still jumps to the top: Situation 1: When an entry is added to the end of the changes list. Situation 2: After editing a comment for a change list entry with the 'Comment' dialog. Change-Id: I4a75e6bcba13fb9cc735cf78756fe736b9d4665d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170598 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/qa/uitest/writer_tests/trackedChanges.py b/sw/qa/uitest/writer_tests/trackedChanges.py index 8681140bb695..93b2374ed820 100644 --- a/sw/qa/uitest/writer_tests/trackedChanges.py +++ b/sw/qa/uitest/writer_tests/trackedChanges.py @@ -78,6 +78,8 @@ class trackedchanges(UITestCase): self.xUITest.executeCommand(".uno:ShowTrackedChanges") with self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges", close_button="close") as xTrackDlg: +changesList = xTrackDlg.getChild("writerchanges") +changesList.getChild(0).executeAction("SELECT", tuple()) xRejBtn = xTrackDlg.getChild("reject") xRejBtn.executeAction("CLICK", tuple()) @@ -152,6 +154,8 @@ class trackedchanges(UITestCase): "The tennis ball is a small ball. The basketball is much bigger.", "The tennis ball is a small ball. The basketball is much bigger."] +changesList.getChild(0).executeAction("SELECT", tuple()) + for i in range(len(listText)): self.assertEqual(document.Text.String.strip(), resultsAccept[i]) self.assertEqual(get_state_as_dict(changesList.getChild('0'))["Text"], listText[i] ) @@ -176,6 +180,8 @@ class trackedchanges(UITestCase): "The tenis ball is a small bal. The baskedball is much bigger.", "The tenis ball is a small bal. The baskedball is much biger."] +changesList.getChild(0).executeAction("SELECT", tuple()) + for i in range(len(listText)): self.assertEqual(document.Text.String.strip(), resultsReject[i]) self.assertEqual(get_state_as_dict(changesList.getChild('0'))["Text"], listText[i] ) @@ -231,6 +237,8 @@ class trackedchanges(UITestCase): # Now: 4 changes (2 deleted/inserted rows and 2 deleted/inserted tables) self.assertEqual(4, len(changesList.getChildren())) +changesList.getChild(0).executeAction("SELECT", tuple()) + # Without the fix in place, it would have crashed here for i in (3, 2, 1, 0): xAccBtn = xTrackDlg.getChild("accept") @@ -521,6 +529,7 @@ class trackedchanges(UITestCase): # check and reject changes with self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges", close_button="close") as xTrackDlg: changesList = xTrackDlg.getChild("writerchanges") +changesList.getChild(0).executeAction("SELECT", tuple()) # six changes, but only one visible in the Manage Changes dialog window state = get_state_as_dict(changesList) @@ -562,6 +571,7 @@ class trackedchanges(UITestCase): # check and reject changes with self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges", close_button="close") as xTrackDlg: changesList = xTrackDlg.getChild("writerchanges") +changesList.getChild(0).executeAction("SELECT", tuple()) # six changes, but only one visible in the Manage Changes dialog window state = get_state_as_dict(changesList) diff --git a/sw/qa/uitest/writer_tests7/tdf90401.py b/sw/qa/uitest/writer_tests7/tdf90401.py index 95cc966e1dc7..6c29269a5880 100644 --- a/sw/qa/uitest/writer_tests7/tdf90401.py +++ b/sw/qa/uitest/writer_tests7/tdf90401.py @@ -79,6 +79,7 @@ class tdf90401(UITestCase): # check removed personal info on tracked changes with self.ui_test.execute_modeless_dialog_through_command('.uno:AcceptTrackedChanges', close_button="close") as xTrackDlg: xTreeList = xTrackDlg.getChild('writerchanges') +
core.git: sw/source
sw/source/uibase/misc/redlndlg.cxx | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) New commits: commit d16ac2a8ed46bdc0f20d49850b9c4989697acd49 Author: Jim Raykowski AuthorDate: Sun Jul 14 09:59:48 2024 -0800 Commit: Jim Raykowski CommitDate: Mon Jul 15 06:25:47 2024 +0200 Resolves tdf#162018 Unexpected loss in focus in the "Manage Changes" window when adding a change in the document (Track changes mode) Change-Id: Iecb49346cfe5d4f447b07ec5451c753c90dddb44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170460 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 26b40b917e50..178c2bc0f2e5 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -413,6 +413,10 @@ void SwRedlineAcceptDlg::Activate() if (!pSh) return; +// tdf#162018 keep the selected entry selected +weld::TreeView& rTreeView = m_pTable->GetWidget(); +const OUString& rId = rTreeView.get_selected_id(); + SwRedlineTable::size_type nCount = pSh->GetRedlineCount(); // check the number of pointers @@ -477,7 +481,6 @@ void SwRedlineAcceptDlg::Activate() } // check comment -weld::TreeView& rTreeView = m_pTable->GetWidget(); bool bIsShowChangesInMargin = SW_MOD()->GetUsrPref(false)->IsShowChangesInMargin(); for (SwRedlineTable::size_type i = 0; i < nCount; i++) { @@ -501,6 +504,12 @@ void SwRedlineAcceptDlg::Activate() } InitAuthors(); + +// tdf#162018 keep the selected entry selected +rTreeView.select_id(rId); +std::unique_ptr xEntry(rTreeView.make_iterator()); +if (rTreeView.get_selected(xEntry.get())) +rTreeView.set_cursor(*xEntry); } void SwRedlineAcceptDlg::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
core.git: include/svx sc/source solenv/sanitizers svx/source svx/uiconfig sw/source
include/svx/ctredlin.hxx | 17 ++- sc/source/ui/miscdlgs/conflictsdlg.cxx |3 - solenv/sanitizers/ui/svx.suppr |1 svx/source/dialog/ctredlin.cxx | 22 - svx/uiconfig/ui/redlineviewpage.ui | 75 ++--- sw/source/uibase/inc/redlndlg.hxx |2 sw/source/uibase/misc/redlndlg.cxx | 22 + 7 files changed, 123 insertions(+), 19 deletions(-) New commits: commit 2c46d3c2ff6bbdcd387771f823aa5b3b812c80a8 Author: Jim Raykowski AuthorDate: Thu Jul 11 17:06:50 2024 -0800 Commit: Jim Raykowski CommitDate: Sun Jul 14 05:31:46 2024 +0200 tdf#161811 Changes in TC manager dialog should be in order of appearance in document Adds a drop down control to the Writer Manage Changes dialog/sidebar panel that can be used to select how the changes list is sorted. Change-Id: I9602322ec61ae6e15a08fbc26aa69de1b64294e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170390 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx index f852a4886bd7..c098efa6a11b 100644 --- a/include/svx/ctredlin.hxx +++ b/include/svx/ctredlin.hxx @@ -83,6 +83,8 @@ private: std::unique_ptr xCalcTreeView; weld::TreeView* pTreeView; +weld::ComboBox* m_pSortByComboBox; + sal_uInt16 nDatePos; boolbAuthor; boolbDate; @@ -100,7 +102,8 @@ private: public: SvxRedlinTable(std::unique_ptr xWriterControl, - std::unique_ptr xCalcControl); + std::unique_ptr xCalcControl, + weld::ComboBox* pSortByControl); weld::TreeView& GetWidget() { return *pTreeView; } bool IsSorted() const { return bSorted; } @@ -256,13 +259,14 @@ public: class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxTPView final : public SvxTPage { private: - Link AcceptClickLk; Link AcceptAllClickLk; Link RejectClickLk; Link RejectAllClickLk; Link UndoClickLk; +Link SortByComboBoxChangedLk; + bool bEnableAccept; bool bEnableAcceptAll; bool bEnableReject; @@ -277,9 +281,11 @@ private: std::unique_ptr m_xAcceptAll; std::unique_ptr m_xRejectAll; std::unique_ptr m_xUndo; +std::unique_ptr m_xSortByComboBox; std::unique_ptr m_xViewData; DECL_DLLPRIVATE_LINK( PbClickHdl, weld::Button&, void ); +DECL_DLLPRIVATE_LINK(SortByComboBoxChangedHdl, weld::ComboBox&, void); public: SvxTPView(weld::Container* pParent); @@ -287,6 +293,8 @@ public: SvxRedlinTable* GetTableControl() { return m_xViewData.get(); } +weld::ComboBox* GetSortByComboBoxControl() { return m_xSortByComboBox.get(); } + voidEnableAccept(bool bFlag); voidEnableAcceptAll(bool bFlag); voidEnableReject(bool bFlag); @@ -307,6 +315,11 @@ public: voidSetUndoClickHdl( const Link& rLink ) { UndoClickLk = rLink; } +void SetSortByComboBoxChangedHdl(const Link& rLink) +{ +SortByComboBoxChangedLk = rLink; +} + virtual voidActivatePage() override; voidDeactivatePage(); }; diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index a70cff4641b0..6e20e04e0414 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -334,7 +334,8 @@ ScConflictsDlg::ScConflictsDlg(weld::Window* pParent, ScViewData* pViewData, ScD , m_xBtnKeepOther(m_xBuilder->weld_button(u"keepother"_ustr)) , m_xBtnKeepAllMine(m_xBuilder->weld_button(u"keepallmine"_ustr)) , m_xBtnKeepAllOthers(m_xBuilder->weld_button(u"keepallothers"_ustr)) -, m_xLbConflicts(new SvxRedlinTable(m_xBuilder->weld_tree_view(u"container"_ustr), nullptr)) +, m_xLbConflicts(new SvxRedlinTable(m_xBuilder->weld_tree_view(u"container"_ustr), nullptr, +nullptr)) { OSL_ENSURE( mpViewData, "ScConflictsDlg CTOR: mpViewData is null!" ); mpOwnDoc = ( mpViewData ? &mpViewData->GetDocument() : nullptr ); diff --git a/solenv/sanitizers/ui/svx.suppr b/solenv/sanitizers/ui/svx.suppr index 0c952e5dc460..5f2d0d8a8bc6 100644 --- a/solenv/sanitizers/ui/svx.suppr +++ b/solenv/sanitizers/ui/svx.suppr @@ -72,6 +72,7 @@ svx/uiconfig/ui/redlinefilterpage.ui://GtkComboBoxText[@id='authorlist'] missing svx/uiconfig/ui/redlinefilterpage.ui://GtkEntry[@id='rangeedit'] missing-label-for svx/uiconfig/ui/redlinefilterpage.ui://GtkComboBoxText[@id='datecond'] missing-label-for svx/uiconfig/ui/redlinefilterpage.ui://GtkLabel[@id='and'] orphan-label +svx/uiconfig/ui/redlineviewpage.ui://GtkLabel[@id='sortbylabel'] orphan-label svx/uiconfig/ui/safemodedialog.ui://GtkLabel[@id='label1'] orphan-label svx/uiconfig/ui/safemodedialog.ui://GtkLabel[@id='label3'] orphan-label svx/uiconfig/ui/
core.git: svx/source
svx/source/dialog/ctredlin.cxx |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) New commits: commit d9856b2ca5f3e80c978bd34330648b6345765202 Author: Jim Raykowski AuthorDate: Fri Jul 5 11:15:35 2024 -0800 Commit: Jim Raykowski CommitDate: Wed Jul 10 17:38:09 2024 +0200 tdf#161811 related: Fix change manager dialog context popup menu Sort By > Document Position results With out the patch installed gtk sorts by the Action column. x11 and qt also do something other than expected. Change-Id: Ic36e79cf928e5ba142b7ff435999e806b1d56214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170059 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 504cbe0f5256..49091e01578a 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -90,7 +90,12 @@ SvxRedlinTable::~SvxRedlinTable() IMPL_LINK(SvxRedlinTable, HeaderBarClick, int, nColumn, void) { -if (!bSorted) +if (nColumn == -1) +{ +pTreeView->make_unsorted(); +bSorted = false; +} +else if (!bSorted) { pTreeView->make_sorted(); bSorted = true; @@ -99,7 +104,7 @@ IMPL_LINK(SvxRedlinTable, HeaderBarClick, int, nColumn, void) bool bSortAtoZ = pTreeView->get_sort_order(); //set new arrow positions in headerbar -if (nColumn == pTreeView->get_sort_column()) +if (nColumn != -1 && nColumn == pTreeView->get_sort_column()) { bSortAtoZ = !bSortAtoZ; pTreeView->set_sort_order(bSortAtoZ);
core.git: sw/source
sw/source/uibase/docvw/edtwin.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 8afc4d10f917cfb5faadac0a1dd8856373693630 Author: Jim Raykowski AuthorDate: Tue Jul 9 13:22:52 2024 -0800 Commit: Jim Raykowski CommitDate: Wed Jul 10 17:27:34 2024 +0200 tdf#161717 Enhancement to identify click on tracked change This is a followup that fixes tracked change comments are not always highlighted in the Manage Changes dialog/sidebar panel when the anchor triangle is clicked on in the document. Change-Id: I0bf8bebf8133777e79101e908afd268ab44c0d68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170258 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 1abf300f3d86..81064a94a8f7 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -5366,8 +5366,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) // tdf#161717 - Track changes: Clicking on change in document should highlight related change // in "Manage Changes" window/sidebar -if (SwContentAtPos aRedlineContentAtPos(IsAttrAtPos::Redline); -rSh.GetContentAtPos(aDocPt, aRedlineContentAtPos)) +if (m_rView.GetWrtShell().GetCurrRedline()) { SwDocShell* pDocSh = m_rView.GetDocShell(); if (pDocSh)
core.git: sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk
sw/UIConfig_swriter.mk |1 sw/inc/strings.hrc |2 sw/source/uibase/sidebar/QuickFindPanel.cxx | 433 ++-- sw/source/uibase/sidebar/QuickFindPanel.hxx | 54 + sw/source/uibase/sidebar/SwPanelFactory.cxx |3 sw/source/uibase/uiview/viewsrch.cxx|2 sw/uiconfig/swriter/ui/sidebarquickfind.ui | 116 +++- sw/uiconfig/swriter/ui/sidebarquickfindoptionsdialog.ui | 175 ++ 8 files changed, 612 insertions(+), 174 deletions(-) New commits: commit 601cf05456073c082ac6bbe43b501eb81256711b Author: Jim Raykowski AuthorDate: Wed Jun 12 18:16:06 2024 -0800 Commit: Jim Raykowski CommitDate: Mon Jun 24 22:48:51 2024 +0200 tdf#160543 Quickfind sidebar enhancements * Makes the search independent of find and replace options. * Adds a button to launch a dialog for match case, whole words only, and similarity search options. * Adds a button to launch the find and replace dialog. * Makes the find entry control have visual feedback when there are no matches. * Adds a label at the bottom of panel that shows the number of matches. Change-Id: I2cffcf86978773471bb86c5e5cf8b967c24efa7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168834 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 27b7248d74e5..262123969dae 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -292,6 +292,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/sidebartableedit \ sw/uiconfig/swriter/ui/sidebartheme \ sw/uiconfig/swriter/ui/sidebarquickfind \ +sw/uiconfig/swriter/ui/sidebarquickfindoptionsdialog \ sw/uiconfig/swriter/ui/sortdialog \ sw/uiconfig/swriter/ui/spellmenu \ sw/uiconfig/swriter/ui/splittable \ diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 298b861eecf6..b9e46f13d0c6 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -1396,7 +1396,7 @@ #define STR_NUM_OUTLINE NC_("STR_NUM_OUTLINE", "Outline ") #define STR_EDIT_FOOTNOTE NC_("STR_EDIT_FOOTNOTE", "Edit Footnote/Endnote") #define STR_NB_REPLACED NC_("STR_NB_REPLACED", "Search key replaced XX times.") -#define STR_SEARCH_KEY_FOUND_TIMES NC_("STR_SEARCH_KEY_FOUND_TIMES", "Search key found %1 times.") +#define STR_SEARCH_KEY_FOUND_TIMES NNC_("STR_SEARCH_KEY_FOUND_TIMES", "One match found.", "%1 matches found.") #define STR_SRCVIEW_ROW NC_("STR_SRCVIEW_ROW", "Row ") #define STR_SRCVIEW_COL NC_("STR_SRCVIEW_COL", "Column ") #define STR_SAVEAS_SRC NC_("STR_SAVEAS_SRC", "~Export source...") diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx b/sw/source/uibase/sidebar/QuickFindPanel.cxx index da6e016ac394..0f620fd09985 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.cxx +++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx @@ -12,8 +12,6 @@ #include #include #include -#include -#include #include #include #include @@ -25,9 +23,8 @@ #include #include #include +#include -const int MinimumContainerWidth = 250; -const int Rounding = 6; const int CharactersBeforeAndAfter = 40; namespace @@ -52,25 +49,85 @@ void getAnchorPos(SwPosition& rPos) namespace sw::sidebar { -std::unique_ptr QuickFindPanel::Create(weld::Widget* pParent) +QuickFindPanel::SearchOptionsDialog::SearchOptionsDialog(weld::Window* pParent) +: GenericDialogController(pParent, u"modules/swriter/ui/sidebarquickfindoptionsdialog.ui"_ustr, + u"SearchOptionsDialog"_ustr) +, m_xMatchCaseCheckButton(m_xBuilder->weld_check_button(u"matchcase"_ustr)) +, m_xWholeWordsOnlyCheckButton(m_xBuilder->weld_check_button(u"wholewordsonly"_ustr)) +, m_xSimilarityCheckButton(m_xBuilder->weld_check_button(u"similarity"_ustr)) +, m_xSimilaritySettingsDialogButton(m_xBuilder->weld_button(u"similaritysettingsdialog"_ustr)) +{ +m_xSimilarityCheckButton->connect_toggled( +LINK(this, SearchOptionsDialog, SimilarityCheckButtonToggledHandler)); +m_xSimilaritySettingsDialogButton->connect_clicked( +LINK(this, SearchOptionsDialog, SimilaritySettingsDialogButtonClickedHandler)); +} + +short QuickFindPanel::SearchOptionsDialog::executeSubDialog(VclAbstractDialog* dialog) +{ +assert(!m_executingSubDialog); +comphelper::ScopeGuard g([this] { m_executingSubDialog = false; }); +m_executingSubDialog = true; +return dialog->Execute(); +} + +IMPL_LINK_NOARG(QuickFindPanel::SearchOptionsDialog, SimilarityCheckButtonToggledHandler, +weld::Toggleable&, void) +{ + m_xSimilaritySettingsDialogButton->set_sensitive(m_xSimilari
core.git: sw/source
sw/source/uibase/sidebar/QuickFindPanel.cxx | 112 +++- sw/source/uibase/sidebar/QuickFindPanel.hxx |1 2 files changed, 95 insertions(+), 18 deletions(-) New commits: commit 35d42ca07159a7fa4958c35dba05c527f3be29e6 Author: Jim Raykowski AuthorDate: Wed Jun 12 13:37:00 2024 -0800 Commit: Jim Raykowski CommitDate: Mon Jun 24 22:47:14 2024 +0200 Partially resolves tdf#160540 Quickfind sidebar: make better use of space for search results Making the row space behavior of SalInstanceTreeView the same as GtkInstanceTreeView would fully resolve this. Change-Id: I5fd5fc755afe3ba2c2e4f4ed56dc1c7f8f541817 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168833 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx b/sw/source/uibase/sidebar/QuickFindPanel.cxx index 753888702587..da6e016ac394 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.cxx +++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx @@ -23,8 +23,12 @@ #include #include #include +#include +#include -const int MinimumPanelWidth = 250; +const int MinimumContainerWidth = 250; +const int Rounding = 6; +const int CharactersBeforeAndAfter = 40; namespace { @@ -60,11 +64,10 @@ QuickFindPanel::QuickFindPanel(weld::Widget* pParent) : PanelLayout(pParent, u"QuickFindPanel"_ustr, u"modules/swriter/ui/sidebarquickfind.ui"_ustr) , m_xSearchFindEntry(m_xBuilder->weld_entry(u"Find"_ustr)) , m_xSearchFindsList(m_xBuilder->weld_tree_view(u"searchfinds"_ustr)) -, m_nRowHeight(m_xSearchFindsList->get_height_rows(4)) , m_pWrtShell(::GetActiveWrtShell()) { -m_xContainer->set_size_request(MinimumPanelWidth, -1); -m_xSearchFindsList->set_size_request(1, m_nRowHeight); +m_xContainer->set_size_request(MinimumContainerWidth, 1); + m_xSearchFindEntry->connect_activate( LINK(this, QuickFindPanel, SearchFindEntryActivateHandler)); m_xSearchFindEntry->connect_changed(LINK(this, QuickFindPanel, SearchFindEntryChangedHandler)); @@ -101,10 +104,55 @@ IMPL_LINK_NOARG(QuickFindPanel, SearchFindEntryActivateHandler, weld::Entry&, bo return true; } -IMPL_LINK_NOARG(QuickFindPanel, SearchFindsListCustomGetSizeHandler, weld::TreeView::get_size_args, -Size) +IMPL_LINK(QuickFindPanel, SearchFindsListCustomGetSizeHandler, weld::TreeView::get_size_args, + aPayload, Size) { -return Size(1, m_nRowHeight); +vcl::RenderContext& rRenderContext = std::get<0>(aPayload); +const OUString& rId = std::get<1>(aPayload); + +const bool bPageEntry = rId[0] == '-'; + +OUString aEntry(rId); +if (!bPageEntry) +{ +int nIndex = m_xSearchFindsList->find_id(rId); +aEntry = m_xSearchFindsList->get_text(nIndex); +} + +// To not have top and bottom clipping when the sidebar width is made smaller by the user +// calculate the text rectangle using the mimimum width the rectangle can become. +int x, y, width, height; +m_xSearchFindsList->get_extents_relative_to(*m_xContainer, x, y, width, height); + +const int leftTextMargin = 6; +const int rightTextMargin = 6 + 3; +tools::Long nScrollBarThickness += Application::GetSettings().GetStyleSettings().GetScrollBarSize(); + +tools::Rectangle aInRect(Point(), Size(MinimumContainerWidth - (x * 2) - leftTextMargin + - nScrollBarThickness - rightTextMargin, + 1)); + +tools::Rectangle aRect; +if (!bPageEntry) +{ +aRect = rRenderContext.GetTextRect(aInRect, aEntry, + DrawTextFlags::VCenter | DrawTextFlags::MultiLine + | DrawTextFlags::WordBreak); +} +else +{ +aRect = rRenderContext.GetTextRect(aInRect, aEntry, + DrawTextFlags::Center | DrawTextFlags::VCenter); +} + +if (!bPageEntry) +{ +aRect.AdjustTop(-3); +aRect.AdjustBottom(+3); +} + +return Size(1, aRect.GetHeight()); } IMPL_LINK(QuickFindPanel, SearchFindsListRender, weld::TreeView::render_args, aPayload, void) @@ -113,16 +161,46 @@ IMPL_LINK(QuickFindPanel, SearchFindsListRender, weld::TreeView::render_args, aP const ::tools::Rectangle& rRect = std::get<1>(aPayload); const OUString& rId = std::get<3>(aPayload); -tools::Rectangle aRect( -rRect.TopLeft(), -Size(rRenderContext.GetOutputSize().Width() - rRect.Left(), rRect.GetHeight())); +const bool bPageEntry = rId[0] == '-'; -int nIndex = m_xSearchFindsList->find_id(rId); -OUString aEntry(m_xSearchFindsList->get_text(nIndex)); +OUString aEntry(rId); -const bool bPageEntry = rId[0] == '-'; if (!bPageEntry) { +int nIndex = m_xSearchFindsList->find_id(rId); +aEntry =
core.git: sw/source
sw/source/uibase/sidebar/QuickFindPanel.cxx | 80 +--- sw/source/uibase/sidebar/QuickFindPanel.hxx |2 2 files changed, 74 insertions(+), 8 deletions(-) New commits: commit 6fb5e52479b0a3e6f63ae96886884b3653abddaf Author: Jim Raykowski AuthorDate: Wed Jun 12 12:59:05 2024 -0800 Commit: Jim Raykowski CommitDate: Mon Jun 24 18:01:49 2024 +0200 tdf#160541 Resolves Quickfind sidebar: present results with some indication of location in document Change-Id: I9262511c46b9a89fd7c5d7fe93551fecbd21cecf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168832 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx b/sw/source/uibase/sidebar/QuickFindPanel.cxx index cffca4511ef2..753888702587 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.cxx +++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx @@ -21,6 +21,8 @@ #include #include #include +#include +#include const int MinimumPanelWidth = 250; @@ -60,7 +62,6 @@ QuickFindPanel::QuickFindPanel(weld::Widget* pParent) , m_xSearchFindsList(m_xBuilder->weld_tree_view(u"searchfinds"_ustr)) , m_nRowHeight(m_xSearchFindsList->get_height_rows(4)) , m_pWrtShell(::GetActiveWrtShell()) - { m_xContainer->set_size_request(MinimumPanelWidth, -1); m_xSearchFindsList->set_size_request(1, m_nRowHeight); @@ -75,6 +76,7 @@ QuickFindPanel::QuickFindPanel(weld::Widget* pParent) LINK(this, QuickFindPanel, SearchFindsListSelectionChangedHandler)); m_xSearchFindsList->connect_row_activated( LINK(this, QuickFindPanel, SearchFindsListRowActivatedHandler)); +m_xSearchFindsList->connect_mouse_press(LINK(this, QuickFindPanel, MousePressHandler)); } QuickFindPanel::~QuickFindPanel() @@ -83,6 +85,16 @@ QuickFindPanel::~QuickFindPanel() m_xSearchFindsList.reset(); } +IMPL_LINK(QuickFindPanel, MousePressHandler, const MouseEvent&, rMEvt, bool) +{ +if (std::unique_ptr xEntry(m_xSearchFindsList->make_iterator()); +m_xSearchFindsList->get_dest_row_at_pos(rMEvt.GetPosPixel(), xEntry.get(), false, false)) +{ +return m_xSearchFindsList->get_id(*xEntry)[0] == '-'; +} +return false; +} + IMPL_LINK_NOARG(QuickFindPanel, SearchFindEntryActivateHandler, weld::Entry&, bool) { FillSearchFindsList(); @@ -100,19 +112,55 @@ IMPL_LINK(QuickFindPanel, SearchFindsListRender, weld::TreeView::render_args, aP vcl::RenderContext& rRenderContext = std::get<0>(aPayload); const ::tools::Rectangle& rRect = std::get<1>(aPayload); const OUString& rId = std::get<3>(aPayload); -int nIndex = m_xSearchFindsList->find_id(rId); -OUString aEntry(m_xSearchFindsList->get_text(nIndex)); -DrawTextFlags const nTextStyle = DrawTextFlags::Left | DrawTextFlags::VCenter - | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak; + tools::Rectangle aRect( rRect.TopLeft(), Size(rRenderContext.GetOutputSize().Width() - rRect.Left(), rRect.GetHeight())); -rRenderContext.DrawText(aRect, aEntry, nTextStyle); + +int nIndex = m_xSearchFindsList->find_id(rId); +OUString aEntry(m_xSearchFindsList->get_text(nIndex)); + +const bool bPageEntry = rId[0] == '-'; +if (!bPageEntry) +{ +rRenderContext.DrawText(aRect, aEntry, +DrawTextFlags::VCenter | DrawTextFlags::MultiLine +| DrawTextFlags::WordBreak); +} +else +{ +aEntry = aEntry.copy(1); // remove '-' +tools::Long aTextWidth = rRenderContext.GetTextWidth(aEntry); +tools::Long aTextHeight = rRenderContext.GetTextHeight(); + +rRenderContext.Push(); +rRenderContext.SetLineColor(COL_BLACK); +rRenderContext.DrawLine( +aRect.LeftCenter(), +Point(aRect.Center().AdjustX(-(aTextWidth / 2)) - 4, aRect.Center().getY())); +rRenderContext.DrawText(Point(aRect.Center().AdjustX(-(aTextWidth / 2)), + aRect.Center().AdjustY(-(aTextHeight / 2) - 1)), +aEntry); +rRenderContext.DrawLine( +Point(aRect.Center().AdjustX(aTextWidth / 2) + 5, aRect.Center().getY()), +aRect.RightCenter()); +rRenderContext.Pop(); +} } IMPL_LINK_NOARG(QuickFindPanel, SearchFindsListSelectionChangedHandler, weld::TreeView&, void) { -std::unique_ptr& rxPaM = m_vPaMs[m_xSearchFindsList->get_cursor_index()]; +std::unique_ptr xEntry(m_xSearchFindsList->make_iterator()); +if (!m_xSearchFindsList->get_cursor(xEntry.get())) +return; + +OUString sId = m_xSearchFindsList->get_id(*xEntry); + +// check for page number entry +if (sId[0] == '-') +return; + +std::unique_ptr& rxPaM = m_vPaMs[sId.toInt64()]; m_pWrtShell->StartAction(); bool bFound = false; @@ -144,6 +192
core.git: svx/source svx/uiconfig
svx/source/form/filtnav.cxx|2 +- svx/uiconfig/ui/filternavigator.ui | 13 + 2 files changed, 10 insertions(+), 5 deletions(-) New commits: commit c5bbbe987321d8f9e101fab9d67ddbf3d4f8dfca Author: Jim Raykowski AuthorDate: Thu Jun 20 17:04:11 2024 -0800 Commit: Jim Raykowski CommitDate: Fri Jun 21 18:29:40 2024 +0200 tdf#161537 fix Filter Navigator no longer shows the name of the field Change-Id: I3dae3458ac5795b217743b1e6897345a22f1bf61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169310 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 722deefaca35..fe633e9fdd20 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1061,7 +1061,7 @@ FmFilterNavigator::FmFilterNavigator(vcl::Window* pTopLevel, std::unique_ptrconnect_custom_get_size(LINK(this, FmFilterNavigator, CustomGetSizeHdl)); m_xTreeView->connect_custom_render(LINK(this, FmFilterNavigator, CustomRenderHdl)); -m_xTreeView->set_column_custom_renderer(0, true); +m_xTreeView->set_column_custom_renderer(1, true); m_xTreeView->connect_changed(LINK(this, FmFilterNavigator, SelectHdl)); m_xTreeView->connect_key_press(LINK(this, FmFilterNavigator, KeyInputHdl)); diff --git a/svx/uiconfig/ui/filternavigator.ui b/svx/uiconfig/ui/filternavigator.ui index 46820867f42e..8999be58f37b 100644 --- a/svx/uiconfig/ui/filternavigator.ui +++ b/svx/uiconfig/ui/filternavigator.ui @@ -4,7 +4,7 @@ - + @@ -43,16 +43,21 @@ - + +False + + + + 6 - + 0 - + True
core.git: svx/uiconfig
svx/uiconfig/ui/filternavigator.ui | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) New commits: commit 28438a5b1f1903fe0a69d53f9bba7d3837380b57 Author: Jim Raykowski AuthorDate: Thu Jun 20 16:51:01 2024 -0800 Commit: Jim Raykowski CommitDate: Fri Jun 21 18:27:52 2024 +0200 Resave with newer Glade version Change-Id: I2b3adc322b4dc928069f306ccb673fa23fba70a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169309 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/svx/uiconfig/ui/filternavigator.ui b/svx/uiconfig/ui/filternavigator.ui index 99297b0dc10f..46820867f42e 100644 --- a/svx/uiconfig/ui/filternavigator.ui +++ b/svx/uiconfig/ui/filternavigator.ui @@ -1,5 +1,5 @@ - + @@ -16,29 +16,29 @@ True -False +False True True True -True +True True True -in +in --1 +-1 True -True -True +True +True True True liststore1 -False +False True -1 -True +1 +True
core.git: sw/source
sw/source/uibase/sidebar/QuickFindPanel.cxx | 208 ++-- 1 file changed, 136 insertions(+), 72 deletions(-) New commits: commit 99ed68ac1fbaf883ddc730936299bba95d9e1d6f Author: Jim Raykowski AuthorDate: Fri Jun 7 18:00:35 2024 -0800 Commit: Jim Raykowski CommitDate: Mon Jun 10 09:04:19 2024 +0200 tdf#160538 Quickfind sidebar list finds in frames and footnotes and endnotes in the order of occurance in the document Change-Id: Ifd91065ed416495084ba7f396f740daef5233c90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168566 Tested-by: Jenkins Reviewed-by: Heiko Tietze Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx b/sw/source/uibase/sidebar/QuickFindPanel.cxx index 176ae3ad2eab..cffca4511ef2 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.cxx +++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx @@ -14,19 +14,36 @@ #include #include #include -#include #include #include -#include #include #include #include -#include -using namespace css; -using namespace std; +#include +#include const int MinimumPanelWidth = 250; +namespace +{ +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; +} +} +} + namespace sw::sidebar { std::unique_ptr QuickFindPanel::Create(weld::Widget* pParent) @@ -149,85 +166,132 @@ void QuickFindPanel::FillSearchFindsList() comphelper::dispatchCommand(u".uno:ExecuteSearch"_ustr, aPropertyValues); -if (m_pWrtShell->HasMark()) +if (!m_pWrtShell->HasMark()) +return; + +for (SwPaM& rPaM : m_pWrtShell->GetCursor()->GetRingContainer()) { -for (SwPaM& rPaM : m_pWrtShell->GetCursor()->GetRingContainer()) -{ -SwPosition* pMarkPosition = rPaM.GetMark(); -const SwContentIndex aContentIndex = pMarkPosition->nContent; -const SwContentNode* pContentNode = aContentIndex.GetContentNode(); -const SwTextNode* pTextNode = pContentNode->GetTextNode(); -const OUString& sNodeText = pTextNode->GetText(); -auto nMarkIndex = rPaM.GetMark()->nContent.GetIndex(); -auto nPointIndex = rPaM.GetPoint()->nContent.GetIndex(); - -// determine the text node text subview start index for the list entry text -auto nStartIndex = nMarkIndex - 50; -if (nStartIndex < 0) -{ -nStartIndex = 0; -} -else +SwPosition* pMarkPosition = rPaM.GetMark(); +SwPosition* pPointPosition = rPaM.GetPoint(); +std::unique_ptr xPaM(std::make_unique(*pMarkPosition, *pPointPosition)); +m_vPaMs.push_back(std::move(xPaM)); +} + +// tdf#160538 sort finds in frames and footnotes in the order they occur in the document +const SwNodeOffset nEndOfInsertsIndex = m_pWrtShell->GetNodes().GetEndOfInserts().GetIndex(); +const SwNodeOffset nEndOfExtrasIndex = m_pWrtShell->GetNodes().GetEndOfExtras().GetIndex(); +std::stable_sort( +m_vPaMs.begin(), m_vPaMs.end(), +[&nEndOfInsertsIndex, &nEndOfExtrasIndex, this](const std::unique_ptr& a, +const std::unique_ptr& b) { +SwPosition aPos(*a->Start()); +SwPosition bPos(*b->Start()); +// use page number for footnotes and endnotes +if (aPos.GetNodeIndex() >= nEndOfInsertsIndex +&& bPos.GetNodeIndex() < nEndOfInsertsIndex) +return b->GetPageNum() >= a->GetPageNum(); +// use anchor position for finds that are located in flys +if (nEndOfExtrasIndex >= aPos.GetNodeIndex()) +getAnchorPos(aPos); +if (nEndOfExtrasIndex >= bPos.GetNodeIndex()) +getAnchorPos(bPos); +if (aPos == bPos) { -// tdf#160539 format search finds results also to word boundaries -sal_Unicode ch; -do +// probably in same or nested fly frame +// sort using layout position +SwRect aCharRect, bCharRect; +if (SwContentFrame* pFrame = a->GetMarkContentNode()->GetTextNode()->getLayoutFrame( +m_pWrtShell->GetLayout())) { -ch = sNodeText[nStartIndex]; -} while (++nStartIndex < nMarkIndex && ch != ' ' && ch != ' '); -if (nStart
core.git: sw/source
sw/source/uibase/sidebar/QuickFindPanel.cxx | 52 ++-- 1 file changed, 49 insertions(+), 3 deletions(-) New commits: commit 200f74b8004564d226dce5cde7d4aa2d109f258f Author: Jim Raykowski AuthorDate: Sun Jun 2 18:23:10 2024 -0800 Commit: Jim Raykowski CommitDate: Thu Jun 6 09:06:16 2024 +0200 tdf#160539 Quickfind sidebar: Words are cut-off at beginning and end Adjust the search finds list entry text subview of paragraph text around the search find to start and end at a pseudo word boundary. Change-Id: Ib1e94b0fa7f5b3f557a19259b1c83bf43ca6fa14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168355 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx b/sw/source/uibase/sidebar/QuickFindPanel.cxx index 37edbc90019a..176ae3ad2eab 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.cxx +++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx @@ -161,19 +161,65 @@ void QuickFindPanel::FillSearchFindsList() auto nMarkIndex = rPaM.GetMark()->nContent.GetIndex(); auto nPointIndex = rPaM.GetPoint()->nContent.GetIndex(); +// determine the text node text subview start index for the list entry text auto nStartIndex = nMarkIndex - 50; if (nStartIndex < 0) +{ nStartIndex = 0; +} +else +{ +// tdf#160539 format search finds results also to word boundaries +sal_Unicode ch; +do +{ +ch = sNodeText[nStartIndex]; +} while (++nStartIndex < nMarkIndex && ch != ' ' && ch != ' '); +if (nStartIndex < nMarkIndex) +{ +// move past neighboring space and tab characters +ch = sNodeText[nStartIndex]; +while (nStartIndex < nMarkIndex && (ch == ' ' || ch == ' ')) +ch = sNodeText[++nStartIndex]; +} +if (nStartIndex == nMarkIndex) // no white space found +nStartIndex = nMarkIndex - 50; +} + +// determine the text node text subview end index for the list entry text auto nEndIndex = nPointIndex + 50; -if (nEndIndex > sNodeText.getLength()) +if (nEndIndex >= sNodeText.getLength()) +{ +nEndIndex = sNodeText.getLength() - 1; +} +else { -nEndIndex = sNodeText.getLength(); +// tdf#160539 format search finds results also to word boundaries +sal_Unicode ch; +do +{ +ch = sNodeText[nEndIndex]; +} while (--nEndIndex > nPointIndex && ch != ' ' && ch != ' '); +if (nEndIndex > nPointIndex) +{ +// move past neighboring space and tab characters +ch = sNodeText[nEndIndex]; +while (nEndIndex > nPointIndex && (ch == ' ' || ch == ' ')) +ch = sNodeText[--nEndIndex]; +} +if (nEndIndex == nPointIndex) // no white space found +{ +nEndIndex = nPointIndex + 50; +if (nEndIndex >= sNodeText.getLength()) +nEndIndex = sNodeText.getLength() - 1; +} } + auto nCount = nMarkIndex - nStartIndex; OUString sTextBeforeFind = OUString::Concat(sNodeText.subView(nStartIndex, nCount)); auto nCount1 = nPointIndex - nMarkIndex; OUString sFind = OUString::Concat(sNodeText.subView(nMarkIndex, nCount1)); -auto nCount2 = nEndIndex - nPointIndex; +auto nCount2 = nEndIndex - nPointIndex + 1; OUString sTextAfterFind = OUString::Concat(sNodeText.subView(nPointIndex, nCount2)); OUString sStr = sTextBeforeFind + "[" + sFind + "]" + sTextAfterFind;
core.git: sw/source
sw/source/uibase/utlui/content.cxx | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) New commits: commit 24c28600430668c0bef6c24679a2fd0279d6253f Author: Jim Raykowski AuthorDate: Tue May 28 06:39:19 2024 -0800 Commit: Jim Raykowski CommitDate: Thu May 30 00:22:24 2024 +0200 SwNavigator: simplify table delete Change-Id: Ic26712972e3465eba10dbaba9cfce20365c5644a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168172 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 78177a9e226c..edfcac1b63b0 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5597,21 +5597,8 @@ void SwContentTree::EditEntry(const weld::TreeIter& rEntry, EditEntryMode nMode) } else if(nMode == EditEntryMode::DELETE) { -m_pActiveShell->StartAction(); -OUString sTable = SwResId(STR_TABLE_NAME); -SwRewriter aRewriterTableName; -aRewriterTableName.AddRule(UndoArg1, SwResId(STR_START_QUOTE)); -aRewriterTableName.AddRule(UndoArg2, pCnt->GetName()); -aRewriterTableName.AddRule(UndoArg3, SwResId(STR_END_QUOTE)); -sTable = aRewriterTableName.Apply(sTable); - -SwRewriter aRewriter; -aRewriter.AddRule(UndoArg1, sTable); -m_pActiveShell->StartUndo(SwUndoId::DELETE, &aRewriter); - m_pActiveShell->GetView().GetViewFrame().GetDispatcher()->Execute(FN_TABLE_SELECT_ALL); -m_pActiveShell->DeleteRow(); -m_pActiveShell->EndUndo(); -m_pActiveShell->EndAction(); +m_pActiveShell->SelTable(); +m_pActiveShell->DeleteTable(); } else if(nMode == EditEntryMode::RENAME) {
core.git: sw/source sw/uiconfig
sw/source/uibase/inc/conttree.hxx |7 +--- sw/source/uibase/utlui/content.cxx | 38 +++-- sw/uiconfig/swriter/ui/navigatorcontextmenu.ui |8 - 3 files changed, 21 insertions(+), 32 deletions(-) New commits: commit ae94c420e6269f99cdaa611d19e73fc92ebd234b Author: Jim Raykowski AuthorDate: Tue May 21 15:05:33 2024 -0800 Commit: Jim Raykowski CommitDate: Tue May 28 06:25:46 2024 +0200 SwNavigator: Improve Indexes context menu * Removes "Remove Index" menu item in favor of the repeated function "Delete index" menu item. * Hides the "Update", "Delete Index", and "Rename..." menu items when the document or index is set read-only. Change-Id: Ie907c33e2fe991ba6c02ad987193db481f375116 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167913 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index 9a67d986f55f..d58123287e07 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -50,10 +50,9 @@ enum class EditEntryMode { EDIT = 0, UPD_IDX = 1, -RMV_IDX = 2, -UNPROTECT_TABLE= 3, -DELETE= 4, -RENAME= 5, +UNPROTECT_TABLE= 2, +DELETE= 3, +RENAME= 4, }; // Flags for PopupMenu-enable/disable diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 1346d3bb5094..f462148fa7d8 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1692,8 +1692,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) bRemoveGotoEntry = true; bool bRemovePostItEntries = true; -bool bRemoveIndexEntries = true; -bool bRemoveCopyEntry = true; +bool bRemoveUpdateIndexEntry = true; +bool bRemoveReadonlyIndexEntry = true;bool bRemoveCopyEntry = true; bool bRemoveEditEntry = true; bool bRemoveUnprotectEntry = true; bool bRemoveDeleteChapterEntry = true, @@ -1825,7 +1825,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) (State::ACTIVE == m_eState || (GetActiveView() && m_pActiveShell == GetActiveView()->GetWrtShellPtr())) && lcl_IsContent(*xEntry, *m_xTreeView)) { -const bool bReadonly = m_pActiveShell->GetView().GetDocShell()->IsReadOnly(); +bool bReadonly = m_pActiveShell->GetView().GetDocShell()->IsReadOnly(); const bool bVisible = !weld::fromId(m_xTreeView->get_id(*xEntry))->IsInvisible(); const bool bProtected = weld::fromId(m_xTreeView->get_id(*xEntry))->IsProtect(); const bool bProtectBM = (ContentTypeId::BOOKMARK == nContentType) @@ -1873,9 +1873,6 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) case ContentTypeId::REFERENCE: bRemoveDeleteReferenceEntry = false; break; -case ContentTypeId::INDEX: -bRemoveDeleteIndexEntry = false; -break; case ContentTypeId::POSTIT: bRemoveDeleteCommentEntry = false; break; @@ -1919,12 +1916,16 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) { if(ContentTypeId::INDEX == nContentType) { -bRemoveIndexEntries = false; - +bRemoveReadonlyIndexEntry = false; +bRemoveEditEntry = false; const SwTOXBase* pBase = weld::fromId(m_xTreeView->get_id(*xEntry))->GetTOXBase(); -if (!pBase->IsTOXBaseInReadonly()) -bRemoveEditEntry = false; - +if (!pBase->IsTOXBaseInReadonly() && !SwEditShell::IsTOXBaseReadonly(*pBase)) +{ +bRemoveUpdateIndexEntry = false; +bRemoveDeleteIndexEntry = false; +} +else +bReadonly = true; xPop->set_active(OUString::number(405), SwEditShell::IsTOXBaseReadonly(*pBase)); } else if(ContentTypeId::TABLE == nContentType) @@ -1955,7 +1956,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) else bRemoveEditEntry = false; } -if (bRenamable) +if (bRenamable && !bReadonly) bRemoveRenameEntry = false; } else @@ -2071,12 +2072,11 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) if (bRemoveRenameEntry) xPop->remove(OUString::number(502)); -if (bRemoveIndexEntries) -{ -xPop->remove(OUString
core.git: sw/source
sw/source/uibase/utlui/content.cxx | 24 +++- 1 file changed, 19 insertions(+), 5 deletions(-) New commits: commit 9ccdb4c63445ad9ca7bdba869e1bb967b7f622c8 Author: Jim Raykowski AuthorDate: Sun May 5 22:13:54 2024 -0800 Commit: Jim Raykowski CommitDate: Tue May 7 18:07:26 2024 +0200 tdf#160598 follow up to make delete key work Adds delete key handling for delete all footnotes/endnotes from the Navigator. Change-Id: Ic1d49377631344ac5e6fdc81c07eebde0470a6be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167180 Reviewed-by: Jim Raykowski Tested-by: Jenkins diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 3e5a2faa8043..5642ff20a790 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -4769,13 +4769,27 @@ IMPL_LINK(SwContentTree, KeyInputHdl, const KeyEvent&, rEvent, bool) else if(aCode.GetCode() == KEY_DELETE && 0 == aCode.GetModifier()) { std::unique_ptr xEntry(m_xTreeView->make_iterator()); -if (m_xTreeView->get_selected(xEntry.get()) && lcl_IsContent(*xEntry, *m_xTreeView)) +if (!m_pActiveShell->GetView().GetDocShell()->IsReadOnly() +&& m_xTreeView->get_selected(xEntry.get())) { - assert(dynamic_cast(weld::fromId(m_xTreeView->get_id(*xEntry; -if (weld::fromId(m_xTreeView->get_id(*xEntry))->GetParent()->IsDeletable() && -!m_pActiveShell->GetView().GetDocShell()->IsReadOnly()) +if (lcl_IsContent(*xEntry, *m_xTreeView)) +{ + assert(dynamic_cast(weld::fromId(m_xTreeView->get_id(*xEntry; +if (weld::fromId(m_xTreeView->get_id(*xEntry))->GetParent()->IsDeletable()) +{ +EditEntry(*xEntry, EditEntryMode::DELETE); +} +} +else { -EditEntry(*xEntry, EditEntryMode::DELETE); +SwContentType* pContentType += weld::fromId(m_xTreeView->get_id(*xEntry)); +if (pContentType->GetMemberCount() +&& (pContentType->GetType() == ContentTypeId::FOOTNOTE +|| pContentType->GetType() == ContentTypeId::ENDNOTE)) +{ +ExecuteContextMenuAction("deleteallfootnotes"); +} } } }
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(&rParent, 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(&rParent, 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 (!pNavi-
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 ob
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( &pViewShell->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 SdPageObjsTLV::AddS
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 ? &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 too
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()) ); -aSet.Pu
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 NC_("STR_HIDDE
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" +m_xDocListBox->a
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, &rName, &rName, nullptr, nullptr, false, xResult.get()); +} else rBox.insert(pParent, -1, &rName, &rName, 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 &rMEvt) +{ +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 0170a8f68a97..dfda8827292
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 = [&pPostItField, 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(&rParent, 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(&rParent)); +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(&rParent)); + +// 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 (!m_xTreeView->get_selected(xFirst.get(
[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 != Cont
[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 &rSet ) } 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( SID_BITMAP_LIST
[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(&aIdx); 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){ + [&nEndOfExtrasIndex, 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 &&