summaryrefslogtreecommitdiffstats
path: root/basctl
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2013-11-08 12:52:51 +0400
committerAndras Timar <andras.timar@collabora.com>2013-11-10 13:14:35 +0100
commit70b563247668aaae7747100c52d0e81434f1fe13 (patch)
tree0a40b232b00a0f02451004a37bc62a14bc692a58 /basctl
parentfdo#71306: fix [Page: N] info in headers of pages printed from basic ide (diff)
downloadcore-70b563247668aaae7747100c52d0e81434f1fe13.tar.gz
core-70b563247668aaae7747100c52d0e81434f1fe13.zip
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 ) )
{