summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-30 09:20:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-30 10:57:04 +0100
commita4b60b78ea36d55a2abf0e5efccd8530568d2209 (patch)
tree9468dc489d37b11e14e190502816f3ed55edd0c9 /sw
parent034a462475c2878e1eba13f10b2fcaf8c1755c4a (diff)
loplugin:returnconstant
Change-Id: I5b859de6ccd908eee4356acbe1f12b441ab36df3 Reviewed-on: https://gerrit.libreoffice.org/62539 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/editsh.hxx6
-rw-r--r--sw/source/core/edit/edglss.cxx9
-rw-r--r--sw/source/uibase/dochdl/gloshdl.cxx7
3 files changed, 6 insertions, 16 deletions
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 36c33afa838b..3da4e3617ca0 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -621,10 +621,8 @@ public:
/// Apply ViewOptions with Start-/EndAction.
virtual void ApplyViewOptions( const SwViewOption &rOpt ) override;
- /** Query text within selection.
- @returns FALSE, if selected range is too large to be copied
- into string buffer or if other errors occur. */
- bool GetSelectedText( OUString &rBuf,
+ /** Query text within selection. */
+ void GetSelectedText( OUString &rBuf,
ParaBreakType nHndlParaBreak = ParaBreakType::ToBlank );
/** @return graphic, if CurrentCursor->Point() points to a SwGrfNode
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index 3ece061f823c..2540672a9be3 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -117,7 +117,8 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
pCursor->GetPoint()->nContent.Assign( pContentNd, pContentNd->Len() );
OUString sBuf;
- if( GetSelectedText( sBuf, ParaBreakType::ToOnlyCR ) && !sBuf.isEmpty() )
+ GetSelectedText( sBuf, ParaBreakType::ToOnlyCR );
+ if( !sBuf.isEmpty() )
nRet = rBlock.PutText( rShortName, rName, sBuf );
}
else
@@ -248,10 +249,8 @@ bool SwEditShell::CopySelToDoc( SwDoc* pInsDoc )
}
/** Get text in a Selection
- *
- * @return false if the selected area is too big for being copied into the string buffer
*/
-bool SwEditShell::GetSelectedText( OUString &rBuf, ParaBreakType nHndlParaBrk )
+void SwEditShell::GetSelectedText( OUString &rBuf, ParaBreakType nHndlParaBrk )
{
GetCursor(); // creates all cursors if needed
if( IsSelOnePara() )
@@ -328,8 +327,6 @@ bool SwEditShell::GetSelectedText( OUString &rBuf, ParaBreakType nHndlParaBrk )
}
}
}
-
- return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index 115f3e8d959c..a52a59f38f30 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -306,12 +306,7 @@ bool SwGlossaryHdl::NewGlossary(const OUString& rName, const OUString& rShortNam
OUString* pOnlyText = nullptr;
if( bNoAttr )
{
- if( !pWrtShell->GetSelectedText( sOnlyText, ParaBreakType::ToOnlyCR ))
- {
- if (!pCurGrp)
- delete pTmp;
- return false;
- }
+ pWrtShell->GetSelectedText( sOnlyText, ParaBreakType::ToOnlyCR );
pOnlyText = &sOnlyText;
}