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 4cef3204e011b235b807d26ddb3c901690b633ff Author: Noel Grandin <[email protected]> AuthorDate: Thu Sep 1 16:29:15 2022 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Sep 13 23:08:19 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 <[email protected]> (cherry picked from commit b24eceb5178fda17fcc4b20c5286e8d27c5ae474) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139186 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 2d494cd8d4ee..5378a5228b26 100644 --- a/basctl/source/inc/basidesh.hxx +++ b/basctl/source/inc/basidesh.hxx @@ -169,7 +169,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 ea7d966c8cc7..31fac39ee25b 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -224,9 +224,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 9c22b76c0c86..26245971fd58 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 8bbdfa61f412..6968e66e2826 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1189,7 +1189,7 @@ SdrView* SfxViewShell::GetDrawView() const OUString SfxViewShell::GetSelectionText ( - bool /*bCompleteWords*/ /* FALSE (default) + bool /*bCompleteWords*/, /* FALSE (default) Only the actual selected text is returned. TRUE @@ -1198,6 +1198,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 422da7fe3ea6..b249710715d7 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 4159b8714a7c..3ecd3450ae6c 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -1647,7 +1647,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 ); }
