summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2013-11-08 12:52:51 +0400
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-11-08 08:44:24 -0600
commit028b550cce4b08b33c9970baf785b6e1bedb4da2 (patch)
tree610265e1776bdcb6f801eacd3859df5129cfd1f8 /basctl
parentabd333fc9ace9e559eef2c5dcb851ef9dceac553 (diff)
fdo#71306: fix printing from basic ide
regression from e13a3d566ecc34a46e037aca1b2d70e58501e422 Change-Id: I0d734e112038746aa48df669d4b82b644a95c220 (cherry picked from commit 560b27613679d2a3b3ddb89c2afe481bcf2996e3) Reviewed-on: https://gerrit.libreoffice.org/6615 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 4eb1a9243928..95ae6e1d61e3 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -903,7 +903,9 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
sal_uInt16 nLines = aLine.getLength()/nCharspLine+1;
for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ )
{
- OUString aTmpLine = aLine.copy(nLine*nCharspLine, nCharspLine );
+ sal_Int32 nBeginIndex = nLine*nCharspLine;
+ sal_Int32 nCopyCount = std::min<sal_Int32>(nCharspLine, aLine.getLength()-nBeginIndex);
+ OUString aTmpLine = aLine.copy(nBeginIndex, nCopyCount);
aPos.Y() += nLineHeight;
if ( aPos.Y() > ( aPaperSz.Height() + Print::nTopMargin ) )
{