[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/sidebar/SlideBackground.cxx | 16 1 file changed, 8 insertions(+), 8 deletions(-) New commits: commit 8e67e3e5e1da4e1a1fc6e7c0197b6b08fcd50d45 Author: Szymon Kłos AuthorDate: Mon Nov 8 14:01:19 2021 +0100 Commit: Andras Timar CommitDate: Mon Nov 8 14:40:54 2021 +0100 lok: hide useless insert image button in sidebar do this also in draw, not only in impress Change-Id: Iaaf2349cfb98b801957b71bd4504f0e9efbfba4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124840 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 0ba486884b25..6ed5af536527 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -328,14 +328,6 @@ void SlideBackground::HandleContextChange( mpInsertImage->Show(); } -// The Insert Image button in the sidebar issues .uno:SelectBackground, -// which when invoked without arguments will open the file-open-dialog -// to prompt the user to select a file. This is useless in LOOL. -// Hide for now so the user will only be able to use the menu to insert -// background image, which prompts the user for file selection in the browser. -if (comphelper::LibreOfficeKit::isActive()) -mpInsertImage->Hide(); - // Need to do a relayouting, otherwise the panel size is not updated after show / hide controls sfx2::sidebar::Panel* pPanel = dynamic_cast(GetParent()); if(pPanel) @@ -357,6 +349,14 @@ void SlideBackground::HandleContextChange( mpBackgroundLabel->Hide(); } } + +// The Insert Image button in the sidebar issues .uno:SelectBackground, +// which when invoked without arguments will open the file-open-dialog +// to prompt the user to select a file. This is useless in LOOL. +// Hide for now so the user will only be able to use the menu to insert +// background image, which prompts the user for file selection in the browser. +if (comphelper::LibreOfficeKit::isActive()) +mpInsertImage->Hide(); } void SlideBackground::Update()
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/filter/eppt/pptx-epptooxml.cxx | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) New commits: commit d5348dd66209697138529e41dd63ee17eff71b3c Author: Sarper Akdemir AuthorDate: Mon Jun 28 13:29:23 2021 +0300 Commit: Jan Holesovsky CommitDate: Wed Jun 30 09:53:57 2021 +0200 tdf#59323 tdf#142228 pptx export: fix datetime footers backwards compatibility Versions before 166671f4aa19deec47c10a220ae1d29fa57faa93 do not import the datetime field as expected if there's no text in the datetime field. To compensate that, added placeholder text "Date" inside them. Fixes regression from: 25ae0de974befb9c279936046056a850d77e0dca tdf#59323: pptx export: add support for slide footers Change-Id: I8e35102bc0bb9a2e540cfdd59fb0dc2a0b23f185 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118009 Reviewed-by: Jan Holesovsky Tested-by: Jenkins CollaboraOffice diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index e3619e8ce96b..5e93fbb446bf 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -1613,6 +1613,10 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceTextBody( bool bIsDateTimeFixed = false; xPagePropSet->getPropertyValue("IsDateTimeFixed") >>= bIsDateTimeFixed; +// Ideally "Date" should be replaced with the formatted date text +// but since variable datetime overrides the text, this seems fine for now. +OUString aDateTimeText = "Date"; + if(ePageType != LAYOUT && !bIsDateTimeFixed) { sal_Int32 nDateTimeFormat = 0; @@ -1632,18 +1636,18 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceTextBody( { OString aUUID(comphelper::xml::generateGUIDString()); mpFS->startElementNS(XML_a, XML_fld, XML_id, aUUID.getStr(), XML_type, aDateTimeType.toUtf8()); -mpFS->endElementNS(XML_a, XML_fld); } else { -OUString aDateTimeText; xPagePropSet->getPropertyValue("DateTimeText") >>= aDateTimeText; mpFS->startElementNS(XML_a, XML_r); -mpFS->startElementNS(XML_a, XML_t); -mpFS->writeEscaped(aDateTimeText); -mpFS->endElementNS(XML_a, XML_t); -mpFS->endElementNS(XML_a, XML_r); } + +mpFS->startElementNS(XML_a, XML_t); +mpFS->writeEscaped(aDateTimeText); +mpFS->endElementNS(XML_a, XML_t); + +mpFS->endElementNS(XML_a, bIsDateTimeFixed ? XML_r : XML_fld); break; } default: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/filter/pdf/sdpdffilter.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 18264abc2d0cd56c1838e71045d5d11b3e0aa947 Author: Michael Meeks AuthorDate: Fri Jun 25 10:31:28 2021 +0100 Commit: Michael Meeks CommitDate: Fri Jun 25 18:23:30 2021 +0200 pdf import: handle out of memory / failure to duplicate page. Avoid some reported segv's from null pages. Change-Id: Ic336b36fb57dc70fff183cd5aa5f3f3ef4562674 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117872 Tested-by: Jenkins CollaboraOffice Reviewed-by: Gökay ŞATIR diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx index 6bc036f7fa21..290eea440e3c 100644 --- a/sd/source/filter/pdf/sdpdffilter.cxx +++ b/sd/source/filter/pdf/sdpdffilter.cxx @@ -71,12 +71,17 @@ bool SdPdfFilter::Import() // Create the page and insert the Graphic. SdPage* pPage = mrDocument.GetSdPage(nPageNumber, PageKind::Standard); +if (!pPage) // failed to duplicate page, out of memory? +return false; // Make the page size match the rendered image. pPage->SetSize(aSizeHMM); SdrGrafObj* pSdrGrafObj = new SdrGrafObj(pPage->getSdrModelFromSdrPage(), rGraphic, tools::Rectangle(Point(), aSizeHMM)); +if (!pSdrGrafObj) // out of memory +return false; + pPage->InsertObject(pSdrGrafObj); for (auto const& rPDFAnnotation : rPDFGraphicResult.maAnnotations) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/filter/eppt/pptx-epptooxml.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 9ce5536514646b364f07ff7e124e90444bdf7b32 Author: Noel Grandin AuthorDate: Thu Jun 17 15:47:59 2021 +0200 Commit: Mike Kaganski CommitDate: Wed Jun 23 23:33:11 2021 +0200 avoid maybe-uninitialized in PowerPointShapeExport /home/noel/libo3/sd/source/filter/eppt/pptx-epptooxml.cxx: In member function ‘oox::drawingml::ShapeExport& oox::core::PowerPointShapeExport::WritePlaceholderReferenceTextBody(oox::core::PlaceholderType, PageType, com::sun::star::uno::Reference)’: /home/noel/libo3/sd/source/filter/eppt/pptx-epptooxml.cxx:1715:31: error: ‘nDateTimeFormat’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1715 | SvxTimeFormat eTime = static_cast(nDateTimeFormat >> 4); | ^ /home/noel/libo3/sd/source/filter/eppt/pptx-epptooxml.cxx:1707:36: error: ‘bIsDateTimeFixed’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1707 | if(ePageType != LAYOUT && !bIsDateTimeFixed) |^~~~ Change-Id: I7f622321680705fb0b0fa42630949c8d6af8488e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117398 Tested-by: Jenkins Reviewed-by: Noel Grandin (cherry picked from commit 3c24e7ed972ae2fc431365e4884e27c0b243c905) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117716 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mike Kaganski diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index e9b7e7a6..e3619e8ce96b 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -1610,12 +1610,12 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceTextBody( case DateAndTime: { OUString aDateTimeType = "datetime1"; -bool bIsDateTimeFixed; +bool bIsDateTimeFixed = false; xPagePropSet->getPropertyValue("IsDateTimeFixed") >>= bIsDateTimeFixed; if(ePageType != LAYOUT && !bIsDateTimeFixed) { -sal_Int32 nDateTimeFormat; +sal_Int32 nDateTimeFormat = 0; xPagePropSet->getPropertyValue("DateTimeFormat") >>= nDateTimeFormat; // 4 LSBs represent the date ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/filter/eppt/epptooxml.hxx | 10 +++ sd/source/filter/eppt/pptx-epptooxml.cxx | 83 ++- 2 files changed, 59 insertions(+), 34 deletions(-) New commits: commit e22a70048ba0025107b1a6c4b14564a6e786bc5a Author: Sarper Akdemir AuthorDate: Wed Jun 9 07:54:04 2021 +0300 Commit: Mike Kaganski CommitDate: Wed Jun 23 23:31:58 2021 +0200 tdf#59323: pptx export: add placeholder index to master footer placeholders OOXML uses placeholder index to determine from which layout placeholder it should be inheriting styles, position etc. Added maPlaceholderShapeToIndexMap that stores corresponding Placeholder index for a Placeholder XShape on the master slide. Right now only used for placeholder types Footer, DateAndTime and SlideNumber. Change-Id: If788f235d00b6d1cde7194d9e4a0789e019432c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117010 Tested-by: Jenkins Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117538 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mike Kaganski diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx index d4f2b618f25d..0b9f5f5fd812 100644 --- a/sd/source/filter/eppt/epptooxml.hxx +++ b/sd/source/filter/eppt/epptooxml.hxx @@ -119,6 +119,12 @@ private: static void WriteDiagram(const FSHelperPtr& pFS, PowerPointShapeExport& rDML, const css::uno::Reference& rXShape, int nDiagramId); +/** Create a new placeholder index for a master placeholder shape + +@param rXShape Master placeholder shape +@returns Placeholder index +*/ +unsigned CreateNewPlaceholderIndex(const css::uno::Reference& rXShape); /// Should we export as .pptm, ie. do we contain macros? bool mbPptm; @@ -141,6 +147,10 @@ private: ::oox::drawingml::ShapeExport::ShapeHashMap maShapeMap; +unsigned mnPlaceholderIndexMax; ///< Last used placeholder index +/// Map of placeholder indexes for Master placeholders +std::unordered_map< css::uno::Reference, unsigned > maPlaceholderShapeToIndexMap; + struct AuthorComments { sal_Int32 nId; sal_Int32 nLastIndex; diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 8a7db7302ff0..2c7a0dc2fb94 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -128,8 +128,35 @@ void WriteSndAc(const FSHelperPtr& pFS, const OUString& sSoundRelId, const OUStr pFS->endElement(FSNS(XML_p, XML_stSnd)); pFS->endElement(FSNS(XML_p, XML_sndAc)); } -} +const char* getPlaceholderTypeName(PlaceholderType ePlaceholder) +{ +switch (ePlaceholder) +{ +case SlideImage: +return "sldImg"; +case Notes: +return "body"; +case Header: +return "hdr"; +case Footer: +return "ftr"; +case SlideNumber: +return "sldNum"; +case DateAndTime: +return "dt"; +case Outliner: +return "body"; +case Title: +return "title"; +case Subtitle: +return "subTitle"; +default: +SAL_INFO("sd.eppt", "warning: unhandled placeholder type: " << ePlaceholder); +return ""; +} +} +} } } @@ -335,6 +362,7 @@ PowerPointExport::PowerPointExport(const Reference< XComponentContext >& rContex , mnAnimationNodeIdMax(1) , mnDiagramId(1) , mbCreateNotes(false) +, mnPlaceholderIndexMax(1) { comphelper::SequenceAsHashMap aArgumentsMap(rArguments); mbPptm = aArgumentsMap.getUnpackedValueOrDefault("IsPPTM", false); @@ -1449,41 +1477,22 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShap mpFS->endElementNS(XML_p, XML_cNvSpPr); mpFS->startElementNS(XML_p, XML_nvPr); -const char* pType = nullptr; -switch (ePlaceholder) +bool bUsePlaceholderIndex += ePlaceholder == Footer || ePlaceholder == DateAndTime || ePlaceholder == SlideNumber; +const char* pType = getPlaceholderTypeName(ePlaceholder); + +SAL_INFO("sd.eppt", "write placeholder " << pType); +if (bUsePlaceholderIndex) { -case SlideImage: -pType = "sldImg"; -break; -case Notes: -pType = "body"; -break; -case Header: -pType = "hdr"; -break; -case Footer: -pType = "ftr"; -break; -case SlideNumber: -pType = "sldNum"; -break; -case DateAndTime: -pType = "dt"; -break; -case Outliner: -pType = "body"; -break; -case Title: -pType = "title"; -break; -case Subtitle: -pType = "subTitle"; -break; -default: -SAL_INFO("sd.eppt", "warning: unhandled placeholder type: " << ePlaceholder); +
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/Outliner.cxx | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) New commits: commit b4d5f54ed4af520d22f52cf4c12299d2db9fb066 Author: Tomaž Vajngerl AuthorDate: Sun Jun 6 20:55:28 2021 +0900 Commit: Miklos Vajna CommitDate: Tue Jun 15 09:31:37 2021 +0200 tdf#142478 fix crash when searching and a viewshell change occurs When searching a impress document for a word, and the word is in notes as welll as in the document, a crash happens (only when searching with "find all"). The regressing commit changed that the search is now bound to a view (and to a viewshell). When searching for words in notes and document, at the transition from "standard" to "notes" page kind mode, the view and viewshells are destroyed and the new one created again. The problem lies here as when we destroy the viewshell, we also destroy the search context and FuSearch objects, but we are still executing the search -> crash. The solution for this is that when we change the page kind, we take the FuSearch object from the old viewshell and put it into the newly created viewshell, so that we keep the FuSearch object alive and don't throw away the search context too. Change-Id: I50931cca2a20c5704f7450e3cc8b3466af4c5a3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116758 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 3b75f9add7ed80e803b0771d86892d6ca0f47e71) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117145 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 2a6a41998e71..f7981cf4940b 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -61,6 +61,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -1550,6 +1551,11 @@ void SdOutliner::SetViewMode (PageKind ePageKind) bool bMatchMayExist = mbMatchMayExist; sd::ViewShellBase& rBase = pViewShell->GetViewShellBase(); + +rtl::Reference xFuSearch; +if (pViewShell->GetView()) +xFuSearch = pViewShell->GetView()->getSearchContext().getFunctionSearch(); + SetViewShell(std::shared_ptr()); sd::framework::FrameworkHelper::Instance(rBase)->RequestView( sViewURL, @@ -1560,7 +1566,11 @@ void SdOutliner::SetViewMode (PageKind ePageKind) // instead. But that would involve major restructuring of the // Outliner code. sd::framework::FrameworkHelper::Instance(rBase)->RequestSynchronousUpdate(); -SetViewShell(rBase.GetMainViewShell()); + +auto pNewViewShell = rBase.GetMainViewShell(); +SetViewShell(pNewViewShell); +if (xFuSearch.is() && pNewViewShell->GetView()) + pNewViewShell->GetView()->getSearchContext().setSearchFunction(xFuSearch); // Switching to another view shell has intermediatly called // EndSpelling(). A PrepareSpelling() is pending, so call that now. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/unoidl/unomodel.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 9180416ee296acad5bcd482569c6c53ecfff5b20 Author: Pranam Lashkari AuthorDate: Tue Mar 30 21:52:13 2021 +0530 Commit: Jan Holesovsky CommitDate: Wed Mar 31 10:45:43 2021 +0200 LOK: getPartInfo now returns master page count master page count will be used when switching to master view to know how many slide previews to be shown Change-Id: I11735797d16538a9f667a85b90a86b1e6cf9b5aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113383 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 21298e4da4af..5de97c06936f 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2274,11 +2274,14 @@ OUString SdXImpressDocument::getPartInfo(int nPart) const bool bIsVisible = pViewSh->IsVisible(nPart); const bool bIsSelected = pViewSh->IsSelected(nPart); +const sal_Int16 nMasterPageCount= pViewSh->GetDoc()->GetMasterSdPageCount(pViewSh->GetPageKind()); OUString aPartInfo = "{ \"visible\": \"" + OUString::number(static_cast(bIsVisible)) + "\", \"selected\": \"" + OUString::number(static_cast(bIsSelected)) + +"\", \"masterPageCount\": \"" + +OUString::number(nMasterPageCount) + "\" }"; return aPartInfo; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/drviews4.cxx | 22 ++ 1 file changed, 22 insertions(+) New commits: commit 4d1348edad5f884dd4d15d3c10cf935ba0100be1 Author: Szymon Kłos AuthorDate: Mon Mar 22 16:11:03 2021 +0100 Commit: Jan Holesovsky CommitDate: Mon Mar 29 13:55:47 2021 +0200 impress: avoid crash when user edits text and other deletes slide We need to end text edit when page is deleted by other user. Change-Id: I89824c91f5652421a443feb9412acbae65db8800 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112917 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index d6952d79685f..6b4c28d01e94 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -64,6 +65,26 @@ #include #include +namespace { +void EndTextEditOnPage(sal_uInt16 nPageId) +{ +SfxViewShell* pShell = SfxViewShell::GetFirst(); +while (pShell) +{ +::sd::ViewShellBase* pBase = dynamic_cast<::sd::ViewShellBase*>(pShell); +if (pBase) +{ +::sd::ViewShell* pViewSh = pBase->GetMainViewShell().get(); +::sd::DrawViewShell* pDrawSh = dynamic_cast<::sd::DrawViewShell*>(pViewSh); +if (pDrawSh && pDrawSh->GetDrawView() && pDrawSh->getCurrentPage()->getPageId() == nPageId) +pDrawSh->GetDrawView()->SdrEndTextEdit(); +} + +pShell = SfxViewShell::GetNext(*pShell); +} +} +} + namespace sd { #define PIPETTE_RANGE 0 @@ -96,6 +117,7 @@ void DrawViewShell::DeleteActualPage() if((bUseSlideSorter && IsSelected(nPageIndex)) || (!bUseSlideSorter && pPage->IsSelected())) { +EndTextEditOnPage(pPage->getPageId()); Reference< XDrawPage > xPage( xPages->getByIndex( nPageIndex ), UNO_QUERY_THROW ); pagesToDelete.push_back(xPage); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/drviews4.cxx | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) New commits: commit d633ee6bdf464de839f3bcea876f46f4b4e1e594 Author: Szymon Kłos AuthorDate: Mon Mar 22 12:28:36 2021 +0100 Commit: Jan Holesovsky CommitDate: Mon Mar 29 12:30:29 2021 +0200 impress: delete correct page when has multiple users When multiple users are editing the presentation few pages could be selected. Then the first selected page was removed instead of currently selected by user who executed the delete action. SlideSorterViewShell has better knowledge about selected slides by current view. Change-Id: Icb3157c8426027a7edc225249f8dd99270e9b2da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112883 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index be16871f630f..d6952d79685f 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -58,6 +58,7 @@ #include #include +#include #include #include @@ -87,9 +88,15 @@ void DrawViewShell::DeleteActualPage() for (sal_uInt16 i = 0; i < nPageCount; i++) { pPage = GetDoc()->GetSdPage(i, mePageKind); -if(pPage->IsSelected()) +sal_uInt16 nPageIndex = maTabControl->GetPagePos(pPage->getPageId()); + +slidesorter::SlideSorterViewShell* pVShell += slidesorter::SlideSorterViewShell::GetSlideSorter(GetViewShellBase()); +bool bUseSlideSorter = pVShell != nullptr; + +if((bUseSlideSorter && IsSelected(nPageIndex)) || (!bUseSlideSorter && pPage->IsSelected())) { -Reference< XDrawPage > xPage( xPages->getByIndex( maTabControl->GetPagePos(pPage->getPageId()) ), UNO_QUERY_THROW ); +Reference< XDrawPage > xPage( xPages->getByIndex( nPageIndex ), UNO_QUERY_THROW ); pagesToDelete.push_back(xPage); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 505965dd5d05e4711bf5b433b8af06e88e030962 Author: mert AuthorDate: Wed Mar 3 06:13:21 2021 +0300 Commit: Mert Tumer CommitDate: Wed Mar 3 13:58:48 2021 +0100 Draw: Fix crash on multiple page selection on slidesorter Change-Id: Id7461b811d3445df895cf751153bd0dd81f09efc Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111864 Reviewed-by: Jan Holesovsky Tested-by: Jenkins CollaboraOffice diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 82d3e50371eb..3edf068e9adb 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -215,6 +215,7 @@ SlideSorterViewShell* SlideSorterViewShell::GetSlideSorter (ViewShellBase& rBase FrameworkHelper::msCenterPaneURL, FrameworkHelper::msFullScreenPaneURL, FrameworkHelper::msLeftImpressPaneURL, +FrameworkHelper::msLeftDrawPaneURL, OUString()}; try ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/dlg/BulletAndPositionDlg.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit f50b5eb2ac667f73d131a59107e24bd651f67f01 Author: Gokce Kuler AuthorDate: Sat Feb 13 00:50:33 2021 +0300 Commit: Gülşah Köse CommitDate: Fri Feb 26 08:57:18 2021 +0100 tdf#137406 removed Apply to Master button in Slide Master mode Change-Id: Ic19c38a5e6e561cae45cd0a40cfe56d7002efe9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110835 Tested-by: Jenkins Reviewed-by: Gülşah Köse Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111562 Tested-by: Jenkins CollaboraOffice diff --git a/sd/source/ui/dlg/BulletAndPositionDlg.cxx b/sd/source/ui/dlg/BulletAndPositionDlg.cxx index 498ea1befcc5..8b8ec797e223 100644 --- a/sd/source/ui/dlg/BulletAndPositionDlg.cxx +++ b/sd/source/ui/dlg/BulletAndPositionDlg.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #define SHOW_NUMBERING 0 #define SHOW_BULLET 1 @@ -197,6 +198,12 @@ SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window* pWindow, const Sf if (pMetricItem) SetMetric(static_cast(pMetricItem->GetValue())); +// tdf#137406: Crash when clicking "Apply to Master" in Slide Master mode on Bullets and Numbering dialog +DocumentType aDocumentType = pView->GetDoc().GetDocumentType(); +EditMode aEditmode = static_cast<::sd::DrawViewShell*>(pView->GetViewShell())->GetEditMode(); +if (aDocumentType == DocumentType::Impress && aEditmode == EditMode::MasterPage) +m_xApplyToMaster->hide(); + // End PageCreated Reset(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/func/fuconstr.cxx |6 -- sd/source/ui/func/fusel.cxx|1 + 2 files changed, 5 insertions(+), 2 deletions(-) New commits: commit 08b25904e81a1b532fe889f53fc1f1909f4b1f06 Author: mert AuthorDate: Thu Feb 4 10:37:03 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 08:33:18 2021 +0100 LOK: disable rotation mode on selection of shape Change-Id: Iff0ed673ae1c61ff0d753cf3a1f871213f8b3a7d Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110399 Tested-by: Jenkins CollaboraOffice diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index e4eb8b3eda5f..23cbd65c00f1 100644 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -39,6 +39,7 @@ #include #include #include +#include using namespace com::sun::star; @@ -187,9 +188,10 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt) pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); } -if (mpView->GetDragMode() == SdrDragMode::Move && mpView->IsRotateAllowed() && +const bool bTiledRendering = comphelper::LibreOfficeKit::isActive(); +if (!bTiledRendering && (mpView->GetDragMode() == SdrDragMode::Move && mpView->IsRotateAllowed() && (mpViewShell->GetFrameView()->IsClickChangeRotation() || - (pSingleObj && pSingleObj->GetObjInventor()==SdrInventor::E3d))) + (pSingleObj && pSingleObj->GetObjInventor()==SdrInventor::E3d { mpView->SetDragMode(SdrDragMode::Rotate); } diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index baa6c6b9e3ad..0cb6e6c36c22 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -707,6 +707,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) } if (nSlotId == SID_OBJECT_SELECT +&& !comphelper::LibreOfficeKit::isActive() && mpView->IsRotateAllowed() && (rMEvt.GetClicks() != 2) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source svx/source
sd/source/ui/view/drawview.cxx |7 ++- svx/source/svdraw/svdedxv.cxx |1 - 2 files changed, 6 insertions(+), 2 deletions(-) New commits: commit 7db8c3d36db3ed727ade2609b7c1017cc813a560 Author: Tamás Zolnai AuthorDate: Wed Feb 17 15:53:08 2021 +0100 Commit: Tamás Zolnai CommitDate: Wed Feb 17 17:14:15 2021 +0100 Better fix for tdf#125824: switch page only for the current view. First workaround was avoiding undoing: 9dca7c2fac5c6b83a6910aa61b1a2a316f36d948 Second workaround was forcing all views to exit text editing: e6c7a018a0cfee395ce2886d41c908a2447ef5cc Instead of these solutions, we allow to continue text editing in other views. What we do is avoiding jumping to the object location in all views while undoing. In theory, the two views / windows should be able to edit the document's different parts independently. So one view should not jump to the location where the other view edits something / does an undo. It works both with multi-window and Collabora Online's collaborative editing. Change-Id: I7ffe29bf175b8f855fe3e92b3d7e11ca6bcd3f5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111073 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index 2c1a4e676c33..883d6d35b0b4 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -424,8 +424,13 @@ void DrawView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) // switch to that page when it's not a master page if(SdrHintKind::SwitchToPage == eHintKind) { -const SdrPage* pPage = static_cast(rHint).GetPage(); +// We switch page only in the current view, which triggered this event +// and keep other views ontouched. +SfxViewShell* pViewShell = SfxViewShell::Current(); +if(pViewShell && pViewShell != >GetViewShellBase()) +return; +const SdrPage* pPage = static_cast(rHint).GetPage(); if(pPage && !pPage->IsMasterPage()) { if(mpDrawViewShell->GetActualPage() != pPage) diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 17c5f57f672d..43ea7336af56 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -1522,7 +1522,6 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally) const bool bUndo = IsUndoEnabled(); if (bUndo) { -EndTextEditAllViews(); OUString aObjName(pTEObj->TakeObjNameSingul()); BegUndo(SvxResId(STR_UndoObjSetText), aObjName); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/sidebar/SlideBackground.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 2be52f741e283b5f172ae536f0e99ce0f38df9e1 Author: Tamás Zolnai AuthorDate: Thu Jan 28 12:20:29 2021 +0100 Commit: Tamás Zolnai CommitDate: Thu Jan 28 16:08:05 2021 +0100 tdf#139965: Broken master slide list after switching mode. Let's update the master slide combobox by context change. populateMasterSlideDropdown() will fill the list when we switch to normal view. The same method is called when the sidebar created in normal view. mpMasterSlide->Clear() will clean the list when we switch to master view. The same happens, when the sidebar is created in a master view context (the list is empty). Change-Id: I322619e409a5352ddcd59a249dd0c874054c1e4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110075 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 197d43abf4b8..0ba486884b25 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -291,6 +291,7 @@ void SlideBackground::HandleContextChange( mpCloseMaster->Show(); mpEditMaster->Hide(); mpMasterSlide->Disable(); +mpMasterSlide->Clear(); mpDspMasterBackground->Disable(); mpDspMasterObjects->Disable(); mpFillStyle->Hide(); @@ -307,6 +308,7 @@ void SlideBackground::HandleContextChange( mpCloseMaster->Hide(); mpEditMaster->Hide(); mpMasterSlide->Disable(); +mpMasterSlide->Clear(); mpDspMasterBackground->Disable(); mpDspMasterObjects->Disable(); mpFillStyle->Hide(); @@ -318,6 +320,7 @@ void SlideBackground::HandleContextChange( mpCloseMaster->Hide(); mpEditMaster->Show(); mpMasterSlide->Enable(); +populateMasterSlideDropdown(); mpDspMasterBackground->Enable(); mpDspMasterObjects->Enable(); mpFillStyle->Show(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/drviews1.cxx |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit 7ea4ee17da49f4ddce1db02557482c755b12 Author: Tamás Zolnai AuthorDate: Tue Jan 26 11:17:40 2021 +0100 Commit: Tamás Zolnai CommitDate: Tue Jan 26 12:19:30 2021 +0100 Revert "LOK: allow slide switching in mobile even if it is same slide" This reverts commit 6693717155cc3f4ab998c5b77b839bb72cbc7236. The reverted commit lead to shape deselection by view switch. Change-Id: I51867e60f0e9e495e2ccf54016d181f4049ad520 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109936 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index bedad6f183e5..3a370de8b33b 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -914,8 +913,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) SdPage* pCurrentPage = pPV ? dynamic_cast(pPV->GetPage()) : nullptr; if (pCurrentPage && pNewPage == pCurrentPage -&& maTabControl->GetPageText(maTabControl->GetPageId(nSelectedPage)) == pNewPage->GetName() -&& SfxLokHelper::getDeviceFormFactor() != LOKDeviceFormFactor::MOBILE) +&& maTabControl->GetPageText(maTabControl->GetPageId(nSelectedPage)) == pNewPage->GetName()) { // this slide is already visible return true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 31 1 file changed, 31 insertions(+) New commits: commit 5fa9dcf0226a93a26dcef439c66956a93f188601 Author: Tamás Zolnai AuthorDate: Fri Jan 22 11:55:06 2021 +0100 Commit: Tamás Zolnai CommitDate: Fri Jan 22 16:13:24 2021 +0100 tdf#139830: keep the right context for chart after view switch (impress). Change-Id: Ida345dd884a09b88e35e0df6f9520528c910d9d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109791 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 9e375bc8f6c3..82d3e50371eb 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -54,6 +54,8 @@ #include #include #include +#include +#include using namespace ::sd::slidesorter; #define ShellClass_SlideSorterViewShell @@ -68,6 +70,24 @@ using ::vcl::EnumContext; namespace sd { namespace slidesorter { +namespace { + +bool inChartContext(sd::View* pView) +{ +if (!pView) +return false; + +SfxViewShell* pViewShell = pView->GetSfxViewShell(); +sfx2::sidebar::SidebarController* pSidebar = sfx2::sidebar::Tools::GetSidebarController(pViewShell); +if (pSidebar) +return pSidebar->hasChartContextCurrently(); + +return false; +} + +} // anonymous namespace + + SFX_IMPL_INTERFACE(SlideSorterViewShell, SfxShell) void SlideSorterViewShell::InitInterface_Impl() @@ -438,6 +458,17 @@ void SlideSorterViewShell::ArrangeGUIElements() void SlideSorterViewShell::Activate (bool bIsMDIActivate) { +if(inChartContext(GetView())) +{ +// Avoid context changes for chart during activation / deactivation. +const bool bIsContextBroadcasterEnabled (SfxShell::SetContextBroadcasterEnabled(false)); + +ViewShell::Activate(bIsMDIActivate); + +SfxShell::SetContextBroadcasterEnabled(bIsContextBroadcasterEnabled); +return; +} + ViewShell::Activate(bIsMDIActivate); if (mbIsArrangeGUIElementsPending) ArrangeGUIElements(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/sidebar/SlideBackground.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 5515f469d32094299ec12bdd58880891ebcc9849 Author: Pranam Lashkari AuthorDate: Fri Nov 20 09:44:25 2020 +0530 Commit: Andras Timar CommitDate: Sun Jan 17 11:08:08 2021 +0100 hide background options in master slide view in sidebar Change-Id: Idecf4c849f9f5ac338ea24ca04cbbf9afe5cad5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106213 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit 962bd10e456d95c7579ffb380b3e69f67cf5ea11) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109401 diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 9f83f29e1a89..197d43abf4b8 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -296,6 +296,11 @@ void SlideBackground::HandleContextChange( mpFillStyle->Hide(); mpBackgroundLabel->Hide(); mpInsertImage->Show(); + +mpFillLB->Hide(); +mpFillAttr->Hide(); +mpFillGrad1->Hide(); +mpFillGrad2->Hide(); } else if ( maContext == maImpressHandoutContext || maContext == maImpressNotesContext ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/drviewse.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit ed58d457d58cc95a931037f4f574588ab50d22b7 Author: Mert Tumer AuthorDate: Wed Dec 9 14:13:26 2020 +0300 Commit: Jan Holesovsky CommitDate: Tue Jan 5 11:01:30 2021 +0100 Insert draw connectors directly for online Change-Id: I962a69c142151a43c47efbdb79428760ab07ad98 Signed-off-by: Mert Tumer Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108682 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 3ae9b37171b0..e330d0416ce8 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -451,6 +451,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) case SID_CONNECTOR_LINES_CIRCLES: case SID_INSERT_SIGNATURELINE: { +bCreateDirectly = comphelper::LibreOfficeKit::isActive(); SetCurrentFunction( FuConstructRectangle::Create( this, GetActiveWindow(), mpDrawView.get(), GetDoc(), rReq, bPermanent ) ); rReq.Done(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/animations/SlideTransitionPane.cxx |6 -- 1 file changed, 6 deletions(-) New commits: commit b0cbb1dcb1a48e32efb6e124f47c83e863c2454d Author: Pranam Lashkari AuthorDate: Wed Dec 9 15:57:59 2020 +0530 Commit: Andras Timar CommitDate: Fri Dec 11 11:35:17 2020 +0100 impress: Difficulty to enter text in Duration field problem: when erasing data in from duration field if we remove decimal point remaining numbers before decimal are multiplied by 100 Change-Id: Id060cc702df9d8365f38c261020cae31f95883d1 Signed-off-by: Pranam Lashkari Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106780 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 05c11354f4b4..c96a8e390adb 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -1114,12 +1114,6 @@ IMPL_LINK_NOARG(SlideTransitionPane, VariantListBoxSelected, ListBox&, void) IMPL_LINK_NOARG(SlideTransitionPane, DurationModifiedHdl, Edit&, void) { -double duration_value = static_cast(mpCBX_duration->GetValue()); -if(duration_value <= 0.0) -mpCBX_duration->SetValue(0); -else -mpCBX_duration->SetValue(duration_value); - applyToSelectedPages(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/drviews2.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 494cee664a3b3dc64dc83e1c29b17097d184a2d7 Author: Pranam Lashkari AuthorDate: Tue Oct 6 18:53:34 2020 +0530 Commit: Andras Timar CommitDate: Tue Oct 13 22:53:15 2020 +0200 fixed crashing on duplicating slide if slide pan is not visible Change-Id: I30cdc8365d0a31b408dc4eb18b195703837c838a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104027 Tested-by: Andras Timar Reviewed-by: Andras Timar diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index ad6802318591..85587bbde585 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -770,10 +770,17 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_DUPLICATE_PAGE: { +auto slideSorter = sd::slidesorter::SlideSorterViewShell::GetSlideSorter(GetViewShellBase()); +SdPage* pNewPage = nullptr; +if(slideSorter) DuplicateSelectedSlides(rReq); +else +pNewPage = CreateOrDuplicatePage (rReq, mePageKind, GetActualPage()); Cancel(); if(HasCurrentFunction(SID_BEZIER_EDIT) ) GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON); +if(!slideSorter && pNewPage != nullptr) +SwitchPage((pNewPage->GetPageNum()-1)/2); rReq.Done(); } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/drviewse.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 4941dced3db465d7e2e88db0864fd785a4574882 Author: Szymon Kłos AuthorDate: Wed Sep 30 11:28:02 2020 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 6 16:16:21 2020 +0200 Don't insert hyperlink outside the page Change-Id: Ida562bdf4eab479b4df2bba7917466d5da788a6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103673 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104024 Reviewed-by: Szymon Kłos diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 5b41c8093289..fbb6edf50085 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -1505,8 +1505,11 @@ void DrawViewShell::InsertURLField(const OUString& rURL, const OUString& rText, ::tools::Rectangle aRect(aPos, GetActiveWindow()->GetOutputSizePixel() ); aPos = aRect.Center(); aPos = GetActiveWindow()->PixelToLogic(aPos); -aPos.AdjustX( -(aSize.Width() / 2) ); -aPos.AdjustY( -(aSize.Height() / 2) ); + +if (aPos.getX() - (aSize.Width() / 2) >= 0) +aPos.AdjustX( -(aSize.Width() / 2) ); +if (aPos.getY() - (aSize.Height() / 2) >= 0) +aPos.AdjustY( -(aSize.Height() / 2) ); ::tools::Rectangle aLogicRect(aPos, aSize); pRectObj->SetLogicRect(aLogicRect); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/drviews1.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 6693717155cc3f4ab998c5b77b839bb72cbc7236 Author: Pranam Lashkari AuthorDate: Wed Aug 26 22:50:56 2020 +0530 Commit: Andras Timar CommitDate: Wed Sep 9 12:00:17 2020 +0200 LOK: allow slide switching in mobile even if it is same slide problem: In the mobile view taping on the selected slide preview would open the wizard but when some object is selected on the slide wizard would open for that object this patch helps us to set the Page as selection and as result mobile wizard opens for the slide even when some object on slide is selected Change-Id: I99cbece8b18ec8766956157c0231e5a0f600d993 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101423 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 3a370de8b33b..bedad6f183e5 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -913,7 +914,8 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) SdPage* pCurrentPage = pPV ? dynamic_cast(pPV->GetPage()) : nullptr; if (pCurrentPage && pNewPage == pCurrentPage -&& maTabControl->GetPageText(maTabControl->GetPageId(nSelectedPage)) == pNewPage->GetName()) +&& maTabControl->GetPageText(maTabControl->GetPageId(nSelectedPage)) == pNewPage->GetName() +&& SfxLokHelper::getDeviceFormFactor() != LOKDeviceFormFactor::MOBILE) { // this slide is already visible return true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/docshell/docshel3.cxx | 82 + sd/source/ui/docshell/docshell.cxx | 19 ++- sd/source/ui/func/fusearch.cxx |9 ++- sd/source/ui/inc/DrawDocShell.hxx |3 - sd/source/ui/inc/View.hxx | 32 ++-- sd/source/ui/inc/fusearch.hxx |2 sd/source/ui/unoidl/DrawController.cxx |6 +- sd/source/ui/view/Outliner.cxx | 12 +++- 8 files changed, 108 insertions(+), 57 deletions(-) New commits: commit 714767b3d521eefc46dd8158ee67610347863f9f Author: Tomaž Vajngerl AuthorDate: Sat Aug 22 21:45:44 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Aug 31 13:29:43 2020 +0200 sd: Make search bound to a view - to allow independent searching Before if two windows are open, the search is not independent because Outline class is not independent for a view (because of FuSearch which remembers the view from when the it was created and then an instance is stored in the DocShell). This creates a SearchContext class stored on a View, which stores the actual View bound FuSearch instance, fix us the calls. Also move the VectorGraphicSearchContext back into Outline::Impl, because it doesn't need to be bound to the view anymore. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101224 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 2ebc26aeefefe33ee6180862509e4971ff2dfc6f) Change-Id: I6a5ce71efafa378845eee4ac9574e2e4301138d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101693 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index 9d8ce84cb538..01705c12cf75 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -166,30 +166,37 @@ void DrawDocShell::Execute( SfxRequest& rReq ) case FID_SEARCH_OFF: { -if( dynamic_cast< FuSearch* >(mxDocShellFunction.get()) ) +if (mpViewShell) { -// End Search in all docshells -SfxObjectShell* pFirstShell = SfxObjectShell::GetFirst(); -SfxObjectShell* pShell = pFirstShell; - -while (pShell) +sd::View* pView = mpViewShell->GetView(); +if (pView) { -if( dynamic_cast< const DrawDocShell *>( pShell ) != nullptr) +auto& rFunctionContext = pView->getSearchContext(); +rtl::Reference& xFuSearch(rFunctionContext.getFunctionSearch()); + +if (xFuSearch.is()) { -static_cast(pShell)->CancelSearching(); -} +// End Search in all docshells +SfxObjectShell* pFirstShell = SfxObjectShell::GetFirst(); +SfxObjectShell* pShell = pFirstShell; -pShell = SfxObjectShell::GetNext(*pShell); +while (pShell) +{ +auto pDrawDocShell = dynamic_cast(pShell); +if (pDrawDocShell) +pDrawDocShell->CancelSearching(); -if (pShell == pFirstShell) -{ -pShell = nullptr; +pShell = SfxObjectShell::GetNext(*pShell); + +if (pShell == pFirstShell) +pShell = nullptr; +} + +rFunctionContext.resetSearchFunction(); +Invalidate(); +rReq.Done(); } } - -SetDocShellFunction(nullptr); -Invalidate(); -rReq.Done(); } } break; @@ -198,23 +205,30 @@ void DrawDocShell::Execute( SfxRequest& rReq ) { const SfxItemSet* pReqArgs = rReq.GetArgs(); -if ( pReqArgs ) +if (pReqArgs && mpViewShell) { -rtl::Reference< FuSearch > xFuSearch( dynamic_cast< FuSearch* >( GetDocShellFunction().get() ) ); - -if( !xFuSearch.is() && mpViewShell ) +sd::View* pView = mpViewShell->GetView(); +if (pView) { -::sd::View* pView = mpViewShell->GetView(); -SetDocShellFunction( FuSearch::Create( mpViewShell, mpViewShell->GetActiveWindow(), pView, mpDoc, rReq ) ); -xFuSearch.set( dynamic_cast< FuSearch* >( GetDocShellFunction().get() ) ); -} +rtl::Reference & xFuSearch = pView->getSearchContext().getFunctionSearch(); -if( xFuSearch.is() ) -
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source svx/source
sd/source/ui/func/futext.cxx |3 --- svx/source/svdraw/svdedxv.cxx |7 +++ 2 files changed, 7 insertions(+), 3 deletions(-) New commits: commit 55df6fce4f333adda627b384deec0dfe8626b167 Author: Mike Kaganski AuthorDate: Fri Jul 3 16:25:03 2020 +0300 Commit: Mike Kaganski CommitDate: Wed Jul 29 10:18:55 2020 +0200 Re-implement 481e686a66e550229ec0b600a785452f0d753342 Marking documents modified simply on entry to an edit box created a problem, when using search in a read-only Online session made the document modified, and then auto-save failed, displaying a warning: Document cannot be saved. Check your permissions or contact the storage server administrator. The original problem, that 481e686a66e550229ec0b600a785452f0d753342 fixed, was that entering a box in Impress in browser, typing, then pressing Save without exiting the box did not save the edits. Yet, the same sequence works outside of Online. In that case, the doc is marked modified in SdrObjEditView::KeyInput, which obviously is not called from Online, where SdrObjEditView::Command is called instead with CommandEventId::ExtTextInput. So just make sure that we mark the document modified also in this case, making sure that only the actual edits set the "modified" flag. This reverts 481e686a66e550229ec0b600a785452f0d753342. Change-Id: Ib05bc0492616a306dd328bcb8f2e1c9d7e7aa191 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97870 Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98133 Tested-by: Jenkins CollaboraOffice diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 7e3b351f9ebe..1db0231f19d1 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -64,7 +64,6 @@ #include #include #include -#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -196,8 +195,6 @@ void FuText::DoExecute( SfxRequest& ) SdrViewEvent aVEvt; mpView->PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt); mpView->MarkObj(aVEvt.pRootObj, pPV); -if (comphelper::LibreOfficeKit::isActive() && mpViewShell && mpViewShell->GetDocSh()) -mpViewShell->GetDocSh()->SetModified(); mxTextObj.reset( dynamic_cast< SdrTextObj* >( aVEvt.pObj ) ); } diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index bafc02dc27db..17c5f57f672d 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -2022,6 +2022,13 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin) else { pTextEditOutlinerView->Command(rCEvt); +if (mpModel && comphelper::LibreOfficeKit::isActive()) +{ +// It could execute CommandEventId::ExtTextInput, while SdrObjEditView::KeyInput +// isn't called +if (pTextEditOutliner && pTextEditOutliner->IsModified()) +mpModel->SetChanged(); +} return true; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/core/sdpage.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ae61d19ed27e2545078bf54cbe259c96b5d66a98 Author: Marco Cecchetti AuthorDate: Thu Jul 23 14:08:47 2020 +0200 Commit: Marco Cecchetti CommitDate: Fri Jul 24 17:49:52 2020 +0200 lok: fix-up: isLOKMobilePhone -> isLOKTablet That was the actual intention. Change-Id: I2967cea8ae3099e8523438a68c076a786042e15a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99296 Tested-by: Jenkins CollaboraOffice Reviewed-by: Marco Cecchetti diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index fbc0f4260520..13a5eec8f4a6 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -2596,7 +2596,7 @@ OUString SdPage::GetPresObjText(PresObjKind eObjKind) const #else bool isMobileDevice = false; if (const SfxViewShell* pCurrentViewShell = SfxViewShell::Current()) -isMobileDevice = pCurrentViewShell->isLOKMobilePhone() || pCurrentViewShell->isLOKMobilePhone(); +isMobileDevice = pCurrentViewShell->isLOKMobilePhone() || pCurrentViewShell->isLOKTablet(); #endif if (eObjKind == PRESOBJ_TITLE) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/func/fusel.cxx |9 - 1 file changed, 8 insertions(+), 1 deletion(-) New commits: commit cfb3eb9a76423eba54145a956f6d3b83d162d2b8 Author: Miklos Vajna AuthorDate: Fri Jun 26 16:35:34 2020 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 29 10:43:01 2020 +0200 sd signature line: allow move / resize of shape before signing Once the initial rectangle is drawn, a certificate is attached to this shape. Allow modifying this shape (and only this one) before the actual signing, in case the user wants to fine-tune the geometry. (cherry picked from commit 5d296183072dc7cfe7a9985c38388b56f37d873c) Change-Id: Icdf4ffa99eaf02f81d60884d45c26b3500ea73d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97368 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 18616775ac9e..baa6c6b9e3ad 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -201,8 +201,15 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) if (!bTextEdit && eHit == SdrHitKind::UrlField && !rMEvt.IsMod2() && !lcl_followHyperlinkAllowed(rMEvt)) bTextEdit = true; +bool bPreventModify = mpDocSh->IsReadOnly(); +if (bPreventModify && mpDocSh->GetSignPDFCertificate().is()) +{ +// If the just added signature line shape is selected, allow moving / resizing it. +bPreventModify = false; +} + if(!bTextEdit -&& !mpDocSh->IsReadOnly() +&& !bPreventModify && ((mpView->IsMarkedHit(aMDPos, nHitLog) && !rMEvt.IsShift() && !rMEvt.IsMod2()) || pHdl != nullptr) && (rMEvt.GetClicks() != 2) ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/func/fuconrec.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 1634699551b9267c16f673707624b15e1dba8acd Author: Miklos Vajna AuthorDate: Wed Jun 24 13:38:11 2020 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 29 09:11:16 2020 +0200 sd signature line: don't ask for certs on non-first pages FuConstructRectangle::Deactivate() is called when the drawing is done, but also when switching pages. Ask for the cert only once, when the drawing is done. With this, we don't ask for the cert multiple times if the signature rectangle is drawn on a non-first page. (cherry picked from commit 87592cc76a53374a7b177cdba65bc529e0203816) Change-Id: Ic34cf31cfd1353496bb957939bdaccba69daaa0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97255 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index c79753285642..c0adb2266891 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -476,6 +476,13 @@ void FuConstructRectangle::Deactivate() return; } +const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); +if (rMarkList.GetMarkCount() < 1) +{ +// Just switching pages, no signature rectangle yet. +return; +} + // Finished drawing a signature rectangle, now set it up. if (!mpViewShell) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/inc/DrawViewShell.hxx |2 + sd/source/ui/view/drviews2.cxx | 69 - 2 files changed, 70 insertions(+), 1 deletion(-) New commits: commit 3ebb1523608959137b2a877b9db06edac653d3a7 Author: Pranam Lashkari AuthorDate: Tue May 26 21:15:18 2020 +0530 Commit: Andras Timar CommitDate: Thu Jun 11 09:14:23 2020 +0200 LOK: duplicating multiple slides Change-Id: Ic2e870bf2ec3b236e2babf6c090bf3ec1978776e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94819 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index a96f3ec15e22..cd283c76fa57 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -451,6 +451,8 @@ private: SdPage* pPage, const sal_Int32 nInsertPosition = -1) override; +void DuplicateSelectedSlides (SfxRequest& rRequest); + css::uno::Reference< css::scanner::XScannerManager2 > mxScannerManager; css::uno::Reference< css::lang::XEventListener > mxScannerListener; rtl::Reference mxClipEvtLstnr; diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index cac505e7e1f0..5184253e4a1a 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -180,6 +180,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -748,7 +756,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_INSERTPAGE: case SID_INSERTPAGE_QUICK: -case SID_DUPLICATE_PAGE: { SdPage* pNewPage = CreateOrDuplicatePage (rReq, mePageKind, GetActualPage()); Cancel(); @@ -760,6 +767,16 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } break; +case SID_DUPLICATE_PAGE: +{ +DuplicateSelectedSlides(rReq); +Cancel(); +if(HasCurrentFunction(SID_BEZIER_EDIT) ) +GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON); +rReq.Done(); +} +break; + case SID_INSERT_MASTER_PAGE: { // Use the API to create a new page. @@ -3748,6 +3765,56 @@ SdPage* DrawViewShell::CreateOrDuplicatePage ( return pNewPage; } +void DrawViewShell::DuplicateSelectedSlides (SfxRequest& rRequest) +{ +// Create a list of the pages that are to be duplicated. The process of +// duplication alters the selection. +sal_Int32 nInsertPosition (0); +::std::vector aPagesToDuplicate; +sd::slidesorter::SlideSorter = sd::slidesorter::SlideSorterViewShell::GetSlideSorter(GetViewShellBase())->GetSlideSorter(); +sd::slidesorter::model::PageEnumeration aSelectedPages ( + sd::slidesorter::model::PageEnumerationProvider::CreateSelectedPagesEnumeration(mrSlideSorter.GetModel())); +while (aSelectedPages.HasMoreElements()) +{ +sd::slidesorter::model::SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement()); +if (pDescriptor && pDescriptor->GetPage()) +{ +aPagesToDuplicate.push_back(pDescriptor->GetPage()); +nInsertPosition = pDescriptor->GetPage()->GetPageNum()+2; +} +} + +// Duplicate the pages in aPagesToDuplicate and collect the newly +// created pages in aPagesToSelect. +const bool bUndo (aPagesToDuplicate.size()>1 && mrSlideSorter.GetView().IsUndoEnabled()); +if (bUndo) +mrSlideSorter.GetView().BegUndo(SdResId(STR_INSERTPAGE)); + +::std::vector aPagesToSelect; +for(::std::vector::const_iterator +iPage(aPagesToDuplicate.begin()), +iEnd(aPagesToDuplicate.end()); +iPage!=iEnd; +++iPage, nInsertPosition+=2) +{ +aPagesToSelect.push_back( +mrSlideSorter.GetViewShell()->CreateOrDuplicatePage( +rRequest, PageKind::Standard, *iPage, nInsertPosition)); +} +aPagesToDuplicate.clear(); + +if (bUndo) +mrSlideSorter.GetView().EndUndo(); + +// Set the selection to the pages in aPagesToSelect. +sd::slidesorter::controller::PageSelector& rSelector (mrSlideSorter.GetController().GetPageSelector()); +rSelector.DeselectAllPages(); +for (auto const& it: aPagesToSelect) +{ +rSelector.SelectPage(it); +} +} + void DrawViewShell::ExecutePropPanelAttr (SfxRequest const & rReq) { if(SlideShow::IsRunning( GetViewShellBase() )) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/drviews4.cxx | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) New commits: commit c5d2ce18870291cac0d799f7c6217af6b98660fc Author: Pranam Lashkari AuthorDate: Tue May 26 10:20:07 2020 +0530 Commit: Andras Timar CommitDate: Thu Jun 11 09:13:52 2020 +0200 LOK: Allow deleting multiple slides from slidesorter Change-Id: Ie371e7eb5a96655fd281b4137243aa8628b6283b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94818 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 78c4635f279e..be16871f630f 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -72,16 +72,33 @@ using namespace ::com::sun::star::drawing; void DrawViewShell::DeleteActualPage() { -sal_uInt16 nPage = maTabControl->GetCurPagePos(); - mpDrawView->SdrEndTextEdit(); try { Reference xDrawPagesSupplier( GetDoc()->getUnoModel(), UNO_QUERY_THROW ); Reference xPages( xDrawPagesSupplier->getDrawPages(), UNO_SET_THROW ); -Reference< XDrawPage > xPage( xPages->getByIndex( nPage ), UNO_QUERY_THROW ); -xPages->remove( xPage ); +sal_uInt16 nPageCount = GetDoc()->GetSdPageCount(mePageKind); +SdPage* pPage = nullptr; +std::vector> pagesToDelete; + +GetView()->BegUndo(SdResId(STR_UNDO_DELETEPAGES)); + +for (sal_uInt16 i = 0; i < nPageCount; i++) +{ +pPage = GetDoc()->GetSdPage(i, mePageKind); +if(pPage->IsSelected()) +{ +Reference< XDrawPage > xPage( xPages->getByIndex( maTabControl->GetPagePos(pPage->getPageId()) ), UNO_QUERY_THROW ); +pagesToDelete.push_back(xPage); +} +} +for (auto : pagesToDelete) +{ +xPages->remove(xPage); +} + +GetView()->EndUndo(); } catch( Exception& ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/drviews1.cxx | 29 + 1 file changed, 25 insertions(+), 4 deletions(-) New commits: commit 5911eca455d403d66cecd3a21cd2a9233670bbc5 Author: Pranam Lashkari AuthorDate: Tue May 26 10:17:40 2020 +0530 Commit: Andras Timar CommitDate: Thu Jun 11 09:13:39 2020 +0200 LOK: slide sorter: update the model on selecting multiple slides Change-Id: I17bdd8e39c960a81d4bef2a8cffd42103adb5341 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94688 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index e41f34a19774..3a370de8b33b 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -758,15 +758,36 @@ bool DrawViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) bool DrawViewShell::SelectPage(sal_uInt16 nPage, sal_uInt16 nSelect) { SdPage* pPage = GetDoc()->GetSdPage(nPage, PageKind::Standard); + +//page selector marks pages to selected in view +auto = sd::slidesorter::SlideSorterViewShell::GetSlideSorter(GetViewShellBase())->GetSlideSorter().GetController().GetPageSelector(); + if (pPage) { if (nSelect == 0) -pPage->SetSelected(false); // Deselect. +{ +GetDoc()->SetSelected(pPage, false); // Deselect. +pageSelector.DeselectPage(nPage); +} else if (nSelect == 1) -pPage->SetSelected(true); // Select. +{ +GetDoc()->SetSelected(pPage, true);// Select. +pageSelector.SelectPage(nPage); +} else -pPage->SetSelected(!pPage->IsSelected()); // Toggle. - +{ +// Toggle. +if (pPage->IsSelected()) +{ +GetDoc()->SetSelected(pPage, false); +pageSelector.DeselectPage(nPage); +} +else +{ +GetDoc()->SetSelected(pPage, true); +pageSelector.SelectPage(nPage); +} +} return true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/Outliner.cxx | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) New commits: commit ca214ec3f5b3c65c8d6d335d284b0702f29b4c25 Author: Tomaž Vajngerl AuthorDate: Sun May 31 21:59:34 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Jun 10 08:11:00 2020 +0200 sd: allow to change the search string between searches Before this was missing, so even with a different search string, it still searched using the old string, which was a bug. Change-Id: I1655cb421e216e30ae593aabd3ead3a2d5c06299 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95461 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 191288d6a7fb52b31038a21c4e71ee57ffa3bacd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95947 Tested-by: Jenkins CollaboraOffice diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 09d84fafc3a7..3114196f7cf2 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -837,13 +837,19 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti if (mpImpl->mbCurrentIsVectorGraphic) { +OUString const & rString = mpSearchItem->GetSearchString(); bool bBackwards = mpSearchItem->GetBackward(); -bool bResult = false; -if (bBackwards) -bResult = mpImpl->mpVectorGraphicSearch->previous(); -else -bResult = mpImpl->mpVectorGraphicSearch->next(); +SearchStartPosition eSearchStartPosition = bBackwards ? SearchStartPosition::End : SearchStartPosition::Begin; +bool bResult = mpImpl->mpVectorGraphicSearch->search(rString, eSearchStartPosition); + +if (bResult) +{ +if (bBackwards) +bResult = mpImpl->mpVectorGraphicSearch->previous(); +else +bResult = mpImpl->mpVectorGraphicSearch->next(); +} if (bResult) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/Outliner.cxx | 45 - 1 file changed, 23 insertions(+), 22 deletions(-) New commits: commit f0ef50cbfe6039dc9dd00f89af8596f309223cb7 Author: Tomaž Vajngerl AuthorDate: Sun May 31 09:58:26 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 9 21:02:08 2020 +0200 sd: PDF search - reset mpVectorGraphicSearch at more places and simplify the case when the search doesn't find a match in the vector graphic. Change-Id: I3e086e8e36f8a578711eed6d4dcca65c0c4c6268 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95456 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit f60caab2c867a578b6e6b963ebd5a72b5a12463e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95942 Tested-by: Jenkins CollaboraOffice diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 585eee9475e8..916d5d1d2dfb 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -1170,6 +1170,7 @@ void SdOutliner::ProvideNextTextObject() mbFoundObject = false; // reset the vector search +mpImpl->mbCurrentIsVectorGraphic = false; mpImpl->mpVectorGraphicSearch.reset(); mpView->UnmarkAllObj (mpView->GetSdrPageView()); @@ -1205,6 +1206,7 @@ void SdOutliner::ProvideNextTextObject() bool bForbiddenPage = comphelper::LibreOfficeKit::isActive() && (maCurrentPosition.mePageKind != PageKind::Standard || maCurrentPosition.meEditMode != EditMode::Page); mpImpl->mbCurrentIsVectorGraphic = false; +mpImpl->mpVectorGraphicSearch.reset(); if (!bForbiddenPage) { @@ -1238,34 +1240,30 @@ void SdOutliner::ProvideNextTextObject() OUString const & rString = mpSearchItem->GetSearchString(); mpImpl->mpVectorGraphicSearch = std::make_unique(pGraphicObject->GetGraphic()); -if (mpImpl->mpVectorGraphicSearch->search(rString)) + +bool bResult = mpImpl->mpVectorGraphicSearch->search(rString); +if (bResult) +bResult = mpImpl->mpVectorGraphicSearch->next(); + +if (bResult) { -bool bResult = mpImpl->mpVectorGraphicSearch->next(); -if (bResult) -{ -mpObj = SetObject(maCurrentPosition); +mpObj = SetObject(maCurrentPosition); -mbStringFound = true; -mbMatchMayExist = true; -mbFoundObject = true; +mbStringFound = true; +mbMatchMayExist = true; +mbFoundObject = true; -SdrPageView* pPageView = mpView->GetSdrPageView(); -mpView->UnmarkAllObj(pPageView); +SdrPageView* pPageView = mpView->GetSdrPageView(); +mpView->UnmarkAllObj(pPageView); -std::vector aSubSelections; -basegfx::B2DRectangle aSubSelection = getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj); -if (!aSubSelection.isEmpty()) -aSubSelections.push_back(aSubSelection); +std::vector aSubSelections; +basegfx::B2DRectangle aSubSelection = getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj); +if (!aSubSelection.isEmpty()) +aSubSelections.push_back(aSubSelection); -mpView->MarkObj(mpObj, pPageView, false, false, aSubSelections); +mpView->MarkObj(mpObj, pPageView, false, false, aSubSelections); -mpDrawDocument->GetDocSh()->SetWaitCursor( false ); -} -else -{ -mpImpl->mbCurrentIsVectorGraphic = false; -mpImpl->mpVectorGraphicSearch.reset(); -} +mpDrawDocument->GetDocSh()->SetWaitCursor( false ); } else { @@ -1298,6 +1296,9 @@ void SdOutliner::ProvideNextTextObject() } else { +mpImpl->mbCurrentIsVectorGraphic = false; +mpImpl->mpVectorGraphicSearch.reset(); + if (meMode == SEARCH) // Instead of doing a full-blown SetObject(), which would do the same -- but would also possibly switch pages. mbStringFound = false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/Outliner.cxx | 24 +--- 1 file changed, 5 insertions(+), 19 deletions(-) New commits: commit e1c7df9482175dff16baa8720d4f0e962b671a35 Author: Tomaž Vajngerl AuthorDate: Tue Jun 2 23:15:03 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 9 15:25:49 2020 +0200 sd: use getPDFSelection to get the search selection for LOKit This reduces code duplication. Change-Id: I0a6a44d696841d1573d23f87353ac055cc92c83a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95386 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit fcc13ba6a0121cfdf70d1f39318a024777247559) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95928 Tested-by: Tomaž Vajngerl diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index c33f07ee913c..1275a55fa801 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -742,26 +742,12 @@ void SdOutliner::sendLOKSearchResultCallback(std::shared_ptr & pV std::vector<::tools::Rectangle> aLogicRects; if (mpImpl->mbCurrentIsVectorGraphic) { -basegfx::B2DSize aPdfPageSize = mpImpl->mpVectorGraphicSearch->pageSize(); +basegfx::B2DRectangle aSelectionHMM = getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj); -tools::Rectangle aObjectRectTwip = OutputDevice::LogicToLogic(mpObj->GetLogicRect(), MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); -basegfx::B2DRectangle aObjectB2DRectTwip(vcl::unotools::b2DRectangleFromRectangle(aObjectRectTwip)); - -// Setup coordinate conversion matrix to convert the inner PDF -// coordinates to the page relative coordinates -basegfx::B2DHomMatrix aB2DMatrix; - -aB2DMatrix.scale(aObjectB2DRectTwip.getWidth() / aPdfPageSize.getX(), - aObjectB2DRectTwip.getHeight() / aPdfPageSize.getY()); - -aB2DMatrix.translate(aObjectB2DRectTwip.getMinX(), aObjectB2DRectTwip.getMinY()); - -for (auto const & rRectangle : mpImpl->mpVectorGraphicSearch->getTextRectangles()) -{ -basegfx::B2DRectangle aRectangle(rRectangle); -aRectangle *= aB2DMatrix; -aLogicRects.emplace_back(Point(aRectangle.getMinX(), aRectangle.getMinY()), Size(aRectangle.getWidth(), aRectangle.getHeight())); -} +tools::Rectangle aSelection(Point(aSelectionHMM.getMinX(), aSelectionHMM.getMinY()), +Size(aSelectionHMM.getWidth(), aSelectionHMM.getHeight())); +aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); +aLogicRects.push_back(aSelection); } else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/Outliner.cxx | 36 +++- 1 file changed, 23 insertions(+), 13 deletions(-) New commits: commit 42cfe2309bd9731d0e5b497356af5834757521bb Author: Tomaž Vajngerl AuthorDate: Fri May 29 08:33:42 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 9 15:23:38 2020 +0200 sd: remove code dupl. when getting PDF text selection for LOK Change-Id: I61d0a9851e9cfe60e9672acec38946b0b25f310f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95349 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 06ddbd4a7a15b80b0286b359bd0a05812fd7ee75) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95924 Tested-by: Tomaž Vajngerl diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 0d69cf872090..f60748bb13a5 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -704,11 +704,16 @@ basegfx::B2DRange b2DRectangleFromRectangle( const ::tools::Rectangle& rRect ) rRect.IsHeightEmpty() ? rRect.Top() : rRect.Bottom()); } -void getPDFSelections(std::vector & rSubSelections, - std::unique_ptr & rVectorGraphicSearch, - SdrObject* pObject) +basegfx::B2DRectangle getPDFSelection(std::unique_ptr & rVectorGraphicSearch, + SdrObject* pObject) { -basegfx::B2DSize aPdfPageSize = rVectorGraphicSearch->pageSize(); +basegfx::B2DRectangle aSelection; + +auto const & rTextRectangles = rVectorGraphicSearch->getTextRectangles(); +if (rTextRectangles.empty()) +return aSelection; + +basegfx::B2DSize aPdfPageSizeHMM = rVectorGraphicSearch->pageSize(); basegfx::B2DRectangle aObjectB2DRectHMM(b2DRectangleFromRectangle(pObject->GetLogicRect())); @@ -716,24 +721,24 @@ void getPDFSelections(std::vector & rSubSelections, // coordinates to the page relative coordinates basegfx::B2DHomMatrix aB2DMatrix; -aB2DMatrix.scale(aObjectB2DRectHMM.getWidth() / aPdfPageSize.getX(), - aObjectB2DRectHMM.getHeight() / aPdfPageSize.getY()); +aB2DMatrix.scale(aObjectB2DRectHMM.getWidth() / aPdfPageSizeHMM.getX(), + aObjectB2DRectHMM.getHeight() / aPdfPageSizeHMM.getY()); aB2DMatrix.translate(aObjectB2DRectHMM.getMinX(), aObjectB2DRectHMM.getMinY()); -basegfx::B2DRectangle aCombined; for (auto const & rRectangle : rVectorGraphicSearch->getTextRectangles()) { basegfx::B2DRectangle aRectangle(rRectangle); aRectangle *= aB2DMatrix; -if (aCombined.isEmpty()) -aCombined = aRectangle; + +if (aSelection.isEmpty()) +aSelection = aRectangle; else -aCombined.expand(aRectangle); +aSelection.expand(aRectangle); } -rSubSelections.push_back(aCombined); +return aSelection; } } // end namespace @@ -862,7 +867,9 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti mpView->UnmarkAllObj(pPageView); std::vector aSubSelections; -getPDFSelections(aSubSelections, mpImpl->mpVectorGraphicSearch, mpObj); +basegfx::B2DRectangle aSubSelection = getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj); +if (!aSubSelection.isEmpty()) +aSubSelections.push_back(aSubSelection); mpView->MarkObj(mpObj, pPageView, false, false, aSubSelections); } } @@ -1263,7 +1270,10 @@ void SdOutliner::ProvideNextTextObject() mpView->UnmarkAllObj(pPageView); std::vector aSubSelections; -getPDFSelections(aSubSelections, mpImpl->mpVectorGraphicSearch, mpObj); +basegfx::B2DRectangle aSubSelection = getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj); +if (!aSubSelection.isEmpty()) +aSubSelections.push_back(aSubSelection); + mpView->MarkObj(mpObj, pPageView, false, false, aSubSelections); mpDrawDocument->GetDocSh()->SetWaitCursor( false ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/Outliner.cxx | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) New commits: commit 2c402eb238ef375971b1604c5dbfe6c6eedc2000 Author: Tomaž Vajngerl AuthorDate: Fri May 29 08:36:34 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 9 15:24:07 2020 +0200 sd: use b2DRectangleFromRectangle from canvastools.hxx Change-Id: I8604b80f887a2c3a1143b8a9bc70f429576512f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95350 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit beb0fc465163e5edc0b7f978ad46c6ad0cd9e2de) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95925 diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index f60748bb13a5..041f08c9b0a5 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -694,15 +695,6 @@ bool SdOutliner::SearchAndReplaceAll() namespace { -basegfx::B2DRange b2DRectangleFromRectangle( const ::tools::Rectangle& rRect ) -{ -if (rRect.IsWidthEmpty() && rRect.IsHeightEmpty()) -return basegfx::B2DRange(basegfx::B2DTuple(rRect.Left(), rRect.Top())); -return basegfx::B2DRectangle(rRect.Left(), - rRect.Top(), - rRect.IsWidthEmpty() ? rRect.Left() : rRect.Right(), - rRect.IsHeightEmpty() ? rRect.Top() : rRect.Bottom()); -} basegfx::B2DRectangle getPDFSelection(std::unique_ptr & rVectorGraphicSearch, SdrObject* pObject) @@ -715,7 +707,7 @@ basegfx::B2DRectangle getPDFSelection(std::unique_ptr & rVe basegfx::B2DSize aPdfPageSizeHMM = rVectorGraphicSearch->pageSize(); -basegfx::B2DRectangle aObjectB2DRectHMM(b2DRectangleFromRectangle(pObject->GetLogicRect())); +basegfx::B2DRectangle aObjectB2DRectHMM(vcl::unotools::b2DRectangleFromRectangle(pObject->GetLogicRect())); // Setup coordinate conversion matrix to convert the inner PDF // coordinates to the page relative coordinates @@ -753,7 +745,7 @@ void SdOutliner::sendLOKSearchResultCallback(std::shared_ptr & pV basegfx::B2DSize aPdfPageSize = mpImpl->mpVectorGraphicSearch->pageSize(); tools::Rectangle aObjectRectTwip = OutputDevice::LogicToLogic(mpObj->GetLogicRect(), MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); -basegfx::B2DRectangle aObjectB2DRectTwip(b2DRectangleFromRectangle(aObjectRectTwip)); +basegfx::B2DRectangle aObjectB2DRectTwip(vcl::unotools::b2DRectangleFromRectangle(aObjectRectTwip)); // Setup coordinate conversion matrix to convert the inner PDF // coordinates to the page relative coordinates ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/Outliner.cxx | 247 ++--- 1 file changed, 209 insertions(+), 38 deletions(-) New commits: commit 894b1a2f412ecc889a9932df3935c69e30852c6f Author: Tomaž Vajngerl AuthorDate: Thu May 28 08:07:51 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 9 15:22:46 2020 +0200 sd: Search inside PDF document that were inserted as a graphic This implements searching inside PDF documents that were inserted into the Draw/Impress document as a graphics and marks the areas of text that matches the search string. Complex (regex) search is not supported. Change-Id: I55d67772a2fe876ae72b9164998347304025d3e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95348 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit 7a84dffb44d4b1fa6e2a3cd3e3dc7d942f3c3e80) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95923 diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index c2cff89909a7..0d69cf872090 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -29,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -96,6 +98,11 @@ public: */ void ReleaseOutlinerView(); +/** Search in vector graphic + */ +bool mbCurrentIsVectorGraphic; +std::unique_ptr mpVectorGraphicSearch; + private: /** Flag that specifies whether we own the outline view pointed to by mpOutlineView and thus have to @@ -685,21 +692,93 @@ bool SdOutliner::SearchAndReplaceAll() return bRet; } +namespace +{ +basegfx::B2DRange b2DRectangleFromRectangle( const ::tools::Rectangle& rRect ) +{ +if (rRect.IsWidthEmpty() && rRect.IsHeightEmpty()) +return basegfx::B2DRange(basegfx::B2DTuple(rRect.Left(), rRect.Top())); +return basegfx::B2DRectangle(rRect.Left(), + rRect.Top(), + rRect.IsWidthEmpty() ? rRect.Left() : rRect.Right(), + rRect.IsHeightEmpty() ? rRect.Top() : rRect.Bottom()); +} + +void getPDFSelections(std::vector & rSubSelections, + std::unique_ptr & rVectorGraphicSearch, + SdrObject* pObject) +{ +basegfx::B2DSize aPdfPageSize = rVectorGraphicSearch->pageSize(); + +basegfx::B2DRectangle aObjectB2DRectHMM(b2DRectangleFromRectangle(pObject->GetLogicRect())); + +// Setup coordinate conversion matrix to convert the inner PDF +// coordinates to the page relative coordinates +basegfx::B2DHomMatrix aB2DMatrix; + +aB2DMatrix.scale(aObjectB2DRectHMM.getWidth() / aPdfPageSize.getX(), + aObjectB2DRectHMM.getHeight() / aPdfPageSize.getY()); + +aB2DMatrix.translate(aObjectB2DRectHMM.getMinX(), aObjectB2DRectHMM.getMinY()); + +basegfx::B2DRectangle aCombined; + +for (auto const & rRectangle : rVectorGraphicSearch->getTextRectangles()) +{ +basegfx::B2DRectangle aRectangle(rRectangle); +aRectangle *= aB2DMatrix; +if (aCombined.isEmpty()) +aCombined = aRectangle; +else +aCombined.expand(aRectangle); +} + +rSubSelections.push_back(aCombined); +} + +} // end namespace + void SdOutliner::sendLOKSearchResultCallback(std::shared_ptr & pViewShell, OutlinerView* pOutlinerView, std::vector* pSelections) { std::vector<::tools::Rectangle> aLogicRects; -pOutlinerView->GetSelectionRectangles(aLogicRects); +if (mpImpl->mbCurrentIsVectorGraphic) +{ +basegfx::B2DSize aPdfPageSize = mpImpl->mpVectorGraphicSearch->pageSize(); + +tools::Rectangle aObjectRectTwip = OutputDevice::LogicToLogic(mpObj->GetLogicRect(), MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); +basegfx::B2DRectangle aObjectB2DRectTwip(b2DRectangleFromRectangle(aObjectRectTwip)); + +// Setup coordinate conversion matrix to convert the inner PDF +// coordinates to the page relative coordinates +basegfx::B2DHomMatrix aB2DMatrix; + +aB2DMatrix.scale(aObjectB2DRectTwip.getWidth() / aPdfPageSize.getX(), + aObjectB2DRectTwip.getHeight() / aPdfPageSize.getY()); + +aB2DMatrix.translate(aObjectB2DRectTwip.getMinX(), aObjectB2DRectTwip.getMinY()); -// convert to twips if in 100thmm (seems as if LibreOfficeKit is based on twips?). Do this -// here where we have the only place needing this, *not* in ImpEditView::GetSelectionRectangles -// which makes that method unusable for others -if (pOutlinerView->GetWindow() && MapUnit::Map100thMM == pOutlinerView->GetWindow()->GetMapMode().GetMapUnit()) +for (auto const & rRectangle :
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/Outliner.cxx | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit 76ba829bf18123daf552afe253a8304a982ceb8d Author: Tomaž Vajngerl AuthorDate: Wed May 27 14:27:30 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 9 15:21:26 2020 +0200 sd: some style fixes in Outliner.cxx Also no need to reset the mpImpl in destructor when it will be reset and destroyed in the next step anyway. Change-Id: I5027f962efc4159e61aa7eda26619db2e3b9434c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95309 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit 43a6def48f425361d79dff46dca41685d5ee03fa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95920 diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index e98c1bde5795..c2cff89909a7 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -211,7 +211,6 @@ SdOutliner::SdOutliner( SdDrawDocument* pDoc, OutlinerMode nMode ) /// Nothing spectacular in the destructor. SdOutliner::~SdOutliner() { -mpImpl.reset(); } /** Prepare find or spellchecking. This distinguishes between three @@ -467,7 +466,9 @@ bool SdOutliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem) const SvxSearchCmd nCommand (mpSearchItem->GetCommand()); if (nCommand == SvxSearchCmd::FIND_ALL || nCommand == SvxSearchCmd::REPLACE_ALL) +{ bEndOfSearch = SearchAndReplaceAll (); +} else { RememberStartPosition (); @@ -573,6 +574,7 @@ void SdOutliner::Initialize (bool bDirectionIsForward) bool SdOutliner::SearchAndReplaceAll() { bool bRet = true; + // Save the current position to be restored after having replaced all // matches. RememberStartPosition (); @@ -756,13 +758,13 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti pOutlinerView = mpImpl->GetOutlinerView(); } -if (pViewShell != nullptr) +if (pViewShell) { mpView = pViewShell->GetView(); mpWindow = pViewShell->GetActiveWindow(); pOutlinerView->SetWindow(mpWindow); -if( nullptr != dynamic_cast< const sd::DrawViewShell *>( pViewShell.get() )) +if (nullptr != dynamic_cast(pViewShell.get())) { // When replacing we first check if there is a selection // indicating a match. If there is then replace it. The @@ -785,7 +787,7 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti { ProvideNextTextObject (); -if ( ! mbEndOfSearch) +if (!mbEndOfSearch) { // Remember the current position as the last one with a // text object. @@ -807,7 +809,7 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti } } } -else if( nullptr != dynamic_cast< const sd::OutlineViewShell *>( pViewShell.get() )) +else if (nullptr != dynamic_cast(pViewShell.get())) { mpDrawDocument->GetDocSh()->SetWaitCursor(false); // The following loop is executed more than once only when a ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/Outliner.cxx | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) New commits: commit 7824545abeb308a89c08aa98e20901df05934625 Author: Tomaž Vajngerl AuthorDate: Wed May 27 14:20:44 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 9 15:19:10 2020 +0200 sd: in Outline add getViewShellBase to simplify code This simplifies constant casting of SfxViewShell::Current to sd::ViewShellBase. Instead of doing it in every method, let's have a dedicated function for that. Change-Id: Iadbe446c7edce5df40c2da14e3eee65012dd4d77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95308 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit 29e06da2b63441f4458c482eae1cd36bd10b4728) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95919 diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index e77e60c5d305..e98c1bde5795 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -111,6 +111,16 @@ private: OutlinerView* mpOutlineView; }; +namespace +{ + +sd::ViewShellBase* getViewShellBase() +{ +return dynamic_cast(SfxViewShell::Current()); +} + +} // end anonymous namespace + SdOutliner::SdOutliner( SdDrawDocument* pDoc, OutlinerMode nMode ) : SdrOutliner( >GetItemPool(), nMode ), mpImpl(new Implementation()), @@ -228,7 +238,7 @@ void SdOutliner::PrepareSpelling() { mbPrepareSpellingPending = false; -sd::ViewShellBase* pBase = dynamic_cast< sd::ViewShellBase *>( SfxViewShell::Current() ); +sd::ViewShellBase* pBase = getViewShellBase(); if (pBase != nullptr) SetViewShell (pBase->GetMainViewShell()); SetRefDevice( SD_MOD()->GetVirtualRefDevice() ); @@ -270,7 +280,7 @@ void SdOutliner::EndSpelling() std::shared_ptr pViewShell (mpWeakViewShell.lock()); std::shared_ptr pOldViewShell (pViewShell); -sd::ViewShellBase* pBase = dynamic_cast< sd::ViewShellBase *>( SfxViewShell::Current() ); +sd::ViewShellBase* pBase = getViewShellBase(); if (pBase != nullptr) pViewShell = pBase->GetMainViewShell(); else @@ -413,7 +423,7 @@ bool SdOutliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem) mpDrawDocument->GetDocSh()->SetWaitCursor( true ); if (mbPrepareSpellingPending) PrepareSpelling(); -sd::ViewShellBase* pBase = dynamic_cast< sd::ViewShellBase *>( SfxViewShell::Current() ); +sd::ViewShellBase* pBase = getViewShellBase(); // Determine whether we have to abort the search. This is necessary // when the main view shell does not support searching. bool bAbort = false; @@ -1618,7 +1628,7 @@ void SdOutliner::BeginConversion() { SetRefDevice( SD_MOD()->GetVirtualRefDevice() ); -sd::ViewShellBase* pBase = dynamic_cast( SfxViewShell::Current() ); +sd::ViewShellBase* pBase = getViewShellBase(); if (pBase != nullptr) SetViewShell (pBase->GetMainViewShell()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/drviews7.cxx | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) New commits: commit eaac3a414e27aa221c6b1ee1fbfd10c39b5cda84 Author: Pranam Lashkari AuthorDate: Fri Apr 24 10:35:45 2020 +0530 Commit: Andras Timar CommitDate: Wed May 27 08:51:52 2020 +0200 resolved: page gradient reset on reopening doc in mobile phone Slide background set to gradient becomes black/white after reopening Change-Id: Ib579856c3df8b89c74b381f3d79870c467802848 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92831 Tested-by: Jenkins Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94854 Tested-by: Andras Timar diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index a1da9aa4226b..dc4b959fd39d 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1807,9 +1807,15 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) if (SfxItemState::SET == pArgs->GetItemState(SID_FILL_GRADIENT_JSON, false, )) { const SfxStringItem* pJSON = static_cast(pItem); -XFillGradientItem aGradient( XGradient::fromJSON(pJSON->GetValue()) ); +XFillGradientItem aGradientItem( XGradient::fromJSON(pJSON->GetValue()) ); + +// MigrateItemSet guarantees unique gradient names +SfxItemSet aMigrateSet( mpDrawView->GetModel()->GetItemPool(), svl::Items{} ); +aMigrateSet.Put( aGradientItem ); +SdrModel::MigrateItemSet( , pTempSet.get(), mpDrawView->GetModel() ); + rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) ); -rPageProperties.PutItem( aGradient ); +rPageProperties.PutItemSet( *pTempSet ); } else { @@ -1820,8 +1826,8 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) aMigrateSet.Put( aGradientItem ); SdrModel::MigrateItemSet( , pTempSet.get(), mpDrawView->GetModel() ); -rPageProperties.PutItemSet( *pTempSet ); rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) ); +rPageProperties.PutItemSet( *pTempSet ); } } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/view/drtxtob1.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 35a17267da430dbe638f0b56ede7c19dadb6b682 Author: Pranam Lashkari AuthorDate: Tue May 5 23:17:29 2020 +0530 Commit: Andras Timar CommitDate: Mon May 18 21:00:37 2020 +0200 resolved: Strange behavior of Paragraph Spacing controls Increase Paragraph Spacing on the sidebar paragraph Spacing spinners aren't increased Change-Id: Icc1ae684ff607909f87646c69e9acebf8f3d8000 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93511 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit 2ab871e806595d555c0460652b52a3f369f95b57) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94275 Tested-by: Andras Timar diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 3d2c68960752..13a998c95744 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -321,6 +321,7 @@ void TextObjectBar::Execute( SfxRequest ) Invalidate(); // to refresh preview (in outline mode), slot has to be invalidated: mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true ); +mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_PARA_ULSPACE, true ); } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source svtools/source
sd/source/ui/unoidl/unomodel.cxx|4 svtools/source/config/slidesorterbaropt.cxx |3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) New commits: commit 5e6514e027b9d6dc9972f8aaf1977079982856d3 Author: Tor Lillqvist AuthorDate: Tue Jan 21 12:43:51 2020 +0200 Commit: Tor Lillqvist CommitDate: Mon May 18 08:45:26 2020 +0200 tdf#129388: Do as kendy suggested in 7e291eedbad335bf8bbc8a17cc3d633bf66d0e90 Keep the behaviour as before when a unit test is running, though. Otherwise CppunitTest_sd_tiledrendering fails. (Yes, I know, this is the wrong thing to do, so sue me.) Change-Id: Iae969eee800994b937d32646cfdf50f8132ae185 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87131 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist (cherry picked from commit 372854e1de4678607d25b76e6c4bae0476fded07) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94218 Tested-by: Tor Lillqvist diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 8bc98bbc6693..26263aa21cc3 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -2472,6 +2473,9 @@ void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequencem_bVisibleImpressView && !comphelper::LibreOfficeKit::isActive(); +static const bool bRunningUnitTest = getenv("LO_TESTNAME"); +return m_pImpl->m_bVisibleImpressView && (!bRunningUnitTest || !comphelper::LibreOfficeKit::isActive()); } void SvtSlideSorterBarOptions::SetVisibleImpressView(bool bVisible) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits