basctl/source/basicide/basides2.cxx | 2 +- basctl/source/inc/basidesh.hxx | 2 +- include/sfx2/viewsh.hxx | 3 ++- sc/source/ui/inc/tabvwsh.hxx | 2 +- sc/source/ui/view/tabvwshe.cxx | 4 ++-- sd/source/ui/inc/ViewShellBase.hxx | 2 +- sd/source/ui/view/ViewShellBase.cxx | 2 +- sfx2/source/view/viewsh.cxx | 3 ++- svx/source/dialog/fntctrl.cxx | 2 +- sw/inc/view.hxx | 2 +- sw/source/uibase/uiview/view.cxx | 2 +- 11 files changed, 14 insertions(+), 12 deletions(-)
New commits: commit b24eceb5178fda17fcc4b20c5286e8d27c5ae474 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Sep 1 16:29:15 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Sep 2 10:58:04 2022 +0200 tdf#150712 limit the dialog to only a sample of the data instead of the entire area, which makes the dialog pretty much instantaneous Change-Id: Icb08a09733ee872b67d5be00cb083139f05fba7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139214 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx index fedebcb1d98b..ca219f4c9059 100644 --- a/basctl/source/basicide/basides2.cxx +++ b/basctl/source/basicide/basides2.cxx @@ -56,7 +56,7 @@ bool Shell::HasSelection( bool /* bText */ ) const return false; } -OUString Shell::GetSelectionText( bool bWholeWord ) +OUString Shell::GetSelectionText( bool bWholeWord, bool /*bOnlyASample*/ ) { OUString aText; if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin.get())) diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx index ef1378580c10..3df158ed01e5 100644 --- a/basctl/source/inc/basidesh.hxx +++ b/basctl/source/inc/basidesh.hxx @@ -168,7 +168,7 @@ public: // virtual sal_uInt16 Print( SfxProgress &rProgress, sal_Bool bIsAPI, PrintDialog *pPrintDialog = 0 ); virtual SfxPrinter* GetPrinter( bool bCreate = false ) override; virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ) override; - virtual OUString GetSelectionText( bool bCompleteWords = false ) override; + virtual OUString GetSelectionText( bool bCompleteWords = false, bool bOnlyASample = false ) override; virtual bool HasSelection( bool bText = true ) const override; void GetState( SfxItemSet& ); diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 28b4c190cdc8..523534f5d1e1 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -226,9 +226,10 @@ public: * Initialize is called after the frame has been loaded and the controller * has been set. By the time this is called the document has been fully * imported. + * @param bOnlyASample used by some dialogs to avoid constructing monster strings e.g. in calc */ virtual bool PrepareClose( bool bUI = true ); - virtual OUString GetSelectionText( bool bCompleteWords = false ); + virtual OUString GetSelectionText( bool bCompleteWords = false, bool bOnlyASample = false ); virtual bool HasSelection( bool bText = true ) const; virtual SdrView* GetDrawView() const; diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 91acb19d39a3..d1a7e5ef89d6 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -201,7 +201,7 @@ protected: virtual void QueryObjAreaPixel( tools::Rectangle& rRect ) const override; - virtual OUString GetSelectionText( bool bWholeWord = false ) override; + virtual OUString GetSelectionText( bool bWholeWord = false, bool bOnlyASample = false ) override; virtual bool HasSelection( bool bText = true ) const override; virtual void WriteUserData(OUString &, bool bBrowse = false) override; diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index d32500b74800..7089c17aa7a2 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -39,7 +39,7 @@ #include <inputhdl.hxx> #include <document.hxx> -OUString ScTabViewShell::GetSelectionText( bool bWholeWord ) +OUString ScTabViewShell::GetSelectionText( bool bWholeWord, bool bOnlyASample ) { OUString aStrSelection; @@ -54,7 +54,7 @@ OUString ScTabViewShell::GetSelectionText( bool bWholeWord ) if ( GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE ) { ScDocument& rDoc = GetViewData().GetDocument(); - if ( bInFormatDialog && aRange.aStart.Row() != aRange.aEnd.Row() ) + if ( (bOnlyASample || bInFormatDialog) && aRange.aStart.Row() != aRange.aEnd.Row() ) { // limit range to one data row // (only when the call comes from a format dialog) diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx index d7f37ba974df..eab26ec8a1ba 100644 --- a/sd/source/ui/inc/ViewShellBase.hxx +++ b/sd/source/ui/inc/ViewShellBase.hxx @@ -108,7 +108,7 @@ public: void GetState (SfxItemSet& rSet); /* override these from SfxViewShell */ - virtual OUString GetSelectionText(bool = false) override; + virtual OUString GetSelectionText(bool = false, bool bOnlyASample = false) override; virtual bool HasSelection(bool = true ) const override; SvBorder GetBorder (bool bOuterResize); diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index b4f581dda9ac..7eea42b1aefd 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -441,7 +441,7 @@ void ViewShellBase::InitializeFramework() { } -OUString ViewShellBase::GetSelectionText(bool bCompleteWords) +OUString ViewShellBase::GetSelectionText(bool bCompleteWords, bool /*bOnlyASample*/) { std::shared_ptr<ViewShell> const pMainShell(GetMainViewShell()); DrawViewShell *const pDrawViewShell( diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 4dfe4596b3ce..2e53fa583828 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1190,7 +1190,7 @@ SdrView* SfxViewShell::GetDrawView() const OUString SfxViewShell::GetSelectionText ( - bool /*bCompleteWords*/ /* FALSE (default) + bool /*bCompleteWords*/, /* FALSE (default) Only the actual selected text is returned. TRUE @@ -1199,6 +1199,7 @@ OUString SfxViewShell::GetSelectionText these are used: white spaces and punctuation ".,;" and single and double quotes. */ + bool /*bOnlyASample*/ /* used by some dialogs to avoid constructing monster strings e.g. in calc */ ) /* [Description] diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index a2d466c1e232..393fc4e68103 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -628,7 +628,7 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const tools::R if (pSh && !pImpl->mbGetSelection && !pImpl->mbUseFontNameAsText) { - pImpl->maText = removeCRLF(pSh->GetSelectionText()); + pImpl->maText = removeCRLF(pSh->GetSelectionText(/*bCompleteWords*/false, /*bOnlyASample*/true)); pImpl->mbGetSelection = true; pImpl->mbSelection = !(pImpl->maText.isEmpty()); } diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index 11ea11d2ec57..e348f74fd73e 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -397,7 +397,7 @@ public: OUString GetSelectionTextParam( bool bCompleteWords, bool bEraseTrail ); virtual bool HasSelection( bool bText = true ) const override; - virtual OUString GetSelectionText( bool bCompleteWords = false ) override; + virtual OUString GetSelectionText( bool bCompleteWords = false, bool bOnlyASample = false ) override; virtual bool PrepareClose( bool bUI = true ) override; virtual void MarginChanged() override; diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 30a57840d9c6..3635fed59652 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -1653,7 +1653,7 @@ bool SwView::HasSelection( bool bText ) const : GetWrtShell().HasSelection(); } -OUString SwView::GetSelectionText( bool bCompleteWrds ) +OUString SwView::GetSelectionText( bool bCompleteWrds, bool /*bOnlyASample*/ ) { return GetSelectionTextParam( bCompleteWrds, true ); }